{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.i3Qwa5Sl/b1/libtorrent-rasterbar_2.0.10-1.1_i386.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.i3Qwa5Sl/b2/libtorrent-rasterbar_2.0.10-1.1_i386.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,7 +1,7 @@\n \n 529fbea61c4f70f812104bf5fb26346f 365476 libdevel optional libtorrent-rasterbar-dev_2.0.10-1.1_i386.deb\n- ad00a93031198d4a3912ae7f80d10985 1669004 doc optional libtorrent-rasterbar-doc_2.0.10-1.1_all.deb\n+ c686a9252ce4580dd39e1c9e67bf866b 1668144 doc optional libtorrent-rasterbar-doc_2.0.10-1.1_all.deb\n c25f6c4f67c08ffa0857595f9f43a0b5 50310088 debug optional libtorrent-rasterbar2.0t64-dbgsym_2.0.10-1.1_i386.deb\n 10f568b7ad3cf4a0d302822d5e419ad4 1823384 libs optional libtorrent-rasterbar2.0t64_2.0.10-1.1_i386.deb\n 67a3b43643c7c0f1581db5394be8a5aa 13042456 debug optional python3-libtorrent-dbgsym_2.0.10-1.1_i386.deb\n e0cbd3b130a7416148a3484b714cb64e 733048 python optional python3-libtorrent_2.0.10-1.1_i386.deb\n"}, {"source1": "libtorrent-rasterbar-doc_2.0.10-1.1_all.deb", "source2": "libtorrent-rasterbar-doc_2.0.10-1.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 2024-02-28 20:35:15.000000 debian-binary\n -rw-r--r-- 0 0 0 3636 2024-02-28 20:35:15.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1665176 2024-02-28 20:35:15.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 1664316 2024-02-28 20:35:15.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -73,43 +73,43 @@\n -rw-r--r-- 0 root (0) root (0) 428300 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/troubleshooting.png\n -rw-r--r-- 0 root (0) root (0) 46279 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/troubleshooting_thumb.png\n -rw-r--r-- 0 root (0) root (0) 243 2024-02-19 12:14:14.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/utp_stack.diagram\n -rw-r--r-- 0 root (0) root (0) 2007 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/utp_stack.png\n -rw-r--r-- 0 root (0) root (0) 1156 2024-02-19 12:14:14.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/write_disk_buffers.diagram\n -rw-r--r-- 0 root (0) root (0) 9631 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/write_disk_buffers.png\n -rw-r--r-- 0 root (0) root (0) 9768 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/index.html\n--rw-r--r-- 0 root (0) root (0) 144610 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html\n+-rw-r--r-- 0 root (0) root (0) 144603 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html\n -rw-r--r-- 0 root (0) root (0) 9650 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/projects.html\n -rw-r--r-- 0 root (0) root (0) 22814 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/python_binding.html\n -rw-r--r-- 0 root (0) root (0) 33687 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html\n -rw-r--r-- 0 root (0) root (0) 256774 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html\n--rw-r--r-- 0 root (0) root (0) 27434 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html\n+-rw-r--r-- 0 root (0) root (0) 27441 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html\n -rw-r--r-- 0 root (0) root (0) 25856 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html\n--rw-r--r-- 0 root (0) root (0) 88956 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html\n+-rw-r--r-- 0 root (0) root (0) 88949 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html\n -rw-r--r-- 0 root (0) root (0) 43739 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html\n -rw-r--r-- 0 root (0) root (0) 50884 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html\n -rw-r--r-- 0 root (0) root (0) 24960 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html\n -rw-r--r-- 0 root (0) root (0) 48568 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html\n -rw-r--r-- 0 root (0) root (0) 13261 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html\n -rw-r--r-- 0 root (0) root (0) 12804 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html\n -rw-r--r-- 0 root (0) root (0) 68487 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html\n -rw-r--r-- 0 root (0) root (0) 9618 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html\n--rw-r--r-- 0 root (0) root (0) 101842 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n+-rw-r--r-- 0 root (0) root (0) 101835 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n -rw-r--r-- 0 root (0) root (0) 167853 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html\n -rw-r--r-- 0 root (0) root (0) 9742 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html\n -rw-r--r-- 0 root (0) root (0) 56856 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html\n--rw-r--r-- 0 root (0) root (0) 129829 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n--rw-r--r-- 0 root (0) root (0) 55640 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n--rw-r--r-- 0 root (0) root (0) 48273 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n--rw-r--r-- 0 root (0) root (0) 16461 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n+-rw-r--r-- 0 root (0) root (0) 129801 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n+-rw-r--r-- 0 root (0) root (0) 55643 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n+-rw-r--r-- 0 root (0) root (0) 48266 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n+-rw-r--r-- 0 root (0) root (0) 16462 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n -rw-r--r-- 0 root (0) root (0) 25530 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html\n -rw-r--r-- 0 root (0) root (0) 9129 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-ed25519.html\n -rw-r--r-- 0 root (0) root (0) 34353 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html\n -rw-r--r-- 0 root (0) root (0) 29242 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/security-audit.html\n--rw-r--r-- 0 root (0) root (0) 1272303 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n+-rw-r--r-- 0 root (0) root (0) 1272265 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n -rw-r--r-- 0 root (0) root (0) 10121 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/streaming.html\n -rw-r--r-- 0 root (0) root (0) 8807 2024-02-19 12:14:14.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/style.css\n -rw-r--r-- 0 root (0) root (0) 522811 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html\n -rw-r--r-- 0 root (0) root (0) 3023 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/troubleshooting.html\n -rw-r--r-- 0 root (0) root (0) 25162 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tuning-ref.html\n -rw-r--r-- 0 root (0) root (0) 132630 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tutorial-ref.html\n -rw-r--r-- 0 root (0) root (0) 16383 2024-02-28 20:35:15.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/udp_tracker_protocol.html\n"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html", "unified_diff": "@@ -100,15 +100,15 @@\n the session, it contains the main loop that serves all torrents.

\n

The basic usage is as follows:

\n \n \n
  • dht_state
  • \n-
  • sign_mutable_item()
  • \n-
  • dht_default_storage_constructor()
  • \n+
  • dht_default_storage_constructor()
  • \n+
  • sign_mutable_item()
  • \n
  • announce_flags_t
  • \n \n \n [report issue]
    \n

    dht_storage_counters

    \n

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n

    This structure hold the relevant counters for the storage

    \n@@ -309,14 +309,25 @@\n
    nodes
    \n
    the bootstrap nodes saved from the buckets node
    \n \n [report issue]
    \n
    nodes6
    \n
    the bootstrap nodes saved from the IPv6 buckets node
    \n
    \n+[report issue]
    \n+
    \n+

    dht_default_storage_constructor()

    \n+

    Declared in "libtorrent/kademlia/dht_storage.hpp"

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

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

    \n [report issue]
    \n
    \n

    sign_mutable_item()

    \n

    Declared in "libtorrent/kademlia/item.hpp"

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

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

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

    dht_default_storage_constructor()

    \n-

    Declared in "libtorrent/kademlia/dht_storage.hpp"

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

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

    \n [report issue]
    \n
    \n

    announce_flags_t

    \n

    Declared in "libtorrent/kademlia/announce_flags.hpp"

    \n
    \n
    seed
    \n
    announce to DHT as a seed
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -14,16 +14,16 @@\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n- * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\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 [_\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@@ -210,36 +210,36 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n nodes\n the bootstrap nodes saved from the buckets node\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n nodes6\n the bootstrap nodes saved from the IPv6 buckets node\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ settings_interface const& settings);\n+constructor for the default DHT storage. The DHT storage is responsible for\n+maintaining peers and mutable and immutable items announced and stored/put to\n+the DHT node.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bh_\bp_\bp\"\n signature s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm (\n span v\n , span salt\n , sequence_number seq\n , public_key const& pk\n , secret_key const& sk);\n given a byte range v and an optional byte range salt, a sequence number, public\n key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function\n produces a signature which is written into a 64 byte buffer pointed to by sig.\n The caller is responsible for allocating the destination buffer that's passed\n in as the sig argument. Typically it would be allocated on the stack.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- settings_interface const& settings);\n-constructor for the default DHT storage. The DHT storage is responsible for\n-maintaining peers and mutable and immutable items announced and stored/put to\n-the DHT node.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n seed\n announce to DHT as a seed\n implied_port\n announce to DHT with the implied-port flag set. This tells the network to\n use your source UDP port as your listen port, rather than the one\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html", "unified_diff": "@@ -33,29 +33,29 @@\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@@ -94,16 +94,39 @@\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+[report issue]\n \n+
    \n+

    i2p_category()

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

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

    returns the error category for I2P errors

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

    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

    libtorrent_category()

    \n

    Declared in "libtorrent/error_code.hpp"

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

    return the instance of the libtorrent_error_category which\n@@ -112,63 +135,217 @@\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-

    pcp_category()

    \n-

    Declared in "libtorrent/natpmp.hpp"

    \n-
    \n-boost::system::error_category& pcp_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+

    pcp_category()

    \n+

    Declared in "libtorrent/natpmp.hpp"

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

    gzip_category()

    \n

    Declared in "libtorrent/gzip.hpp"

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

    get the error_category for zip errors

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

    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-

    i2p_category()

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

    enum i2p_error_code

    \n

    Declared in "libtorrent/i2p_stream.hpp"

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

    returns the error category for I2P errors

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

    bdecode_category()

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-
    \n-boost::system::error_category& bdecode_category ();\n-
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\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/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/error_code.hpp"

    \n \n \n \n \n \n \n@@ -987,14 +1164,83 @@\n \n \n \n \n \n \n
    service_unavailable503 
    \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 pcp_errors

    \n

    Declared in "libtorrent/natpmp.hpp"

    \n \n \n \n@@ -1063,84 +1309,15 @@\n \n \n \n \n \n
    pcp_excessive_remote_peers13 
    \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+
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/gzip.hpp"

    \n \n \n \n \n \n@@ -1219,191 +1396,14 @@\n \n \n \n \n \n \n
    error_code_max16the 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 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/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 \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,29 +2,29 @@\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.10\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+ * _\bi_\b2_\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 * _\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__\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+ * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\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- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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 _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n * _\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 _\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\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 [_\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@@ -50,52 +50,98 @@\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* 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* 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* 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* 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* 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* 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* 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* 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* i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\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-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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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* 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+*\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-boost::system::error_category& b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/_\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@@ -490,33 +536,14 @@\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 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/_\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@@ -538,14 +565,33 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 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/_\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@@ -574,60 +620,14 @@\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 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 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/_\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 _\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& operator= (ip_filter&&);\n    ~ip_filter ();\n    ip_filter ();\n-   ip_filter (ip_filter const&);\n+   ip_filter& operator= (ip_filter&&);\n    ip_filter (ip_filter&&);\n    ip_filter& operator= (ip_filter const&);\n+   ip_filter (ip_filter const&);\n    bool empty () const;\n    void add_rule (address const& first, address const& last, std::uint32_t flags);\n    std::uint32_t access (address const& addr) const;\n    filter_tuple_t export_filter () const;\n \n    enum access_flags\n    {\n@@ -153,20 +153,20 @@\n 

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

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

    home

    \n \n@@ -75,18 +75,18 @@\n

    remove() add()

    \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 allow (socket_type_t const st, peer_class_t const peer_class);\n void disallow (socket_type_t const st, peer_class_t const peer_class);\n 
    \n

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

    \n

    The peer_class argument cannot be greater than 31. The bitmasks representing\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,15 +1,15 @@\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.10\n _\bh_\bo_\bm_\be\n Table of contents\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_\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 [_\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@@ -38,15 +38,15 @@\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 [_\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 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "unified_diff": "@@ -46,50 +46,50 @@\n

  • on_tick()
  • \n
  • get_unchoke_priority()
  • \n
  • load_state()
  • \n \n \n
  • torrent_plugin\n
  • \n
  • peer_plugin\n
  • \n
  • crypto_plugin\n
  • \n
  • peer_connection_handle
  • \n
  • bt_peer_connection_handle
  • \n-
  • create_ut_metadata_plugin()
  • \n-
  • create_smart_ban_plugin()
  • \n-
  • create_ut_pex_plugin()
  • \n+
  • create_ut_pex_plugin()
  • \n+
  • create_ut_metadata_plugin()
  • \n+
  • create_smart_ban_plugin()
  • \n \n
    \n

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

    \n

    In short, the plugin interface makes it possible to:

    \n@@ -345,19 +345,19 @@\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_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@@ -376,21 +376,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_failed() on_piece_pass()

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

    on_piece_pass() on_piece_failed()

    \n
    \n-virtual void on_piece_failed (piece_index_t);\n virtual void on_piece_pass (piece_index_t);\n+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@@ -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,51 +475,51 @@\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_unchoke ();\n- virtual bool on_choke ();\n- virtual bool on_dont_have (piece_index_t);\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n- virtual bool on_have_all ();\n- virtual bool on_have_none ();\n- virtual bool on_request (peer_request const&);\n virtual bool on_not_interested ();\n+ virtual bool on_have_none ();\n+ virtual bool on_have_all ();\n virtual bool on_allowed_fast (piece_index_t);\n- virtual bool on_have (piece_index_t);\n+ virtual bool on_unchoke ();\n+ virtual bool on_choke ();\n+ virtual bool on_request (peer_request const&);\n+ virtual bool on_dont_have (piece_index_t);\n virtual bool on_interested ();\n+ virtual bool on_have (piece_index_t);\n virtual bool on_piece (peer_request const& /*piece*/\n , span<char const> /*buf*/);\n- virtual bool on_reject (peer_request const&);\n- virtual bool on_cancel (peer_request const&);\n virtual bool on_suggest (piece_index_t);\n+ virtual bool on_cancel (peer_request const&);\n+ virtual bool on_reject (peer_request const&);\n virtual void sent_choke ();\n- virtual void sent_reject_request (peer_request const&);\n- virtual void sent_cancel (peer_request const&);\n virtual void sent_have_none ();\n+ virtual void sent_suggest (piece_index_t);\n virtual void sent_request (peer_request const&);\n virtual void sent_have_all ();\n- virtual void sent_suggest (piece_index_t);\n+ virtual void sent_cancel (peer_request const&);\n virtual void sent_allow_fast (piece_index_t);\n+ virtual void sent_reject_request (peer_request const&);\n virtual void sent_piece (peer_request const&);\n+ virtual void sent_interested ();\n virtual void sent_not_interested ();\n virtual void sent_have (piece_index_t);\n virtual void sent_unchoke ();\n- virtual void sent_interested ();\n virtual void sent_payload (int /* bytes */);\n virtual bool can_disconnect (error_code const& /*ec*/);\n virtual bool on_extended (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n- virtual void on_piece_failed (piece_index_t);\n virtual void on_piece_pass (piece_index_t);\n+ virtual void on_piece_failed (piece_index_t);\n virtual void tick ();\n virtual bool write_request (peer_request const&);\n };\n \n [report issue]
    \n

    type()

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

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

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

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

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

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

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

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

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

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

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

    called after a choke message has been sent to the peer

    \n [report issue]
    \n
    \n

    sent_payload()

    \n
    \n virtual void sent_payload (int /* bytes */);\n@@ -669,21 +669,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_failed() on_piece_pass()

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

    on_piece_pass() on_piece_failed()

    \n
    \n-virtual void on_piece_failed (piece_index_t);\n virtual void on_piece_pass (piece_index_t);\n+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@@ -703,16 +703,16 @@\n 
    \n
    \n

    crypto_plugin

    \n

    Declared in "libtorrent/extensions.hpp"

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

    decrypt()

    \n
    \n@@ -746,40 +746,40 @@\n    bool upload_only () const;\n    bool has_piece (piece_index_t i) const;\n    peer_id const& pid () const;\n    bool is_interesting () const;\n    bool is_choked () const;\n    bool has_peer_choked () const;\n    bool is_peer_interested () 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 const& remote () const;\n    tcp::endpoint local_endpoint () const;\n-   bool is_disconnecting () const;\n-   bool is_outgoing () const;\n    bool is_connecting () const;\n+   bool is_disconnecting () const;\n    void disconnect (error_code const& ec, operation_t op\n       , disconnect_severity_t = peer_connection_interface::normal);\n-   bool on_local_network () const;\n+   bool is_outgoing () const;\n    bool ignore_unchoke_slots () const;\n+   bool on_local_network () const;\n    bool failed () const;\n    bool should_log (peer_log_alert::direction_t direction) const;\n    void peer_log (peer_log_alert::direction_t direction\n       , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n    bool can_disconnect (error_code const& ec) const;\n    bool has_metadata () const;\n    bool in_handshake () const;\n    void send_buffer (char const* begin, int size);\n-   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@@ -789,19 +789,33 @@\n
    \n struct bt_peer_connection_handle : peer_connection_handle\n {\n    explicit bt_peer_connection_handle (peer_connection_handle pc);\n    bool support_extensions () const;\n    bool packet_finished () const;\n    bool supports_encryption () const;\n-   void switch_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_ut_metadata_plugin()

    \n

    Declared in "libtorrent/extensions/ut_metadata.hpp"

    \n
    \n std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n 
    \n@@ -822,28 +836,14 @@\n
    \n

    constructor function for the smart ban extension. The extension keeps\n track of the data peers have sent us for failing pieces and once the\n piece completes and passes the hash check bans the peers that turned\n out to have sent corrupt data.\n This function can either be passed in the add_torrent_params::extensions\n field, or via torrent_handle::add_extension().

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

    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": "@@ -15,47 +15,47 @@\n o _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b)\n o _\bg_\be_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n o _\bl_\bo_\ba_\bd_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bn_\be_\bw_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\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__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n- _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\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)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)\n- _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)\n+ o _\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__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)\n+ _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\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)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)\n+ _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\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)\n- _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\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__\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__\bh_\ba_\bv_\be_\b(_\b)\n+ _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bs_\be_\bn_\bt_\b__\bp_\ba_\by_\bl_\bo_\ba_\bd_\b(_\b)\n o _\bc_\ba_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bd_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n * _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n * _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\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__\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@@ -256,19 +256,19 @@\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_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@@ -285,30 +285,30 @@\n have its hook functions called on event specific to that peer.\n The peer_connection_handle will be valid as long as the shared_ptr is being\n held by the torrent object. So, it is generally a good idea to not keep a\n shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n weak_ptr.\n If this function throws an exception, the connection will be closed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-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_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n These hooks are called when a piece passes the hash check or fails the hash\n check, respectively. The index is the piece index that was downloaded. It is\n possible to access the list of peers that participated in sending the piece\n through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n virtual void t\bti\bic\bck\bk ();\n This hook is called approximately once per second. It is a way of making it\n easy for plugins to do timed events, for sending messages or whatever.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_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,51 +354,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_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual bool o\bon\bn_\b_c\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_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_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_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_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual bool o\bon\bn_\b_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_u\bun\bnc\bch\bho\bok\bke\be ();\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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n- virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n- virtual bool o\bon\bn_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n virtual bool o\bon\bn_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual bool o\bon\bn_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_c\bch\bho\bok\bke\be ();\n- virtual void s\bse\ben\bnt\bt_\b_r\bre\bej\bje\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_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_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n virtual void s\bse\ben\bnt\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n- virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (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_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_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_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 (piece_index_t);\n virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual void s\bse\ben\bnt\bt_\b_p\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@@ -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_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt\n-(\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) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\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_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual bool o\bon\bn_\b_c\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+*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bch\bho\bok\bke\be(\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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b)\n+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_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) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b)\n+o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_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_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_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual bool o\bon\bn_\b_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_u\bun\bnc\bch\bho\bok\bke\be ();\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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n returning true from any of the message handlers indicates that the _\bp_\bl_\bu_\bg_\bi_\bn has\n handled the message. it will break the _\bp_\bl_\bu_\bg_\bi_\bn chain traversing and not let\n anyone else handle the message, including the default handler.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n This function is called when the peer connection is receiving a piece. buf\n points (non-owning pointer) to the data in an internal immutable disk buffer.\n The length of the data is specified in the length member of the piece\n parameter. returns true to indicate that the piece is handled and the rest of\n the logic should be ignored.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) s\bse\ben\bnt\bt_\b_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)\n-s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) *\b**\b**\b**\b**\b*\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_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_h\bha\bav\bve\be(\b()\b)\n+s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\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_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 (piece_index_t);\n virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n 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@@ -490,17 +490,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_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n called when a piece that this peer participated in either fails or passes the\n hash_check\n [_\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@@ -510,16 +510,16 @@\n original request message won't be sent and no other _\bp_\bl_\bu_\bg_\bi_\bn will have this\n function called.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* c\bcr\bry\byp\bpt\bto\bo_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n struct crypto_plugin\n {\n- virtual void s\bse\bet\bt_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n virtual void s\bse\bet\bt_\b_o\bou\but\btg\bgo\boi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n+ virtual void s\bse\bet\bt_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n e\ben\bnc\bcr\bry\byp\bpt\bt (span> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/\n ) = 0;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* d\bde\bec\bcr\bry\byp\bpt\bt(\b()\b) *\b**\b**\b**\b**\b*\n virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n@@ -548,60 +548,71 @@\n bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n peer_id const& p\bpi\bid\bd () const;\n bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n bool i\bis\bs_\b_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 m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt const& r\bre\bem\bmo\bot\bte\be () const;\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n- bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n- bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n , disconnect_severity_t = peer_connection_interface::normal);\n- bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n+ bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n bool f\bfa\bai\bil\ble\bed\bd () const;\n bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n (4,5);\n bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n- 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==\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 s\bsu\bup\bpp\bpo\bor\brt\bt_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs () const;\n bool p\bpa\bac\bck\bke\bet\bt_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd () const;\n bool s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\ben\bnc\bcr\bry\byp\bpt\bti\bio\bon\bn () const;\n- void s\bsw\bwi\bit\btc\bch\bh_\b_r\bre\bec\bcv\bv_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n void s\bsw\bwi\bit\btc\bch\bh_\b_s\bse\ben\bnd\bd_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n+ 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_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n const&, client_data_t);\n constructor function for the ut_metadata extension. The ut_metadata extension\n allows peers to request the .torrent file (or more specifically the info-\n dictionary of the .torrent file) from each other. This is the main building\n@@ -615,25 +626,14 @@\n std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n client_data_t);\n constructor function for the smart ban extension. The extension keeps track of\n the data peers have sent us for failing pieces and once the piece completes and\n passes the hash check bans the peers that turned out to have sent corrupt data.\n This function can either be passed in the add_torrent_params::extensions field,\n or via _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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.10\n \n \n

    home

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

    write_resume_data_buf() write_resume_data()

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

    write_resume_data() write_resume_data_buf()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

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

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

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

    write_torrent_file_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, 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@@ -70,22 +70,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    , int piece_limit = 0x200000);\n-add_torrent_params read_resume_data (span<char const> buffer\n-   , error_code& ec, load_torrent_limits const& cfg = {});\n add_torrent_params read_resume_data (bdecode_node const& rd\n    , error_code& ec, int piece_limit = 0x200000);\n+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 
    \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,50 +1,50 @@\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.10\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__\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__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\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+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n+entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n this function turns the resume data in an add_torrent_params object into a\n bencoded structure\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n+ , write_torrent_flags_t flags);\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n flags);\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n-std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n- , write_torrent_flags_t flags);\n writes only the fields to create a .torrent file. This function may fail with a\n std::system_error exception if:\n * The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object passed to this function does not contain\n the info dictionary (the ti field)\n * The piece layers are not complete for all files that need them\n The write_torrent_file_buf() overload returns the torrent file in bencoded\n buffer form. This overload may be faster at the expense of lost flexibility to\n add custom fields.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n- , load_torrent_limits const& cfg = {});\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n , int piece_limit = 0x200000);\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (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 , 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 (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 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/reference-Session.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "unified_diff": "@@ -28,222 +28,83 @@\n 2.0.10\n \n \n

    home

    \n
    \n

    Table of contents

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

    session_proxy

    \n-

    Declared in "libtorrent/session.hpp"

    \n-

    this is a holder for the internal session implementation object. Once the\n-session destruction is explicitly initiated, this holder is used to\n-synchronize the completion of the shutdown. The lifetime of this object\n-may outlive session, causing the session destructor to not block. The\n-session_proxy destructor will block however, until the underlying session\n-is done shutting down.

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

    session_proxy() operator=() ~session_proxy()

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

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

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

    session

    \n-

    Declared in "libtorrent/session.hpp"

    \n-

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

    \n-

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

    \n-

    see apply_settings().

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

    session()

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

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

    \n-

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

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

    session()

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

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

    \n-
    \n-

    Warning

    \n-

    The session object does not cleanly terminate with an external\n-io_context. The io_context::run() call must have returned\n-before it's safe to destruct the session. Which means you MUST\n-call session::abort() and save the session_proxy first, then\n-destruct the session object, then sync with the io_context, then\n-destruct the session_proxy object.

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

    ~session()

    \n-
    \n-~session ();\n-
    \n-

    The destructor of session will notify all trackers that our torrents\n-have been shut down. If some trackers are down, they will time out.\n-All this before the destructor of session returns. So, it's advised\n-that any kind of interface (such as windows) are closed before\n-destructing the session object. Because it can take a few second for\n-it to finish. The timeout can be set with apply_settings().

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

    abort()

    \n-
    \n-session_proxy abort ();\n-
    \n-

    In case you want to destruct the session asynchronously, you can\n-request a session destruction proxy. If you don't do this, the\n-destructor of the session object will block while the trackers are\n-contacted. If you keep one session_proxy to the session when\n-destructing it, the destructor will not block, but start to close down\n-the session, the destructor of the proxy will then synchronize the\n-threads. So, the destruction of the session is performed from the\n-session destructor call until the session_proxy destructor\n-call. The session_proxy does not have any operations on it (since\n-the session is being closed down, no operations are allowed on it).\n-The only valid operation is calling the destructor:

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

    session_params

    \n

    Declared in "libtorrent/session_params.hpp"

    \n

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

    \n
    \n struct session_params\n {\n+   session_params ();\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@@ -253,17 +114,17 @@\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 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@@ -310,15 +171,15 @@\n [report issue]
    \n
    \n
    \n

    session_handle

    \n

    Declared in "libtorrent/session_handle.hpp"

    \n

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

    \n
    \n struct session_handle\n {\n    bool is_valid () const;\n    session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n@@ -326,69 +187,69 @@\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+   void set_dht_state (dht::dht_state&& st);\n    std::vector<torrent_handle> get_torrents () const;\n    torrent_handle find_torrent (sha1_hash const& info_hash) const;\n    torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n-   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n-   torrent_handle add_torrent (add_torrent_params const& params);\n-   void async_add_torrent (add_torrent_params&& params);\n    void async_add_torrent (add_torrent_params const& params);\n+   torrent_handle 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+   void async_add_torrent (add_torrent_params&& 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_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n    void dht_live_nodes (sha1_hash const& nid);\n    void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n    void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n    void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n       torrent_handle const&, client_data_t)> ext);\n    void add_extension (std::shared_ptr<plugin> ext);\n    void set_ip_filter (ip_filter f);\n    ip_filter get_ip_filter () const;\n    void set_port_filter (port_filter const& f);\n-   unsigned short listen_port () const;\n    unsigned short ssl_listen_port () const;\n    bool is_listening () const;\n-   void set_peer_class_filter (ip_filter const& f);\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    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 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    void set_alert_notify (std::function<void()> const& fun);\n    alert* wait_for_alert (time_duration max_wait);\n-   std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n    void delete_port_mapping (port_mapping_t handle);\n+   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@@ -501,24 +362,24 @@\n void post_dht_stats ();\n 
    \n

    This will cause a dht_stats_alert to be posted.

    \n [report issue]
    \n
    \n

    set_dht_state()

    \n
    \n-void set_dht_state (dht::dht_state&& st);\n void set_dht_state (dht::dht_state const& st);\n+void set_dht_state (dht::dht_state&& st);\n 
    \n

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

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

    get_torrents() find_torrent()

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

    find_torrent() get_torrents()

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

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

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

    add_torrent() async_add_torrent()

    \n
    \n torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n-torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n-torrent_handle add_torrent (add_torrent_params const& params);\n-void async_add_torrent (add_torrent_params&& params);\n void async_add_torrent (add_torrent_params const& params);\n+torrent_handle 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+void async_add_torrent (add_torrent_params&& params);\n 
    \n

    You add torrents through the add_torrent() function where you give an\n object with all the parameters. The add_torrent() overloads will block\n until the torrent has been added (or failed to be added) and returns\n an error code and a torrent_handle. In order to add torrents more\n efficiently, consider using async_add_torrent() which returns\n immediately, without waiting for the torrent to add. Notification of\n@@ -561,19 +422,19 @@\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 \n-[report issue]
    \n-
    \n-

    resume() is_paused() pause()

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

    pause() is_paused() resume()

    \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@@ -685,21 +546,21 @@\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+[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@@ -807,36 +668,36 @@\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-

    ssl_listen_port() listen_port() is_listening()

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

    ssl_listen_port() is_listening() listen_port()

    \n
    \n-unsigned short listen_port () const;\n unsigned short ssl_listen_port () const;\n bool is_listening () 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

    get_peer_class_filter() set_peer_class_filter()

    \n
    \n-void set_peer_class_filter (ip_filter const& f);\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@@ -856,18 +717,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-

    set_peer_class_type_filter() get_peer_class_type_filter()

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

    get_peer_class_type_filter() set_peer_class_type_filter()

    \n
    \n void set_peer_class_type_filter (peer_class_type_filter const& f);\n peer_class_type_filter get_peer_class_type_filter () const;\n 
    \n

    Sets and gets the peer class type filter. This is controls automatic\n peer class assignments to peers based on what kind of socket it is.

    \n

    It does not only support assigning peer classes, it also supports\n@@ -909,18 +770,18 @@\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+[report issue]
    \n+
    \n+

    set_peer_class() get_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 
    \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@@ -975,19 +836,19 @@\n void apply_settings (settings_pack&&);\n void apply_settings (settings_pack const&);\n settings_pack get_settings () const;\n \n

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

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

    wait_for_alert() set_alert_notify() pop_alerts()

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

    pop_alerts() wait_for_alert() set_alert_notify()

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

    Alerts is the main mechanism for libtorrent to report errors and\n events. pop_alerts fills in the vector passed to it with pointers\n@@ -1037,21 +898,21 @@\n message to an HWND or some other main message pump. The actual\n retrieval of alerts should not be done in the callback. In fact, the\n callback should not block. It should not perform any expensive work.\n It really should just notify the main application thread.

    \n

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

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

    add_port_mapping() delete_port_mapping()

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

    delete_port_mapping() add_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+std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\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@@ -1117,28 +978,167 @@\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-\n+[report issue]
    \n+
    \n+
    \n+

    session_proxy

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

    this is a holder for the internal session implementation object. Once the\n+session destruction is explicitly initiated, this holder is used to\n+synchronize the completion of the shutdown. The lifetime of this object\n+may outlive session, causing the session destructor to not block. The\n+session_proxy destructor will block however, until the underlying session\n+is done shutting down.

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

    session_proxy() operator=() ~session_proxy()

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

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

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

    session

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

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

    \n+

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

    \n+

    see apply_settings().

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

    session()

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

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

    \n+
    \n+

    Warning

    \n+

    The session object does not cleanly terminate with an external\n+io_context. The io_context::run() call must have returned\n+before it's safe to destruct the session. Which means you MUST\n+call session::abort() and save the session_proxy first, then\n+destruct the session object, then sync with the io_context, then\n+destruct the session_proxy object.

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

    ~session()

    \n+
    \n+~session ();\n+
    \n+

    The destructor of session will notify all trackers that our torrents\n+have been shut down. If some trackers are down, they will time out.\n+All this before the destructor of session returns. So, it's advised\n+that any kind of interface (such as windows) are closed before\n+destructing the session object. Because it can take a few second for\n+it to finish. The timeout can be set with apply_settings().

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

    abort()

    \n+
    \n+session_proxy abort ();\n+
    \n+

    In case you want to destruct the session asynchronously, you can\n+request a session destruction proxy. If you don't do this, the\n+destructor of the session object will block while the trackers are\n+contacted. If you keep one session_proxy to the session when\n+destructing it, the destructor will not block, but start to close down\n+the session, the destructor of the proxy will then synchronize the\n+threads. So, the destruction of the session is performed from the\n+session destructor call until the session_proxy destructor\n+call. The session_proxy does not have any operations on it (since\n+the session is being closed down, no operations are allowed on it).\n+The only valid operation is calling the destructor:

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

    write_session_params() read_session_params() write_session_params_buf()

    \n+
    \n+

    read_session_params() write_session_params_buf() write_session_params()

    \n

    Declared in "libtorrent/session_params.hpp"

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

    These functions serialize and de-serialize a session_params object to and\n from bencoded form. The session_params object is used to initialize a new\n session using the state from a previous one (or by programmatically configure\n the session up-front).\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,178 +1,70 @@\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.10\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n- * _\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 * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)_\b _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\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 _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\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__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n o _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n o _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\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)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)\n+ o _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\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 _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\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 _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- o _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n+ o _\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 _\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- * _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\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&&) & noexcept;\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy 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 (session_proxy const&);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-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 (session_proxy const&);\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-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- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn ();\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n- session_proxy a\bab\bbo\bor\brt\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n-s\bse\bes\bss\bsi\bio\bon\bn ();\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n-Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n-order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n-it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n-before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n-The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n-passing in session::paused). Note that add_default_plugins do not have an\n-affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n-the plugins to use.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n-Overload of the constructor that takes an external io_context to run the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n-multiple sessions on a single io_context, or low resource systems where\n-additional threads are expensive and sharing an io_context with other events is\n-fine.\n-Warning\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n-io_context::run() call m\bmu\bus\bst\bt have returned before it's safe to destruct the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn. Which means you M\bMU\bUS\bST\bT call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b:_\b:_\ba_\bb_\bo_\br_\bt_\b(_\b) and save the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-first, then destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn object, then sync with the io_context, then\n-destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n-The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n-shut down. If some trackers are down, they will time out. All this before the\n-destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n-(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n-can take a few second for it to finish. The timeout can be set with\n-_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-session_proxy a\bab\bbo\bor\brt\bt ();\n-In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-object will block while the trackers are contacted. If you keep one\n-session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n-block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n-then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n-from the session destructor call until the session_proxy destructor call. The\n-session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n-closed down, no operations are allowed on it). The only valid operation is\n-calling the destructor:\n-struct session_proxy {};\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n+ * _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n [_\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 ();\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@@ -180,17 +72,17 @@\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 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@@ -240,74 +132,74 @@\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+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& 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);\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- void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n- void 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+ void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n void p\bpa\bau\bus\bse\be ();\n bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n void r\bre\bes\bsu\bum\bme\be ();\n bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n , std::string salt = std::string());\n sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n , std::function&\n , std::int64_t&, std::string const&)> cb\n , std::string salt = std::string());\n+ void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n void d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be (sha1_hash const& info_hash, int port = 0, dht::\n announce_flags_t flags = {});\n- void d\bdh\bht\bt_\b_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 void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n- unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n+ 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 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 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 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 d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n external_port, int local_port);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n 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@@ -391,37 +283,37 @@\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+void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n set the DHT state for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This will be taken into account the next\n time the DHT is started, as if it had been passed in via the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs on\n startup.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n find_torrent() looks for a torrent with the given info-hash. In case there is\n such a torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be to that torrent is returned. In\n case the torrent cannot be found, an invalid _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is returned.\n See torrent_handle::is_valid() to know if the torrent was found or not.\n get_torrents() returns a vector of torrent_handles to all the torrents\n currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& 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-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 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);\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+void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n torrent has been added (or failed to be added) and returns an error code and a\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n The overload that does not take an error_code throws an exception on error and\n@@ -438,15 +330,15 @@\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* 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+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) r\bre\bes\bsu\bum\bme\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@@ -525,18 +417,18 @@\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+*\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).\n@@ -610,27 +502,27 @@\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* 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) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () 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-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_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@@ -647,15 +539,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* 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+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n assignments to peers based on what kind of socket it is.\n It does not only support assigning peer classes, it also supports removing peer\n classes based on socket type.\n The order of these rules being applied are:\n@@ -685,15 +577,15 @@\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+*\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 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@@ -733,15 +625,15 @@\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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\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 void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n Alerts is the main mechanism for libtorrent to report errors and events.\n pop_alerts fills in the vector passed to it with pointers to new alerts. The\n _\bs_\be_\bs_\bs_\bi_\bo_\bn still owns these alerts and they will stay valid until the next time\n pop_alerts is called. You may not delete the _\ba_\bl_\be_\br_\bt objects.\n@@ -783,18 +675,18 @@\n alerts should not be done in the callback. In fact, the callback should not\n block. It should not perform any expensive work. It really should just notify\n the main application thread.\n The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n can also be queries from a concrete type via T::alert_type, as a static\n constant.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+*\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+void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n external_port, int local_port);\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n whichever is enabled. A mapping is created for each listen socket in the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn. The return values are all handles referring to the port mappings that\n were just created. Pass them to _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b) to remove them.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n@@ -840,23 +732,131 @@\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* w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b)\n+*\b**\b**\b**\b**\b**\b* 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&&) & noexcept;\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 (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+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\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 (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+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+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+ s\bse\bes\bss\bsi\bio\bon\bn ();\n+ 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, 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+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+s\bse\bes\bss\bsi\bio\bon\bn ();\n+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 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+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n+The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n+shut down. If some trackers are down, they will time out. All this before the\n+destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n+(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n+can take a few second for it to finish. The timeout can be set with\n+_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+session_proxy a\bab\bbo\bor\brt\bt ();\n+In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+object will block while the trackers are contacted. If you keep one\n+session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n+block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n+then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n+from the session destructor call until the session_proxy destructor call. The\n+session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n+closed down, no operations are allowed on it). The only valid operation is\n+calling the destructor:\n+struct session_proxy {};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-entry w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n , save_state_flags_t flags = save_state_flags_t::all());\n session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n , save_state_flags_t flags = save_state_flags_t::all());\n+entry w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n std::vector w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf (session_params const& sp\n , save_state_flags_t flags = save_state_flags_t::all());\n These functions serialize and de-serialize a session_params object to and from\n bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n using the state from a previous one (or by programmatically configure the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n certain aspects of the session's state. The _buf suffix indicates the function\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "unified_diff": "@@ -33,31 +33,31 @@\n

    Table of contents

    \n \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@@ -4562,24 +4562,24 @@\n i2p_port).

    \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, 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-   void set_int (int name, int 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-   std::string const& get_str (int name) const override;\n    int get_int (int name) const override;\n+   std::string const& get_str (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@@ -4654,18 +4654,18 @@\n };\n 
    \n \n \n [report issue]
    \n

    set_bool() set_int() set_str()

    \n
    \n-void set_bool (int name, bool val) override;\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-void set_int (int name, int 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@@ -4685,23 +4685,23 @@\n [report issue]
    \n
    \n

    clear()

    \n
    \n void clear (int name);\n 
    \n

    clear a specific setting from the pack

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

    get_int() get_bool() get_str()

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

    get_bool() get_int() get_str()

    \n
    \n bool get_bool (int name) const override;\n-std::string const& get_str (int name) const override;\n int get_int (int name) const override;\n+std::string const& get_str (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@@ -5060,64 +5060,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-\n-[report issue]
    \n-
    \n-

    name_for_setting() setting_by_name()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

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

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

    default_settings()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

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

    generate_fingerprint()

    \n

    Declared in "libtorrent/fingerprint.hpp"

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

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

    \n

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

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

    high_performance_seed() min_memory_usage()

    \n+

    Declared in "libtorrent/session.hpp"

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

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

    \n+

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

    \n+

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

    \n+

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

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

    setting_by_name() name_for_setting()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

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

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

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

    default_settings()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

    \n
    \n \n \n \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,29 +4,29 @@\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__\bi_\bn_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bt_\br_\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__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\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- * _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n- * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+ * _\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+ * _\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 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@@ -1420,24 +1420,24 @@\n next time the SAM connection is re-established (by restarting or changing\n i2p_hostname or i2p_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, 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- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int 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- std::string const& g\bge\bet\bt_\b_s\bst\btr\br (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 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@@ -1508,18 +1508,18 @@\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_i\bin\bnt\bt(\b()\b) s\bse\bet\bt_\b_s\bst\btr\br(\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, 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-void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int 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@@ -1530,18 +1530,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_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n 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 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 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@@ -1668,18 +1668,43 @@\n | | |trackers, a plain proxy will suffice. The proxy is assumed to|\n | | |not require authorization. The username and password will not|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\b _\bu_\bs_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |The server is assumed to be an HTTP proxy that requires user |\n |http_pw |5 |authorization. The username and password will be sent to the |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n+std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n+ , int major, int minor = 0, int revision = 0, int tag = 0);\n+This is a utility function to produce a client ID fingerprint formatted to the\n+most common convention. The fingerprint can be set via the peer_fingerprint\n+setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n+The name string should contain exactly two characters. These are the characters\n+unique to your client, used to identify it. Make sure not to clash with anybody\n+else. Here are some taken id's:\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n+|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n+|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+There's an informal directory of client id's _\bh_\be_\br_\be.\n+The major, minor, revision and tag parameters are used to identify the version\n+of your client.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-settings_pack 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+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@@ -1692,50 +1717,25 @@\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* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n converts a setting integer (from the enums string_types, int_types or\n bool_types) to a string, and vice versa.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n settings_pack d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs ();\n returns a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk with every setting set to its default value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n-std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n-This is a utility function to produce a client ID fingerprint formatted to the\n-most common convention. The fingerprint can be set via the peer_fingerprint\n-setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-The name string should contain exactly two characters. These are the characters\n-unique to your client, used to identify it. Make sure not to clash with anybody\n-else. Here are some taken id's:\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n-|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n-|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-There's an informal directory of client id's _\bh_\be_\br_\be.\n-The major, minor, revision and tag parameters are used to identify the version\n-of your client.\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "comments": ["Ordering differences only"], "unified_diff": "@@ -45,28 +45,28 @@\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+   counters& operator= (counters const&) & ;\n    std::int64_t operator[] (int i) const ;\n-   void set_value (int c, std::int64_t value) ;\n+   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\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+std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n 
    \n

    returns the new value

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

    stats_metric

    \n

    Declared in "libtorrent/session_stats.hpp"

    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -11,25 +11,25 @@\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+ 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- void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\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 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+std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n returns the new value\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n struct stats_metric\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "unified_diff": "@@ -28,85 +28,63 @@\n 2.0.10\n \n \n

    home

    \n
    \n

    Table of contents

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

    storage_params

    \n-

    Declared in "libtorrent/storage_defs.hpp"

    \n-

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

    \n-
    \n-struct storage_params\n-{\n-   storage_params (file_storage const& f, file_storage const* mf\n-      , std::string const& sp, storage_mode_t const sm\n-      , aux::vector<download_priority_t, file_index_t> const& prio\n-      , sha1_hash const& ih);\n-\n-   file_storage const& files;\n-   file_storage const* mapped_files  = nullptr;\n-   std::string const& path;\n-   storage_mode_t mode {storage_mode_sparse};\n-   aux::vector<download_priority_t, file_index_t> const& priorities;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n+[report issue]
    \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@@ -139,23 +117,23 @@\n size. Everything necessary to interpret a regular bittorrent storage\n file structure.

    \n
    \n class file_storage\n {\n    bool is_valid () const;\n    void reserve (int num_files);\n-   void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n    void add_file_borrow (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 (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 (string_view filename\n       , std::string const& path, std::int64_t file_size\n       , file_flags_t file_flags = {}, char const* filehash = nullptr\n@@ -176,33 +154,33 @@\n    index_range<piece_index_t> piece_range () const noexcept;\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-   void set_name (std::string const& n);\n    std::string const& name () const;\n+   void set_name (std::string const& n);\n    void swap (file_storage& ti) noexcept;\n    void canonicalize ();\n-   string_view file_name (file_index_t index) const;\n    std::time_t mtime (file_index_t index) const;\n-   char const* root_ptr (file_index_t const index) const;\n-   std::string symlink (file_index_t index) const;\n+   sha1_hash hash (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::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   char const* root_ptr (file_index_t const index) const;\n+   string_view file_name (file_index_t index) const;\n    std::int64_t file_size (file_index_t index) const;\n    sha256_hash root (file_index_t index) const;\n-   sha1_hash hash (file_index_t index) const;\n-   int file_num_blocks (file_index_t index) const;\n+   std::int64_t file_offset (file_index_t index) const;\n+   std::string symlink (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n    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_num_blocks (file_index_t index) const;\n    int file_first_piece_node (file_index_t index) const;\n+   int file_first_block_node (file_index_t index) const;\n    std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n    void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n    file_flags_t file_flags (file_index_t index) const;\n    bool file_absolute_path (file_index_t index) const;\n    file_index_t file_index_at_offset (std::int64_t offset) const;\n    file_index_t file_index_at_piece (piece_index_t piece) const;\n    file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n@@ -235,23 +213,23 @@\n be used to avoid reallocating the internal file list when the number\n of files to be added is known up-front.

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

    add_file_borrow() add_file()

    \n
    \n-void add_file (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 (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 (string_view filename\n       , std::string const& path, std::int64_t file_size\n       , file_flags_t file_flags = {}, char const* filehash = nullptr\n@@ -392,18 +370,18 @@\n 

    piece_range()

    \n
    \n index_range<piece_index_t> piece_range () const noexcept;\n 
    \n

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

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

    set_piece_length() piece_length()

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

    piece_length() set_piece_length()

    \n
    \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@@ -440,16 +418,16 @@\n

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

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

    set_name() name()

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

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

    \n [report issue]
    \n
    \n

    swap()

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

    canonicalize()

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

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

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

    root() file_name() root_ptr() file_size() mtime() hash() pad_file_at() file_offset() file_path() symlink()

    \n
    \n-string_view file_name (file_index_t index) const;\n std::time_t mtime (file_index_t index) const;\n-char const* root_ptr (file_index_t const index) const;\n-std::string symlink (file_index_t index) const;\n+sha1_hash hash (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::string file_path (file_index_t index, std::string const& save_path = "") const;\n+char const* root_ptr (file_index_t const index) const;\n+string_view file_name (file_index_t index) const;\n std::int64_t file_size (file_index_t index) const;\n sha256_hash root (file_index_t index) const;\n-sha1_hash hash (file_index_t index) const;\n+std::int64_t file_offset (file_index_t index) const;\n+std::string symlink (file_index_t index) const;\n+std::string file_path (file_index_t index, std::string const& save_path = "") const;\n 
    \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@@ -508,37 +486,37 @@\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-\n-[report issue]
    \n-
    \n-

    file_num_blocks() file_num_pieces() file_piece_range()

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

    file_piece_range() file_num_blocks() file_num_pieces()

    \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+int file_num_blocks (file_index_t index) const;\n 
    \n

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

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

    file_first_piece_node() file_first_block_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@@ -569,18 +547,18 @@\n 

    file_absolute_path()

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

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

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

    file_index_at_piece() file_index_at_offset()

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

    file_index_at_offset() file_index_at_piece()

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

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

    \n [report issue]
    \n
    \n@@ -629,46 +607,68 @@\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-

    default_disk_io_constructor()

    \n-

    Declared in "libtorrent/session.hpp"

    \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-std::unique_ptr<disk_interface> default_disk_io_constructor (\n+struct storage_params\n+{\n+   storage_params (file_storage const& f, file_storage const* mf\n+      , std::string const& sp, storage_mode_t const sm\n+      , aux::vector<download_priority_t, file_index_t> const& prio\n+      , sha1_hash const& ih);\n+\n+   file_storage const& files;\n+   file_storage const* mapped_files  = nullptr;\n+   std::string const& path;\n+   storage_mode_t mode {storage_mode_sparse};\n+   aux::vector<download_priority_t, file_index_t> const& priorities;\n+   sha1_hash info_hash;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    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+

    constructs a memory mapped file disk I/O object.

    \n [report issue]
    \n
    \n

    posix_disk_io_constructor()

    \n

    Declared in "libtorrent/posix_disk_io.hpp"

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

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

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

    mmap_disk_io_constructor()

    \n-

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    default_disk_io_constructor()

    \n+

    Declared in "libtorrent/session.hpp"

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

    constructs a memory mapped file disk I/O object.

    \n+

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

    \n [report issue]
    \n
    \n

    disabled_disk_io_constructor()

    \n

    Declared in "libtorrent/disabled_disk_io.hpp"

    \n
    \n std::unique_ptr<disk_interface> disabled_disk_io_constructor (\n    io_context& ios, settings_interface const&, counters& cnt);\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,13 +1,12 @@\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.10\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__\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@@ -16,62 +15,44 @@\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 _\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__\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 _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)\n-            _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)\n-          o _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\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 _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)\n+            _\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)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\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__\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__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)\n           o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n           o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n           o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n           o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n-          o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+          o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\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_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n-    * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+    * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n     * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+    * _\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     * _\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-_\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@@ -96,23 +77,23 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n The file_storage class represents a file list and the piece size. Everything\n necessary to interpret a regular bittorrent storage file structure.\n class file_storage\n {\n    bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n    void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n-   void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n    void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (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@@ -135,34 +116,34 @@\n    index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\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-   void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n    std::string const& n\bna\bam\bme\be () const;\n+   void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n    void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n    void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n-   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-   char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n-   std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n+   sha1_hash h\bha\bas\bsh\bh (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+   char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+   string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+   std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+   sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n    std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n+   std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n    std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n \"\") const;\n-   std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n-   sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n-   sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n-   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_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n    int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n+   int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n    std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n save_path) const;\n    void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n    file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n    bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n    file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n    file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n@@ -186,23 +167,23 @@\n *\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n allocates space for num_files in the internal file list. This can be used to\n avoid reallocating the internal file list when the number of files to be added\n is known up-front.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (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 (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 (string_view filename\n       , std::string const& path, std::int64_t file_size\n       , file_flags_t file_flags = {}, char const* filehash = nullptr\n@@ -301,15 +282,15 @@\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+*\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 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@@ -329,40 +310,40 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n returns the number of blocks there are in the typical piece. There may be fewer\n in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n std::string const& n\bna\bam\bme\be () const;\n+void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n set and get the name of this torrent. For multi-file torrents, this is also the\n name of the root directory all the files are stored in.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n swap all content of t\bth\bhi\bis\bs with t\bti\bi.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n arrange files and padding to match the canonical form required by BEP 52\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpa\bat\bth\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_n\bna\bam\bme\be(\b()\b) h\bha\bas\bsh\bh(\b()\b) r\bro\boo\bot\bt(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be\n-(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+*\b**\b**\b**\b**\b* r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) m\bmt\bti\bim\bme\be(\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)\n+f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\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) *\b**\b**\b**\b**\b*\n std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n-char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n+sha1_hash h\bha\bas\bsh\bh (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+char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n+std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n const;\n-std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n-sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n-sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n 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 +356,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_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-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_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_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 Returns the number of pieces or blocks the file atindexspans, under the\n assumption that the file is aligned to the start of a piece. This is only\n meaningful for v2 torrents, where files are guaranteed such alignment. These\n numbers are used to size and navigate the merkle hash tree for each file.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n 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@@ -411,15 +392,15 @@\n returns a bitmask of flags from file_flags_t that apply to file at index.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n returns true if the file at the specified index has been renamed to have an\n absolute path, i.e. is not anchored in the save path of the torrent.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_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+*\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_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@@ -450,35 +431,54 @@\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\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+*\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+a parameter pack used to construct the storage for a torrent, used in\n+_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+struct storage_params\n+{\n+   s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs (file_storage const& f, file_storage const* mf\n+      , std::string const& sp, storage_mode_t const sm\n+      , aux::vector const& prio\n+      , sha1_hash const& ih);\n+\n+   file_storage const& files;\n+   file_storage const* m\bma\bap\bpp\bpe\bed\bd_\b_f\bfi\bil\ble\bes\bs  = nullptr;\n+   std::string const& path;\n+   storage_mode_t m\bmo\bod\bde\be {storage_mode_sparse};\n+   aux::vector const& priorities;\n+   sha1_hash info_hash;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n    io_context& ios, settings_interface const&, counters& cnt);\n-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+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* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n    io_context& ios, settings_interface const&, counters& cnt);\n this is a simple posix disk I/O back-end, used for systems that don't have a 64\n bit virtual address space or don't support memory mapped files. It's\n implemented using portable C file functions and is single-threaded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n    io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n    io_context& ios, settings_interface const&, counters& cnt);\n creates a disk io object that discards all data written to it, and only returns\n zero-buffers when read from. May be useful for testing and benchmarking.\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html", "unified_diff": "@@ -39,52 +39,52 @@\n \n 
  • partial_piece_info
  • \n
  • torrent_handle\n
  • \n
  • hash_value()
  • \n@@ -94,16 +94,16 @@\n

    block_info

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n

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

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

    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,15 +254,15 @@\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@@ -272,98 +272,98 @@\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    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    std::vector<partial_piece_info> get_download_queue () const;\n-   void get_download_queue (std::vector<partial_piece_info>& queue) const;\n    void post_download_queue () const;\n+   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-   void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n    void post_file_progress (file_progress_flags_t flags) const;\n    std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+   void 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 replace_trackers (std::vector<announce_entry> const&) const;\n    void post_trackers () const;\n+   void replace_trackers (std::vector<announce_entry> const&) const;\n    void add_tracker (announce_entry const&) 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-   std::set<std::string> url_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+   void add_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 unset_flags (torrent_flags_t flags) const;\n+   void resume () const;\n    void set_flags (torrent_flags_t flags) const;\n    torrent_flags_t flags () const;\n+   void unset_flags (torrent_flags_t flags) const;\n    void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n    void flush_cache () const;\n    void force_recheck () const;\n    void save_resume_data (resume_data_flags_t flags = {}) const;\n    bool need_save_resume_data (resume_data_flags_t flags) const;\n    bool need_save_resume_data () const;\n+   void queue_position_bottom () const;\n+   void queue_position_up () const;\n+   void queue_position_down () const;\n    void queue_position_top () const;\n    queue_position_t queue_position () const;\n-   void queue_position_down () const;\n-   void queue_position_up () const;\n-   void queue_position_bottom () 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::vector<std::vector<sha256_hash>> piece_layers () const;\n    void post_piece_availability () const;\n    void piece_availability (std::vector<int>& avail) 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    void prioritize_pieces (std::vector<std::pair<piece_index_t, 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-   void file_priority (file_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    std::vector<download_priority_t> get_file_priorities () const;\n-   void prioritize_files (std::vector<download_priority_t> const& files) const;\n    download_priority_t file_priority (file_index_t index) const;\n+   void 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_lsd_announce () const;\n-   void force_dht_announce () const;\n    void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+   void force_dht_announce () const;\n    void scrape_tracker (int idx = -1) const;\n    void set_upload_limit (int limit) const;\n-   int download_limit () const;\n    int upload_limit () const;\n    void set_download_limit (int limit) const;\n+   int download_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+   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@@ -393,15 +393,15 @@\n 
    \n [report issue]
    \n

    torrent_handle()

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

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

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

    \n [report issue]
    \n
    \n

    add_piece()

    \n
    \n void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n 
    \n@@ -444,18 +444,18 @@\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+[report issue]
    \n+
    \n+

    get_peer_info() post_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@@ -492,28 +492,28 @@\n what to include are defined in this class.

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

    post_download_queue() get_download_queue()

    \n
    \n std::vector<partial_piece_info> get_download_queue () const;\n-void get_download_queue (std::vector<partial_piece_info>& queue) const;\n void post_download_queue () const;\n+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-

    reset_piece_deadline() set_piece_deadline() clear_piece_deadlines()

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

    set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()

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

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

    \n

    This operation is not very cheap. Its complexity is O(n + mj).\n Where n is the number of files, m is the number of currently\n@@ -573,23 +573,23 @@\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-

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

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

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

    \n
    \n std::vector<announce_entry> trackers () const;\n-void replace_trackers (std::vector<announce_entry> const&) const;\n void post_trackers () const;\n+void replace_trackers (std::vector<announce_entry> const&) const;\n void add_tracker (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@@ -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-

    add_url_seed() url_seeds() remove_url_seed()

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

    remove_url_seed() add_url_seed() url_seeds()

    \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-std::set<std::string> url_seeds () 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-

    remove_http_seed() add_http_seed() http_seeds()

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

    http_seeds() add_http_seed() remove_http_seed()

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

    pause() resume()

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

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

    \n@@ -704,23 +704,23 @@\n
    \n

    Note

    \n

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

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

    flags() set_flags() unset_flags()

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

    set_flags() flags() unset_flags()

    \n
    \n-void unset_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags) const;\n torrent_flags_t flags () const;\n+void unset_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n 
    \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@@ -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 \n-[report issue]
    \n-
    \n-

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

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

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

    \n
    \n+void queue_position_bottom () const;\n+void queue_position_up () const;\n+void queue_position_down () const;\n void queue_position_top () const;\n queue_position_t queue_position () const;\n-void queue_position_down () const;\n-void queue_position_up () const;\n-void queue_position_bottom () 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@@ -916,26 +916,26 @@\n

    queue_position_set()

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

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

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

    set_ssl_certificate() set_ssl_certificate_buffer()

    \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@@ -951,18 +951,18 @@\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+\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 
    \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@@ -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 post_piece_availability () const;\n void piece_availability (std::vector<int>& avail) const;\n 
    \n

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

    \n

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

    \n

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

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

    piece_priority() prioritize_pieces() get_piece_priorities()

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

    get_piece_priorities() prioritize_pieces() piece_priority()

    \n
    \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 void prioritize_pieces (std::vector<std::pair<piece_index_t, 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+void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n+std::vector<download_priority_t> get_piece_priorities () 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@@ -1060,18 +1060,18 @@\n usage of file- and piece priorities.

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

    prioritize_files() get_file_priorities() file_priority()

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

    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,23 +1094,23 @@\n file_prio_alert.

    \n

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

    \n

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

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

    force_lsd_announce() force_reannounce() force_dht_announce()

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

    force_reannounce() force_dht_announce() force_lsd_announce()

    \n
    \n void force_lsd_announce () const;\n-void force_dht_announce () const;\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+void force_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 as the min_interval expires. This is to honor trackers minimum\n@@ -1142,17 +1142,17 @@\n \n \n [report issue]

    \n
    \n

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

    \n
    \n void set_upload_limit (int limit) const;\n-int download_limit () const;\n int upload_limit () const;\n void set_download_limit (int limit) const;\n+int download_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,33 +1275,33 @@\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 \n-[report issue]
    \n+[report issue]
    \n
    \n-

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

    \n+

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

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

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

    \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 _\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 _\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 _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)\n- o _\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 _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\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 _\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 _\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)_\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 _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\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 _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\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__\bu_\bp_\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__\bd_\bo_\bw_\bn_\b(_\b)\n- _\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)\n+ o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\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)\n+ _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)\n 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(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\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 _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\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)\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__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\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 _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\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 _\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 _\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 _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n o _\bi_\bd_\b(_\b)\n o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n o _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b)\n o _\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n * _\bh_\ba_\bs_\bh_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bk_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n holds the state of a block in a piece. Who we requested it from and how far\n along we are at downloading it.\n struct block_info\n {\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n \n enum block_state_t\n {\n none,\n requested,\n writing,\n finished,\n@@ -78,16 +78,16 @@\n unsigned bytes_progress:15;\n unsigned block_size:15;\n unsigned state:2;\n unsigned num_peers:14;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* 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@@ -186,106 +186,106 @@\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 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 std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n- void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ 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- 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_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n 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 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 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_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 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 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_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 u\bun\bns\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 void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n+ void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n void s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags = {}) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_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_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_d\bdo\bow\bwn\bn () const;\n- void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n- 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_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::vector> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n- 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 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- 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_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 std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n- void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n 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_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n- void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n+ void f\bfo\bor\brc\bce\be_\b_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_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n 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 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+ 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@@ -354,15 +354,15 @@\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* 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+*\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@@ -387,23 +387,23 @@\n In order to get regular updates for torrents whose status changes, consider\n calling session::post_torrent_updates()`` instead.\n By default everything is included. The flags you can use to decide what to\n i\bin\bnc\bcl\blu\bud\bde\be are defined in this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+void 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* 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) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n void 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@@ -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-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+*\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 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 f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress, file_progress_flags_t\n+flags = {}) const;\n This function fills in the supplied vector, or returns a vector, with the\n number of bytes downloaded of each file in this torrent. The progress values\n are ordered the same as the files in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo.\n This operation is not very cheap. Its complexity is O\bO(\b(n\bn +\b+ m\bmj\bj)\b). Where n\bn is the\n number of files, m\bm is the number of currently downloading pieces and j\bj is the\n number of blocks in a piece.\n The flags parameter can be used to specify the granularity of the file\n@@ -449,18 +449,18 @@\n See _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n If the torrent is in an error state (i.e. torrent_status::error is non-empty),\n this will clear the error and start the torrent again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) 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+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n 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 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_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@@ -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* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void 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 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* 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) 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+*\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n 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@@ -524,35 +524,35 @@\n and false afterward.\n Clients should only use _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) to determine if the result of session::\n find_torrent() was successful.\n Unlike other member functions which return a value, _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) completes\n immediately, without blocking on a result from the network thread. Also unlike\n other functions, it never throws the system_error exception.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bsu\bum\bme\be () const;\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n+void r\bre\bes\bsu\bum\bme\be () const;\n pause(), and resume() will disconnect all peers and reconnect all peers\n respectively. When a torrent is paused, it will however remember all share\n ratios to all peers and remember all potential (not connected) peers. Torrents\n may be paused automatically if there is a file error (e.g. disk full) or\n something similar. See _\bf_\bi_\bl_\be_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt.\n For possible values of the flags parameter, see pause_flags_t.\n To know if a torrent is paused or not, call torrent_handle::flags() and check\n for the torrent_status::paused flag.\n Note\n Torrents that are auto-managed may be automatically resumed again. It does not\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more\n information, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n+void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n sets and gets the torrent state flags. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt. The set_flags\n overload that take a mask will affect all flags part of the mask, and set their\n values to what the flags argument is set to. This allows clearing and setting\n 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@@ -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()\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_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) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\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)\n+q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) *\b**\b**\b**\b**\b*\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_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_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_d\bdo\bow\bwn\bn () const;\n-void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n-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 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@@ -705,22 +705,22 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n updates the position in the queue for this torrent. The relative order of all\n other torrents remain intact but their numerical queue position shifts to make\n space for this torrent's new position\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be(\b()\b) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n+*\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@@ -734,15 +734,15 @@\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-*\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+*\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 _\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@@ -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\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n The piece availability is the number of peers that we are connected that has\n advertised having a particular piece. This is the information that libtorrent\n uses in order to prefer picking rare pieces.\n post_piece_availability() will trigger a _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt to be posted.\n piece_availability() fills the specified std::vector with the availability\n for each piece in this torrent. libtorrent does not keep track of availability\n for seeds, so if the torrent is seeding the availability for all pieces is\n reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\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+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\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) *\b**\b**\b**\b**\b*\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+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 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@@ -817,18 +817,18 @@\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* 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 std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n 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@@ -847,19 +847,19 @@\n When combining file- and piece priorities, the resume file will record both.\n When loading the resume data, the file priorities will be applied first, then\n the piece priorities.\n Moving data from a file into the part file is currently not supported. If a\n file has its priority set to 0 a\baf\bft\bte\ber\br it has already been created, it will not\n be moved into the partfile.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_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-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_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 The tracker_index argument specifies which tracker to re-announce. If set to -\n@@ -880,17 +880,17 @@\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) 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) 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 void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n-int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n 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 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,24 +982,24 @@\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+*\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 [_\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"}]}, {"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,32 +41,32 @@\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,58 +197,58 @@\n

    \n

    torrent_info

    \n

    Declared in "libtorrent/torrent_info.hpp"

    \n

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

    \n
    \n class torrent_info\n {\n-   torrent_info (std::string const& filename, error_code& ec);\n-   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-   explicit torrent_info (info_hash_t const& info_hash);\n+   torrent_info (char const* buffer, int size);\n+   explicit torrent_info (span<char const> buffer, from_span_t);\n    torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n    explicit torrent_info (bdecode_node const& torrent_file);\n-   explicit torrent_info (std::string const& filename);\n-   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n    torrent_info (char const* buffer, int size, error_code& ec);\n-   torrent_info (char const* buffer, int size);\n-   explicit torrent_info (span<char const> buffer, from_span_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+   explicit torrent_info (std::string const& filename);\n+   torrent_info (std::string const& filename, error_code& ec);\n    torrent_info (torrent_info const& t);\n-   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   explicit torrent_info (info_hash_t const& info_hash);\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 ();\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+   std::vector<announce_entry> const& trackers () const;\n    void add_tracker (std::string const& url, int tier\n       , announce_entry::tracker_source source);\n-   std::vector<announce_entry> const& trackers () const;\n-   void clear_trackers ();\n    std::vector<sha1_hash> similar_torrents () const;\n    std::vector<std::string> collections () const;\n    void add_url_seed (std::string const& url\n       , std::string const& ext_auth = std::string()\n       , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   std::vector<web_seed_entry> const& web_seeds () const;\n    void add_http_seed (std::string const& url\n       , std::string const& extern_auth = std::string()\n       , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+   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 blocks_per_piece () const;\n    index_range<piece_index_t> piece_range () const;\n-   piece_index_t last_piece () const;\n    piece_index_t end_piece () 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 v1 () const;\n+   info_hash_t const& info_hashes () const;\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@@ -269,27 +269,27 @@\n    span<char const> piece_layer (file_index_t) const;\n    void free_piece_layers ();\n };\n 
    \n [report issue]
    \n

    torrent_info()

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

    trackers() clear_trackers() add_tracker()

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

    clear_trackers() add_tracker() trackers()

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

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

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

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

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

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

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

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

    piece_length() num_pieces()

    \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@@ -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() end_piece() last_piece()

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

    last_piece() end_piece() piece_range()

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

    v2() v1()

    \n
    \n-bool v1 () const;\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@@ -590,18 +590,18 @@\n
    \n

    piece_size()

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

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

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

    hash_for_piece_ptr() hash_for_piece()

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

    hash_for_piece() hash_for_piece_ptr()

    \n
    \n 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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -10,32 +10,32 @@\n * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\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 _\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_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n o _\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\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)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n+ o _\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 _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n+ o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bv_\b2_\b(_\b)_\b _\bv_\b1_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bp_\br_\bi_\bv_\b(_\b)\n o _\bi_\bs_\b__\bi_\b2_\bp_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bt_\br_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bt_\br_\b(_\b)\n o _\bn_\ba_\bm_\be_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\bo_\br_\b(_\b)\n o _\bc_\bo_\bm_\bm_\be_\bn_\bt_\b(_\b)\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n@@ -120,62 +120,62 @@\n the max number of bdecode tokens\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n class torrent_info\n {\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\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- 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 (char const* buffer, int size);\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 (bdecode_node const& torrent_file);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, 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 (char const* buffer, int size);\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 (bdecode_node const& torrent_file, error_code& ec);\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, load_torrent_limits const&\n cfg);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\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 (std::string const& filename, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 ~\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+ std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\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 std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n- void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n- std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n headers_t());\n+ 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 b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\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 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+ 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\bv1\b1 () const;\n+ info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\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@@ -196,29 +196,29 @@\n bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\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-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 (char const* buffer, int size);\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 (bdecode_node const& torrent_file);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, 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 (char const* buffer, int size);\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 (bdecode_node const& torrent_file, error_code& ec);\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, load_torrent_limits const&\n cfg);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\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 (std::string const& filename, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 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@@ -284,20 +284,20 @@\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* 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+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void 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+std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\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 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@@ -308,25 +308,25 @@\n std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n returned from these correspond to the \"similar\" and \"collections\" keys in the\n .torrent file. Both info-hashes and collections from within the info-dict and\n from outside of it are included.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_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) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n-void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n-std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n headers_t());\n+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@@ -339,47 +339,47 @@\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+*\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 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) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n 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 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 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\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+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@@ -427,15 +427,15 @@\n than the i2p network.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n returns the piece size of file with index. This will be the same as\n _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html", "unified_diff": "@@ -426,15 +426,15 @@\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+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"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html", "unified_diff": "@@ -31,15 +31,15 @@\n

    home

    \n \n [report issue]
    \n

    announce_infohash

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

    announce_entry

    \n

    Declared in "libtorrent/announce_entry.hpp"

    \n

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

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

    operator=() ~announce_entry() announce_entry()

    \n+[report issue]
    \n+

    announce_entry() ~announce_entry() operator=()

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

    constructs a tracker announce entry with u as the URL.

    \n [report issue]
    \n
    \n

    enum tracker_source

    \n

    Declared in "libtorrent/announce_entry.hpp"

    \n
    \n@@ -189,15 +189,15 @@\n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,15 +2,15 @@\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.10\n _\bh_\bo_\bm_\be\n Table of contents\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n struct announce_infohash\n {\n std::string message;\n@@ -78,19 +78,19 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n this class holds information about one bittorrent tracker, as it relates to a\n specific torrent.\n struct announce_entry\n {\n- announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\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 explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\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+ announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n \n enum tracker_source\n {\n source_torrent,\n source_client,\n source_magnet_link,\n source_tex,\n@@ -101,20 +101,20 @@\n std::vector endpoints;\n std::uint8_t t\bti\bie\ber\br = 0;\n std::uint8_t f\bfa\bai\bil\bl_\b_l\bli\bim\bmi\bit\bt = 0;\n std::uint8_t source:4;\n bool verified:1;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+*\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n-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+announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "unified_diff": "@@ -47,15 +47,15 @@\n
  • swap()
  • \n
  • count()
  • \n
  • find_first_set()
  • \n
  • find_last_clear()
  • \n \n \n
  • hasher\n
  • \n
  • hasher256
      \n
    • operator=() hasher256()
    • \n@@ -70,23 +70,23 @@\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 () noexcept = default;\n    bitfield (int bits, bool val);\n-   bitfield (char const* b, int bits);\n    bitfield (bitfield const& rhs);\n+   bitfield () noexcept = default;\n+   explicit bitfield (int bits);\n+   bitfield (char const* b, int bits);\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@@ -99,20 +99,20 @@\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 () noexcept = default;\n bitfield (int bits, bool val);\n-bitfield (char const* b, int bits);\n bitfield (bitfield const& rhs);\n+bitfield () noexcept = default;\n+explicit bitfield (int bits);\n+bitfield (char const* b, int bits);\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@@ -126,16 +126,16 @@\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+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@@ -242,30 +242,30 @@\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 (hasher const&);\n+   hasher (char const* data, int len);\n    explicit hasher (span<char const> data);\n    hasher& operator= (hasher const&) &;\n    hasher& update (char const* data, int len);\n    hasher& update (span<char const> data);\n    sha1_hash final ();\n    void reset ();\n };\n 
      \n-\n-[report issue]
      \n-

      hasher() operator=()

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

      operator=() hasher()

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

      operator=() hasher256()

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

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

      \n [report issue]
      \n
      \n

      update()

      \n
      \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -16,15 +16,15 @@\n           o _\be_\bm_\bp_\bt_\by_\b(_\b)\n           o _\bd_\ba_\bt_\ba_\b(_\b)\n           o _\bs_\bw_\ba_\bp_\b(_\b)\n           o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n           o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n           o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n     * _\bh_\ba_\bs_\bh_\be_\br\n-          o _\bh_\ba_\bs_\bh_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+          o _\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 _\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@@ -32,23 +32,23 @@\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 () 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 (char const* b, int bits);\n    b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\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 (char const* b, int bits);\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@@ -59,35 +59,35 @@\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 () 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 (char const* b, int bits);\n b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\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 (char const* b, int bits);\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+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@@ -151,27 +151,27 @@\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    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    hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n    hasher& u\bup\bpd\bda\bat\bte\be (span data);\n    sha1_hash f\bfi\bin\bna\bal\bl ();\n    void r\bre\bes\bse\bet\bt ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\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 (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 this is the same as default constructing followed by a call to update(data,\n len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n@@ -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-   explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n    h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n-   hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n    h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+   hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+   explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\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* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) *\b**\b**\b**\b**\b*\n-explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n-hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n this is the same as default constructing followed by a call to update(data,\n len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n hasher256& u\bup\bpd\bda\bat\bte\be (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"}]}, {"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+\n+

      Torrent Info

      \n+\n+

      Trackers

      \n+\n

      Session

      \n \n+

      Stats

      \n+\n+

      Add Torrent

      \n+\n

      Core

      \n \n-

      Add Torrent

      \n-\n-

      Torrent Info

      \n+

      Torrent Status

      \n \n

      Settings

      \n \n-

      Stats

      \n-\n-

      Torrent Status

      \n-\n-

      Trackers

      \n-\n-

      Torrent Handle

      \n-\n

      DHT

      \n \n

      Resume Data

      \n \n
      \n \n-
      \n-

      Custom Storage

      \n-\n-

      Utility

      \n+

      Filter

      \n \n-

      PeerClass

      \n-\n+
      \n

      Plugins

      \n \n+

      PeerClass

      \n+\n+

      Utility

      \n+\n

      Storage

      \n \n+

      Custom Storage

      \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+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 Session\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 _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n-_\bw_\br_\bi_\bt_\be_\b__\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+_\bs_\be_\bs_\bs_\bi_\bo_\bn\n _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)\n+_\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+Stats\n+_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n+_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n+_\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n+_\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n+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 Core\n _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n+_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\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+_\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_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n _\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 _\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-_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n-_\be_\bv_\be_\bn_\bt_\b__\bt\n-_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+_\be_\bv_\be_\bn_\bt_\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+_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n+_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n-_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n _\bi_\bn_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\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-Add Torrent\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n-_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n-Torrent Info\n-_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n+Torrent Status\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\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+_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n-_\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n+_\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\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-_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n-Stats\n-_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n-_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n-_\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n-_\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n-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-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 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-_\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\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__\bb_\bu_\bf_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+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+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 Error Codes\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n+_\bi_\b2_\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 _\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__\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+_\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n-_\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-_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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-_\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+_\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n-_\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n-_\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\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-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-Filter\n-_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n-_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n-Bdecoding\n-_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n-_\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n-_\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n Create Torrents\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n-Custom Storage\n-_\bo_\bv_\be_\br_\bv_\bi_\be_\bw\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-_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n-_\bb_\bu_\bf_\bf_\be_\br_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n-_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br\n-_\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n-Utility\n-_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n-_\bh_\ba_\bs_\bh_\be_\br\n-_\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n-PeerClass\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n+Filter\n+_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n+_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n Plugins\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\bp_\bl_\bu_\bg_\bi_\bn\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n+_\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n _\bc_\br_\be_\ba_\bt_\be_\b__\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__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\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+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_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n-_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\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 _\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+_\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n+_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br\n+_\bb_\bu_\bf_\bf_\be_\br_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br\n+_\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+_\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\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.10
    \n

    home

    \n
    \n

    Table of contents

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

    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 session_proxy\n+struct bdecode_node\n {\n-   session_proxy (session_proxy const&);\n-   session_proxy& operator= (session_proxy const&) &;\n-   session_proxy ();\n-   session_proxy (session_proxy&&) noexcept;\n-   session_proxy& operator= (session_proxy&&) & noexcept;\n-   ~session_proxy ();\n+   bdecode_node () = default;\n+   bdecode_node& operator= (bdecode_node&&) & = default;\n+   bdecode_node (bdecode_node const&);\n+   bdecode_node (bdecode_node&&) noexcept;\n+   bdecode_node& operator= (bdecode_node const&) &;\n+   type_t type () const noexcept;\n+   explicit operator bool () const noexcept;\n+   bdecode_node non_owning () const;\n+   std::ptrdiff_t data_offset () const noexcept;\n+   span<char const> data_section () const noexcept;\n+   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+   std::pair<string_view, bdecode_node> dict_at (int i) const;\n+   bdecode_node dict_find_list (string_view key) const;\n+   bdecode_node dict_find_int (string_view key) const;\n+   bdecode_node dict_find_string (string_view key) const;\n+   string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) const;\n+   bdecode_node dict_find_dict (string_view key) const;\n+   std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n+   bdecode_node dict_find (string_view key) const;\n+   int dict_size () const;\n+   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n+   std::int64_t int_value () const;\n+   string_view string_value () const;\n+   std::ptrdiff_t string_offset () const;\n+   int string_length () const;\n+   char const* string_ptr () const;\n+   void clear ();\n+   void swap (bdecode_node& n);\n+   void reserve (int tokens);\n+   void switch_underlying_buffer (char const* buf) noexcept;\n+   bool has_soft_error (span<char> error) const;\n+\n+   enum type_t\n+   {\n+      none_t,\n+      dict_t,\n+      list_t,\n+      string_t,\n+      int_t,\n+   };\n };\n 
    \n-\n-\n-[report issue]
    \n-

    operator=() ~session_proxy() session_proxy()

    \n+[report issue]
    \n+

    bdecode_node()

    \n
    \n-session_proxy (session_proxy const&);\n-session_proxy& operator= (session_proxy const&) &;\n-session_proxy ();\n-session_proxy (session_proxy&&) noexcept;\n-session_proxy& operator= (session_proxy&&) & noexcept;\n-~session_proxy ();\n+bdecode_node () = default;\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+

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

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

    bdecode_node() operator=()

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

    session()

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

    the type of this node. See type_t.

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

    bool()

    \n
    \n-session (session_params&& params, io_context& ios);\n-session (session_params const& params, io_context& ios, session_flags_t);\n-session (session_params&& params, io_context& ios, session_flags_t);\n-session (session_params const& params, io_context& ios);\n+explicit operator bool () const noexcept;\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 true if type() != none_t.

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

    non_owning()

    \n
    \n-~session ();\n+bdecode_node non_owning () const;\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+

    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-session_proxy abort ();\n+std::ptrdiff_t data_offset () const noexcept;\n+span<char const> data_section () const noexcept;\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+

    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_string_value_at() list_int_value_at() list_size() list_at()

    \n
    \n-struct session_proxy {};\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-[report issue]
    \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() dict_find() dict_find_string_value() dict_find_dict() dict_find_int() dict_find_list() dict_at_node() dict_size() dict_at() dict_find_int_value()

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

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

    \n+

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

    \n+

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

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

    int_value()

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

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

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

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

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

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

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

    clear()

    \n+
    \n+void clear ();\n+
    \n+

    resets the bdecoded_node to a default constructed state. If this is\n+an owning node, the tree is freed and all child nodes are invalidated.

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

    swap()

    \n+
    \n+void swap (bdecode_node& n);\n+
    \n+

    Swap contents.

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

    reserve()

    \n+
    \n+void reserve (int tokens);\n+
    \n+

    preallocate memory for the specified numbers of tokens. This is\n+useful if you know approximately how many tokens are in the file\n+you are about to parse. Doing so will save realloc operations\n+while parsing. You should only call this on the root node, before\n+passing it in to bdecode().

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

    switch_underlying_buffer()

    \n+
    \n+void switch_underlying_buffer (char const* buf) noexcept;\n+
    \n+

    this buffer MUST be identical to the one originally parsed. This\n+operation is only defined on owning root nodes, i.e. the one passed in to\n+decode().

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

    has_soft_error()

    \n+
    \n+bool has_soft_error (span<char> error) const;\n+
    \n+

    returns true if there is a non-fatal error in the bencoding of this node\n+or its children

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

    enum type_t

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    none_t0uninitialized or default constructed. This is also used\n+to indicate that a node was not found in some cases.
    dict_t1a dictionary node. The dict_find_ functions are valid.
    list_t2a list node. The list_ functions are valid.
    string_t3a string node, the string_ functions are valid.
    int_t4an integer node. The int_ functions are valid.
    \n+[report issue]
    \n
    \n-
    \n-

    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+

    print_entry()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n
    \n-struct session_params\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+   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+   , int token_limit = 2000000);\n+bdecode_node bdecode (span<char const> buffer\n+   , int depth_limit = 100, int token_limit = 2000000);\n+
    \n+

    This function decodes/parses bdecoded data (for example a .torrent file).\n+The data structure is returned in the ret argument. the buffer to parse\n+is specified by the start of the buffer as well as the end, i.e. one\n+byte past the end. If the buffer fails to parse, the function returns a\n+non-zero value and fills in ec with the error code. The optional\n+argument error_pos, if set to non-nullptr, will be set to the byte offset\n+into the buffer where the parse failure occurred.

    \n+

    depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the\n+function, be careful not to set it too high).

    \n+

    token_limit is the max number of tokens allowed to be parsed from the\n+buffer. This is simply a sanity check to not have unbounded memory usage.

    \n+

    The resulting bdecode_node is an owning node. That means it will\n+be holding the whole parsed tree. When iterating lists and dictionaries,\n+those bdecode_node objects will simply have references to the root or\n+owning bdecode_node. If the root node is destructed, all other nodes\n+that refer to anything in that tree become invalid.

    \n+

    However, the underlying buffer passed in to this function (start, end)\n+must also remain valid while the bdecoded tree is used. The parsed tree\n+produced by this function does not copy any data out of the buffer, but\n+simply produces references back into it.

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

    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-   session_params (settings_pack&& sp);\n-   session_params ();\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+   tcp::endpoint peer () const;\n+   void set_peer (tcp::endpoint const& ep);\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+   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-[report issue]
    \n-

    session_params()

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

    peer() set_peer()

    \n
    \n-session_params (settings_pack&& sp);\n-session_params ();\n-session_params (settings_pack const& sp);\n+tcp::endpoint peer () const;\n+void set_peer (tcp::endpoint const& ep);\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 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
    \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+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-

    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+[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-
    dht_state
    \n-
    DHT node ID and node addresses to bootstrap the DHT with.
    \n+[report issue]
    \n+
    blocks_in_piece
    \n+
    the number of blocks in this piece
    \n
    \n-[report issue]
    \n-
    dht_storage_constructor
    \n-
    function object to construct the storage object for DHT items.
    \n+[report issue]
    \n+
    finished
    \n+
    the number of blocks that are in the finished state
    \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+[report issue]
    \n+
    writing
    \n+
    the number of blocks that are in the writing state
    \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+[report issue]
    \n+
    requested
    \n+
    the number of blocks that are in the requested state
    \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+[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-[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+

    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-
    \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+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+   void post_status (status_flags_t flags = status_flags_t::all()) const;\n+   torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n+   void 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 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+   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+   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 post_trackers () const;\n+   void remove_url_seed (std::string const& url) const;\n+   std::set<std::string> url_seeds () const;\n+   void add_url_seed (std::string const& url) const;\n+   void remove_http_seed (std::string const& url) const;\n+   std::set<std::string> http_seeds () const;\n+   void add_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-   session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n-   void refresh_torrent_status (std::vector<torrent_status>* ret\n-      , status_flags_t flags = {}) const;\n-   std::vector<torrent_status> get_torrent_status (\n-      std::function<bool(torrent_status const&)> const& pred\n-      , status_flags_t flags = {}) const;\n-   void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n-   void post_session_stats ();\n-   void post_dht_stats ();\n-   void set_dht_state (dht::dht_state const& st);\n-   void set_dht_state (dht::dht_state&& st);\n-   std::vector<torrent_handle> get_torrents () const;\n-   torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-   void async_add_torrent (add_torrent_params const& params);\n-   torrent_handle add_torrent (add_torrent_params&& params);\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 const& params, error_code& ec);\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::shared_ptr<plugin> ext);\n-   void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n-      torrent_handle const&, client_data_t)> 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 ssl_listen_port () const;\n-   bool is_listening () const;\n-   unsigned short listen_port () const;\n-   void set_peer_class_filter (ip_filter const& f);\n-   ip_filter get_peer_class_filter () const;\n-   void set_peer_class_type_filter (peer_class_type_filter const& f);\n-   peer_class_type_filter get_peer_class_type_filter () const;\n-   peer_class_t create_peer_class (char const* name);\n-   void delete_peer_class (peer_class_t cid);\n-   peer_class_info get_peer_class (peer_class_t cid) const;\n-   void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n-   void remove_torrent (const torrent_handle&, remove_flags_t = {});\n-   settings_pack get_settings () const;\n-   void apply_settings (settings_pack 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 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+   void pause (pause_flags_t flags = {}) const;\n+   void resume () 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 unset_flags (torrent_flags_t flags) const;\n+   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_up () const;\n+   void queue_position_bottom () const;\n+   queue_position_t queue_position () const;\n+   void queue_position_down () const;\n+   void queue_position_top () const;\n+   void queue_position_set (queue_position_t p) const;\n+   void set_ssl_certificate (std::string const& certificate\n+      , std::string const& private_key\n+      , std::string const& dh_params\n+      , std::string const& passphrase = "");\n+   void set_ssl_certificate_buffer (std::string const& certificate\n+      , std::string const& private_key\n+      , std::string const& dh_params);\n+   std::shared_ptr<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 post_piece_availability () const;\n+   void piece_availability (std::vector<int>& avail) 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+   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 file_priority (file_index_t index, download_priority_t priority) const;\n+   std::vector<download_priority_t> get_file_priorities () const;\n+   void prioritize_files (std::vector<download_priority_t> const& files) const;\n+   download_priority_t file_priority (file_index_t index) const;\n+   void force_dht_announce () const;\n+   void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+   void force_lsd_announce () const;\n+   void scrape_tracker (int idx = -1) const;\n+   int upload_limit () const;\n+   void set_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+   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 \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+   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-[report issue]
    \n-

    is_valid()

    \n+[report issue]
    \n+

    torrent_handle()

    \n
    \n-bool is_valid () const;\n+torrent_handle () noexcept = default;\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+

    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-session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n+void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n 
    \n-

    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+

    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 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 read_piece (piece_index_t piece) const;\n 
    \n-
    \n-

    Note

    \n-

    these calls are potentially expensive and won't scale well with\n-lots of torrents. If you're concerned about performance, consider\n-using post_torrent_updates() instead.

    \n-
    \n-

    get_torrent_status returns a vector of the torrent_status for\n-every torrent which satisfies pred, which is a predicate function\n-which determines if a torrent should be included in the returned set\n-or not. Returning true means it should be included and false means\n-excluded. The flags argument is the same as to\n-torrent_handle::status(). Since pred is guaranteed to be\n-called for every torrent, it may be used to count the number of\n-torrents of different categories as well.

    \n-

    refresh_torrent_status takes a vector of torrent_status structs\n-(for instance the same vector that was returned by\n-get_torrent_status() ) and refreshes the status based on the\n-handle member. It is possible to use this function by first\n-setting up a vector of default constructed torrent_status objects,\n-only initializing the handle member, in order to request the\n-torrent status for multiple torrents in a single call. This can save a\n-significant amount of time if you have a lot of torrents.

    \n-

    Any torrent_status object whose handle member is not referring to\n-a valid torrent are ignored.

    \n-

    The intended use of these functions is to start off by calling\n-get_torrent_status() to get a list of all torrents that match your\n-criteria. Then call refresh_torrent_status() on that list. This\n-will only refresh the status for the torrents in your list, and thus\n-ignore all other torrents you might be running. This may save a\n-significant amount of time, especially if the number of torrents you're\n-interested in is small. In order to keep your list of interested\n-torrents up to date, you can either call get_torrent_status() from\n-time to time, to include torrents you might have become interested in\n-since the last time. In order to stop refreshing a certain torrent,\n-simply remove it from the list.

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

    post_torrent_updates()

    \n+

    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 post_torrent_updates (status_flags_t flags = status_flags_t::all());\n+bool have_piece (piece_index_t piece) const;\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+

    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 post_session_stats ();\n+void get_peer_info (std::vector<peer_info>& v) const;\n+void post_peer_info () const;\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+

    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 post_dht_stats ();\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-

    This will cause a dht_stats_alert to be posted.

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

    set_dht_state()

    \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 set_dht_state (dht::dht_state const& st);\n-void set_dht_state (dht::dht_state&& st);\n+void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+void post_download_queue () const;\n+std::vector<partial_piece_info> get_download_queue () const;\n 
    \n-

    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+

    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() set_piece_deadline() clear_piece_deadlines()

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

    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+

    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+

    post_file_progress() file_progress()

    \n
    \n-void async_add_torrent (add_torrent_params const& params);\n-torrent_handle add_torrent (add_torrent_params&& params);\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 const& params, error_code& ec);\n-torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\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-

    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 overload that does not take an error_code throws an exception on\n-error and is not available when building without exception support.\n-The torrent_handle returned by add_torrent() can be used to retrieve\n-information about the torrent's progress, its peers etc. It is also\n-used to abort a torrent.

    \n-

    If the torrent you are trying to add already exists in the session (is\n-either queued for checking, being checked or downloading)\n-add_torrent() will throw system_error which derives from\n-std::exception unless duplicate_is_error is set to false. In that\n-case, add_torrent() will return the handle to the existing torrent.

    \n-

    The add_torrent_params class has a flags field. It can be used to\n-control what state the new torrent will be added in. Common flags to\n-want to control are torrent_flags::paused and\n-torrent_flags::auto_managed. In order to add a magnet link that will\n-just download the metadata, but no payload, set the\n-torrent_flags::upload_mode flag.

    \n-

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

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

    pause() resume() is_paused()

    \n+

    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 pause ();\n-void resume ();\n-bool is_paused () const;\n+std::vector<open_file_state> file_status () const;\n 
    \n-

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

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

    is_dht_running()

    \n+

    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-bool is_dht_running () const;\n+void clear_error () 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+

    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+

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

    \n
    \n-void set_dht_storage (dht::dht_storage_constructor_type sc);\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 post_trackers () const;\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+

    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+

    remove_url_seed() add_url_seed() url_seeds()

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

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

    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
    \n-void dht_get_item (sha1_hash const& target);\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 
    \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+

    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-void dht_get_item (std::array<char, 32> key\n-      , std::string salt = std::string());\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-

    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+

    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-sha1_hash dht_put_item (entry data);\n+bool set_metadata (span<char const> metadata) const;\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+

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

    store a mutable item. The key is the public key the blob is\n-to be stored under. The optional salt argument is a string that\n-is to be mixed in with the key when determining where in the DHT\n-the value is to be stored. The callback function is called from within\n-the libtorrent network thread once we've found where to store the blob,\n-possibly with the current value stored under the key.\n-The values passed to the callback functions are:

    \n-
    \n-
    entry& value
    \n-
    the current value stored under the key (may be empty). Also expected\n-to be set to the value to be stored by the function.
    \n-
    std::array<char,64>& signature
    \n-
    the signature authenticating the current value. This may be zeros\n-if there is currently no value stored. The function is expected to\n-fill in this buffer with the signature of the new value to store.\n-To generate the signature, you may want to use the\n-sign_mutable_item function.
    \n-
    std::int64_t& seq
    \n-
    current sequence number. May be zero if there is no current value.\n-The function is expected to set this to the new sequence number of\n-the value that is to be stored. Sequence numbers must be monotonically\n-increasing. Attempting to overwrite a value with a lower or equal\n-sequence number will fail, even if the signature is correct.
    \n-
    std::string const& salt
    \n-
    this is the salt that was used for this put call.
    \n-
    \n-

    Since the callback function cb is called from within libtorrent,\n-it is critical to not perform any blocking operations. Ideally not\n-even locking a mutex. Pass any data required for this function along\n-with the function object's context and make the function entirely\n-self-contained. The only reason data blob's value is computed\n-via a function instead of just passing in the new value is to avoid\n-race conditions. If you want to update the value in the DHT, you\n-must first retrieve it, then modify it, then write it back. The way\n-the DHT works, it is natural to always do a lookup before storing and\n-calling the callback in between is convenient.

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

    dht_get_peers() dht_announce()

    \n+

    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+

    pause() resume()

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

    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+

    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+

    unset_flags() set_flags() flags()

    \n
    \n-void dht_live_nodes (sha1_hash const& nid);\n+void set_flags (torrent_flags_t flags) const;\n+void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n+void unset_flags (torrent_flags_t flags) const;\n+torrent_flags_t flags () const;\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+

    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-void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n+void flush_cache () const;\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+

    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-void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+void force_recheck () const;\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+

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

    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-#include <libtorrent/extensions/smart_ban.hpp>\n-ses.add_extension(&lt::create_smart_ban_plugin);\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-\n-[report issue]
    \n-
    \n-

    get_ip_filter() set_ip_filter()

    \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-ip_filter get_ip_filter () const;\n-void set_ip_filter (ip_filter f);\n+bool need_save_resume_data (resume_data_flags_t flags) const;\n+bool need_save_resume_data () 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+

    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_down() queue_position_top() queue_position_bottom() queue_position_up() queue_position()

    \n
    \n-void set_port_filter (port_filter const& f);\n+void queue_position_up () const;\n+void queue_position_bottom () const;\n+queue_position_t queue_position () const;\n+void queue_position_down () const;\n+void queue_position_top () const;\n 
    \n-

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

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

    is_listening() listen_port() ssl_listen_port()

    \n+

    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-unsigned short ssl_listen_port () const;\n-bool is_listening () const;\n-unsigned short listen_port () const;\n+void queue_position_set (queue_position_t p) 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+

    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-void set_peer_class_filter (ip_filter const& f);\n-ip_filter get_peer_class_filter () const;\n-
    \n-

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

    \n-

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

    \n-

    For more info, see ip_filter.

    \n-

    For example, to make all peers in the range 200.1.1.0 - 200.1.255.255\n-belong to their own peer class, apply the following filter:

    \n-
    \n-ip_filter f = ses.get_peer_class_filter();\n-peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");\n-f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")\n-        , 1 << static_cast<std::uint32_t>(my_class));\n-ses.set_peer_class_filter(f);\n+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-

    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+

    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-void set_peer_class_type_filter (peer_class_type_filter const& f);\n-peer_class_type_filter get_peer_class_type_filter () const;\n+std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n+std::shared_ptr<const torrent_info> torrent_file () const;\n 
    \n-

    Sets and gets the peer class type filter. This is controls automatic\n-peer class assignments to peers based on what kind of socket it is.

    \n-

    It does not only support assigning peer classes, it also supports\n-removing peer classes based on socket type.

    \n-

    The order of these rules being applied are:

    \n-
      \n-
    1. peer-class IP filter
    2. \n-
    3. peer-class type filter, removing classes
    4. \n-
    5. peer-class type filter, adding classes
    6. \n-
    \n-

    For more information, see peer classes.

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

    create_peer_class()

    \n+

    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-peer_class_t create_peer_class (char const* name);\n+std::vector<std::vector<sha256_hash>> piece_layers () const;\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+

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

    This call dereferences the reference count of the specified peer\n-class. When creating a peer class it's automatically referenced by 1.\n-If you want to recycle a peer class, you may call this function. You\n-may only call this function once per peer class you create.\n-Calling it more than once for the same class will lead to memory\n-corruption.

    \n-

    Since peer classes are reference counted, this function will not\n-remove the peer class if it's still assigned to torrents or peers. It\n-will however remove it once the last peer and torrent drops their\n-references to it.

    \n-

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

    \n-

    For more information on peer classes, see peer classes.

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

    set_peer_class() get_peer_class()

    \n+

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

    \n+

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

    \n+

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

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

    get_piece_priorities() piece_priority() prioritize_pieces()

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

    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() get_file_priorities() file_priority()

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

    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+

    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_lsd_announce() force_dht_announce()

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

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

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

    wait_for_alert() set_alert_notify() pop_alerts()

    \n+

    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-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 scrape_tracker (int idx = -1) const;\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+

    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() download_limit() set_upload_limit() set_download_limit()

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

    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+

    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-void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\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-

    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+

    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-std::shared_ptr<aux::session_impl> native_handle () const;\n+void clear_peers ();\n 
    \n-

    This function is intended only for use by plugins. This type does\n-not have a stable API and should be relied on as little as possible.

    \n-[report issue]
    \n-
    save_settings
    \n-
    saves settings (i.e. the settings_pack)
    \n-
    \n-[report issue]
    \n-
    save_dht_state
    \n-
    saves dht state such as nodes and node-id, possibly accelerating\n-joining the DHT if provided at next session startup.
    \n-
    \n-[report issue]
    \n-
    save_extension_state
    \n-
    load or save state from plugins
    \n-
    \n-[report issue]
    \n-
    save_ip_filter
    \n-
    load or save the IP filter set on the session
    \n-
    \n-\n-\n-[report issue]
    \n-
    global_peer_class_id tcp_peer_class_id local_peer_class_id
    \n-
    built-in peer classes
    \n-
    \n-[report issue]
    \n-
    delete_files
    \n-
    delete the files belonging to the torrent from disk.\n-including the part-file, if there is one
    \n-
    \n-[report issue]
    \n-
    delete_partfile
    \n-
    delete just the part-file associated with this torrent
    \n-
    \n-[report issue]
    \n-
    paused
    \n-
    when set, the session will start paused. Call\n-session_handle::resume() to start
    \n-
    \n-\n-[report issue]
    \n-
    udp tcp
    \n-
    protocols used by add_port_mapping()
    \n-
    \n-[report issue]
    \n-
    reopen_map_ports
    \n-
    This option indicates if the ports are mapped using natpmp\n-and upnp. If mapping was already made, they are deleted and added\n-again. This only works if natpmp and/or upnp are configured to be\n-enable.
    \n-
    \n-\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+

    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
    \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 (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-entry write_session_params (session_params const& sp\n-   , save_state_flags_t flags = save_state_flags_t::all());\n+void set_max_uploads (int max_uploads) const;\n+int max_uploads () const;\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-

    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+

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

    \n+

    max_uploads() returns the current settings.

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

    max_connections() set_max_connections()

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

    info_hash_t()

    \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-explicit info_hash_t (sha256_hash h2) noexcept;\n-info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n-info_hash_t () noexcept = default;\n-explicit info_hash_t (sha1_hash h1) noexcept;\n+void move_storage (std::string const& save_path\n+      , move_flags_t flags = move_flags_t::always_replace_files\n+      ) const;\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() has_v2() has_v1()

    \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-bool has_v2 () const;\n-bool has (protocol_version v) const;\n-bool has_v1 () const;\n+void rename_file (file_index_t index, std::string const& new_name) const;\n 
    \n-

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

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

    get()

    \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-sha1_hash get (protocol_version v) const;\n+info_hash_t info_hashes () const;\n+sha1_hash info_hash () const;\n 
    \n-

    returns the has for the specified protocol version

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

    get_best()

    \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-sha1_hash get_best () 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-

    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+

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

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

    id()

    \n
    \n-template <typename F> void for_each (F f) const;\n+std::uint32_t id () const;\n 
    \n-

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

    \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(sha1_hash const&, protocol_version);\n+std::shared_ptr<torrent> native_handle () const;\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+

    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 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+client_data_t userdata () const;\n 
    \n-[report issue]
    \n-

    i2p_destination()

    \n+

    returns the userdata pointer as set in add_torrent_params

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

    in_session()

    \n
    \n-sha256_hash i2p_destination () const;\n+bool in_session () const;\n 
    \n-

    If this peer is an i2p peer, this function returns the destination\n-address of the peer

    \n-[report issue]
    \n-
    client
    \n-
    A human readable string describing the software at the other end of\n-the connection. In some cases this information is not available, then\n-it will contain a string that may give away something about which\n-software is running in the other end. In the case of a web seed, the\n-server type and version will be a part of this string. This is UTF-8\n-encoded.
    \n-
    \n-[report issue]
    \n-
    pieces
    \n-
    a bitfield, with one bit per piece in the torrent. Each bit tells you\n-if the peer has that piece (if it's set to 1) or if the peer miss that\n-piece (set to 0).
    \n-
    \n-\n-[report issue]
    \n-
    total_download total_upload
    \n-
    the total number of bytes downloaded from and uploaded to this peer.\n-These numbers do not include the protocol chatter, but only the\n-payload data.
    \n-
    \n-\n-[report issue]
    \n-
    last_request last_active
    \n-
    the time since we last sent a request to this peer and since any\n-transfer occurred with this peer
    \n-
    \n-[report issue]
    \n-
    download_queue_time
    \n-
    the time until all blocks in the request queue will be downloaded
    \n-
    \n-[report issue]
    \n-
    interesting
    \n-
    we are interested in pieces from this peer.
    \n-
    \n-[report issue]
    \n-
    choked
    \n-
    we have choked this peer.
    \n-
    \n-[report issue]
    \n-
    remote_interested
    \n-
    the peer is interested in us
    \n-
    \n-[report issue]
    \n-
    remote_choked
    \n-
    the peer has choked us.
    \n-
    \n-[report issue]
    \n-
    supports_extensions
    \n-
    means that this peer supports the\n-extension protocol.
    \n-
    \n-[report issue]
    \n-
    outgoing_connection
    \n-
    The connection was initiated by us, the peer has a\n-listen port open, and that port is the same as in the\n-address of this peer. If this flag is not set, this\n-peer connection was opened by this peer connecting to\n-us.
    \n-
    \n-[report issue]
    \n-
    local_connection
    \n-
    deprecated synonym for outgoing_connection
    \n-
    \n-[report issue]
    \n-
    handshake
    \n-
    The connection is opened, and waiting for the\n-handshake. Until the handshake is done, the peer\n-cannot be identified.
    \n-
    \n-[report issue]
    \n-
    connecting
    \n-
    The connection is in a half-open state (i.e. it is\n-being connected).
    \n-
    \n-[report issue]
    \n-
    on_parole
    \n-
    The peer has participated in a piece that failed the\n-hash check, and is now "on parole", which means we're\n-only requesting whole pieces from this peer until\n-it either fails that piece or proves that it doesn't\n-send bad data.
    \n-
    \n-[report issue]
    \n-
    seed
    \n-
    This peer is a seed (it has all the pieces).
    \n-
    \n-[report issue]
    \n-
    optimistic_unchoke
    \n-
    This peer is subject to an optimistic unchoke. It has\n-been unchoked for a while to see if it might unchoke\n-us in return an earn an upload/unchoke slot. If it\n-doesn't within some period of time, it will be choked\n-and another peer will be optimistically unchoked.
    \n-
    \n-[report issue]
    \n-
    snubbed
    \n-
    This peer has recently failed to send a block within\n-the request timeout from when the request was sent.\n-We're currently picking one block at a time from this\n-peer.
    \n-
    \n-[report issue]
    \n-
    upload_only
    \n-
    This peer has either explicitly (with an extension)\n-or implicitly (by becoming a seed) told us that it\n-will not downloading anything more, regardless of\n-which pieces we have.
    \n-
    \n-[report issue]
    \n-
    endgame_mode
    \n-
    This means the last time this peer picket a piece,\n-it could not pick as many as it wanted because there\n-were not enough free ones. i.e. all pieces this peer\n-has were already requested from other peers.
    \n-
    \n-[report issue]
    \n-
    holepunched
    \n-
    This flag is set if the peer was in holepunch mode\n-when the connection succeeded. This typically only\n-happens if both peers are behind a NAT and the peers\n-connect via the NAT holepunch mechanism.
    \n-
    \n-[report issue]
    \n-
    i2p_socket
    \n-
    indicates that this socket is running on top of the\n-I2P transport.
    \n-
    \n-[report issue]
    \n-
    utp_socket
    \n-
    indicates that this socket is a uTP socket
    \n-
    \n-[report issue]
    \n-
    ssl_socket
    \n-
    indicates that this socket is running on top of an SSL\n-(TLS) channel
    \n-
    \n-[report issue]
    \n-
    rc4_encrypted
    \n-
    this connection is obfuscated with RC4
    \n-
    \n-[report issue]
    \n-
    plaintext_encrypted
    \n-
    the handshake of this connection was obfuscated\n-with a Diffie-Hellman exchange
    \n-
    \n-[report issue]
    \n-
    flags
    \n-
    tells you in which state the peer is in. It is set to\n-any combination of the peer_flags_t flags above.
    \n-
    \n-[report issue]
    \n-
    tracker
    \n-
    The peer was received from the tracker.
    \n-
    \n-[report issue]
    \n-
    dht
    \n-
    The peer was received from the kademlia DHT.
    \n-
    \n-[report issue]
    \n-
    pex
    \n-
    The peer was received from the peer exchange\n-extension.
    \n-
    \n-[report issue]
    \n-
    lsd
    \n-
    The peer was received from the local service\n-discovery (The peer is on the local network).
    \n-
    \n-[report issue]
    \n-
    resume_data
    \n-
    The peer was added from the fast resume data.
    \n-
    \n-[report issue]
    \n-
    incoming
    \n-
    we received an incoming connection from this peer
    \n-
    \n-[report issue]
    \n-
    source
    \n-
    a combination of flags describing from which sources this peer\n-was received. A combination of the peer_source_flags_t above.
    \n-
    \n-\n-[report issue]
    \n-
    up_speed down_speed
    \n-
    the current upload and download speed we have to and from this peer\n-(including any protocol messages). updated about once per second
    \n-
    \n-\n-[report issue]
    \n-
    payload_up_speed payload_down_speed
    \n-
    The transfer rates of payload data only updated about once per second
    \n-
    \n-[report issue]
    \n-
    pid
    \n-
    the peer's id as used in the bittorrent protocol. This id can be used\n-to extract 'fingerprints' from the peer. Sometimes it can tell you\n-which client the peer is using. See identify_client()_
    \n-
    \n-[report issue]
    \n-
    queue_bytes
    \n-
    the number of bytes we have requested from this peer, but not yet\n-received.
    \n-
    \n-[report issue]
    \n-
    request_timeout
    \n-
    the number of seconds until the current front piece request will time\n-out. This timeout can be adjusted through\n-settings_pack::request_timeout.\n--1 means that there is not outstanding request.
    \n-
    \n-\n-[report issue]
    \n-
    send_buffer_size used_send_buffer
    \n-
    the number of bytes allocated\n-and used for the peer's send buffer, respectively.
    \n-
    \n-\n-\n-[report issue]
    \n-
    receive_buffer_size used_receive_buffer receive_buffer_watermark
    \n-
    the number of bytes\n-allocated and used as receive buffer, respectively.
    \n-
    \n-[report issue]
    \n-
    num_hashfails
    \n-
    the number of pieces this peer has participated in sending us that\n-turned out to fail the hash check.
    \n-
    \n-[report issue]
    \n-
    download_queue_length
    \n-
    this is the number of requests we have sent to this peer that we\n-haven't got a response for yet
    \n-
    \n-[report issue]
    \n-
    timed_out_requests
    \n-
    the number of block requests that have timed out, and are still in the\n-download queue
    \n-
    \n-[report issue]
    \n-
    busy_requests
    \n-
    the number of busy requests in the download queue. A busy request is a\n-request for a block we've also requested from a different peer
    \n-
    \n-[report issue]
    \n-
    requests_in_buffer
    \n-
    the number of requests messages that are currently in the send buffer\n-waiting to be sent.
    \n+

    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-
    target_dl_queue_length
    \n-
    the number of requests that is tried to be maintained (this is\n-typically a function of download speed)
    \n+[report issue]
    \n+
    query_distributed_copies
    \n+
    calculates distributed_copies, distributed_full_copies and\n+distributed_fraction.
    \n
    \n-[report issue]
    \n-
    upload_queue_length
    \n-
    the number of piece-requests we have received from this peer\n-that we haven't answered with a piece yet.
    \n+[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-
    failcount
    \n-
    the number of times this peer has "failed". i.e. failed to connect or\n-disconnected us. The failcount is decremented when we see this peer in\n-a tracker response or peer exchange message.
    \n+[report issue]
    \n+
    query_last_seen_complete
    \n+
    includes last_seen_complete.
    \n
    \n-\n-\n-\n-[report issue]
    \n-
    downloading_piece_index downloading_block_index downloading_progress downloading_total
    \n-
    You can know which piece, and which part of that piece, that is\n-currently being downloaded from a specific peer by looking at these\n-four members. downloading_piece_index is the index of the piece\n-that is currently being downloaded. This may be set to -1 if there's\n-currently no piece downloading from this peer. If it is >= 0, the\n-other three members are valid. downloading_block_index is the\n-index of the block (or sub-piece) that is being downloaded.\n-downloading_progress is the number of bytes of this block we have\n-received from the peer, and downloading_total is the total number\n-of bytes in this block.
    \n+[report issue]
    \n+
    query_pieces
    \n+
    populate the pieces field in torrent_status.
    \n
    \n-[report issue]
    \n-
    standard_bittorrent
    \n-
    Regular bittorrent connection
    \n+[report issue]
    \n+
    query_verified_pieces
    \n+
    includes verified_pieces (only applies to torrents in seed\n+mode).
    \n
    \n-[report issue]
    \n-
    web_seed
    \n-
    HTTP connection using the BEP 19 protocol
    \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-
    http_seed
    \n-
    HTTP connection using the BEP 17 protocol
    \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-
    connection_type
    \n-
    the kind of connection this peer uses. See connection_type_t.
    \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-
    pending_disk_bytes
    \n-
    the number of bytes this peer has pending in the disk-io thread.\n-Downloaded and waiting to be written to disk. This is what is capped\n-by settings_pack::max_queued_disk_bytes.
    \n+[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-
    pending_disk_read_bytes
    \n-
    number of outstanding bytes to read\n-from disk
    \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-\n-[report issue]
    \n-
    send_quota receive_quota
    \n-
    the number of bytes this peer has been assigned to be allowed to send\n-and receive until it has to request more quota from the bandwidth\n-manager.
    \n+[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-
    rtt
    \n-
    an estimated round trip time to this peer, in milliseconds. It is\n-estimated by timing the TCP connect(). It may be 0 for\n-incoming connections.
    \n+[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-
    num_pieces
    \n-
    the number of pieces this peer has.
    \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-\n-[report issue]
    \n-
    download_rate_peak upload_rate_peak
    \n-
    the highest download and upload rates seen on this connection. They\n-are given in bytes per second. This number is reset to 0 on reconnect.
    \n+[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-
    progress
    \n-
    the progress of the peer in the range [0, 1]. This is always 0 when\n-floating point operations are disabled, instead use progress_ppm.
    \n+[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-
    progress_ppm
    \n-
    indicates the download progress of the peer in the range [0, 1000000]\n-(parts per million).
    \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-
    ip
    \n-
    the IP-address to this peer. The type is an asio endpoint. For\n-more info, see the asio documentation. This field is not valid for\n-i2p peers. Instead use the i2p_destination() function.
    \n+[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-
    local_endpoint
    \n-
    the IP and port pair the socket is bound to locally. i.e. the IP\n-address of the interface it's going out over. This may be useful for\n-multi-homed clients with multiple interfaces to the internet.\n-This field is not valid for i2p peers.
    \n+[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-
    bw_idle
    \n-
    The peer is not waiting for any external events to\n-send or receive data.
    \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-
    bw_limit
    \n-
    The peer is waiting for the rate limiter.
    \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-
    bw_network
    \n-
    The peer has quota and is currently waiting for a\n-network read or write operation to complete. This is\n-the state all peers are in if there are no bandwidth\n-limits.
    \n+[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+

    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+posting alerts. Only alerts that belong to an enabled category are\n+posted. Setting the alert bitmask to 0 will disable all alerts (except those\n+that are non-discardable). Alerts that are responses to API calls such as\n+save_resume_data() and post_session_stats() are non-discardable and will be\n+posted even if their category is disabled.

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

    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+   int num_replacements;\n+   int last_active;\n+};\n+
    \n+\n+[report issue]
    \n+
    num_nodes num_replacements
    \n+
    the total number of nodes and replacement nodes\n+in the routing table
    \n
    \n-[report issue]
    \n-
    bw_disk
    \n-
    The peer is waiting for the disk I/O thread to catch\n-up writing buffers to disk before downloading more.
    \n+[report issue]
    \n+
    last_active
    \n+
    number of seconds since last activity
    \n
    \n-\n-[report issue]
    \n-
    read_state write_state
    \n-
    bitmasks indicating what state this peer\n-is in with regards to sending and receiving data. The states are\n-defined as independent flags of type bandwidth_state_flags_t, in this\n-class.
    \n+[report issue]
    \n+
    \n+

    torrent_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is a base class for alerts that are associated with a\n+specific torrent. It contains a handle to the torrent.

    \n+

    Note that by the time the client receives a torrent_alert, its\n+handle member may be invalid.

    \n+
    \n+struct torrent_alert : alert\n+{\n+   std::string message () const override;\n+   char const* torrent_name () const;\n+\n+   torrent_handle handle;\n+};\n+
    \n+[report issue]
    \n+

    message()

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

    returns the message associated with this alert

    \n+[report issue]
    \n+
    handle
    \n+
    The torrent_handle pointing to the torrent this\n+alert is associated with.
    \n
    \n-[report issue]
    \n+[report issue]
    \n
    \n-
    \n-

    piece_block

    \n-

    Declared in "libtorrent/piece_block.hpp"

    \n+
    \n+

    peer_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The peer alert is a base class for alerts that refer to a specific peer. It includes all\n+the information to identify the peer. i.e. ip and peer-id.

    \n
    \n-struct piece_block\n+struct peer_alert : torrent_alert\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+   std::string message () const override;\n \n-   static const piece_block invalid;\n-   piece_index_t piece_index {0};\n-   int block_index  = 0;\n+   aux::noexcept_movable<tcp::endpoint> endpoint;\n+   peer_id pid;\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+
    endpoint
    \n+
    The peer's IP address and port.
    \n+
    \n+[report issue]
    \n+
    pid
    \n+
    the peer ID, if known.
    \n+
    \n+[report issue]
    \n+
    \n+

    tracker_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is a base class used for alerts that are associated with a\n+specific tracker. It derives from torrent_alert since a tracker\n+is also associated with a specific torrent.

    \n
    \n-struct peer_request\n+struct tracker_alert : torrent_alert\n {\n-   bool operator== (peer_request const& r) const;\n+   std::string message () const override;\n+   char const* tracker_url () const;\n \n-   piece_index_t piece;\n-   int start;\n-   int length;\n+   aux::noexcept_movable<tcp::endpoint> local_endpoint;\n };\n 
    \n-[report issue]
    \n-

    operator==()

    \n+[report issue]
    \n+

    tracker_url()

    \n
    \n-bool operator== (peer_request const& r) const;\n+char const* tracker_url () 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+

    returns a 0-terminated string of the tracker's URL

    \n+[report issue]
    \n+
    local_endpoint
    \n+
    endpoint of the listen interface being announced
    \n
    \n-\n-\n-[report issue]
    \n+[report issue]
    \n
    \n-
    \n-

    load_torrent_buffer() load_torrent_parsed() load_torrent_file()

    \n-

    Declared in "libtorrent/load_torrent.hpp"

    \n+
    \n+

    torrent_removed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The torrent_removed_alert is posted whenever a torrent is removed. Since\n+the torrent handle in its base class will usually be invalid (since the torrent\n+is already removed) it has the info hash as a member, to identify it.\n+It's posted when the alert_category::status bit is set in the alert_mask.

    \n+

    Note that the handle remains valid for some time after\n+torrent_removed_alert is posted, as long as some internal libtorrent\n+task (such as an I/O task) refers to it. Additionally, other alerts like\n+save_resume_data_alert may be posted after torrent_removed_alert.\n+To synchronize on whether the torrent has been removed or not, call\n+torrent_handle::in_session(). This will return true before\n+torrent_removed_alert is posted, and false afterward.

    \n+

    Even though the handle member doesn't point to an existing torrent anymore,\n+it is still useful for comparing to other handles, which may also no\n+longer point to existing torrents, but to the same non-existing torrents.

    \n+

    The torrent_handle acts as a weak_ptr, even though its object no\n+longer exists, it can still compare equal to another weak pointer which\n+points to the same non-existent object.

    \n
    \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-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer, load_torrent_limits const& cfg);\n+struct torrent_removed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   info_hash_t info_hashes;\n+   client_data_t userdata;\n+};\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-

    truncate_files()

    \n-

    Declared in "libtorrent/truncate.hpp"

    \n+[report issue]
    \n+
    userdata
    \n+
    'userdata` as set in add_torrent_params at torrent creation.\n+This can be used to associate this torrent with related data\n+in the client application more efficiently than info_hashes.
    \n+
    \n+[report issue]
    \n+
    \n+

    read_piece_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when the asynchronous read operation initiated by\n+a call to torrent_handle::read_piece() is completed. If the read failed, the torrent\n+is paused and an error state is set and the buffer member of the alert\n+is 0. If successful, buffer points to a buffer containing all the data\n+of the piece. piece is the piece index that was read. size is the\n+number of bytes that was read.

    \n+

    If the operation fails, error will indicate what went wrong.

    \n
    \n-void truncate_files (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+struct read_piece_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   error_code const error;\n+   boost::shared_array<char> const buffer;\n+   piece_index_t const piece;\n+   int const size;\n+};\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+[report issue]
    \n+
    \n+

    file_completed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is posted whenever an individual file completes its download. i.e.\n+All pieces overlapping this file have passed their hash check.

    \n
    \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+struct file_completed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   file_index_t const index;\n+};\n 
    \n-

    Generates a magnet URI from the specified torrent.

    \n-

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

    \n-
    \n-ti, info_hashes, url_seeds, dht_nodes,\n-file_priorities, trackers, name, peers.
    \n-

    Depending on what the use case for the resulting magnet link is, clearing\n-peers and dht_nodes is probably a good idea if the add_torrent_params\n-came from a running torrent. Those lists may be long and be ephemeral.

    \n-

    If none of the info_hashes or ti fields are set, there is not\n-info-hash available, and a magnet link cannot be created. In this case\n-make_magnet_uri() returns an empty string.

    \n-

    The recommended way to generate a magnet link from a torrent_handle is to\n-call save_resume_data(), which will post a save_resume_data_alert\n-containing an add_torrent_params object. This can then be passed to\n-make_magnet_uri().

    \n-

    The overload that takes a torrent_handle will make blocking calls to\n-query information about the torrent. If the torrent handle is invalid,\n-an empty string is returned.

    \n-

    For more information about magnet links, see magnet links.

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

    parse_magnet_uri()

    \n-

    Declared in "libtorrent/magnet_uri.hpp"

    \n+[report issue]
    \n+
    index
    \n+
    refers to the index of the file that completed.
    \n+
    \n+[report issue]
    \n+
    \n+

    file_renamed_alert

    \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-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-add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\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+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   file_index_t const index;\n+};\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-

    version()

    \n-

    Declared in "libtorrent/version.hpp"

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

    new_name() old_name()

    \n
    \n-char const* version ();\n+char const* new_name () const;\n+char const* old_name () const;\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+

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

    file_rename_failed_alert

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

    \n
    \n-inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n+struct file_rename_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   file_index_t const index;\n+   error_code const error;\n+};\n 
    \n-[report issue]
    \n-
    \n-

    enum protocol_version

    \n-

    Declared in "libtorrent/info_hash.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    V10The original BitTorrent version, using SHA-1 hashes
    V21Version 2 of the BitTorrent protocol, using SHA-256 hashes
    NUM2 
    \n-[report issue]
    \n-
    \n-

    enum event_t

    \n-

    Declared in "libtorrent/tracker_manager.hpp"

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

    enum connection_type

    \n-

    Declared in "libtorrent/peer_connection.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    bittorrent0 
    url_seed1 
    http_seed2 
    \n-[report issue]
    \n-
    \n-

    enum socket_type_t

    \n-

    Declared in "libtorrent/socket_type.hpp"

    \n+\n+[report issue]
    \n+
    index error
    \n+
    refers to the index of the file that was supposed to be renamed,\n+error is the error code returned from the filesystem.
    \n+
    \n+[report issue]
    \n+
    \n+

    performance_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a limit is reached that might have a negative impact on\n+upload or download rate performance.

    \n+
    \n+struct performance_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   enum performance_warning_t\n+   {\n+      outstanding_disk_buffer_limit_reached,\n+      outstanding_request_limit_reached,\n+      upload_limit_too_low,\n+      download_limit_too_low,\n+      send_buffer_watermark_too_low,\n+      too_many_optimistic_unchoke_slots,\n+      too_high_disk_queue_limit,\n+      aio_limit_reached,\n+      deprecated_bittyrant_with_no_uplimit,\n+      too_few_outgoing_ports,\n+      too_few_file_descriptors,\n+      num_warnings,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::performance_warning;\n+   performance_warning_t const warning_code;\n+};\n+
    \n+[report issue]
    \n+

    enum performance_warning_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \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
    outstanding_disk_buffer_limit_reached0 This warning means that the number of bytes queued to be written to disk\n+exceeds the max disk byte queue setting (settings_pack::max_queued_disk_bytes).\n+This might restrict the download rate, by not queuing up enough write jobs\n+to the disk I/O thread. When this alert is posted, peer connections are\n+temporarily stopped from downloading, until the queued disk bytes have fallen\n+below the limit again. Unless your max_queued_disk_bytes setting is already\n+high, you might want to increase it to get better performance.
    socks5
    outstanding_request_limit_reached1 This is posted when libtorrent would like to send more requests to a peer,\n+but it's limited by settings_pack::max_out_request_queue. The queue length\n+libtorrent is trying to achieve is determined by the download rate and the\n+assumed round-trip-time (settings_pack::request_queue_time). The assumed\n+round-trip-time is not limited to just the network RTT, but also the remote disk\n+access time and message handling time. It defaults to 3 seconds. The target number\n+of outstanding requests is set to fill the bandwidth-delay product (assumed RTT\n+times download rate divided by number of bytes per request). When this alert\n+is posted, there is a risk that the number of outstanding requests is too low\n+and limits the download rate. You might want to increase the max_out_request_queue\n+setting.
    http
    upload_limit_too_low2 This warning is posted when the amount of TCP/IP overhead is greater than the\n+upload rate limit. When this happens, the TCP/IP overhead is caused by a much\n+faster download rate, triggering TCP ACK packets. These packets eat into the\n+rate limit specified to libtorrent. When the overhead traffic is greater than\n+the rate limit, libtorrent will not be able to send any actual payload, such\n+as piece requests. This means the download rate will suffer, and new requests\n+can be sent again. There will be an equilibrium where the download rate, on\n+average, is about 20 times the upload rate limit. If you want to maximize the\n+download rate, increase the upload rate limit above 5% of your download capacity.
    utp
    download_limit_too_low3 This is the same warning as upload_limit_too_low but referring to the download\n+limit instead of upload. This suggests that your download rate limit is much lower\n+than your upload capacity. Your upload rate will suffer. To maximize upload rate,\n+make sure your download rate limit is above 5% of your upload capacity.
    i2p
    send_buffer_watermark_too_low4 

    We're stalled on the disk. We want to write to the socket, and we can write\n+but our send buffer is empty, waiting to be refilled from the disk.\n+This either means the disk is slower than the network connection\n+or that our send buffer watermark is too small, because we can\n+send it all before the disk gets back to us.\n+The number of bytes that we keep outstanding, requested from the disk, is calculated\n+as follows:

    \n+
    \n+min(512, max(upload_rate * send_buffer_watermark_factor / 100, send_buffer_watermark))\n+
    \n+

    If you receive this alert, you might want to either increase your send_buffer_watermark\n+or send_buffer_watermark_factor.

    \n+
    tcp_ssl
    too_many_optimistic_unchoke_slots5 If the half (or more) of all upload slots are set as optimistic unchoke slots, this\n+warning is issued. You probably want more regular (rate based) unchoke slots.
    socks5_ssl
    too_high_disk_queue_limit6 If the disk write queue ever grows larger than half of the cache size, this warning\n+is posted. The disk write queue eats into the total disk cache and leaves very little\n+left for the actual cache. This causes the disk cache to oscillate in evicting large\n+portions of the cache before allowing peers to download any more, onto the disk write\n+queue. Either lower max_queued_disk_bytes or increase cache_size.
    http_ssl
    aio_limit_reached7 
    utp_ssl
    deprecated_bittyrant_with_no_uplimit8 
    \n-[report issue]
    \n-
    \n-

    enum portmap_transport

    \n-

    Declared in "libtorrent/portmap.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n \n \n \n
    namevaluedescription
    too_few_outgoing_ports9This is generated if outgoing peer connections are failing because of address in use\n+errors, indicating that settings_pack::outgoing_ports is set and is too small of\n+a range. Consider not using the outgoing_ports setting at all, or widen the range to\n+include more ports.
    natpmp0natpmp can be NAT-PMP or PCP
    too_few_file_descriptors10 
    upnp1
    num_warnings11 
    \n-[report issue]
    \n-
    \n-

    enum portmap_protocol

    \n-

    Declared in "libtorrent/portmap.hpp"

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

    state_changed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    Generated whenever a torrent changes its state.

    \n+
    \n+struct state_changed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   torrent_status::state_t const state;\n+   torrent_status::state_t const prev_state;\n+};\n+
    \n+[report issue]
    \n+
    state
    \n+
    the new state of the torrent.
    \n+
    \n+[report issue]
    \n+
    prev_state
    \n+
    the previous state.
    \n+
    \n+[report issue]
    \n+
    \n+

    tracker_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated on tracker time outs, premature disconnects,\n+invalid response or a HTTP response other than "200 OK". From the alert\n+you can get the handle to the torrent the tracker belongs to.

    \n+
    \n+struct tracker_error_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+   char const* failure_reason () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n+   int const times_in_row;\n+   error_code const error;\n+   operation_t op;\n+   protocol_version version;\n+};\n+
    \n+[report issue]
    \n+

    failure_reason()

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

    if the tracker sent a "failure reason" string, it will be returned\n+here.

    \n+[report issue]
    \n+
    times_in_row
    \n+
    This member says how many times in a row this tracker has failed.
    \n+
    \n+[report issue]
    \n+
    error
    \n+
    the error code indicating why the tracker announce failed. If it is\n+is lt::errors::tracker_failure the failure_reason() might contain\n+a more detailed description of why the tracker rejected the request.\n+HTTP status codes indicating errors are also set in this field.
    \n+
    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that was announced
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    tracker_warning_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is triggered if the tracker reply contains a warning field.\n+Usually this means that the tracker announce was successful, but the\n+tracker has a message to the client.

    \n+
    \n+struct tracker_warning_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+   char const* warning_message () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n+   protocol_version version;\n+};\n+
    \n+[report issue]
    \n+

    warning_message()

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

    the message associated with this warning

    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that was announced
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    scrape_reply_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a scrape request succeeds.

    \n+
    \n+struct scrape_reply_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker;\n+   int const incomplete;\n+   int const complete;\n+   protocol_version version;\n+};\n+
    \n+\n+[report issue]
    \n+
    incomplete complete
    \n+
    the data returned in the scrape response. These numbers\n+may be -1 if the response was malformed.
    \n+
    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that was scraped
    \n+
    \n+[report issue]
    \n+
    \n+

    scrape_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    If a scrape request fails, this alert is generated. This might be due\n+to the tracker timing out, refusing connection or returning an http response\n+code indicating an error.

    \n+
    \n+struct scrape_failed_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+   char const* error_message () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n+   error_code const error;\n+   protocol_version version;\n+};\n+
    \n+[report issue]
    \n+

    error_message()

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

    if the error indicates there is an associated message, this returns\n+that message. Otherwise and empty string.

    \n+[report issue]
    \n+
    error
    \n+
    the error itself. This may indicate that the tracker sent an error\n+message (error::tracker_failure), in which case it can be\n+retrieved by calling error_message().
    \n+
    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that was scraped
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    tracker_reply_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is only for informational purpose. It is generated when a tracker announce\n+succeeds. It is generated regardless what kind of tracker was used, be it UDP, HTTP or\n+the DHT.

    \n+
    \n+struct tracker_reply_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker;\n+   int const num_peers;\n+   protocol_version version;\n+};\n+
    \n+[report issue]
    \n+
    num_peers
    \n+
    tells how many peers the tracker returned in this response. This is\n+not expected to be greater than the num_want settings. These are not necessarily\n+all new peers, some of them may already be connected.
    \n+
    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that was announced
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_reply_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated each time the DHT receives peers from a node. num_peers\n+is the number of peers we received in this packet. Typically these packets are\n+received from multiple DHT nodes, and so the alerts are typically generated\n+a few at a time.

    \n+
    \n+struct dht_reply_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht | alert_category::tracker;\n+   int const num_peers;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    tracker_announce_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated each time a tracker announce is sent (or attempted to be sent).\n+There are no extra data members in this alert. The url can be found in the base class\n+however.

    \n+
    \n+struct tracker_announce_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::tracker;\n+   event_t const event;\n+   protocol_version version;\n+};\n+
    \n+[report issue]
    \n+
    event
    \n+
    specifies what event was sent to the tracker. See event_t.
    \n+
    \n+[report issue]
    \n+
    version
    \n+
    the bittorrent protocol version that is announced
    \n+
    \n+[report issue]
    \n+
    \n+

    hash_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a finished piece fails its hash check. You can get the handle\n+to the torrent which got the failed piece and the index of the piece itself from the alert.

    \n+
    \n+struct hash_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    peer_ban_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer is banned because it has sent too many corrupt pieces\n+to us. ip is the endpoint to the peer that was banned.

    \n+
    \n+struct peer_ban_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    peer_unsnubbed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer is un-snubbed. Essentially when it was snubbed for stalling\n+sending data, and now it started sending data again.

    \n+
    \n+struct peer_unsnubbed_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    peer_snubbed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer is snubbed, when it stops sending data when we request\n+it.

    \n+
    \n+struct peer_snubbed_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    peer_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer sends invalid data over the peer-peer protocol. The peer\n+will be disconnected, but you get its ip address from the alert, to identify it.

    \n+
    \n+struct peer_error_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+   operation_t op;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    op
    \n+
    a 0-terminated string of the low-level operation that failed, or nullptr if\n+there was no low level disk operation.
    \n+
    \n+[report issue]
    \n+
    error
    \n+
    tells you what error caused this alert.
    \n+
    \n+[report issue]
    \n+
    \n+

    peer_connect_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted every time an incoming peer connection both\n+successfully passes the protocol handshake and is associated with a\n+torrent, or an outgoing peer connection attempt succeeds. For arbitrary\n+incoming connections, see incoming_connection_alert.

    \n+
    \n+struct peer_connect_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   enum direction_t\n+   {\n+      in,\n+      out,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::connect;\n+   direction_t direction;\n+   socket_type_t socket_type;\n+};\n+
    \n+[report issue]
    \n+

    enum direction_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n \n \n \n \n \n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n-\n \n
    namevaluedescription
    none
    in0 
    tcp
    out1 
    udp2 
    \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+[report issue]
    \n+
    direction
    \n+
    Tells you if the peer was incoming or outgoing
    \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+
    \n+
    \n+

    peer_disconnected_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer is disconnected for any reason (other than the ones\n+covered by peer_error_alert ).

    \n+
    \n+struct peer_disconnected_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::connect;\n+   socket_type_t const socket_type;\n+   operation_t const op;\n+   error_code const error;\n+   close_reason_t const reason;\n+};\n+
    \n+[report issue]
    \n+
    socket_type
    \n+
    the kind of socket this peer was connected over
    \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+
    op
    \n+
    the operation or level where the error occurred. Specified as an\n+value from the operation_t enum. Defined in operations.hpp.
    \n
    \n-[report issue]
    \n-
    \n-

    int

    \n-

    Declared in "libtorrent/version.hpp"

    \n-
    \n-
    version_major
    \n-
    the major, minor and tiny versions of libtorrent
    \n+[report issue]
    \n+
    error
    \n+
    tells you what error caused peer to disconnect.
    \n
    \n-
    \n-
    version_minor
    \n-
    the major, minor and tiny versions of libtorrent
    \n+[report issue]
    \n+
    reason
    \n+
    the reason the peer disconnected (if specified)
    \n
    \n-
    \n-
    version_tiny
    \n-
    the major, minor and tiny versions of libtorrent
    \n+[report issue]
    \n+
    \n+

    invalid_request_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is a debug alert that is generated by an incoming invalid piece request.\n+ip is the address of the peer and the request is the actual incoming\n+request from the peer. See peer_request for more info.

    \n+
    \n+struct invalid_request_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+   peer_request const request;\n+   bool const we_have;\n+   bool const peer_interested;\n+   bool const withheld;\n+};\n+
    \n+[report issue]
    \n+
    request
    \n+
    the request we received from the peer
    \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-are present for this torrent and that they all match the hashes in\n-the torrent file. Each time a peer requests to download a block,\n-the piece is verified against the hash, unless it has been verified\n-already. If a hash fails, the torrent will automatically leave the\n-seed mode and recheck all the files. The use case for this mode is\n-if a torrent is created and seeded, or if the user already know\n-that the files are complete, this is a way to avoid the initial\n-file checks, and significantly reduce the startup time.

    \n-

    Setting seed_mode on a torrent without metadata (a\n-.torrent file) is a no-op and will be ignored.

    \n-

    It is not possible to set the seed_mode flag on a torrent after it has\n-been added to a session. It is possible to clear it though.

    \n-
    \n+[report issue]
    \n+
    we_have
    \n+
    true if we have this piece
    \n
    \n-
    \n-
    upload_mode
    \n-

    If upload_mode is set, the torrent will be initialized in\n-upload-mode, which means it will not make any piece requests. This\n-state is typically entered on disk I/O errors, and if the torrent\n-is also auto managed, it will be taken out of this state\n-periodically (see settings_pack::optimistic_disk_retry).

    \n-

    This mode can be used to avoid race conditions when\n-adjusting priorities of pieces before allowing the torrent to start\n-downloading.

    \n-

    If the torrent is auto-managed (auto_managed), the torrent\n-will eventually be taken out of upload-mode, regardless of how it\n-got there. If it's important to manually control when the torrent\n-leaves upload mode, don't make it auto managed.

    \n-
    \n+[report issue]
    \n+
    peer_interested
    \n+
    true if the peer indicated that it was interested to download before\n+sending the request
    \n
    \n-
    \n-
    share_mode
    \n-

    determines if the torrent should be added in share mode or not.\n-Share mode indicates that we are not interested in downloading the\n-torrent, but merely want to improve our share ratio (i.e. increase\n-it). A torrent started in share mode will do its best to never\n-download more than it uploads to the swarm. If the swarm does not\n-have enough demand for upload capacity, the torrent will not\n-download anything. This mode is intended to be safe to add any\n-number of torrents to, without manual screening, without the risk\n-of downloading more than is uploaded.

    \n-

    A torrent in share mode sets the priority to all pieces to 0,\n-except for the pieces that are downloaded, when pieces are decided\n-to be downloaded. This affects the progress bar, which might be set\n-to "100% finished" most of the time. Do not change file or piece\n-priorities for torrents in share mode, it will make it not work.

    \n-

    The share mode has one setting, the share ratio target, see\n-settings_pack::share_mode_target for more info.

    \n-
    \n+[report issue]
    \n+
    withheld
    \n+
    if this is true, the peer is not allowed to download this piece because\n+of super-seeding rules.
    \n
    \n-
    \n-
    apply_ip_filter
    \n-
    determines if the IP filter should apply to this torrent or not. By\n-default all torrents are subject to filtering by the IP filter\n-(i.e. this flag is set by default). This is useful if certain\n-torrents needs to be exempt for some reason, being an auto-update\n-torrent for instance.
    \n+[report issue]
    \n+
    \n+

    torrent_finished_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a torrent switches from being a downloader to a seed.\n+It will only be generated once per torrent. It contains a torrent_handle to the\n+torrent in question.

    \n+
    \n+struct torrent_finished_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    piece_finished_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted every time a piece completes downloading\n+and passes the hash check. This alert derives from torrent_alert\n+which contains the torrent_handle to the torrent the piece belongs to.\n+Note that being downloaded and passing the hash check may happen before\n+the piece is also fully flushed to disk. So torrent_handle::have_piece()\n+may still return false

    \n+
    \n+struct piece_finished_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    piece_index
    \n+
    the index of the piece that finished
    \n
    \n-
    \n-
    paused
    \n-
    specifies whether or not the torrent is paused. i.e. it won't connect to the tracker or any of the peers\n-until it's resumed. Note that a paused torrent that also has the\n-auto_managed flag set can be started at any time by libtorrent's queuing\n-logic. See queuing.
    \n-
    \n-
    \n-
    auto_managed
    \n-

    If the torrent is auto-managed (auto_managed), the torrent\n-may be resumed at any point, regardless of how it paused. If it's\n-important to manually control when the torrent is paused and\n-resumed, don't make it auto managed.

    \n-

    If auto_managed is set, the torrent will be queued,\n-started and seeded automatically by libtorrent. When this is set,\n-the torrent should also be started as paused. The default queue\n-order is the order the torrents were added. They are all downloaded\n-in that order. For more details, see queuing.

    \n-
    \n-
    \n-
    \n-
    duplicate_is_error
    \n-
    used in add_torrent_params to indicate that it's an error to attempt\n-to add a torrent that's already in the session. If it's not considered an\n-error, a handle to the existing torrent is returned.\n-This flag is not saved by write_resume_data(), since it is only meant for\n-adding torrents.
    \n-
    \n-
    \n-
    update_subscribe
    \n-
    on by default and means that this torrent will be part of state\n-updates when calling post_torrent_updates().\n-This flag is not saved by write_resume_data().
    \n-
    \n-
    \n-
    super_seeding
    \n-
    sets the torrent into super seeding/initial seeding mode. If the torrent\n-is not a seed, this flag has no effect.
    \n-
    \n-
    \n-
    sequential_download
    \n-
    sets the sequential download state for the torrent. In this mode the\n-piece picker will pick pieces with low index numbers before pieces with\n-high indices. The actual pieces that are picked depend on other factors\n-still, such as which pieces a peer has and whether it is in parole mode\n-or "prefer whole pieces"-mode. Sequential mode is not ideal for streaming\n-media. For that, see set_piece_deadline() instead.
    \n-
    \n-
    \n-
    stop_when_ready
    \n-

    When this flag is set, the torrent will force stop whenever it\n-transitions from a non-data-transferring state into a data-transferring\n-state (referred to as being ready to download or seed). This is useful\n-for torrents that should not start downloading or seeding yet, but want\n-to be made ready to do so. A torrent may need to have its files checked\n-for instance, so it needs to be started and possibly queued for checking\n-(auto-managed and started) but as soon as it's done, it should be\n-stopped.

    \n-

    Force stopped means auto-managed is set to false and it's paused. As\n-if the auto_manages flag is cleared and the paused flag is set on the torrent.

    \n-

    Note that the torrent may transition into a downloading state while\n-setting this flag, and since the logic is edge triggered you may\n-miss the edge. To avoid this race, if the torrent already is in a\n-downloading state when this call is made, it will trigger the\n-stop-when-ready immediately.

    \n-

    When the stop-when-ready logic fires, the flag is cleared. Any\n-subsequent transitions between downloading and non-downloading states\n-will not be affected, until this flag is set again.

    \n-

    The behavior is more robust when setting this flag as part of adding\n-the torrent. See add_torrent_params.

    \n-

    The stop-when-ready flag fixes the inherent race condition of waiting\n-for the state_changed_alert and then call pause(). The download/seeding\n-will most likely start in between posting the alert and receiving the\n-call to pause.

    \n-

    A downloading state is one where peers are being connected. Which means\n-just downloading the metadata via the ut_metadata extension counts\n-as a downloading state. In order to stop a torrent once the metadata\n-has been downloaded, instead set all file priorities to dont_download

    \n-
    \n-
    \n-
    \n-
    override_trackers
    \n-
    when this flag is set, the tracker list in the add_torrent_params\n-object override any trackers from the torrent file. If the flag is\n-not set, the trackers from the add_torrent_params object will be\n-added to the list of trackers used by the torrent.\n-This flag is set by read_resume_data() if there are trackers present in\n-the resume data file. This effectively makes the trackers saved in the\n-resume data take precedence over the original trackers. This includes if\n-there's an empty list of trackers, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
    \n-
    \n-
    \n-
    override_web_seeds
    \n-
    If this flag is set, the web seeds from the add_torrent_params\n-object will override any web seeds in the torrent file. If it's not\n-set, web seeds in the add_torrent_params object will be added to the\n-list of web seeds used by the torrent.\n-This flag is set by read_resume_data() if there are web seeds present in\n-the resume data file. This effectively makes the web seeds saved in the\n-resume data take precedence over the original ones. This includes if\n-there's an empty list of web seeds, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
    \n-
    \n-
    \n-
    need_save_resume
    \n-

    if this flag is set (which it is by default) the torrent will be\n-considered needing to save its resume data immediately, in the\n-category if_metadata_changed. See resume_data_flags_t and\n-save_resume_data() for details.

    \n-

    This flag is cleared by a successful call to save_resume_data()\n-This flag is not saved by write_resume_data(), since it represents an\n-ephemeral state of a running torrent.

    \n-
    \n-
    \n-
    \n-
    disable_dht
    \n-
    set this flag to disable DHT for this torrent. This lets you have the DHT\n-enabled for the whole client, and still have specific torrents not\n-participating in it. i.e. not announcing to the DHT nor picking up peers\n-from it.
    \n-
    \n-
    \n-
    disable_lsd
    \n-
    set this flag to disable local service discovery for this torrent.
    \n-
    \n-
    \n-
    disable_pex
    \n-
    set this flag to disable peer exchange for this torrent.
    \n-
    \n-
    \n-
    no_verify_files
    \n-
    if this flag is set, the resume data will be assumed to be correct\n-without validating it against any files on disk. This may be used when\n-restoring a session by loading resume data from disk. It will save time\n-and also delay any hard disk errors until files are actually needed. If\n-the resume data cannot be trusted, or if a torrent is added for the first\n-time to some save path that may already have some of the files, this flag\n-should not be set.
    \n-
    \n-
    \n-
    default_dont_download
    \n-
    default all file priorities to dont_download. This is useful for adding\n-magnet links where the number of files is unknown, but the\n-file_priorities is still set for some files. Any file not covered by\n-the file_priorities list will be set to normal download priority,\n-unless this flag is set, in which case they will be set to 0\n-(dont_download).
    \n-
    \n-
    \n-
    i2p_torrent
    \n-
    this flag makes the torrent be considered an "i2p torrent" for purposes\n-of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n-is disabled, i2p torrents won't add normal peers to its peer list.\n-Note that non i2p torrents may still allow i2p peers (on the off-chance\n-that a tracker return them and the session is configured with a SAM\n-connection).\n-This flag is set automatically when adding a torrent that has at least\n-one tracker whose hostname ends with .i2p.\n-It's also set by parse_magnet_uri() if the tracker list contains such\n-URL.
    \n-
    \n-
    \n-
    all
    \n-
    all torrent flags combined. Can conveniently be used when creating masks\n-for flags
    \n-
    \n-[report issue]
    \n-
    \n-

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

    request_dropped_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a peer rejects or ignores a piece request.

    \n+
    \n+struct request_dropped_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    block_timeout_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a block request times out.

    \n+
    \n+struct block_timeout_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    block_finished_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a block request receives a response.

    \n+
    \n+struct block_finished_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    block_downloading_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a block request is sent to a peer.

    \n+
    \n+struct block_downloading_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    unwanted_block_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a block is received that was not requested or\n+whose request timed out.

    \n+
    \n+struct unwanted_block_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    storage_moved_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The storage_moved_alert is generated when all the disk IO has\n+completed and the files have been moved, as an effect of a call to\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* 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+

    old_path() storage_path()

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

    The storage_moved_failed_alert is generated when an attempt to move the storage,\n+via torrent_handle::move_storage(), fails.

    \n+
    \n+struct storage_moved_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+   char const* file_path () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   error_code const error;\n+   operation_t op;\n+};\n+
    \n+[report issue]
    \n+

    file_path()

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

    If the error happened for a specific file, this returns its path.

    \n+[report issue]
    \n+
    op
    \n+
    this indicates what underlying operation caused the error
    \n
    \n-[report issue]
    \n-
    \n-

    add_torrent_params

    \n-

    Declared in "libtorrent/add_torrent_params.hpp"

    \n-

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

    \n-
      \n-
    • ti - the immutable info-dict part of the torrent
    • \n-
    • info_hash - when you don't have the metadata (.torrent file). This\n-uniquely identifies the torrent and can validate the info-dict when\n-received from the swarm.
    • \n-
    \n-

    In order to add a torrent to a session, one of those fields must be set\n-in addition to save_path. The add_torrent_params object can then be\n-passed into one of the session::add_torrent() overloads or\n-session::async_add_torrent().

    \n-

    If you only specify the info-hash, the torrent file will be downloaded\n-from peers, which requires them to support the metadata extension. For\n-the metadata extension to work, libtorrent must be built with extensions\n-enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also\n-takes an optional name argument. This may be left empty in case no\n-name should be assigned to the torrent. In case it's not, the name is\n-used for the torrent as long as it doesn't have metadata. See\n-torrent_handle::name.

    \n-

    The add_torrent_params is also used when requesting resume data for a\n-torrent. It can be saved to and restored from a file and added back to a\n-new session. For serialization and de-serialization of\n-add_torrent_params objects, see read_resume_data() and\n-write_resume_data().

    \n-

    The add_torrent_params is also used to represent a parsed .torrent\n-file. It can be loaded via load_torrent_file(), load_torrent_buffer() and\n-load_torrent_parsed(). It can be saved via write_torrent_file().

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

    torrent_deleted_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a request to delete the files of a torrent complete.

    \n+

    This alert is posted in the alert_category::storage category, and that bit\n+needs to be set in the alert_mask.

    \n
    \n-struct add_torrent_params\n+struct torrent_deleted_alert final : torrent_alert\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+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n    info_hash_t info_hashes;\n-   int max_uploads  = -1;\n-   int max_connections  = -1;\n-   int upload_limit  = -1;\n-   int download_limit  = -1;\n-   std::int64_t total_uploaded  = 0;\n-   std::int64_t total_downloaded  = 0;\n-   int active_time  = 0;\n-   int finished_time  = 0;\n-   int seeding_time  = 0;\n-   std::time_t added_time  = 0;\n-   std::time_t completed_time  = 0;\n-   std::time_t last_seen_complete  = 0;\n-   int num_complete  = -1;\n-   int num_incomplete  = -1;\n-   int num_downloaded  = -1;\n-   aux::noexcept_movable<std::vector<std::string>> http_seeds;\n-   aux::noexcept_movable<std::vector<std::string>> url_seeds;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;\n-   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;\n-   typed_bitfield<piece_index_t> have_pieces;\n-   typed_bitfield<piece_index_t> verified_pieces;\n-   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;\n-   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;\n-   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;\n-   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;\n-   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;\n-   std::time_t last_download  = 0;\n-   std::time_t last_upload  = 0;\n };\n 
    \n-[report issue]
    \n-
    version
    \n-
    filled in by the constructor and should be left untouched. It is used\n-for forward binary compatibility.
    \n-
    \n-[report issue]
    \n-
    ti
    \n-
    torrent_info object with the torrent to add. Unless the\n-info_hash is set, this is required to be initialized.
    \n-
    \n-[report issue]
    \n-
    trackers
    \n-
    If the torrent doesn't have a tracker, but relies on the DHT to find\n-peers, the trackers can specify tracker URLs for the torrent.
    \n-
    \n-[report issue]
    \n-
    tracker_tiers
    \n-
    the tiers the URLs in trackers belong to. Trackers belonging to\n-different tiers may be treated differently, as defined by the multi\n-tracker extension. This is optional, if not specified trackers are\n-assumed to be part of tier 0, or whichever the last tier was as\n-iterating over the trackers.
    \n+[report issue]
    \n+
    info_hashes
    \n+
    The info-hash of the torrent that was just deleted. Most of\n+the time the torrent_handle in the torrent_alert will be invalid by the time\n+this alert arrives, since the torrent is being deleted. The info_hashes member\n+is hence the main way of identifying which torrent just completed the delete.
    \n
    \n-[report issue]
    \n-
    dht_nodes
    \n-
    a list of hostname and port pairs, representing DHT nodes to be added\n-to the session (if DHT is enabled). The hostname may be an IP address.
    \n+[report issue]
    \n+
    \n+

    torrent_delete_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a request to delete the files of a torrent fails.\n+Just removing a torrent from the session cannot fail

    \n+
    \n+struct torrent_delete_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage\n+   | alert_category::error;\n+   error_code const error;\n+   info_hash_t info_hashes;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    tells you why it failed.
    \n
    \n-[report issue]
    \n-
    name
    \n-
    in case there's no other name in this torrent, this name will be used.\n-The name out of the torrent_info object takes precedence if available.
    \n+[report issue]
    \n+
    info_hashes
    \n+
    the info hash of the torrent whose files failed to be deleted
    \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+[report issue]
    \n+
    \n+

    save_resume_data_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated as a response to a torrent_handle::save_resume_data request.\n+It is generated once the disk IO thread is done writing the state for this torrent.

    \n+
    \n+struct save_resume_data_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   add_torrent_params params;\n+};\n+
    \n+[report issue]
    \n+
    params
    \n+

    the params object is populated with the torrent file whose resume\n+data was saved. It is suitable to be:

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

    save_resume_data_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated instead of save_resume_data_alert if there was an error\n+generating the resume data. error describes what went wrong.

    \n+
    \n+struct save_resume_data_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage\n+   | alert_category::error;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    the error code from the resume_data failure
    \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+[report issue]
    \n+
    \n+

    torrent_paused_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated as a response to a torrent_handle::pause request. It is\n+generated once all disk IO is complete and the files in the torrent have been closed.\n+This is useful for synchronizing with the disk.

    \n+
    \n+struct torrent_paused_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    torrent_resumed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated as a response to a torrent_handle::resume() request. It is\n+generated when a torrent goes from a paused state to an active state.

    \n+
    \n+struct torrent_resumed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    torrent_checked_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when a torrent completes checking. i.e. when it transitions\n+out of the checking files state into a state where it is ready to start downloading

    \n+
    \n+struct torrent_checked_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    url_seed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a HTTP seed name lookup fails.

    \n+
    \n+struct url_seed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+   char const* server_url () const;\n+   char const* error_message () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer | alert_category::error;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+

    server_url()

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

    the URL the error is associated with

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

    error_message()

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

    in case the web server sent an error message, this function returns\n+it.

    \n+[report issue]
    \n+
    error
    \n+
    the error the web seed encountered. If this is not set, the server\n+sent an error message, call error_message().
    \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+[report issue]
    \n+
    \n+
    \n+

    file_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    If the storage fails to read or write files that it needs access to, this alert is\n+generated and the torrent is paused.

    \n+
    \n+struct file_error_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+   char const* filename () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status\n+   | alert_category::storage;\n+   error_code const error;\n+   operation_t op;\n+};\n+
    \n+[report issue]
    \n+

    filename()

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

    the file that experienced the error

    \n+[report issue]
    \n+
    error
    \n+
    the error code describing the error.
    \n
    \n-[report issue]
    \n-
    trackerid
    \n-
    the default tracker id to be used when announcing to trackers. By\n-default this is empty, and no tracker ID is used, since this is an\n-optional argument. If a tracker returns a tracker ID, that ID is used\n-instead of this.
    \n+[report issue]
    \n+
    op
    \n+
    indicates which underlying operation caused the error
    \n
    \n-[report issue]
    \n-
    flags
    \n-

    flags controlling aspects of this torrent and how it's added. See\n-torrent_flags_t for details.

    \n-
    \n-

    Note

    \n-

    The flags field is initialized with default flags by the\n-constructor. In order to preserve default behavior when clearing or\n-setting other flags, make sure to bitwise OR or in a flag or bitwise\n-AND the inverse of a flag to clear it.

    \n+[report issue]
    \n
    \n-\n-\n-[report issue]
    \n-
    info_hashes
    \n-
    set this to the info hash of the torrent to add in case the info-hash\n-is the only known property of the torrent. i.e. you don't have a\n-.torrent file nor a magnet link.\n-To add a magnet link, use parse_magnet_uri() to populate fields in the\n-add_torrent_params object.
    \n+
    \n+

    metadata_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when the metadata has been completely received and the info-hash\n+failed to match it. i.e. the metadata that was received was corrupt. libtorrent will\n+automatically retry to fetch it in this case. This is only relevant when running a\n+torrent-less download, with the metadata extension provided by libtorrent.

    \n+
    \n+struct metadata_failed_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    indicates what failed when parsing the metadata. This error is\n+what's returned from lazy_bdecode().
    \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+[report issue]
    \n+
    \n+

    metadata_received_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when the metadata has been completely received and the torrent\n+can start downloading. It is not generated on torrents that are started with metadata, but\n+only those that needs to download it from peers (when utilizing the libtorrent extension).

    \n+

    There are no additional data members in this alert.

    \n+

    Typically, when receiving this alert, you would want to save the torrent file in order\n+to load it back up again when the session is restarted. Here's an example snippet of\n+code to do that:

    \n+
    \n+torrent_handle h = alert->handle();\n+std::shared_ptr<torrent_info const> ti = h.torrent_file();\n+create_torrent ct(*ti);\n+entry te = ct.generate();\n+std::vector<char> buffer;\n+bencode(std::back_inserter(buffer), te);\n+FILE* f = fopen((to_hex(ti->info_hashes().get_best().to_string()) + ".torrent").c_str(), "wb+");\n+if (f) {\n+        fwrite(&buffer[0], 1, buffer.size(), f);\n+        fclose(f);\n+}\n+
    \n+
    \n+struct metadata_received_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    udp_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when there is an error on a UDP socket. The\n+UDP sockets are used for all uTP, DHT and UDP tracker traffic. They are\n+global to the session.

    \n+
    \n+struct udp_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   aux::noexcept_movable<udp::endpoint> endpoint;\n+   operation_t operation;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    endpoint
    \n+
    the source address associated with the error (if any)
    \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+[report issue]
    \n+
    operation
    \n+
    the operation that failed
    \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+[report issue]
    \n+
    error
    \n+
    the error code describing the error
    \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+[report issue]
    \n+
    \n+

    external_ip_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    Whenever libtorrent learns about the machines external IP, this alert is\n+generated. The external IP address can be acquired from the tracker (if it\n+supports that) or from peers that supports the extension protocol.\n+The address can be accessed through the external_address member.

    \n+
    \n+struct external_ip_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   aux::noexcept_movable<address> external_address;\n+};\n+
    \n+[report issue]
    \n+
    external_address
    \n+
    the IP address that is believed to be our external IP
    \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+[report issue]
    \n+
    \n+

    listen_failed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when none of the ports, given in the port range, to\n+session can be opened for listening. The listen_interface member is the\n+interface that failed, error is the error code describing the failure.

    \n+

    In the case an endpoint was created before generating the alert, it is\n+represented by address and port. The combinations of socket type\n+and operation in which such address and port are not valid are:\n+accept - i2p\n+accept - socks5\n+enum_if - tcp

    \n+

    libtorrent may sometimes try to listen on port 0, if all other ports failed.\n+Port 0 asks the operating system to pick a port that's free). If that fails\n+you may see a listen_failed_alert with port 0 even if you didn't ask to\n+listen on it.

    \n+
    \n+struct listen_failed_alert final : alert\n+{\n+   std::string message () const override;\n+   char const* listen_interface () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status | alert_category::error;\n+   error_code const error;\n+   operation_t op;\n+   lt::socket_type_t const socket_type;\n+   aux::noexcept_movable<lt::address> address;\n+   int const port;\n+};\n+
    \n+[report issue]
    \n+

    listen_interface()

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

    the network device libtorrent attempted to listen on, or the IP address

    \n+[report issue]
    \n+
    error
    \n+
    the error the system returned
    \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+[report issue]
    \n+
    op
    \n+
    the underlying operation that failed
    \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+[report issue]
    \n+
    socket_type
    \n+
    the type of listen socket this alert refers to.
    \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+[report issue]
    \n+
    address
    \n+
    the address libtorrent attempted to listen on\n+see alert documentation for validity of this value
    \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+[report issue]
    \n+
    port
    \n+
    the port libtorrent attempted to listen on\n+see alert documentation for validity of this value
    \n
    \n-[report issue]
    \n-
    banned_peers
    \n-
    peers banned from this torrent. The will not be connected to
    \n+[report issue]
    \n+
    \n+
    \n+

    listen_succeeded_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when the listen port succeeds to be opened on a\n+particular interface. address and port is the endpoint that\n+successfully was opened for listening.

    \n+
    \n+struct listen_succeeded_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   aux::noexcept_movable<lt::address> address;\n+   int const port;\n+   lt::socket_type_t const socket_type;\n+};\n+
    \n+[report issue]
    \n+
    address
    \n+
    the address libtorrent ended up listening on. This address\n+refers to the local interface.
    \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+[report issue]
    \n+
    port
    \n+
    the port libtorrent ended up listening on.
    \n
    \n-[report issue]
    \n-
    have_pieces
    \n-
    this is a bitfield indicating which pieces we already have of this\n-torrent.
    \n+[report issue]
    \n+
    socket_type
    \n+
    the type of listen socket this alert refers to.
    \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+[report issue]
    \n+
    \n+

    portmap_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a NAT router was successfully found but some\n+part of the port mapping request failed. It contains a text message that\n+may help the user figure out what is wrong. This alert is not generated in\n+case it appears the client is not running on a NAT:ed network or if it\n+appears there is no NAT router that can be remote controlled to add port\n+mappings.

    \n+
    \n+struct portmap_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::port_mapping\n+   | alert_category::error;\n+   port_mapping_t const mapping;\n+   portmap_transport map_transport;\n+   aux::noexcept_movable<address> local_address;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    mapping
    \n+
    refers to the mapping index of the port map that failed, i.e.\n+the index returned from add_mapping().
    \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+[report issue]
    \n+
    map_transport
    \n+
    UPnP or NAT-PMP
    \n
    \n-[report issue]
    \n-
    merkle_trees
    \n-
    v2 hashes, if known
    \n+[report issue]
    \n+
    local_address
    \n+
    the local network the port mapper is running on
    \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+
    error
    \n+
    tells you what failed.
    \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+
    \n+

    portmap_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a NAT router was successfully found and\n+a port was successfully mapped on it. On a NAT:ed network with a NAT-PMP\n+capable router, this is typically generated once when mapping the TCP\n+port and, if DHT is enabled, when the UDP port is mapped.

    \n+
    \n+struct portmap_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::port_mapping;\n+   port_mapping_t const mapping;\n+   int const external_port;\n+   portmap_protocol const map_protocol;\n+   portmap_transport const map_transport;\n+   aux::noexcept_movable<address> local_address;\n+};\n+
    \n+[report issue]
    \n+
    mapping
    \n+
    refers to the mapping index of the port map that failed, i.e.\n+the index returned from add_mapping().
    \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+
    external_port
    \n+
    the external port allocated for the mapping.
    \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+
    local_address
    \n+
    the local network the port mapper is running on
    \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+[report issue]
    \n+
    \n+

    portmap_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated to log informational events related to either\n+UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP\n+and 1 = UPnP). Displaying these messages to an end user is only useful\n+for debugging the UPnP or NAT-PMP implementation. This alert is only\n+posted if the alert_category::port_mapping_log flag is enabled in\n+the alert mask.

    \n
    \n-struct client_data_t\n+struct portmap_log_alert final : alert\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 const*) = delete;\n-   operator void* () const = delete;\n-   client_data_t& operator= (void*) = delete;\n+   std::string message () const override;\n+   char const* log_message () const;\n \n-   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n+   static constexpr alert_category_t static_category  = alert_category::port_mapping_log;\n+   portmap_transport const map_transport;\n+   aux::noexcept_movable<address> local_address;\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*() const*() operator=()

    \n+[report issue]
    \n+

    log_message()

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

    we don't allow type-unsafe operations

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

    the message associated with this log line

    \n+[report issue]
    \n+
    local_address
    \n+
    the local network the port mapper is running on
    \n+
    \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+

    fastresume_rejected_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a fast resume file has been passed to\n+add_torrent() but the files on disk did not match the fast resume file.\n+The error_code explains the reason why the resume file was rejected.

    \n
    \n-struct open_file_state\n+struct fastresume_rejected_alert final : torrent_alert\n {\n-   file_index_t file_index;\n-   file_open_mode_t open_mode;\n-   time_point last_use;\n+   std::string message () const override;\n+   char const* file_path () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status\n+   | alert_category::error;\n+   error_code error;\n+   operation_t op;\n };\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+[report issue]
    \n+

    file_path()

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

    If the error happened to a specific file, this returns the path to it.

    \n+[report issue]
    \n+
    op
    \n+
    the underlying operation that failed
    \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+
    \n+

    peer_blocked_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when an incoming peer connection, or a peer that's about to be added\n+to our peer list, is blocked for some reason. This could be any of:

    \n+
      \n+
    • the IP filter
    • \n+
    • i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)
    • \n+
    • the port filter
    • \n+
    • the peer has a low port and no_connect_privileged_ports is enabled
    • \n+
    • the protocol of the peer is blocked (uTP/TCP blocking)
    • \n+
    \n
    \n-struct disk_interface\n+struct peer_blocked_alert final : peer_alert\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_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+   std::string message () const override;\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+   enum reason_t\n+   {\n+      ip_filter,\n+      port_filter,\n+      i2p_mixed,\n+      privileged_ports,\n+      utp_disabled,\n+      tcp_disabled,\n+      invalid_local_interface,\n+      ssrf_mitigation,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::ip_block;\n+   int const reason;\n };\n 
    \n-[report issue]
    \n-

    new_torrent()

    \n+[report issue]
    \n+

    enum reason_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    ip_filter0 
    port_filter1 
    i2p_mixed2 
    privileged_ports3 
    utp_disabled4 
    tcp_disabled5 
    invalid_local_interface6 
    ssrf_mitigation7 
    \n+[report issue]
    \n+
    reason
    \n+
    the reason for the peer being blocked. Is one of the values from the\n+reason_t enum.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    dht_announce_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a DHT node announces to an info-hash on our\n+DHT node. It belongs to the alert_category::dht category.

    \n
    \n-virtual storage_holder new_torrent (storage_params const& p\n-      , std::shared_ptr<void> const& torrent) = 0;\n+struct dht_announce_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   aux::noexcept_movable<address> ip;\n+   int port;\n+   sha1_hash info_hash;\n+};\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+[report issue]
    \n+
    \n+

    dht_get_peers_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when a DHT node sends a get_peers message to\n+our DHT node. It belongs to the alert_category::dht category.

    \n
    \n-virtual void remove_torrent (storage_index_t) = 0;\n+struct dht_get_peers_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash info_hash;\n+};\n 
    \n-

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

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

    async_read() async_write()

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

    cache_flushed_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when the disk cache has been flushed for a specific\n+torrent as a result of a call to torrent_handle::flush_cache(). This\n+alert belongs to the alert_category::storage category, which must be\n+enabled to let this alert through. The alert is also posted when removing\n+a torrent from the session, once the outstanding cache flush is complete\n+and the torrent does no longer have any files open.

    \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+struct cache_flushed_alert final : torrent_alert\n+{\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+};\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+
    \n+

    lsd_peer_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when we receive a local service discovery message\n+from a peer for a torrent we're currently participating in.

    \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+struct lsd_peer_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+};\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+[report issue]
    \n+
    \n+

    trackerid_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted whenever a tracker responds with a trackerid.\n+The tracker ID is like a cookie. libtorrent will store the tracker ID\n+for this tracker and repeat it in subsequent announces.

    \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+struct trackerid_alert final : tracker_alert\n+{\n+   std::string message () const override;\n+   char const* tracker_id () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\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+[report issue]
    \n+

    tracker_id()

    \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+char const* tracker_id () 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+

    The tracker ID returned by the tracker

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

    dht_bootstrap_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when the initial DHT bootstrap is done.

    \n
    \n-virtual void async_release_files (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+struct dht_bootstrap_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+};\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+[report issue]
    \n+
    \n+

    torrent_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is posted whenever a torrent is transitioned into the error state.\n+If the error code is duplicate_torrent (error_code_enum) error, it suggests two magnet\n+links ended up resolving to the same hybrid torrent. For more details,\n+see BitTorrent v2 torrents.

    \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+struct torrent_error_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+   char const* filename () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error | alert_category::status;\n+   error_code const error;\n+};\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+[report issue]
    \n+

    filename()

    \n
    \n-virtual void async_stop_torrent (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+char const* filename () const;\n 
    \n-

    This is called when a torrent is stopped. It gives the disk I/O\n-object an opportunity to flush any data to disk that's currently kept\n-cached. This function should at least do the same thing as\n-async_release_files().

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

    async_rename_file()

    \n+

    the filename (or object) the error occurred on.

    \n+[report issue]
    \n+
    error
    \n+
    specifies which error the torrent encountered.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    torrent_need_cert_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is always posted for SSL torrents. This is a reminder to the client that\n+the torrent won't work unless torrent_handle::set_ssl_certificate() is called with\n+a valid certificate. Valid certificates MUST be signed by the SSL certificate\n+in the .torrent 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+struct torrent_need_cert_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+};\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+[report issue]
    \n+
    \n+

    incoming_connection_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The incoming connection alert is posted every time we successfully accept\n+an incoming connection, through any mean. The most straight-forward ways\n+of accepting incoming connections are through the TCP listen socket and\n+the UDP listen socket for uTP sockets. However, connections may also be\n+accepted through a Socks5 or i2p listen socket, or via an SSL listen\n+socket.

    \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+struct incoming_connection_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer;\n+   socket_type_t socket_type;\n+   aux::noexcept_movable<tcp::endpoint> endpoint;\n+};\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+[report issue]
    \n+
    socket_type
    \n+
    tells you what kind of socket the connection was accepted
    \n+
    \n+[report issue]
    \n+
    endpoint
    \n+
    is the IP address and port the connection came from.
    \n+
    \n+[report issue]
    \n+
    \n+

    add_torrent_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is always posted when a torrent was attempted to be added\n+and contains the return status of the add operation. The torrent handle of the new\n+torrent can be found as the handle member in the base class. If adding\n+the torrent failed, error contains the error code.

    \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+struct add_torrent_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   add_torrent_params params;\n+   error_code error;\n+};\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+[report issue]
    \n+
    params
    \n+

    This contains copies of the most important fields from the original\n+add_torrent_params object, passed to add_torrent() or\n+async_add_torrent(). Specifically, these fields are copied:

    \n+
      \n+
    • version
    • \n+
    • ti
    • \n+
    • name
    • \n+
    • save_path
    • \n+
    • userdata
    • \n+
    • tracker_id
    • \n+
    • flags
    • \n+
    • info_hash
    • \n+
    \n+

    the info_hash field will be updated with the info-hash of the torrent\n+specified by ti.

    \n+
    \n+
    \n+[report issue]
    \n+
    error
    \n+
    set to the error, if one occurred while adding the torrent.
    \n+
    \n+[report issue]
    \n+
    \n+

    state_update_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is only posted when requested by the user, by calling\n+session::post_torrent_updates() on the session. It contains the torrent\n+status of all torrents that changed since last time this message was\n+posted. Its category is alert_category::status, but it's not subject to\n+filtering, since it's only manually posted anyway.

    \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+struct state_update_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<torrent_status> status;\n+};\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+[report issue]
    \n+
    status
    \n+
    contains the torrent status of all torrents that changed since last\n+time this message was posted. Note that you can map a torrent status\n+to a specific torrent via its handle member. The receiving end is\n+suggested to have all torrents sorted by the torrent_handle or hashed\n+by it, for efficient updates.
    \n+
    \n+[report issue]
    \n+
    \n+

    session_stats_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The session_stats_alert is posted when the user requests session statistics by\n+calling post_session_stats() on the session object. This alert does not\n+have a category, since it's only posted in response to an API call. It\n+is not subject to the alert_mask filter.

    \n+

    the message() member function returns a string representation of the values that\n+properly match the line returned in session_stats_header_alert::message().

    \n+

    this specific output is parsed by tools/parse_session_stats.py\n+if this is changed, that parser should also be changed

    \n
    \n-virtual void update_stats_counters (counters& c) const = 0;\n+struct session_stats_alert final : alert\n+{\n+   std::string message () const override;\n+   span<std::int64_t const> counters () const;\n+\n+   static constexpr alert_category_t static_category  = {};\n+};\n 
    \n-

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

    counters()

    \n
    \n-virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n+span<std::int64_t const> counters () const;\n 
    \n-

    Return a list of all the files that are currently open for the\n-specified storage/torrent. This is is just used for the client to\n-query the currently open files, and which modes those files are open\n-in.

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

    abort()

    \n+

    An array are a mix of counters and gauges, which meanings can be\n+queries via the session_stats_metrics() function on the session. The\n+mapping from a specific metric to an index into this array is constant\n+for a specific version of libtorrent, but may differ for other\n+versions. The intended usage is to request the mapping, i.e. call\n+session_stats_metrics(), once on startup, and then use that mapping to\n+interpret these values throughout the process' runtime.

    \n+

    For more information, see the session statistics section.

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

    dht_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when something fails in the DHT. This is not necessarily a fatal\n+error, but it could prevent proper operation

    \n
    \n-virtual void abort (bool wait) = 0;\n+struct dht_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error | alert_category::dht;\n+   error_code error;\n+   operation_t op;\n+};\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+[report issue]
    \n+
    error
    \n+
    the error code
    \n+
    \n+[report issue]
    \n+
    op
    \n+
    the operation that failed
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_immutable_item_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted as a response to a call to session::get_item(),\n+specifically the overload for looking up immutable items in the DHT.

    \n
    \n-virtual void submit_jobs () = 0;\n+struct dht_immutable_item_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash target;\n+   entry item;\n+};\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+[report issue]
    \n+
    target
    \n+
    the target hash of the immutable item. This must\n+match the SHA-1 hash of the bencoded form of item.
    \n+
    \n+[report issue]
    \n+
    item
    \n+
    the data for this item
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_mutable_item_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted as a response to a call to session::get_item(),\n+specifically the overload for looking up mutable items in the DHT.

    \n
    \n-virtual void settings_updated () = 0;\n+struct dht_mutable_item_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   std::array<char, 32> key;\n+   std::array<char, 64> signature;\n+   std::int64_t seq;\n+   std::string salt;\n+   entry item;\n+   bool authoritative;\n+};\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+[report issue]
    \n+
    key
    \n+
    the public key that was looked up
    \n
    \n-[report issue]
    \n-
    sequential_access
    \n-
    hint that there may be more disk operations with sequential access to\n-the file
    \n+[report issue]
    \n+
    signature
    \n+
    the signature of the data. This is not the signature of the\n+plain encoded form of the item, but it includes the sequence number\n+and possibly the hash as well. See the dht_store document for more\n+information. This is primarily useful for echoing back in a store\n+request.
    \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+[report issue]
    \n+
    seq
    \n+
    the sequence number of this item
    \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+[report issue]
    \n+
    salt
    \n+
    the salt, if any, used to lookup and store this item. If no\n+salt was used, this is an empty string
    \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+[report issue]
    \n+
    item
    \n+
    the data for this item
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    storage_holder

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-

    a unique, owning, reference to the storage of a torrent in a disk io\n-subsystem (class that implements disk_interface). This is held by the\n-internal libtorrent torrent object to tie the storage object allocated\n-for a torrent to the lifetime of the internal torrent object. When a\n-torrent is removed from the session, this holder is destructed and will\n-inform the disk object.

    \n-
    \n-struct storage_holder\n-{\n-   storage_holder () = 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+[report issue]
    \n+
    authoritative
    \n+
    the last response for mutable data is authoritative.
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_put_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this is posted when a DHT put operation completes. This is useful if the\n+client is waiting for a put to complete before shutting down for instance.

    \n
    \n-struct settings_interface\n+struct dht_put_alert final : alert\n {\n-   virtual void set_str (int name, std::string val) = 0;\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 int get_int (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+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash target;\n+   std::array<char, 32> public_key;\n+   std::array<char, 64> signature;\n+   std::string salt;\n+   std::int64_t seq;\n+   int num_success;\n };\n 
    \n-[report issue]
    \n-
    \n-

    disk_observer

    \n-

    Declared in "libtorrent/disk_observer.hpp"

    \n+[report issue]
    \n+
    target
    \n+
    the target hash the item was stored under if this was an immutable\n+item.
    \n+
    \n+\n+\n+\n+[report issue]
    \n+
    public_key signature salt seq
    \n+
    if a mutable item was stored, these are the public key, signature,\n+salt and sequence number the item was stored under.
    \n+
    \n+[report issue]
    \n+
    num_success
    \n+
    DHT put operation usually writes item to k nodes, maybe the node\n+is stale so no response, or the node doesn't support 'put', or the\n+token for write is out of date, etc. num_success is the number of\n+successful responses we got from the puts.
    \n+
    \n+[report issue]
    \n+
    \n+

    i2p_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is used to report errors in the i2p SAM connection

    \n
    \n-struct disk_observer\n+struct i2p_alert final : alert\n {\n-   virtual void on_disk () = 0;\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code error;\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-

    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+[report issue]
    \n+
    error
    \n+
    the error that occurred in the i2p SAM connection
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_outgoing_get_peers_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is generated when we send a get_peers request\n+It belongs to the alert_category::dht category.

    \n
    \n-struct buffer_allocator_interface\n+struct dht_outgoing_get_peers_alert final : alert\n {\n-   virtual void free_disk_buffer (char* b) = 0;\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash info_hash;\n+   sha1_hash obfuscated_info_hash;\n+   aux::noexcept_movable<udp::endpoint> endpoint;\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+[report issue]
    \n+
    info_hash
    \n+
    the info_hash of the torrent we're looking for peers for.
    \n+
    \n+[report issue]
    \n+
    obfuscated_info_hash
    \n+
    if this was an obfuscated lookup, this is the info-hash target\n+actually sent to the node.
    \n+
    \n+[report issue]
    \n+
    endpoint
    \n+
    the endpoint we're sending this query to
    \n+
    \n+[report issue]
    \n+
    \n+

    log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted by some session wide event. Its main purpose is\n+trouble shooting and debugging. It's not enabled by the default alert\n+mask and is enabled by the alert_category::session_log bit.\n+Furthermore, it's by default disabled as a build configuration.

    \n
    \n-struct disk_buffer_holder\n+struct log_alert final : alert\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+   std::string message () const override;\n+   char const* log_message () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::session_log;\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+[report issue]
    \n+

    log_message()

    \n
    \n-disk_buffer_holder () noexcept = default;\n+char const* log_message () const;\n 
    \n-

    default construct a holder that does not own any buffer

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

    ~disk_buffer_holder()

    \n+

    returns the log message

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

    torrent_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted by torrent wide events. It's meant to be used for\n+trouble shooting and debugging. It's not enabled by the default alert\n+mask and is enabled by the alert_category::torrent_log bit. By\n+default it is disabled as a build configuration.

    \n
    \n-~disk_buffer_holder ();\n+struct torrent_log_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+   char const* log_message () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::torrent_log;\n+};\n 
    \n-

    frees disk buffer held by this object

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

    data()

    \n+[report issue]
    \n+

    log_message()

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

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

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

    reset()

    \n+

    returns the log message

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

    peer_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted by events specific to a peer. It's meant to be used\n+for trouble shooting and debugging. It's not enabled by the default alert\n+mask and is enabled by the alert_category::peer_log bit. By\n+default it is disabled as a build configuration.

    \n
    \n-void reset ();\n+struct peer_log_alert final : peer_alert\n+{\n+   std::string message () const override;\n+   char const* log_message () const;\n+\n+   enum direction_t\n+   {\n+      incoming_message,\n+      outgoing_message,\n+      incoming,\n+      outgoing,\n+      info,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::peer_log;\n+   char const* event_type;\n+   direction_t direction;\n+};\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+[report issue]
    \n+

    log_message()

    \n
    \n-void swap (disk_buffer_holder& h) noexcept;\n+char const* log_message () const;\n 
    \n-

    swap pointers of two disk buffer holders.

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

    is_mutable()

    \n+

    returns the log message

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

    enum direction_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    incoming_message0 
    outgoing_message1 
    incoming2 
    outgoing3 
    info4 
    \n+[report issue]
    \n+
    event_type
    \n+
    string literal indicating the kind of event. For messages, this is the\n+message name.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    lsd_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted if the local service discovery socket fails to start properly.\n+it's categorized as alert_category::error.

    \n
    \n-bool is_mutable () const noexcept;\n+struct lsd_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   aux::noexcept_movable<address> local_address;\n+   error_code error;\n+};\n 
    \n-

    if this returns true, the buffer may not be modified in place

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

    bool()

    \n+[report issue]
    \n+
    local_address
    \n+
    the local network the corresponding local service discovery is running\n+on
    \n+
    \n+[report issue]
    \n+
    error
    \n+
    The error code
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_lookup

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    holds statistics about a current dht_lookup operation.\n+a DHT lookup is the traversal of nodes, looking up a\n+set of target nodes in the DHT for retrieving and possibly\n+storing information in the DHT

    \n
    \n-explicit operator bool () const noexcept;\n+struct dht_lookup\n+{\n+   char const* type;\n+   int outstanding_requests;\n+   int timeouts;\n+   int responses;\n+   int branch_factor;\n+   int nodes_left;\n+   int last_sent;\n+   int first_timeout;\n+   sha1_hash target;\n+};\n 
    \n-

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

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

    file_open_mode_t

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-
    \n-
    read_only
    \n-
    open the file for reading only
    \n+[report issue]
    \n+
    type
    \n+
    string literal indicating which kind of lookup this is
    \n
    \n-
    \n-
    write_only
    \n-
    open the file for writing only
    \n+[report issue]
    \n+
    outstanding_requests
    \n+
    the number of outstanding request to individual nodes\n+this lookup has right now
    \n
    \n-
    \n-
    read_write
    \n-
    open the file for reading and writing
    \n+[report issue]
    \n+
    timeouts
    \n+
    the total number of requests that have timed out so far\n+for this lookup
    \n
    \n-
    \n-
    rw_mask
    \n-
    the mask for the bits determining read or write mode
    \n+[report issue]
    \n+
    responses
    \n+
    the total number of responses we have received for this\n+lookup so far for this lookup
    \n
    \n-
    \n-
    sparse
    \n-
    open the file in sparse mode (if supported by the\n-filesystem).
    \n+[report issue]
    \n+
    branch_factor
    \n+
    the branch factor for this lookup. This is the number of\n+nodes we keep outstanding requests to in parallel by default.\n+when nodes time out we may increase this.
    \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+[report issue]
    \n+
    nodes_left
    \n+
    the number of nodes left that could be queries for this\n+lookup. Many of these are likely to be part of the trail\n+while performing the lookup and would never end up actually\n+being queried.
    \n
    \n-
    \n-
    random_access
    \n-
    open the file for random access. This disables read-ahead\n-logic
    \n+[report issue]
    \n+
    last_sent
    \n+
    the number of seconds ago the\n+last message was sent that's still\n+outstanding
    \n
    \n-
    \n-
    mmapped
    \n-
    the file is memory mapped
    \n+[report issue]
    \n+
    first_timeout
    \n+
    the number of outstanding requests\n+that have exceeded the short timeout\n+and are considered timed out in the\n+sense that they increased the branch\n+factor
    \n
    \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+[report issue]
    \n+
    target
    \n+
    the node-id or info-hash target for this lookup
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_stats_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    contains current DHT state. Posted in response to session::post_dht_stats().

    \n
    \n-struct web_seed_entry\n+struct dht_stats_alert final : alert\n {\n-   bool operator== (web_seed_entry const& e) const;\n-   bool operator< (web_seed_entry const& e) const;\n+   std::string message () const override;\n \n-   enum type_t\n-   {\n-      url_seed,\n-      http_seed,\n-   };\n+   static constexpr alert_category_t static_category  = {};\n+   std::vector<dht_lookup> active_requests;\n+   std::vector<dht_routing_bucket> routing_table;\n+   sha1_hash nid;\n+   aux::noexcept_movable<udp::endpoint> local_endpoint;\n+};\n+
    \n+[report issue]
    \n+
    active_requests
    \n+
    a vector of the currently running DHT lookups.
    \n+
    \n+[report issue]
    \n+
    routing_table
    \n+
    contains information about every bucket in the DHT routing\n+table.
    \n+
    \n+[report issue]
    \n+
    nid
    \n+
    the node ID of the DHT node instance
    \n+
    \n+[report issue]
    \n+
    local_endpoint
    \n+
    the local socket this DHT node is running on
    \n+
    \n+[report issue]
    \n+
    \n+

    incoming_request_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted every time an incoming request from a peer is accepted and queued\n+up for being serviced. This alert is only posted if\n+the alert_category::incoming_request flag is enabled in the alert\n+mask.

    \n+
    \n+struct incoming_request_alert final : peer_alert\n+{\n+   std::string message () const override;\n \n-   std::string url;\n-   std::string auth;\n-   headers_t extra_headers;\n-   std::uint8_t type;\n+   static constexpr alert_category_t static_category  = alert_category::incoming_request;\n+   peer_request req;\n };\n 
    \n-[report issue]
    \n-

    operator==()

    \n+[report issue]
    \n+
    req
    \n+
    the request this peer sent to us
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    debug logging of the DHT when alert_category::dht_log is set in the alert\n+mask.

    \n
    \n-bool operator== (web_seed_entry const& e) const;\n+struct dht_log_alert final : alert\n+{\n+   std::string message () const override;\n+   char const* log_message () const;\n+\n+   enum dht_module_t\n+   {\n+      tracker,\n+      node,\n+      routing_table,\n+      rpc_manager,\n+      traversal,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_log;\n+   dht_module_t module;\n+};\n 
    \n-

    URL and type comparison

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

    operator<()

    \n+[report issue]
    \n+

    log_message()

    \n
    \n-bool operator< (web_seed_entry const& e) const;\n+char const* log_message () 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+

    the log message

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

    enum dht_module_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n
    namevaluedescription
    url_seed
    tracker0 
    http_seed
    node1 
    routing_table2 
    rpc_manager3 
    traversal4 
    \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+[report issue]
    \n+
    module
    \n+
    the module, or part, of the DHT that produced this log message.
    \n
    \n-[report issue]
    \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+

    dht_pkt_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted every time a DHT message is sent or received. It is\n+only posted if the alert_category::dht_log alert category is\n+enabled. It contains a verbatim copy of the message.

    \n
    \n-struct load_torrent_limits\n+struct dht_pkt_alert final : alert\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+   std::string message () const override;\n+   span<char const> pkt_buf () const;\n+\n+   enum direction_t\n+   {\n+      incoming,\n+      outgoing,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_log;\n+   direction_t direction;\n+   aux::noexcept_movable<udp::endpoint> node;\n };\n 
    \n-[report issue]
    \n-
    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+[report issue]
    \n+

    pkt_buf()

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

    returns a pointer to the packet buffer and size of the packet,\n+respectively. This buffer is only valid for as long as the alert itself\n+is valid, which is owned by libtorrent and reclaimed whenever\n+pop_alerts() is called on the session.

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

    enum direction_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    incoming0 
    outgoing1 
    \n+[report issue]
    \n+
    direction
    \n+
    whether this is an incoming or outgoing packet.
    \n
    \n-[report issue]
    \n-
    max_decode_tokens
    \n-
    the max number of bdecode tokens
    \n+[report issue]
    \n+
    node
    \n+
    the DHT node we received this packet from, or sent this packet to\n+(depending on direction).
    \n
    \n-[report issue]
    \n-
    \n-

    torrent_info

    \n-

    Declared in "libtorrent/torrent_info.hpp"

    \n-

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

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

    dht_get_peers_reply_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    Posted when we receive a response to a DHT get_peers request.

    \n
    \n-class torrent_info\n+struct dht_get_peers_reply_alert final : alert\n {\n-   explicit torrent_info (bdecode_node const& torrent_file);\n-   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-   torrent_info (std::string const& filename, error_code& ec);\n-   explicit torrent_info (span<char const> buffer, from_span_t);\n-   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-   torrent_info (char const* buffer, int size);\n-   explicit torrent_info (info_hash_t const& info_hash);\n-   explicit torrent_info (std::string const& filename);\n-   torrent_info (bdecode_node const& torrent_file, error_code& ec);\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 (torrent_info const& t);\n-   ~torrent_info ();\n-   file_storage const& orig_files () const;\n-   file_storage const& files () const;\n-   void rename_file (file_index_t index, std::string const& new_filename);\n-   void remap_files (file_storage const& f);\n-   void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-   void clear_trackers ();\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-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   std::vector<web_seed_entry> const& web_seeds () const;\n-   void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   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::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-   index_range<piece_index_t> piece_range () const;\n-   piece_index_t last_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+   std::string message () const override;\n+   int num_peers () const;\n+   std::vector<tcp::endpoint> peers () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n+   sha1_hash info_hash;\n };\n 
    \n-[report issue]
    \n-

    torrent_info()

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

    dht_direct_response_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is posted exactly once for every call to session_handle::dht_direct_request.\n+If the request failed, response() will return a default constructed bdecode_node.

    \n
    \n-explicit torrent_info (bdecode_node const& torrent_file);\n-torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-torrent_info (std::string const& filename, error_code& ec);\n-explicit torrent_info (span<char const> buffer, from_span_t);\n-torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-torrent_info (char const* buffer, int size);\n-explicit torrent_info (info_hash_t const& info_hash);\n-explicit torrent_info (std::string const& filename);\n-torrent_info (bdecode_node const& torrent_file, error_code& ec);\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 (torrent_info const& t);\n+struct dht_direct_response_alert final : alert\n+{\n+   std::string message () const override;\n+   bdecode_node response () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   client_data_t userdata;\n+   aux::noexcept_movable<udp::endpoint> endpoint;\n+};\n 
    \n-

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

    picker_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this is posted when one or more blocks are picked by the piece picker,\n+assuming the verbose piece picker logging is enabled (see\n+alert_category::picker_log).

    \n
    \n-~torrent_info ();\n+struct picker_log_alert final : peer_alert\n+{\n+   std::string message () const override;\n+   std::vector<piece_block> blocks () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::picker_log;\n+   static constexpr picker_flags_t partial_ratio  = 0_bit;\n+   static constexpr picker_flags_t prioritize_partials  = 1_bit;\n+   static constexpr picker_flags_t rarest_first_partials  = 2_bit;\n+   static constexpr picker_flags_t rarest_first  = 3_bit;\n+   static constexpr picker_flags_t reverse_rarest_first  = 4_bit;\n+   static constexpr picker_flags_t suggested_pieces  = 5_bit;\n+   static constexpr picker_flags_t prio_sequential_pieces  = 6_bit;\n+   static constexpr picker_flags_t sequential_pieces  = 7_bit;\n+   static constexpr picker_flags_t reverse_pieces  = 8_bit;\n+   static constexpr picker_flags_t time_critical  = 9_bit;\n+   static constexpr picker_flags_t random_pieces  = 10_bit;\n+   static constexpr picker_flags_t prefer_contiguous  = 11_bit;\n+   static constexpr picker_flags_t reverse_sequential  = 12_bit;\n+   static constexpr picker_flags_t backup1  = 13_bit;\n+   static constexpr picker_flags_t backup2  = 14_bit;\n+   static constexpr picker_flags_t end_game  = 15_bit;\n+   static constexpr picker_flags_t extent_affinity  = 16_bit;\n+   picker_flags_t const picker_flags;\n+};\n 
    \n-

    frees all storage associated with this torrent_info object

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

    files() orig_files()

    \n+[report issue]
    \n+
    picker_flags
    \n+
    this is a bitmask of which features were enabled for this particular\n+pick. The bits are defined in the picker_flags_t enum.
    \n+
    \n+[report issue]
    \n+
    \n+

    session_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted when the session encounters a serious error,\n+potentially fatal

    \n
    \n-file_storage const& orig_files () const;\n-file_storage const& files () const;\n+struct session_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code const error;\n+};\n 
    \n-

    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+[report issue]
    \n+
    error
    \n+
    The error code, if one is associated with this error
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_live_nodes_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

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

    \n
    \n-void rename_file (file_index_t index, std::string const& new_filename);\n+struct dht_live_nodes_alert final : alert\n+{\n+   std::string message () const override;\n+   int num_nodes () const;\n+   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash node_id;\n+};\n 
    \n-

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

    nodes() num_nodes()

    \n
    \n-void remap_files (file_storage const& f);\n+int num_nodes () const;\n+std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\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+

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

    \n+[report issue]
    \n+
    node_id
    \n+
    the local DHT node's node-ID this routing table belongs to
    \n+
    \n+[report issue]
    \n
    \n-

    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-

    trackers() clear_trackers() add_tracker()

    \n-
    \n-void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-void clear_trackers ();\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-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-

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

    \n-
    \n-void set_web_seeds (std::vector<web_seed_entry> seeds);\n-std::vector<web_seed_entry> const& web_seeds () const;\n-void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-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-
    \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+

    session_stats_header_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The session_stats_header alert is posted the first time\n+post_session_stats() is called

    \n+

    the message() member function returns a string representation of the\n+header that properly match the stats values string returned in\n+session_stats_alert::message().

    \n+

    this specific output is parsed by tools/parse_session_stats.py\n+if this is changed, that parser should also be changed

    \n
    \n-int piece_length () const;\n-int num_pieces () const;\n+struct session_stats_header_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = {};\n+};\n 
    \n-

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

    dht_sample_infohashes_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

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

    \n
    \n-int blocks_per_piece () const;\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+   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-

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

    samples() num_samples()

    \n
    \n-piece_index_t end_piece () const;\n-index_range<piece_index_t> piece_range () const;\n-piece_index_t last_piece () const;\n+std::vector<sha1_hash> samples () const;\n+int num_samples () const;\n 
    \n-

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

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

    info_hashes() info_hash()

    \n+

    returns 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-info_hash_t const& info_hashes () const;\n-sha1_hash info_hash () const noexcept;\n+int num_nodes () 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+

    The total number of nodes returned by nodes().

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

    nodes()

    \n
    \n-bool v2 () const;\n-bool v1 () const;\n+std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () 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+

    This is the set of more DHT nodes returned by the request.

    \n+

    The information is included so that indexing nodes can perform a key\n+space traversal with a single RPC per node by adjusting the target\n+value for each RPC.

    \n+[report issue]
    \n+
    node_id
    \n+
    id of the node the request was sent to (and this response was received from)
    \n+
    \n+[report issue]
    \n+
    endpoint
    \n+
    the node the request was sent to (and this response was received from)
    \n+
    \n+[report issue]
    \n+
    interval
    \n+
    the interval to wait before making another request to this node
    \n+
    \n+[report issue]
    \n+
    num_infohashes
    \n+
    This field indicates how many info-hash keys are currently in the node's storage.\n+If the value is larger than the number of returned samples it indicates that the\n+indexer may obtain additional samples after waiting out the interval.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    block_uploaded_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when a block intended to be sent to a peer is placed in the\n+send buffer. Note that if the connection is closed before the send buffer is sent,\n+the alert may be posted without the bytes having been sent to the peer.\n+It belongs to the alert_category::upload category.

    \n
    \n-int num_files () const;\n+struct block_uploaded_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n 
    \n-

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

    alerts_dropped_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

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

    \n
    \n-std::vector<file_slice> map_block (piece_index_t const piece\n-      , std::int64_t offset, int size) const;\n+struct alerts_dropped_alert final : alert\n+{\n+   std::string message () const override;\n+   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   std::bitset<abi_alert_count> dropped_alerts;\n+};\n 
    \n-

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

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

    map_file()

    \n+[report issue]
    \n+
    dropped_alerts
    \n+
    a bitmask indicating which alerts were dropped. Each bit represents the\n+alert type ID, where bit 0 represents whether any alert of type 0 has\n+been dropped, and so on.
    \n+
    \n+[report issue]
    \n+
    \n+

    socks5_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n+configured. It's enabled with the alert_category::error alert category.

    \n
    \n-peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+struct socks5_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code error;\n+   operation_t op;\n+   aux::noexcept_movable<tcp::endpoint> ip;\n+};\n 
    \n-

    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+[report issue]
    \n+
    error
    \n+
    the error
    \n+
    \n+[report issue]
    \n+
    op
    \n+
    the operation that failed
    \n+
    \n+[report issue]
    \n+
    ip
    \n+
    the endpoint configured as the proxy
    \n+
    \n+[report issue]
    \n+
    \n+

    file_prio_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when a prioritize_files() or file_priority() update of the file\n+priorities complete, which requires a round-trip to the disk thread.

    \n+

    If the disk operation fails this alert won't be posted, but a\n+file_error_alert is posted instead, and the torrent is stopped.

    \n
    \n-string_view ssl_cert () const;\n+struct file_prio_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   error_code error;\n+   operation_t op;\n+};\n 
    \n-

    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+[report issue]
    \n+
    error
    \n+
    the error
    \n+
    \n+[report issue]
    \n+
    op
    \n+
    the operation that failed
    \n+
    \n+[report issue]
    \n+
    \n+

    oversized_file_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert may be posted when the initial checking of resume data and files\n+on disk (just existence, not piece hashes) completes. If a file belonging\n+to the torrent is found on disk, but is larger than the file in the\n+torrent, that's when this alert is posted.\n+the client may want to call truncate_files() in that case, or perhaps\n+interpret it as a sign that some other file is in the way, that shouldn't\n+be overwritten.

    \n
    \n-bool is_valid () const;\n+struct oversized_file_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+};\n 
    \n-

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

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

    priv()

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

    torrent_conflict_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted when two separate torrents (magnet links) resolve to\n+the same torrent, thus causing the same torrent being added twice. In\n+that case, both torrents enter an error state with duplicate_torrent\n+as the error code. This alert is posted containing the metadata. For more\n+information, see BitTorrent v2 torrents.\n+The torrent this alert originated from was the one that downloaded the

    \n+

    metadata (i.e. the handle member from the torrent_alert base class).

    \n
    \n-bool priv () const;\n+struct torrent_conflict_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   torrent_handle conflicting_torrent;\n+   std::shared_ptr<torrent_info> metadata;\n+};\n 
    \n-

    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+[report issue]
    \n+
    conflicting_torrent
    \n+
    the handle to the torrent in conflict. The swarm associated with this\n+torrent handle did not download the metadata, but the downloaded\n+metadata collided with this swarm's info-hash.
    \n+
    \n+[report issue]
    \n+
    metadata
    \n+
    the metadata that was received by one of the torrents in conflict.\n+One way to resolve the conflict is to remove both failing torrents\n+and re-add it using this metadata
    \n+
    \n+[report issue]
    \n+
    \n+

    peer_info_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_peer_info() is called

    \n
    \n-bool is_i2p () const;\n+struct peer_info_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<lt::peer_info> peer_info;\n+};\n 
    \n-

    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+[report issue]
    \n+
    peer_info
    \n+
    the list of the currently connected peers
    \n+
    \n+[report issue]
    \n+
    \n+

    file_progress_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_file_progress() is called

    \n
    \n-int piece_size (piece_index_t index) const;\n+struct file_progress_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::file_progress;\n+   aux::vector<std::int64_t, file_index_t> files;\n+};\n 
    \n-

    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+[report issue]
    \n+
    files
    \n+
    the list of the files in the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    piece_info_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_download_queue() is called

    \n
    \n-sha1_hash hash_for_piece (piece_index_t index) const;\n-char const* hash_for_piece_ptr (piece_index_t const index) const;\n+struct piece_info_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::piece_progress;\n+   std::vector<partial_piece_info> piece_info;\n+   std::vector<block_info> block_data;\n+};\n 
    \n-

    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+[report issue]
    \n+
    piece_info
    \n+
    info about pieces being downloaded for the torrent
    \n+
    \n+[report issue]
    \n+
    block_data
    \n+
    storage for block_info pointers in partial_piece_info objects
    \n+
    \n+[report issue]
    \n+
    \n+

    piece_availability_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_piece_availability() is called

    \n
    \n-const std::string& name () const;\n+struct piece_availability_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<int> piece_availability;\n+};\n 
    \n-

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

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

    creation_date()

    \n+[report issue]
    \n+
    piece_availability
    \n+
    info about pieces being downloaded for the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    tracker_list_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_trackers() is called

    \n
    \n-std::time_t creation_date () const;\n+struct tracker_list_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<announce_entry> trackers;\n+};\n 
    \n-

    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+[report issue]
    \n+
    trackers
    \n+
    list of trackers and their status for the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    alert

    \n+

    Declared in "libtorrent/alert.hpp"

    \n+

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

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

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

    timestamp()

    \n
    \n-const std::string& comment () const;\n+time_point timestamp () 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+

    a timestamp is automatically created in the constructor

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

    type()

    \n
    \n-std::vector<std::pair<std::string, int>> const& nodes () const;\n+virtual int type () const noexcept = 0;\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+

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

    \n+

    e.g:

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

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

    what()

    \n
    \n-bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+virtual char const* what () const noexcept = 0;\n 
    \n-

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

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

    info()

    \n+

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

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

    message()

    \n
    \n-bdecode_node info (char const* key) const;\n+virtual std::string message () const = 0;\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+

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

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

    category()

    \n
    \n-span<char const> info_section () const;\n+virtual alert_category_t category () const noexcept = 0;\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+

    returns a bitmask specifying which categories this alert belong to.

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

    operation_name()

    \n+

    Declared in "libtorrent/operations.hpp"

    \n
    \n-span<char const> piece_layer (file_index_t) const;\n+char const* operation_name (operation_t op);\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+

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

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

    alert_cast()

    \n+

    Declared in "libtorrent/alert.hpp"

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

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

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

    settings_pack

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \n-

    The settings_pack struct, contains the names of all settings as\n-enum values. These values are passed in to the set_str(),\n-set_int(), set_bool() functions, to specify the setting to\n-change.

    \n-

    The settings_pack only stores values for settings that have been\n-explicitly set on this object. However, it can still be queried for\n-settings that have not been set and returns the default value for those\n-settings.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    user_agentstringlibtorrent/
    \n-

    this is the client identification to the tracker. The recommended\n-format of this string is: "client-name/client-version\n-libtorrent/libtorrent-version". This name will not only be used when\n-making HTTP requests, but also when sending extended headers to\n-peers that support that extension. It may not contain r or n

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    announce_ipstringnullptr
    \n-

    announce_ip is the ip address passed along to trackers as the\n-&ip= parameter. If left as the default, that parameter is\n-omitted.

    \n+

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

    \n
    \n

    Note

    \n-

    This setting is only meant for very special cases where a seed is\n-running on the same host as the tracker, and the tracker accepts\n-the IP parameter (which normal trackers don't). Do not set this\n-option unless you also control the tracker.

    \n+

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

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

    enum operation_t

    \n+

    Declared in "libtorrent/operations.hpp"

    \n+
    \n \n-\n-\n \n+\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefaultvaluedescription
    handshake_client_versionstringnullptr
    unknown0the error was unexpected and it is unknown which operation caused it
    \n-

    this is the client name and version identifier sent to peers in the\n-handshake message. If this is an empty string, the user_agent is\n-used instead. This string must be a UTF-8 encoded unicode string.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    bittorrent1this is used when the bittorrent logic\n+determines to disconnect
    outgoing_interfacesstring 
    iocontrol2a call to iocontrol failed
    \n-

    This controls which IP address outgoing TCP peer connections are bound\n-to, in addition to controlling whether such connections are also\n-bound to a specific network interface/adapter (bind-to-device).

    \n-

    This string is a comma-separated list of IP addresses and\n-interface names. An empty string will not bind TCP sockets to a\n-device, and let the network stack assign the local address.

    \n-

    A list of names will be used to bind outgoing TCP sockets in a\n-round-robin fashion. An IP address will simply be used to bind()\n-the socket. An interface name will attempt to bind the socket to\n-that interface. If that fails, or is unsupported, one of the IP\n-addresses configured for that interface is used to bind() the\n-socket to. If the interface or adapter doesn't exist, the\n-outgoing peer connection will fail with an error message suggesting\n-the device cannot be found. Adapter names on Unix systems are of\n-the form "eth0", "eth1", "tun0", etc. This may be useful for\n-clients that are multi-homed. Binding an outgoing connection to a\n-local IP does not necessarily make the connection via the\n-associated NIC/Adapter.

    \n-

    When outgoing interfaces are specified, incoming connections or\n-packets sent to a local interface or IP that's not in this list\n-will be rejected with a peer_blocked_alert with\n-invalid_local_interface as the reason.

    \n-

    Note that these are just interface/adapter names or IP addresses.\n-There are no ports specified in this list. IPv6 addresses without\n-port should be specified without enclosing [, ].

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    getpeername3a call to getpeername() failed (querying the remote IP of a\n+connection)
    listen_interfacesstring0.0.0.0:6881,[::]:6881
    getname4a call to getname failed (querying the local IP of a\n+connection)
    \n-

    a comma-separated list of (IP or device name, port) pairs. These are\n-the listen ports that will be opened for accepting incoming uTP and\n-TCP peer connections. These are also used for outgoing uTP and UDP\n-tracker connections and DHT nodes.

    \n-

    It is possible to listen on multiple interfaces and\n-multiple ports. Binding to port 0 will make the operating system\n-pick the port.

    \n-
    \n-

    Note

    \n-

    There are reasons to stick to the same port across sessions,\n-which would mean only using port 0 on the first start, and\n-recording the port that was picked for subsequent startups.\n-Trackers, the DHT and other peers will remember the port they see\n-you use and hand that port out to other peers trying to connect\n-to you, as well as trying to connect to you themselves.

    \n-
    \n-

    A port that has an "s" suffix will accept SSL peer connections. (note\n-that SSL sockets are only available in builds with SSL support)

    \n-

    A port that has an "l" suffix will be considered a local network.\n-i.e. it's assumed to only be able to reach hosts in the same local\n-network as the IP address (based on the netmask associated with the\n-IP, queried from the operating system).

    \n-

    if binding fails, the listen_failed_alert is posted. Once a\n-socket binding succeeds (if it does), the listen_succeeded_alert\n-is posted. There may be multiple failures before a success.

    \n-

    If a device name that does not exist is configured, no listen\n-socket will be opened for that interface. If this is the only\n-interface configured, it will be as if no listen ports are\n-configured.

    \n-

    If no listen ports are configured (e.g. listen_interfaces is an\n-empty string), networking will be disabled. No DHT will start, no\n-outgoing uTP or tracker connections will be made. No incoming TCP\n-or uTP connections will be accepted. (outgoing TCP connections\n-will still be possible, depending on\n-settings_pack::outgoing_interfaces).

    \n-

    For example:\n-[::1]:8888 - will only accept connections on the IPv6 loopback\n-address on port 8888.

    \n-

    eth0:4444,eth1:4444 - will accept connections on port 4444 on\n-any IP address bound to device eth0 or eth1.

    \n-

    [::]:0s - will accept SSL connections on a port chosen by the\n-OS. And not accept non-SSL connections at all.

    \n-

    0.0.0.0:6881,[::]:6881 - binds to all interfaces on port 6881.

    \n-

    10.0.1.13:6881l - binds to the local IP address, port 6881, but\n-only allow talking to peers on the same local network. The netmask\n-is queried from the operating system. Interfaces marked l are\n-not announced to trackers, unless the tracker is also on the same\n-local network.

    \n-

    Windows OS network adapter device name must be specified with GUID.\n-It can be obtained from "netsh lan show interfaces" command output.\n-GUID must be uppercased string embraced in curly brackets.\n-{E4F0B674-0DFC-48BB-98A5-2AA730BDB6D6}:7777 - will accept\n-connections on port 7777 on adapter with this GUID.

    \n-

    For more information, see the Multi-homed hosts section.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    alloc_recvbuf5an attempt to allocate a receive buffer failed
    proxy_hostnamestring 
    alloc_sndbuf6an attempt to allocate a send buffer failed
    \n-

    when using a proxy, this is the hostname where the proxy is running\n-see proxy_type. Note that when using a proxy, the\n-settings_pack::listen_interfaces setting is overridden and only a\n-single interface is created, just to contact the proxy. This\n-means a proxy cannot be combined with SSL torrents or multiple\n-listen interfaces. This proxy listen interface will not accept\n-incoming TCP connections, will not map ports with any gateway and\n-will not enable local service discovery. All traffic is supposed\n-to be channeled through the proxy.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_write7writing to a file failed
    proxy_usernamestring 
    file_read8reading from a file failed
    proxy_passwordstring 
    file9a non-read and non-write file operation failed
    \n-

    when using a proxy, these are the credentials (if any) to use when\n-connecting to it. see proxy_type

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    sock_write10a socket write operation failed
    i2p_hostnamestring 
    sock_read11a socket read operation failed
    \n-

    sets the i2p SAM bridge to connect to. set the port with the\n-i2p_port setting. Unless this is set, i2p torrents are not\n-supported. This setting is separate from the other proxy settings\n-since i2p torrents and their peers are orthogonal. You can have\n-i2p peers as well as regular peers via a proxy.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    sock_open12a call to open(), to create a socket socket failed
    peer_fingerprintstring-LT20A0-
    sock_bind13a call to bind() on a socket failed
    \n-

    this is the fingerprint for the client. It will be used as the\n-prefix to the peer_id. If this is 20 bytes (or longer) it will be\n-truncated to 20 bytes and used as the entire peer-id

    \n-

    There is a utility function, generate_fingerprint() that can be used\n-to generate a standard client peer ID fingerprint prefix.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    available14an attempt to query the number of bytes available to read from a socket\n+failed
    dht_bootstrap_nodesstringdht.libtorrent.org:25401
    encryption15a call related to bittorrent protocol encryption failed
    \n-

    This is a comma-separated list of IP port-pairs. They will be added\n-to the DHT node (if it's enabled) as back-up nodes in case we don't\n-know of any.

    \n-

    Changing these after the DHT has been started may not have any\n-effect until the DHT is restarted.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    connect16an attempt to connect a socket failed
    allow_multiple_connections_per_ipboolfalse
    ssl_handshake17establishing an SSL connection failed
    \n-

    determines if connections from the same IP address as existing\n-connections should be rejected or not. Rejecting multiple connections\n-from the same IP address will prevent abusive\n-behavior by peers. The logic for determining whether connections are\n-to the same peer is more complicated with this enabled, and more\n-likely to fail in some edge cases. It is not recommended to enable\n-this feature.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    get_interface18a connection failed to satisfy the bind interface setting
    send_redundant_havebooltrue
    sock_listen19a call to listen() on a socket
    \n-

    send_redundant_have controls if have messages will be sent to\n-peers that already have the piece. This is typically not necessary,\n-but it might be necessary for collecting statistics in some cases.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    sock_bind_to_device20a call to the ioctl to bind a socket to a specific network device or\n+adapter
    use_dht_as_fallbackboolfalse
    sock_accept21a call to accept() on a socket
    \n-

    use_dht_as_fallback determines how the DHT is used. If this is\n-true, the DHT will only be used for torrents where all trackers in\n-its tracker list has failed. Either by an explicit error message or\n-a time out. If this is false, the DHT is used regardless of if the\n-trackers fail or not.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    parse_address22convert a string into a valid network address
    upnp_ignore_nonroutersboolfalse
    enum_if23enumeration network devices or adapters
    \n-

    upnp_ignore_nonrouters indicates whether or not the UPnP\n-implementation should ignore any broadcast response from a device\n-whose address is not on our subnet. i.e.\n-it's a way to not talk to other people's routers by mistake.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_stat24invoking stat() on a file
    use_parole_modebooltrue
    file_copy25copying a file
    \n-

    use_parole_mode specifies if parole mode should be used. Parole\n-mode means that peers that participate in pieces that fail the hash\n-check are put in a mode where they are only allowed to download\n-whole pieces. If the whole piece a peer in parole mode fails the\n-hash check, it is banned. If a peer participates in a piece that\n-passes the hash check, it is taken out of parole mode.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_fallocate26allocating storage for a file
    auto_manage_prefer_seedsboolfalse
    file_hard_link27creating a hard link
    \n-

    if true, prefer seeding torrents when determining which torrents to give\n-active slots to. If false, give preference to downloading torrents

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_remove28removing a file
    dont_count_slow_torrentsbooltrue
    file_rename29renaming a file
    \n-

    if dont_count_slow_torrents is true, torrents without any\n-payload transfers are not subject to the active_seeds and\n-active_downloads limits. This is intended to make it more\n-likely to utilize all available bandwidth, and avoid having\n-torrents that don't transfer anything block the active slots.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_open30opening a file
    close_redundant_connectionsbooltrue
    mkdir31creating a directory
    \n-

    close_redundant_connections specifies whether libtorrent should\n-close connections where both ends have no utility in keeping the\n-connection open. For instance if both ends have completed their\n-downloads, there's no point in keeping it open.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    check_resume32check fast resume data against files on disk
    prioritize_partial_piecesboolfalse
    exception33an unknown exception
    \n-

    If prioritize_partial_pieces is true, partial pieces are picked\n-before pieces that are more rare. If false, rare pieces are always\n-prioritized, unless the number of partial pieces is growing out of\n-proportion.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    alloc_cache_piece34allocate space for a piece in the cache
    rate_limit_ip_overheadbooltrue
    partfile_move35move a part-file
    \n-

    if set to true, the estimated TCP/IP overhead is drained from the\n-rate limiters, to avoid exceeding the limits with the total traffic

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    partfile_read36read from a part file
    announce_to_all_tiersboolfalse
    partfile_write37write to a part-file
    announce_to_all_trackersboolfalse
    hostname_lookup38a hostname lookup
    \n-

    announce_to_all_trackers controls how multi tracker torrents\n-are treated. If this is set to true, all trackers in the same tier\n-are announced to in parallel. If all trackers in tier 0 fails, all\n-trackers in tier 1 are announced as well. If it's set to false, the\n-behavior is as defined by the multi tracker specification.

    \n-

    announce_to_all_tiers also controls how multi tracker torrents\n-are treated. When this is set to true, one tracker from each tier\n-is announced to. This is the uTorrent behavior. To be compliant\n-with the Multi-tracker specification, set it to false.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    symlink39create or read a symlink
    prefer_udp_trackersbooltrue
    handshake40handshake with a peer or server
    \n-

    prefer_udp_trackers: true means that trackers\n-may be rearranged in a way that udp trackers are always tried\n-before http trackers for the same hostname. Setting this to false\n-means that the tracker's tier is respected and there's no\n-preference of one protocol over another.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    sock_option41set socket option
    disable_hash_checksboolfalse
    enum_route42enumeration of network routes
    \n-

    when set to true, all data downloaded from peers will be assumed to\n-be correct, and not tested to match the hashes in the torrent this\n-is only useful for simulation and testing purposes (typically\n-combined with disabled_storage)

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_seek43moving read/write position in a file, operation_t::hostname_lookup
    allow_i2p_mixedboolfalse
    timer44an async wait operation on a timer
    \n-

    if this is true, i2p torrents are allowed to also get peers from\n-other sources than the tracker, and connect to regular IPs, not\n-providing any anonymization. This may be useful if the user is not\n-interested in the anonymization of i2p, but still wants to be able\n-to connect to i2p peers.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    file_mmap45call to mmap() (or windows counterpart)
    no_atime_storagebooltrue
    file_truncate46call to ftruncate() (or SetEndOfFile() on windows)
    \n-

    no_atime_storage this is a Linux-only option and passes in the\n-O_NOATIME to open() when opening files. This may lead to\n-some disk performance improvements.

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

    int

    \n+

    Declared in "libtorrent/alert_types.hpp"

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

    alert_category_t

    \n+

    Declared in "libtorrent/alert.hpp"

    \n+
    \n+
    error
    \n+

    Enables alerts that report an error. This includes:

    \n+
      \n+
    • tracker errors
    • \n+
    • tracker warnings
    • \n+
    • file errors
    • \n+
    • resume data failures
    • \n+
    • web seed errors
    • \n+
    • .torrent files errors
    • \n+
    • listen socket errors
    • \n+
    • port mapping errors
    • \n+
    \n+
    \n+
    \n+
    \n+
    peer
    \n+
    Enables alerts when peers send invalid requests, get banned or\n+snubbed.
    \n+
    \n+
    \n+
    port_mapping
    \n+
    Enables alerts for port mapping events. For NAT-PMP and UPnP.
    \n+
    \n+
    \n+
    storage
    \n+
    Enables alerts for events related to the storage. File errors and\n+synchronization events for moving the storage, renaming files etc.
    \n+
    \n+
    \n+
    tracker
    \n+
    Enables all tracker events. Includes announcing to trackers,\n+receiving responses, warnings and errors.
    \n+
    \n+
    \n+
    connect
    \n+
    Low level alerts for when peers are connected and disconnected.
    \n+
    \n+
    \n+
    status
    \n+
    Enables alerts for when a torrent or the session changes state.
    \n+
    \n+
    \n+
    ip_block
    \n+
    Alerts when a peer is blocked by the ip blocker or port blocker.
    \n+
    \n+
    \n+
    performance_warning
    \n+
    Alerts when some limit is reached that might limit the download\n+or upload rate.
    \n+
    \n+
    \n+
    dht
    \n+
    Alerts on events in the DHT node. For incoming searches or\n+bootstrapping being done etc.
    \n+
    \n+
    \n+
    stats
    \n+
    If you enable these alerts, you will receive a stats_alert\n+approximately once every second, for every active torrent.\n+These alerts contain all statistics counters for the interval since\n+the lasts stats alert.
    \n+
    \n+
    \n+
    session_log
    \n+
    Enables debug logging alerts. These are available unless libtorrent\n+was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n+alerts being posted are log_alert and are session wide.
    \n+
    \n+
    \n+
    torrent_log
    \n+
    Enables debug logging alerts for torrents. These are available\n+unless libtorrent was built with logging disabled\n+(TORRENT_DISABLE_LOGGING). The alerts being posted are\n+torrent_log_alert and are torrent wide debug events.
    \n+
    \n+
    \n+
    peer_log
    \n+
    Enables debug logging alerts for peers. These are available unless\n+libtorrent was built with logging disabled\n+(TORRENT_DISABLE_LOGGING). The alerts being posted are\n+peer_log_alert and low-level peer events and messages.
    \n+
    \n+
    \n+
    incoming_request
    \n+
    enables the incoming_request_alert.
    \n+
    \n+
    \n+
    dht_log
    \n+
    enables dht_log_alert, debug logging for the DHT
    \n+
    \n+
    \n+
    dht_operation
    \n+
    enable events from pure dht operations not related to torrents
    \n+
    \n+
    \n+
    port_mapping_log
    \n+
    enables port mapping log events. This log is useful\n+for debugging the UPnP or NAT-PMP implementation
    \n+
    \n+
    \n+
    picker_log
    \n+
    enables verbose logging from the piece picker.
    \n+
    \n+
    \n+
    file_progress
    \n+
    alerts when files complete downloading
    \n+
    \n+
    \n+
    piece_progress
    \n+
    alerts when pieces complete downloading or fail hash check
    \n+
    \n+
    \n+
    upload
    \n+
    alerts when we upload blocks to other peers
    \n+
    \n+
    \n+
    block_progress
    \n+
    alerts on individual blocks being requested, downloading, finished,\n+rejected, time-out and cancelled. This is likely to post alerts at a\n+high rate.
    \n+
    \n+
    \n+
    all
    \n+

    The full bitmask, representing all available categories.

    \n+

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

    \n+
    \n+
    \n+

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

    \n+

    In short, the plugin interface makes it possible to:

    \n+
      \n+
    • register extension messages (sent in the extension handshake), see\n+extensions.
    • \n+
    • add data and parse data from the extension handshake.
    • \n+
    • send extension messages and standard bittorrent messages.
    • \n+
    • override or block the handling of standard bittorrent messages.
    • \n+
    • save and restore state via the session state
    • \n+
    • see all alerts that are posted
    • \n+
    \n+
    \n+
    \n+

    a word of caution

    \n+

    Writing your own plugin is a very easy way to introduce serious bugs such as\n+dead locks and race conditions. Since a plugin has access to internal\n+structures it is also quite easy to sabotage libtorrent's operation.

    \n+

    All the callbacks are always called from the libtorrent network thread. In\n+case portions of your plugin are called from other threads, typically the main\n+thread, you cannot use any of the member functions on the internal structures\n+in libtorrent, since those require being called from the libtorrent network\n+thread . Furthermore, you also need to synchronize your own shared data\n+within the plugin, to make sure it is not accessed at the same time from the\n+libtorrent thread (through a callback). If you need to send out a message\n+from another thread, it is advised to use an internal queue, and do the\n+actual sending in tick().

    \n+

    Since the plugin interface gives you easy access to internal structures, it\n+is not supported as a stable API. Plugins should be considered specific to a\n+specific version of libtorrent. Although, in practice the internals mostly\n+don't change that dramatically.

    \n+
    \n+
    \n+

    plugin-interface

    \n+

    The plugin interface consists of three base classes that the plugin may\n+implement. These are called plugin, torrent_plugin and peer_plugin.\n+They are found in the <libtorrent/extensions.hpp> header.

    \n+

    These plugins are instantiated for each session, torrent and possibly each peer,\n+respectively.

    \n+

    For plugins that only need per torrent state, it is enough to only implement\n+torrent_plugin and pass a constructor function or function object to\n+session::add_extension() or torrent_handle::add_extension() (if the\n+torrent has already been started and you want to hook in the extension at\n+run-time).

    \n+

    The signature of the function is:

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

    The second argument is the userdata passed to session::add_torrent() or\n+torrent_handle::add_extension().

    \n+

    The function should return a std::shared_ptr<torrent_plugin> which\n+may or may not be 0. If it is a nullptr, the extension is simply ignored\n+for this torrent. If it is a valid pointer (to a class inheriting\n+torrent_plugin), it will be associated with this torrent and callbacks\n+will be made on torrent events.

    \n+

    For more elaborate plugins which require session wide state, you would\n+implement plugin, construct an object (in a std::shared_ptr) and pass\n+it in to session::add_extension().

    \n+
    \n+
    \n+

    custom alerts

    \n+

    Since plugins are running within internal libtorrent threads, one convenient\n+way to communicate with the client is to post custom alerts.

    \n+

    The expected interface of any alert, apart from deriving from the alert\n+base class, looks like this:

    \n+
    \n+static const int alert_type = <unique alert ID>;\n+virtual int type() const { return alert_type; }\n+\n+virtual std::string message() const;\n+\n+static const alert_category_t static_category = <bitmask of alert::category_t flags>;\n+virtual alert_category_t category() const { return static_category; }\n+\n+virtual char const* what() const { return <string literal of the name of this alert>; }\n+
    \n+

    The alert_type is used for the type-checking in alert_cast. It must\n+not collide with any other alert. The built-in alerts in libtorrent will\n+not use alert type IDs greater than user_alert_id. When defining your\n+own alert, make sure it's greater than this constant.

    \n+

    type() is the run-time equivalence of the alert_type.

    \n+

    The message() virtual function is expected to construct a useful\n+string representation of the alert and the event or data it represents.\n+Something convenient to put in a log file for instance.

    \n+

    clone() is used internally to copy alerts. The suggested implementation\n+of simply allocating a new instance as a copy of *this is all that's\n+expected.

    \n+

    The static category is required for checking whether or not the category\n+for a specific alert is enabled or not, without instantiating the alert.\n+The category virtual function is the run-time equivalence.

    \n+

    The what() virtual function may simply be a string literal of the class\n+name of your alert.

    \n+

    For more information, see the alert section.

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

    plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    this is the base class for a session plugin. One primary feature\n+is that it is notified of all torrents that are added to the session,\n+and can add its own torrent_plugins.

    \n+
    \n+struct plugin\n+{\n+   virtual feature_flags_t implemented_features ();\n+   virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n+   virtual void added (session_handle const&);\n+   virtual void abort ();\n+   virtual bool on_dht_request (string_view /* query */\n+      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n+      , entry& /* response */);\n+   virtual void on_alert (alert const*);\n+   virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n+      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n+   virtual void on_tick ();\n+   virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n+   virtual std::map<std::string, std::string> save_state () const;\n+   virtual void load_state (std::map<std::string, std::string> const&);\n+\n+   static constexpr feature_flags_t optimistic_unchoke_feature  = 1_bit;\n+   static constexpr feature_flags_t tick_feature  = 2_bit;\n+   static constexpr feature_flags_t dht_request_feature  = 3_bit;\n+   static constexpr feature_flags_t alert_feature  = 4_bit;\n+   static constexpr feature_flags_t unknown_torrent_feature  = 5_bit;\n+};\n+
    \n+[report issue]
    \n+

    implemented_features()

    \n+
    \n+virtual feature_flags_t implemented_features ();\n+
    \n+

    This function is expected to return a bitmask indicating which features\n+this plugin implements. Some callbacks on this object may not be called\n+unless the corresponding feature flag is returned here. Note that\n+callbacks may still be called even if the corresponding feature is not\n+specified in the return value here. See feature_flags_t for possible\n+flags to return.

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

    new_torrent()

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

    this is called by the session every time a new torrent is added.\n+The torrent* points to the internal torrent object created\n+for the new torrent. The client_data_t is the userdata pointer as\n+passed in via add_torrent_params.

    \n+

    If the plugin returns a torrent_plugin instance, it will be added\n+to the new torrent. Otherwise, return an empty shared_ptr to a\n+torrent_plugin (the default).

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

    added()

    \n+
    \n+virtual void added (session_handle const&);\n+
    \n+

    called when plugin is added to a session

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

    abort()

    \n+
    \n+virtual void abort ();\n+
    \n+

    called when the session is aborted\n+the plugin should perform any cleanup necessary to allow the session's\n+destruction (e.g. cancel outstanding async operations)

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

    on_dht_request()

    \n+
    \n+virtual bool on_dht_request (string_view /* query */\n+      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n+      , entry& /* response */);\n+
    \n+

    called when a dht request is received.\n+If your plugin expects this to be called, make sure to include the flag\n+dht_request_feature in the return value from implemented_features().

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

    on_alert()

    \n+
    \n+virtual void on_alert (alert const*);\n+
    \n+

    called when an alert is posted alerts that are filtered are not posted.\n+If your plugin expects this to be called, make sure to include the flag\n+alert_feature in the return value from implemented_features().

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

    on_unknown_torrent()

    \n+
    \n+virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n+      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n+
    \n+

    return true if the add_torrent_params should be added

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

    on_tick()

    \n+
    \n+virtual void on_tick ();\n+
    \n+

    called once per second.\n+If your plugin expects this to be called, make sure to include the flag\n+tick_feature in the return value from implemented_features().

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

    get_unchoke_priority()

    \n+
    \n+virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n+
    \n+

    called when choosing peers to optimistically unchoke. The return value\n+indicates the peer's priority for unchoking. Lower return values\n+correspond to higher priority. Priorities above 2^63-1 are reserved.\n+If your plugin has no priority to assign a peer it should return 2^64-1.\n+If your plugin expects this to be called, make sure to include the flag\n+optimistic_unchoke_feature in the return value from implemented_features().\n+If multiple plugins implement this function the lowest return value\n+(i.e. the highest priority) is used.

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

    load_state()

    \n+
    \n+virtual void load_state (std::map<std::string, std::string> const&);\n+
    \n+

    called on startup while loading settings state from the session_params

    \n+[report issue]
    \n+
    optimistic_unchoke_feature
    \n+
    include this bit if your plugin needs to alter the order of the\n+optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n+callback be called.
    \n+
    \n+[report issue]
    \n+
    tick_feature
    \n+
    include this bit if your plugin needs to have on_tick() called
    \n+
    \n+[report issue]
    \n+
    dht_request_feature
    \n+
    include this bit if your plugin needs to have on_dht_request()\n+called
    \n+
    \n+[report issue]
    \n+
    alert_feature
    \n+
    include this bit if your plugin needs to have on_alert()\n+called
    \n+
    \n+[report issue]
    \n+
    unknown_torrent_feature
    \n+
    include this bit if your plugin needs to have on_unknown_torrent()\n+called even if there is no active torrent in the session
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    torrent_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    Torrent plugins are associated with a single torrent and have a number\n+of functions called at certain events. Many of its functions have the\n+ability to change or override the default libtorrent behavior.

    \n+
    \n+struct torrent_plugin\n+{\n+   virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n+   virtual void on_piece_failed (piece_index_t);\n+   virtual void on_piece_pass (piece_index_t);\n+   virtual void tick ();\n+   virtual bool on_pause ();\n+   virtual bool on_resume ();\n+   virtual void on_files_checked ();\n+   virtual void on_state (torrent_status::state_t);\n+   virtual void on_add_peer (tcp::endpoint const&,\n+      peer_source_flags_t, add_peer_flags_t);\n+\n+   static constexpr add_peer_flags_t first_time  = 1_bit;\n+   static constexpr add_peer_flags_t filtered  = 2_bit;\n+};\n+
    \n+[report issue]
    \n+

    new_connection()

    \n+
    \n+virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n+
    \n+

    This function is called each time a new peer is connected to the torrent. You\n+may choose to ignore this by just returning a default constructed\n+shared_ptr (in which case you don't need to override this member\n+function).

    \n+

    If you need an extension to the peer connection (which most plugins do) you\n+are supposed to return an instance of your peer_plugin class. Which in\n+turn will have its hook functions called on event specific to that peer.

    \n+

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

    \n+

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

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

    on_piece_pass() on_piece_failed()

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

    These hooks are called when a piece passes the hash check or fails the hash\n+check, respectively. The index is the piece index that was downloaded.\n+It is possible to access the list of peers that participated in sending the\n+piece through the torrent and the piece_picker.

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

    tick()

    \n+
    \n+virtual void tick ();\n+
    \n+

    This hook is called approximately once per second. It is a way of making it\n+easy for plugins to do timed events, for sending messages or whatever.

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

    on_pause() on_resume()

    \n+
    \n+virtual bool on_pause ();\n+virtual bool on_resume ();\n+
    \n+

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

    \n+

    Note that if you call pause() or resume() on the torrent from your\n+handler it will recurse back into your handler, so in order to invoke the\n+standard handler, you have to keep your own state on whether you want standard\n+behavior or overridden behavior.

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

    on_files_checked()

    \n+
    \n+virtual void on_files_checked ();\n+
    \n+

    This function is called when the initial files of the torrent have been\n+checked. If there are no files to check, this function is called immediately.

    \n+

    i.e. This function is always called when the torrent is in a state where it\n+can start downloading.

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

    on_state()

    \n+
    \n+virtual void on_state (torrent_status::state_t);\n+
    \n+

    called when the torrent changes state\n+the state is one of torrent_status::state_t\n+enum members

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

    on_add_peer()

    \n+
    \n+virtual void on_add_peer (tcp::endpoint const&,\n+      peer_source_flags_t, add_peer_flags_t);\n+
    \n+

    called every time a new peer is added to the peer list.\n+This is before the peer is connected to. For flags, see\n+torrent_plugin::flags_t. The source argument refers to\n+the source where we learned about this peer from. It's a\n+bitmask, because many sources may have told us about the same\n+peer. For peer source flags, see peer_info::peer_source_flags.

    \n+[report issue]
    \n+
    first_time
    \n+
    this is the first time we see this peer
    \n+
    \n+[report issue]
    \n+
    filtered
    \n+
    this peer was not added because it was\n+filtered by the IP filter
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    peer_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    peer plugins are associated with a specific peer. A peer could be\n+both a regular bittorrent peer (bt_peer_connection) or one of the\n+web seed connections (web_peer_connection or http_seed_connection).\n+In order to only attach to certain peers, make your\n+torrent_plugin::new_connection only return a plugin for certain peer\n+connection types

    \n+
    \n+struct peer_plugin\n+{\n+   virtual string_view type () const;\n+   virtual void add_handshake (entry&);\n+   virtual void on_disconnect (error_code const&);\n+   virtual void on_connected ();\n+   virtual bool on_handshake (span<char const>);\n+   virtual bool on_extension_handshake (bdecode_node const&);\n+   virtual bool on_have_all ();\n+   virtual bool on_allowed_fast (piece_index_t);\n+   virtual bool on_bitfield (bitfield const& /*bitfield*/);\n+   virtual bool on_have (piece_index_t);\n+   virtual bool on_unchoke ();\n+   virtual bool on_choke ();\n+   virtual bool on_dont_have (piece_index_t);\n+   virtual bool on_request (peer_request const&);\n+   virtual bool on_not_interested ();\n+   virtual bool on_interested ();\n+   virtual bool on_have_none ();\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 void sent_cancel (peer_request const&);\n+   virtual void sent_have_none ();\n+   virtual void sent_choke ();\n+   virtual void sent_request (peer_request const&);\n+   virtual void sent_allow_fast (piece_index_t);\n+   virtual void sent_suggest (piece_index_t);\n+   virtual void sent_have_all ();\n+   virtual void sent_reject_request (peer_request const&);\n+   virtual void sent_unchoke ();\n+   virtual void sent_not_interested ();\n+   virtual void sent_interested ();\n+   virtual void sent_have (piece_index_t);\n+   virtual void sent_piece (peer_request const&);\n+   virtual void sent_payload (int /* bytes */);\n+   virtual bool can_disconnect (error_code const& /*ec*/);\n+   virtual bool on_extended (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+   virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+   virtual void on_piece_failed (piece_index_t);\n+   virtual void on_piece_pass (piece_index_t);\n+   virtual void tick ();\n+   virtual bool write_request (peer_request const&);\n+};\n+
    \n+[report issue]
    \n+

    type()

    \n+
    \n+virtual string_view type () const;\n+
    \n+

    This function is expected to return the name of\n+the plugin.

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

    add_handshake()

    \n+
    \n+virtual void add_handshake (entry&);\n+
    \n+

    can add entries to the extension handshake\n+this is not called for web seeds

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

    on_disconnect()

    \n+
    \n+virtual void on_disconnect (error_code const&);\n+
    \n+

    called when the peer is being disconnected.

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

    on_connected()

    \n+
    \n+virtual void on_connected ();\n+
    \n+

    called when the peer is successfully connected. Note that\n+incoming connections will have been connected by the time\n+the peer plugin is attached to it, and won't have this hook\n+called.

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

    on_handshake()

    \n+
    \n+virtual bool on_handshake (span<char const>);\n+
    \n+

    this is called when the initial bittorrent handshake is received.\n+Returning false means that the other end doesn't support this extension\n+and will remove it from the list of plugins. this is not called for web\n+seeds

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

    on_extension_handshake()

    \n+
    \n+virtual bool on_extension_handshake (bdecode_node const&);\n+
    \n+

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

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

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

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

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

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

    on_piece()

    \n+
    \n+virtual bool on_piece (peer_request const& /*piece*/\n+      , span<char const> /*buf*/);\n+
    \n+

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

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

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

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

    called after a choke message has been sent to the peer

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

    sent_payload()

    \n+
    \n+virtual void sent_payload (int /* bytes */);\n+
    \n+

    called after piece data has been sent to the peer\n+this can be used for stats book keeping

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

    can_disconnect()

    \n+
    \n+virtual bool can_disconnect (error_code const& /*ec*/);\n+
    \n+

    called when libtorrent think this peer should be disconnected.\n+if the plugin returns false, the peer will not be disconnected.

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

    on_extended()

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

    called when an extended message is received. If returning true,\n+the message is not processed by any other plugin and if false\n+is returned the next plugin in the chain will receive it to\n+be able to handle it. This is not called for web seeds.\n+thus function may be called more than once per incoming message, but\n+only the last of the calls will the body size equal the length.\n+i.e. Every time another fragment of the message is received, this\n+function will be called, until finally the whole message has been\n+received. The purpose of this is to allow early disconnects for invalid\n+messages and for reporting progress of receiving large messages.

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

    on_unknown_message()

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

    this is not called for web seeds

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

    on_piece_pass() on_piece_failed()

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

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

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

    tick()

    \n+
    \n+virtual void tick ();\n+
    \n+

    called approximately once every second

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

    write_request()

    \n+
    \n+virtual bool write_request (peer_request const&);\n+
    \n+

    called each time a request message is to be sent. If true\n+is returned, the original request message won't be sent and\n+no other plugin will have this function called.

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

    crypto_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

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

    decrypt()

    \n+
    \n+virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n+
    \n+

    decrypt the provided buffers.\n+returns is a tuple representing the values\n+(consume, produce, packet_size)

    \n+

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

    \n+

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

    \n+

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

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

    peer_connection_handle

    \n+

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n+

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

    \n+
    \n+struct peer_connection_handle\n+{\n+   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n+   connection_type type () const;\n+   peer_plugin const* find_plugin (string_view type) const;\n+   void add_extension (std::shared_ptr<peer_plugin>);\n+   bool is_seed () const;\n+   bool upload_only () const;\n+   peer_id const& pid () const;\n+   bool has_piece (piece_index_t i) const;\n+   bool is_choked () const;\n+   bool is_interesting () 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_disconnecting () const;\n+   bool is_connecting () const;\n+   bool is_outgoing () const;\n+   void disconnect (error_code const& ec, operation_t op\n+      , disconnect_severity_t = peer_connection_interface::normal);\n+   bool 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+   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+   std::shared_ptr<peer_connection> native_handle () const;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    bt_peer_connection_handle

    \n+

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n+

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

    \n+
    \n+struct bt_peer_connection_handle : peer_connection_handle\n+{\n+   explicit bt_peer_connection_handle (peer_connection_handle pc);\n+   bool 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+   std::shared_ptr<bt_peer_connection> native_handle () const;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    create_ut_pex_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_pex.hpp"

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

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

    \n+

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

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

    create_ut_metadata_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_metadata.hpp"

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

    constructor function for the ut_metadata extension. The ut_metadata\n+extension allows peers to request the .torrent file (or more\n+specifically the info-dictionary of the .torrent file) from each\n+other. This is the main building block in making magnet links work.\n+This extension is enabled by default unless explicitly disabled in\n+the session constructor.

    \n+

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

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

    create_smart_ban_plugin()

    \n+

    Declared in "libtorrent/extensions/smart_ban.hpp"

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

    constructor function for the smart ban extension. The extension keeps\n+track of the data peers have sent us for failing pieces and once the\n+piece completes and passes the hash check bans the peers that turned\n+out to have sent corrupt data.\n+This function can either be passed in the add_torrent_params::extensions\n+field, or via torrent_handle::add_extension().

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

    peer_class_type_filter

    \n+

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n+

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

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

    add() remove()

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

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

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

    disallow() allow()

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

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

    \n+

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

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

    apply()

    \n+
    \n+std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+
    \n+

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

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

    enum socket_type_t

    \n+

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n+
    \n \n-\n-\n-\n+\n+\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefaultvaluedescription
    incoming_starts_queued_torrentsboolfalse
    tcp_socket0these match the socket types from socket_type.hpp\n+shifted one down
    \n-

    incoming_starts_queued_torrents. If a torrent\n-has been paused by the auto managed feature in libtorrent, i.e. the\n-torrent is paused and auto managed, this feature affects whether or\n-not it is automatically started on an incoming connection. The main\n-reason to queue torrents, is not to make them unavailable, but to\n-save on the overhead of announcing to the trackers, the DHT and to\n-avoid spreading one's unchoke slots too thin. If a peer managed to\n-find us, even though we're no in the torrent anymore, this setting\n-can make us start the torrent and serve it.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    utp_socket1 
    report_true_downloadedboolfalse
    ssl_tcp_socket2 
    \n-

    when set to true, the downloaded counter sent to trackers will\n-include the actual number of payload bytes downloaded including\n-redundant bytes. If set to false, it will not include any redundancy\n-bytes

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n \n
    nametypedefault
    ssl_utp_socket3 
    strict_end_game_modebooltrue
    i2p_socket4 
    num_socket_types5 
    \n-

    strict_end_game_mode controls when a\n-block may be requested twice. If this is true, a block may only\n-be requested twice when there's at least one request to every piece\n-that's left to download in the torrent. This may slow down progress\n-on some pieces sometimes, but it may also avoid downloading a lot\n-of redundant bytes. If this is false, libtorrent attempts to\n-use each peer connection to its max, by always requesting\n-something, even if it means requesting something that has been\n-requested from another peer already.

    \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+[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+
    \n+struct bitfield\n+{\n+   bitfield (char const* b, int bits);\n+   bitfield (bitfield const& rhs);\n+   bitfield () noexcept = default;\n+   explicit bitfield (int bits);\n+   bitfield (bitfield&& rhs) noexcept = default;\n+   bitfield (int bits, bool val);\n+   void assign (char const* b, int const bits);\n+   bool operator[] (int index) const noexcept;\n+   bool get_bit (int index) const noexcept;\n+   void set_bit (int index) noexcept;\n+   void clear_bit (int index) noexcept;\n+   bool all_set () const noexcept;\n+   bool none_set () const noexcept;\n+   int size () const noexcept;\n+   int num_words () const noexcept;\n+   int num_bytes () const noexcept;\n+   bool empty () const noexcept;\n+   char* 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 (char const* b, int bits);\n+bitfield (bitfield const& rhs);\n+bitfield () noexcept = default;\n+explicit bitfield (int bits);\n+bitfield (bitfield&& rhs) noexcept = default;\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+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+

    get_bit() operator[]()

    \n+
    \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+void set_bit (int index) noexcept;\n+void clear_bit (int index) noexcept;\n+
    \n+

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

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

    all_set()

    \n+
    \n+bool all_set () const noexcept;\n+
    \n+

    returns true if all bits in the bitfield are set

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

    none_set()

    \n+
    \n+bool none_set () const noexcept;\n+
    \n+

    returns true if no bit in the bitfield is set

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

    size()

    \n+
    \n+int size () const noexcept;\n+
    \n+

    returns the size of the bitfield in bits.

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

    num_words()

    \n+
    \n+int num_words () const noexcept;\n+
    \n+

    returns the number of 32 bit words are needed to represent all bits in\n+this bitfield.

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

    num_bytes()

    \n+
    \n+int num_bytes () const noexcept;\n+
    \n+

    returns the number of bytes needed to represent all bits in this\n+bitfield

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

    empty()

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

    returns true if the bitfield has zero size.

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

    data()

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

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

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

    swap()

    \n+
    \n+void swap (bitfield& rhs) noexcept;\n+
    \n+

    swaps the bit-fields two variables refer to

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

    count()

    \n+
    \n+int count () const noexcept;\n+
    \n+

    count the number of bits in the bitfield that are set to 1.

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

    find_first_set()

    \n+
    \n+int find_first_set () const noexcept;\n+
    \n+

    returns the index of the first set bit in the bitfield, i.e. 1 bit.

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

    find_last_clear()

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

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

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

    operator=() hasher()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

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

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

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

    reset()

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

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

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

    hasher256

    \n+

    Declared in "libtorrent/hasher.hpp"

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

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

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

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

    reset()

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

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

    \n+[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-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefaultvaluedescription
    enable_outgoing_utpbooltrue
    enable_incoming_utpbooltrue
    enable_outgoing_tcpbooltrue
    url_seed0 
    enable_incoming_tcpbooltrue
    http_seed1 
    \n-

    Enables incoming and outgoing, TCP and uTP peer connections.\n-false is disabled and true is enabled. When outgoing\n-connections are disabled, libtorrent will simply not make\n-outgoing peer connections with the specific transport protocol.\n-Disabled incoming peer connections will simply be rejected.\n-These options only apply to peer connections, not tracker- or any\n-other kinds of connections.

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

    load_torrent_limits

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

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

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

    torrent_info

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

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

    \n+
    \n+class torrent_info\n+{\n+   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+   explicit torrent_info (span<char const> buffer, from_span_t);\n+   explicit torrent_info (std::string const& filename);\n+   explicit torrent_info (info_hash_t const& info_hash);\n+   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   torrent_info (torrent_info const& t);\n+   torrent_info (std::string const& filename, error_code& ec);\n+   explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+   torrent_info (char const* buffer, int size, error_code& ec);\n+   torrent_info (char const* buffer, int size);\n+   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\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 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+   void clear_trackers ();\n+   std::vector<std::string> collections () const;\n+   std::vector<sha1_hash> similar_torrents () const;\n+   void set_web_seeds (std::vector<web_seed_entry> seeds);\n+   std::vector<web_seed_entry> const& web_seeds () const;\n+   void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+   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::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 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+   char const* hash_for_piece_ptr (piece_index_t const index) const;\n+   sha1_hash hash_for_piece (piece_index_t index) const;\n+   bool is_loaded () const;\n+   const std::string& name () const;\n+   std::time_t creation_date () const;\n+   const std::string& creator () const;\n+   const std::string& comment () const;\n+   std::vector<std::pair<std::string, int>> const& nodes () const;\n+   void add_node (std::pair<std::string, int> const& node);\n+   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+   bdecode_node info (char const* key) const;\n+   span<char const> info_section () const;\n+   span<char const> piece_layer (file_index_t) const;\n+   void free_piece_layers ();\n+};\n+
    \n+[report issue]
    \n+

    torrent_info()

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

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

    \n+

    The constructor that takes a bdecode_node will create a torrent_info\n+object from the information found in the given torrent_file. The\n+bdecode_node represents a tree node in an bencoded file. To load an\n+ordinary .torrent file into a bdecode_node, use bdecode().

    \n+

    The version that takes a buffer pointer and a size will decode it as a\n+.torrent file and initialize the torrent_info object for you.

    \n+

    The version that takes a filename will simply load the torrent file\n+and decode it inside the constructor, for convenience. This might not\n+be the most suitable for applications that want to be able to report\n+detailed errors on what might go wrong.

    \n+

    There is an upper limit on the size of the torrent file that will be\n+loaded by the overload taking a filename. If it's important that even\n+very large torrent files are loaded, use one of the other overloads.

    \n+

    The overloads that takes an error_code const& never throws if an\n+error occur, they will simply set the error code to describe what went\n+wrong and not fully initialize the torrent_info object. The overloads\n+that do not take the extra error_code parameter will always throw if\n+an error occurs. These overloads are not available when building\n+without exception support.

    \n+

    The overload that takes a span also needs an extra parameter of\n+type from_span_t to disambiguate the std::string overload for\n+string literals. There is an object in the libtorrent namespace of this\n+type called from_span.

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

    ~torrent_info()

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

    frees all storage associated with this torrent_info object

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

    orig_files() files()

    \n+
    \n+file_storage const& 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() clear_trackers() trackers()

    \n+
    \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+void clear_trackers ();\n+
    \n+

    add_tracker() adds a tracker to the announce-list. The tier\n+determines the order in which the trackers are to be tried.\n+The trackers() function will return a sorted vector of\n+announce_entry. Each announce entry contains a string, which is\n+the tracker url, and a tier index. The tier index is the high-level\n+priority. No matter which trackers that works or not, the ones with\n+lower tier will always be tried before the one with higher tier\n+number. For more information, see announce_entry.

    \n+

    trackers() returns all entries from announce-list.

    \n+

    clear_trackers() removes all trackers from announce-list.

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

    collections() similar_torrents()

    \n+
    \n+std::vector<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+

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

    \n+
    \n+void set_web_seeds (std::vector<web_seed_entry> seeds);\n+std::vector<web_seed_entry> const& web_seeds () const;\n+void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+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+
    \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 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+

    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+

    v2() v1()

    \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_ptr() hash_for_piece()

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

    hash_for_piece() takes a piece-index and returns the 20-bytes\n+sha1-hash for that piece and info_hash() returns the 20-bytes\n+sha1-hash for the info-section of the torrent file.\n+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+[report issue]
    \n+
    \n+
    \n+

    announce_infohash

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+
    \n+struct announce_infohash\n+{\n+   std::string message;\n+   error_code last_error;\n+   int scrape_incomplete  = -1;\n+   int scrape_complete  = -1;\n+   int scrape_downloaded  = -1;\n+   std::uint8_t fails : 7;\n+   bool updating : 1;\n+   bool start_sent : 1;\n+   bool complete_sent : 1;\n+};\n+
    \n+[report issue]
    \n+
    message
    \n+
    if this tracker has returned an error or warning message\n+that message is stored here
    \n+
    \n+[report issue]
    \n+
    last_error
    \n+
    if this tracker failed the last time it was contacted\n+this error code specifies what error occurred
    \n+
    \n+\n+\n+[report issue]
    \n+
    scrape_incomplete scrape_complete scrape_downloaded
    \n+
    if this tracker has returned scrape data, these fields are filled in\n+with valid numbers. Otherwise they are set to -1. incomplete counts\n+the number of current downloaders. complete counts the number of\n+current peers completed the download, or "seeds". downloaded is the\n+cumulative number of completed downloads.
    \n+
    \n+[report issue]
    \n+
    fails
    \n+
    the number of times in a row we have failed to announce to this\n+tracker.
    \n+
    \n+[report issue]
    \n+
    updating
    \n+
    true while we're waiting for a response from the tracker.
    \n+
    \n+[report issue]
    \n+
    start_sent
    \n+
    set to true when we get a valid response from an announce\n+with event=started. If it is set, we won't send start in the subsequent\n+announces.
    \n+
    \n+[report issue]
    \n+
    complete_sent
    \n+
    set to true when we send a event=completed.
    \n+
    \n+[report issue]
    \n+
    \n+

    announce_endpoint

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+

    announces are sent to each tracker using every listen socket\n+this class holds information about one listen socket for one tracker

    \n+
    \n+struct announce_endpoint\n+{\n+   announce_endpoint ();\n+\n+   tcp::endpoint local_endpoint;\n+   aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n+   bool enabled  = true;\n+};\n+
    \n+[report issue]
    \n+
    local_endpoint
    \n+
    the local endpoint of the listen interface associated with this endpoint
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    info_hashes[0] is the v1 info hash (SHA1)\n+info_hashes[1] is the v2 info hash (truncated SHA-256)
    \n+
    \n+[report issue]
    \n+
    enabled
    \n+
    set to false to not announce from this endpoint
    \n+
    \n+[report issue]
    \n+
    \n+

    announce_entry

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+

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

    \n+
    \n+struct announce_entry\n+{\n+   ~announce_entry ();\n+   announce_entry (announce_entry const&);\n+   announce_entry ();\n+   explicit announce_entry (string_view u);\n+   announce_entry& operator= (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<announce_endpoint> endpoints;\n+   std::uint8_t tier  = 0;\n+   std::uint8_t fail_limit  = 0;\n+   std::uint8_t source:4;\n+   bool verified:1;\n+};\n+
    \n+\n+\n+[report issue]
    \n+

    announce_entry() operator=() ~announce_entry()

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

    constructs a tracker announce entry with u as the URL.

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

    enum tracker_source

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+
    \n \n-\n-\n \n+\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n
    nametypedefaultvaluedescription
    no_recheck_incomplete_resumeboolfalse
    source_torrent1the tracker was part of the .torrent file
    source_client2the tracker was added programmatically via the add_tracker() function
    source_magnet_link4the tracker was part of a magnet link
    source_tex8the tracker was received from the swarm via tracker exchange
    \n-

    no_recheck_incomplete_resume determines if the storage should\n-check the whole files when resume data is incomplete or missing or\n-whether it should simply assume we don't have any of the data. If\n-false, any existing files will be checked.\n-By setting this setting to true, the files won't be checked, but\n-will go straight to download mode.

    \n-\n+[report issue]
    \n+
    url
    \n+
    tracker URL as it appeared in the torrent file
    \n+
    \n+[report issue]
    \n+
    trackerid
    \n+
    the current &trackerid= argument passed to the tracker.\n+this is optional and is normally empty (in which case no\n+trackerid is sent).
    \n+
    \n+[report issue]
    \n+
    endpoints
    \n+
    each local listen socket (endpoint) will announce to the tracker. This\n+list contains state per endpoint.
    \n+
    \n+[report issue]
    \n+
    tier
    \n+
    the tier this tracker belongs to
    \n+
    \n+[report issue]
    \n+
    fail_limit
    \n+
    the max number of failures to announce to this tracker in\n+a row, before this tracker is not used anymore. 0 means unlimited
    \n+
    \n+[report issue]
    \n+
    source
    \n+
    a bitmask specifying which sources we got this tracker from.
    \n+
    \n+[report issue]
    \n+
    verified
    \n+
    set to true the first time we receive a valid response\n+from this tracker.
    \n+
    \n+

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

    \n+

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

    \n+

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n+This function builds a tree that points back into the original buffer. The\n+returned bdecode_node will not be valid once the buffer it was parsed out of\n+is discarded.

    \n+

    It's possible to construct an entry from a bdecode_node, if a structure needs\n+to be altered and re-encoded.

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

    entry

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+

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

    \n+
    \n+class entry\n+{\n+   data_type type () const;\n+   entry (dictionary_type);\n+   entry (preformatted_type);\n+   entry (list_type);\n+   entry (span<char const>);\n+   entry (integer_type);\n+   entry (U v);\n+   entry (data_type t);\n+   entry (bdecode_node const& n);\n+   entry& operator= (dictionary_type) &;\n+   entry& operator= (preformatted_type) &;\n+   entry& operator= (entry&&) & noexcept;\n+   entry& operator= (list_type) &;\n+   entry& operator= (entry const&) &;\n+   entry& operator= (bdecode_node const&) &;\n+   entry& operator= (span<char const>) &;\n+   entry& operator= (integer_type) &;\n+   entry& operator= (U v) &;\n+   list_type const& list () const;\n+   preformatted_type const& preformatted () const;\n+   string_type& string ();\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+   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+   enum data_type\n+   {\n+      int_t,\n+      string_t,\n+      list_t,\n+      dictionary_t,\n+      undefined_t,\n+      preformatted_t,\n+   };\n+};\n+
    \n+[report issue]
    \n+

    type()

    \n+
    \n+data_type type () const;\n+
    \n+

    returns the concrete type of the entry

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

    entry()

    \n+
    \n+entry (dictionary_type);\n+entry (preformatted_type);\n+entry (list_type);\n+entry (span<char const>);\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+
    \n+entry (data_type t);\n+
    \n+

    construct an empty entry of the specified type.\n+see data_type enum.

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

    entry()

    \n+
    \n+entry (bdecode_node const& n);\n+
    \n+

    construct from bdecode_node parsed form (see bdecode())

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

    operator=()

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

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

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

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

    \n+
    \n+list_type const& list () const;\n+preformatted_type const& preformatted () const;\n+string_type& string ();\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+
    \n+

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

    \n+

    If you want to create an entry you give it the type you want it to\n+have in its constructor, and then use one of the non-const accessors\n+to get a reference which you then can assign the value you want it to\n+have.

    \n+

    The typical code to get info from a torrent file will then look like\n+this:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find("announce");\n+if (i != dict.end())\n+{\n+        std::string tracker_url = i->second.string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    The following code is equivalent, but a little bit shorter:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key("announce"))\n+{\n+        std::string tracker_url = i->string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    To make it easier to extract information from a torrent file, the\n+class torrent_info exists.

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

    swap()

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

    swaps the content of this with e.

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

    operator[]()

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

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

    \n+

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

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

    find_key()

    \n+
    \n+entry const* find_key (string_view key) const;\n+entry* find_key (string_view key);\n+
    \n+

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

    \n+

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

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

    to_string()

    \n+
    \n+std::string to_string (bool single_line = false) const;\n+
    \n+

    returns a pretty-printed string representation\n+of the bencoded structure, with JSON-style syntax

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

    enum data_type

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+
    \n \n-\n+\n \n-\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefaultvaluedescription
    anonymous_modeboolfalse
    int_t0 
    \n-

    anonymous_mode: When set to true, the client tries to hide\n-its identity to a certain degree.

    \n-
      \n-
    • A generic user-agent will be\n-used for trackers (except for private torrents).
    • \n-
    • Your local IPv4 and IPv6 address won't be sent as query string\n-parameters to private trackers.
    • \n-
    • If announce_ip is configured, it will not be sent to trackers
    • \n-
    • The client version will not be sent to peers in the extension\n-handshake.
    • \n-
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    string_t1 
    report_web_seed_downloadsbooltrue
    list_t2 
    \n-

    specifies whether downloads from web seeds is reported to the\n-tracker or not. Turning it off also excludes web\n-seed traffic from other stats and download rate reporting via the\n-libtorrent API.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n \n
    nametypedefault
    dictionary_t3 
    seeding_outgoing_connectionsbooltrue
    undefined_t4 
    preformatted_t5 
    \n-

    seeding_outgoing_connections determines if seeding (and\n-finished) torrents should attempt to make outgoing connections or\n-not. It may be set to false in very\n-specific applications where the cost of making outgoing connections\n-is high, and there are no or small benefits of doing so. For\n-instance, if no nodes are behind a firewall or a NAT, seeds don't\n-need to make outgoing connections.

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

    bencode()

    \n+

    Declared in "libtorrent/bencode.hpp"

    \n+
    \n+template<class OutIt> int bencode (OutIt out, const entry& e);\n+
    \n+

    This function will encode data to bencoded form.

    \n+

    The entry class is the internal representation of the bencoded data\n+and it can be used to retrieve information, an entry can also be build by\n+the program and given to bencode() to encode it into the OutIt\n+iterator.

    \n+

    OutIt is an OutputIterator. It's a template and usually\n+instantiated as ostream_iterator or back_insert_iterator. This\n+function assumes the value_type of the iterator is a char.\n+In order to encode entry e into a buffer, do:

    \n+
    \n+std::vector<char> buf;\n+bencode(std::back_inserter(buf), e);\n+
    \n+[report issue]
    \n+
    \n+

    file_slice

    \n+

    Declared in "libtorrent/file_storage.hpp"

    \n+

    represents a window of a file in a torrent.

    \n+

    The file_index refers to the index of the file (in the torrent_info).\n+To get the path and filename, use file_path() and give the file_index\n+as argument. The offset is the byte offset in the file where the range\n+starts, and size is the number of bytes this range is. The size + offset\n+will never be greater than the file size.

    \n+
    \n+struct file_slice\n+{\n+   file_index_t file_index;\n+   std::int64_t offset;\n+   std::int64_t size;\n+};\n+
    \n+[report issue]
    \n+
    file_index
    \n+
    the index of the file
    \n+
    \n+[report issue]
    \n+
    offset
    \n+
    the offset from the start of the file, in bytes
    \n+
    \n+[report issue]
    \n+
    size
    \n+
    the size of the window, in bytes
    \n+
    \n+[report issue]
    \n+
    \n+

    file_storage

    \n+

    Declared in "libtorrent/file_storage.hpp"

    \n+

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

    \n+
    \n+class file_storage\n+{\n+   bool is_valid () const;\n+   void reserve (int num_files);\n+   void add_file (std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void 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+   int num_pieces () const;\n+   void set_num_pieces (int n);\n+   piece_index_t end_piece () const;\n+   piece_index_t last_piece () const;\n+   index_range<piece_index_t> piece_range () const noexcept;\n+   void set_piece_length (int l);\n+   int piece_length () const;\n+   int piece_size (piece_index_t index) const;\n+   int piece_size2 (piece_index_t index) const;\n+   int blocks_in_piece2 (piece_index_t index) const;\n+   int blocks_per_piece () const;\n+   std::string const& name () const;\n+   void set_name (std::string const& n);\n+   void swap (file_storage& ti) noexcept;\n+   void canonicalize ();\n+   sha1_hash hash (file_index_t index) const;\n+   std::string symlink (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   char const* root_ptr (file_index_t const index) const;\n+   string_view file_name (file_index_t index) const;\n+   std::int64_t file_size (file_index_t index) const;\n+   std::int64_t file_offset (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+   bool pad_file_at (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+   index_range<piece_index_t::diff_type> file_piece_range (file_index_t) 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_for_root (sha256_hash const& root_hash) const;\n+   piece_index_t piece_index_at_file (file_index_t f) const;\n+   void sanitize_symlinks ();\n+   bool v2 () const;\n+\n+   static constexpr file_flags_t flag_pad_file  = 0_bit;\n+   static constexpr file_flags_t flag_hidden  = 1_bit;\n+   static constexpr file_flags_t flag_executable  = 2_bit;\n+   static constexpr file_flags_t flag_symlink  = 3_bit;\n+};\n+
    \n+[report issue]
    \n+

    is_valid()

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

    returns true if the piece length has been initialized\n+on the file_storage. This is typically taken as a proxy\n+of whether the file_storage as a whole is initialized or\n+not.

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

    reserve()

    \n+
    \n+void reserve (int num_files);\n+
    \n+

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

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

    add_file() add_file_borrow()

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

    Adds a file to the file storage. The add_file_borrow version\n+expects that filename is the file name (without a path) of\n+the file that's being added.\n+This memory is borrowed, i.e. it is the caller's\n+responsibility to make sure it stays valid throughout the lifetime\n+of this file_storage object or any copy of it. The same thing applies\n+to filehash, which is an optional pointer to a 20 byte binary\n+SHA-1 hash of the file.

    \n+

    if filename is empty, the filename from path is used and not\n+borrowed.

    \n+

    The path argument is the full path (in the torrent file) to\n+the file to add. Note that this is not supposed to be an absolute\n+path, but it is expected to include the name of the torrent as the\n+first path element.

    \n+

    file_size is the size of the file in bytes.

    \n+

    The file_flags argument sets attributes on the file. The file\n+attributes is an extension and may not work in all bittorrent clients.

    \n+

    For possible file attributes, see file_storage::flags_t.

    \n+

    The mtime argument is optional and can be set to 0. If non-zero,\n+it is the posix time of the last modification time of this file.

    \n+

    symlink_path is the path the file is a symlink to. To make this a\n+symlink you also need to set the file_storage::flag_symlink file flag.

    \n+

    root_hash is an optional pointer to a 32 byte SHA-256 hash, being\n+the merkle tree root hash for this file. This is only used for v2\n+torrents. If the root hash is specified for one file, it has to\n+be specified for all, otherwise this function will fail.\n+Note that the buffer root_hash points to must out-live the\n+file_storage object, it will not be copied. This parameter is only\n+used when loading torrents, that already have their file hashes\n+computed. When creating torrents, the file hashes will be computed by\n+the piece hashes.

    \n+

    If more files than one are added, certain restrictions to their paths\n+apply. In a multi-file file storage (torrent), all files must share\n+the same root directory.

    \n+

    That is, the first path element of all files must be the same.\n+This shared path element is also set to the name of the torrent. It\n+can be changed by calling set_name.

    \n+

    The overloads that take an error_code reference will report failures\n+via that variable, otherwise system_error is thrown.

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

    rename_file()

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

    renames the file at index to new_filename. Keep in mind\n+that filenames are expected to be UTF-8 encoded.

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

    map_block()

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

    returns a list of file_slice objects representing the portions of\n+files the specified piece index, byte offset and size range overlaps.\n+this is the inverse mapping of map_file().

    \n+

    Preconditions of this function is that the input range is within the\n+torrents address space. piece may not be negative and

    \n+
    \n+piece * piece_size + offset + size
    \n+

    may not exceed the total size of the torrent.

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

    map_file()

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

    returns a peer_request representing the piece index, byte offset\n+and size the specified file range overlaps. This is the inverse\n+mapping over map_block(). Note that the peer_request return type\n+is meant to hold bittorrent block requests, which may not be larger\n+than 16 kiB. Mapping a range larger than that may return an overflown\n+integer.

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

    num_files()

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

    returns the number of files in the file_storage

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

    end_file()

    \n+
    \n+file_index_t end_file () const noexcept;\n+
    \n+

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

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

    file_range()

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

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

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

    total_size()

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

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

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

    num_pieces() set_num_pieces()

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

    set and get the number of pieces in the torrent

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

    end_piece()

    \n+
    \n+piece_index_t end_piece () const;\n+
    \n+

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

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

    last_piece()

    \n+
    \n+piece_index_t last_piece () const;\n+
    \n+

    returns the index of the last piece in the torrent. The last piece is\n+special in that it may be smaller than the other pieces (and the other\n+pieces are all the same size).

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

    piece_range()

    \n+
    \n+index_range<piece_index_t> piece_range () const noexcept;\n+
    \n+

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

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

    piece_length() set_piece_length()

    \n+
    \n+void set_piece_length (int l);\n+int piece_length () const;\n+
    \n+

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

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

    piece_size()

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

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

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

    piece_size2()

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

    Returns the size of the given piece. If the piece spans multiple files,\n+only the first file is considered part of the piece. This is used for\n+v2 torrents, where all files are piece aligned and padded. i.e. The pad\n+files are not considered part of the piece for this purpose.

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

    blocks_in_piece2()

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

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

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

    blocks_per_piece()

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

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

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

    set_name() name()

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

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

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

    swap()

    \n+
    \n+void swap (file_storage& ti) noexcept;\n+
    \n+

    swap all content of this with ti.

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

    canonicalize()

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

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

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

    mtime() hash() root() file_path() file_offset() file_size() root_ptr() file_name() pad_file_at() symlink()

    \n+
    \n+sha1_hash hash (file_index_t index) const;\n+std::string symlink (file_index_t index) const;\n+std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+char const* root_ptr (file_index_t const index) const;\n+string_view file_name (file_index_t index) const;\n+std::int64_t file_size (file_index_t index) const;\n+std::int64_t file_offset (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+bool pad_file_at (file_index_t index) const;\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_blocks() file_num_pieces()

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

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

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

    file_first_piece_node() file_first_block_node()

    \n+
    \n+int file_first_piece_node (file_index_t index) const;\n+int file_first_block_node (file_index_t index) const;\n+
    \n+

    index of first piece node in the merkle tree

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

    file_path_hash()

    \n+
    \n+std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+
    \n+

    returns the crc32 hash of file_path(index)

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

    all_path_hashes()

    \n+
    \n+void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+
    \n+

    this will add the CRC32 hash of all directory entries to the table. No\n+filename will be included, just directories. Every depth of directories\n+are added separately to allow test for collisions with files at all\n+levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32\n+hashes for foo, foo/bar and foo/bar/baz will be added to\n+the set.

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

    file_flags()

    \n+
    \n+file_flags_t file_flags (file_index_t index) const;\n+
    \n+

    returns a bitmask of flags from file_flags_t that apply\n+to file at index.

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

    file_absolute_path()

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

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

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

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

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

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

    file_index_for_root()

    \n+
    \n+file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+
    \n+

    finds the file with the given root hash and returns its index\n+if there is no file with the root hash, file_index_t{-1} is returned

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

    piece_index_at_file()

    \n+
    \n+piece_index_t piece_index_at_file (file_index_t f) const;\n+
    \n+

    returns the piece index the given file starts at

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

    sanitize_symlinks()

    \n+
    \n+void sanitize_symlinks ();\n+
    \n+

    validate any symlinks, to ensure they all point to\n+other files or directories inside this storage. Any invalid symlinks\n+are updated to point to themselves.

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

    v2()

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

    returns true if this torrent contains v2 metadata.

    \n+[report issue]
    \n+
    flag_pad_file
    \n+
    the file is a pad file. It's required to contain zeros\n+at it will not be saved to disk. Its purpose is to make\n+the following file start on a piece boundary.
    \n+
    \n+[report issue]
    \n+
    flag_hidden
    \n+
    this file has the hidden attribute set. This is primarily\n+a windows attribute
    \n+
    \n+[report issue]
    \n+
    flag_executable
    \n+
    this file has the executable attribute set.
    \n+
    \n+[report issue]
    \n+
    flag_symlink
    \n+
    this file is a symbolic link. It should have a link\n+target string associated with it.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    storage_params

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+

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

    \n+
    \n+struct storage_params\n+{\n+   storage_params (file_storage const& f, file_storage const* mf\n+      , std::string const& sp, storage_mode_t const sm\n+      , aux::vector<download_priority_t, file_index_t> const& prio\n+      , sha1_hash const& ih);\n+\n+   file_storage const& files;\n+   file_storage const* mapped_files  = nullptr;\n+   std::string const& path;\n+   storage_mode_t mode {storage_mode_sparse};\n+   aux::vector<download_priority_t, file_index_t> const& priorities;\n+   sha1_hash info_hash;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    constructs a memory mapped file disk I/O object.

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

    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+

    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+

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

    when this is true, libtorrent will not attempt to make outgoing\n-connections to peers whose port is < 1024. This is a safety\n-precaution to avoid being part of a DDoS attack

    \n-\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-
    nametypedefaultvaluedescription
    smooth_connectsbooltrue
    no_error0 
    \n-

    smooth_connects means the number of\n-connection attempts per second may be limited to below the\n-connection_speed, in case we're close to bump up against the\n-limit of number of connections. The intention of this setting is to\n-more evenly distribute our connection attempts over time, instead\n-of attempting to connect in batches, and timing them out in\n-batches.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    fatal_disk_error1 
    always_send_user_agentboolfalse
    need_full_check2 
    \n-

    always send user-agent in every web seed request. If false, only\n-the first request per http connection will include the user agent

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    file_exist3 
    apply_ip_filter_to_trackersbooltrue
    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-

    apply_ip_filter_to_trackers determines\n-whether the IP filter applies to trackers as well as peers. If this\n-is set to false, trackers are exempt from the IP filter (if there\n-is one). If no IP filter is set, this setting is irrelevant.

    \n-\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-
    nametypedefaultvaluedescription
    ban_web_seedsbooltrue
    always_replace_files0replace any files in the destination when copying\n+or moving the storage
    \n-

    when true, web seeds sending bad data will be banned

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    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.
    support_share_modebooltrue
    dont_replace2if any file exist in the target, take those files instead\n+of the ones we may have in the source.
    \n-

    if false, prevents libtorrent to advertise share-mode support

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    reset_save_path3don't move any source files, just forget about them\n+and begin checking files at new save path
    report_redundant_bytesbooltrue
    reset_save_path_unchecked4don't move any source files, just change save path\n+and continue working without any checks
    \n-

    if this is true, the number of redundant bytes is sent to the\n-tracker

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

    i2p_category()

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

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

    returns the error category for I2P errors

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

    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+

    libtorrent_category()

    \n+

    Declared in "libtorrent/error_code.hpp"

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

    returns the error_category for HTTP 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+

    pcp_category()

    \n+

    Declared in "libtorrent/natpmp.hpp"

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

    gzip_category()

    \n+

    Declared in "libtorrent/gzip.hpp"

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

    get the error_category for zip errors

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

    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-
    nametypedefaultvaluedescription
    listen_system_port_fallbackbooltrue
    no_error0 
    \n-

    if this is true, libtorrent will fall back to listening on a port\n-chosen by the operating system (i.e. binding to port 0). If a\n-failure is preferred, set this to false.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    parse_failed1 
    announce_crypto_supportbooltrue
    cant_reach_peer2 
    \n-

    when this is true, and incoming encrypted connections are enabled,\n-&supportcrypt=1 is included in http tracker announces

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    i2p_error3 
    enable_upnpbooltrue
    invalid_key4 
    \n-

    Starts and stops the UPnP service. When started, the listen port\n-and the DHT port are attempted to be forwarded on local UPnP router\n-devices.

    \n-

    The upnp object returned by start_upnp() can be used to add and\n-remove arbitrary port mappings. Mapping status is returned through\n-the portmap_alert and the portmap_error_alert. The object will be\n-valid until stop_upnp() is called. See upnp and nat pmp.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_id5 
    enable_natpmpbooltrue
    timeout6 
    \n-

    Starts and stops the NAT-PMP service. When started, the listen port\n-and the DHT port are attempted to be forwarded on the router\n-through NAT-PMP.

    \n-

    The natpmp object returned by start_natpmp() can be used to add\n-and remove arbitrary port mappings. Mapping status is returned\n-through the portmap_alert and the portmap_error_alert. The object\n-will be valid until stop_natpmp() is called. See\n-upnp and nat pmp.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n \n
    nametypedefault
    key_not_found7 
    enable_lsdbooltrue
    duplicated_id8 
    num_errors9 
    \n-

    Starts and stops Local Service Discovery. This service will\n-broadcast the info-hashes of all the non-private torrents on the\n-local network to look for peers on the same swarm within multicast\n-reach.

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n \n-\n-\n-\n+\n+\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefaultvaluedescription
    enable_dhtbooltrue
    no_error0Not an error
    \n-

    starts the dht node and makes the trackerless service available to\n-torrents.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    expected_digit1expected digit in bencoded string
    prefer_rc4boolfalse
    expected_colon2expected colon in bencoded string
    \n-

    if the allowed encryption level is both, setting this to true will\n-prefer RC4 if both methods are offered, plain text otherwise

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    unexpected_eof3unexpected end of file in bencoded string
    proxy_hostnamesbooltrue
    expected_value4expected value (list, dict, int or string) in bencoded string
    \n-

    if true, hostname lookups are done via the configured proxy (if\n-any). This is only supported by SOCKS5 and HTTP.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    depth_exceeded5bencoded recursion depth limit exceeded
    proxy_peer_connectionsbooltrue
    limit_exceeded6bencoded item count limit exceeded
    \n-

    if true, peer connections are made (and accepted) over the\n-configured proxy, if any. Web seeds as well as regular bittorrent\n-peer connections are considered "peer connections". Anything\n-transporting actual torrent payload (trackers and DHT traffic are\n-not considered peer connections).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    overflow7integer overflow
    auto_sequentialbooltrue
    error_code_max8the number of error codes
    \n-

    if this setting is true, torrents with a very high availability of\n-pieces (and seeds) are downloaded sequentially. This is more\n-efficient for the disk I/O. With many seeds, the download order is\n-unlikely to matter anyway

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

    enum socks_error_code

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n+
    \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefaultvaluedescription
    proxy_tracker_connectionsbooltrue
    no_error0 
    \n-

    if true, tracker connections are made over the configured proxy, if\n-any.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    unsupported_version1 
    enable_ip_notifierbooltrue
    unsupported_authentication_method2 
    \n-

    Starts and stops the internal IP table route changes notifier.

    \n-

    The current implementation supports multiple platforms, and it is\n-recommended to have it enable, but you may want to disable it if\n-it's supported but unreliable, or if you have a better way to\n-detect the changes. In the later case, you should manually call\n-session_handle::reopen_network_sockets to ensure network\n-changes are taken in consideration.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    unsupported_authentication_version3 
    dht_prefer_verified_node_idsbooltrue
    authentication_error4 
    \n-

    when this is true, nodes whose IDs are derived from their source\n-IP according to BEP 42 are preferred in the routing table.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    username_required5 
    dht_restrict_routing_ipsbooltrue
    general_failure6 
    \n-

    determines if the routing table entries should restrict entries to one\n-per IP. This defaults to true, which helps mitigate some attacks on\n-the DHT. It prevents adding multiple nodes with IPs with a very close\n-CIDR distance.

    \n-

    when set, nodes whose IP address that's in the same /24 (or /64 for\n-IPv6) range in the same routing table bucket. This is an attempt to\n-mitigate node ID spoofing attacks also restrict any IP to only have a\n-single entry in the whole routing table

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    command_not_supported7 
    dht_restrict_search_ipsbooltrue
    no_identd8 
    \n-

    determines if DHT searches should prevent adding nodes with IPs with\n-very close CIDR distance. This also defaults to true and helps\n-mitigate certain attacks on the DHT.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    identd_error9 
    dht_extended_routing_tablebooltrue
    num_errors10 
    \n-

    makes the first buckets in the DHT routing table fit 128, 64, 32 and\n-16 nodes respectively, as opposed to the standard size of 8. All other\n-buckets have size 8 still.

    \n-\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-
    nametypedefaultvaluedescription
    dht_aggressive_lookupsbooltrue
    no_error0Not an error
    \n-

    slightly changes the lookup behavior in terms of how many outstanding\n-requests we keep. Instead of having branch factor be a hard limit, we\n-always keep branch factor outstanding requests to the closest nodes.\n-i.e. every time we get results back with closer nodes, we query them\n-right away. It lowers the lookup times at the cost of more outstanding\n-queries.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    file_collision1Two torrents has files which end up overwriting each other
    dht_privacy_lookupsboolfalse
    failed_hash_check2A piece did not match its piece hash
    \n-

    when set, perform lookups in a way that is slightly more expensive,\n-but which minimizes the amount of information leaked about you.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    torrent_is_no_dict3The .torrent file does not contain a bencoded dictionary at\n+its top level
    dht_enforce_node_idboolfalse
    \n-

    when set, node's whose IDs that are not correctly generated based on\n-its external IP are ignored. When a query arrives from such node, an\n-error message is returned with a message saying "invalid node ID".

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_ignore_dark_internetbooltrue
    \n-

    ignore DHT messages from parts of the internet we wouldn't expect to\n-see any traffic from

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_read_onlyboolfalse
    \n-

    when set, the other nodes won't keep this node in their routing\n-tables, it's meant for low-power and/or ephemeral devices that\n-cannot support the DHT, it is also useful for mobile devices which\n-are sensitive to network traffic and battery life.\n-this node no longer responds to 'query' messages, and will place a\n-'ro' key (value = 1) in the top-level message dictionary of outgoing\n-query messages.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    piece_extent_affinityboolfalse
    \n-

    when this is true, create an affinity for downloading 4 MiB extents\n-of adjacent pieces. This is an attempt to achieve better disk I/O\n-throughput by downloading larger extents of bytes, for torrents with\n-small piece sizes

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    validate_https_trackersbooltrue
    \n-

    when set to true, the certificate of HTTPS trackers and HTTPS web\n-seeds will be validated against the system's certificate store\n-(as defined by OpenSSL). If the system does not have a\n-certificate store, this option may have to be disabled in order\n-to get trackers and web seeds to work).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    ssrf_mitigationbooltrue
    \n-

    when enabled, tracker and web seed requests are subject to\n-certain restrictions.

    \n-

    An HTTP(s) tracker requests to localhost (loopback)\n-must have the request path start with "/announce". This is the\n-conventional bittorrent tracker request. Any other HTTP(S)\n-tracker request to loopback will be rejected. This applies to\n-trackers that redirect to loopback as well.

    \n-

    Web seeds that end up on the client's local network (i.e. in a\n-private IP address range) may not include query string arguments.\n-This applies to web seeds redirecting to the local network as\n-well.

    \n-

    Web seeds on global IPs (i.e. not local network) may not redirect\n-to a local network address

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    allow_idnaboolfalse
    \n-

    when disabled, any tracker or web seed with an IDNA hostname\n-(internationalized domain name) is ignored. This is a security\n-precaution to avoid various unicode encoding attacks that might\n-happen at the application level.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    enable_set_file_valid_databoolfalse
    \n-

    when set to true, enables the attempt to use SetFileValidData()\n-to pre-allocate disk space. This system call will only work when\n-running with Administrator privileges on Windows, and so this\n-setting is only relevant in that scenario. Using\n-SetFileValidData() poses a security risk, as it may reveal\n-previously deleted information from the disk.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    socks5_udp_send_local_epboolfalse
    \n-

    When using a SOCKS5 proxy, UDP traffic is routed through the\n-proxy by sending a UDP ASSOCIATE command. If this option is true,\n-the UDP ASSOCIATE command will include the IP address and\n-listen port to the local UDP socket. This indicates to the proxy\n-which source endpoint to expect our packets from. The benefit is\n-that incoming packets can be forwarded correctly, before any\n-outgoing packets are sent. The risk is that if there's a NAT\n-between the client and the proxy, the IP address specified in the\n-protocol may not be valid from the proxy's point of view.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    tracker_completion_timeoutint30
    \n-

    tracker_completion_timeout is the number of seconds the tracker\n-connection will wait from when it sent the request until it\n-considers the tracker to have timed-out.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    tracker_receive_timeoutint10
    \n-

    tracker_receive_timeout is the number of seconds to wait to\n-receive any data from the tracker. If no data is received for this\n-number of seconds, the tracker will be considered as having timed\n-out. If a tracker is down, this is the kind of timeout that will\n-occur.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n \n+\n \n-\n-
    nametypedefault
    torrent_missing_info4The .torrent file does not have an info dictionary
    stop_tracker_timeoutint
    torrent_info_no_dict5The .torrent file's info entry is not a dictionary
    \n-

    stop_tracker_timeout is the number of seconds to wait when\n-sending a stopped message before considering a tracker to have\n-timed out. This is usually shorter, to make the client quit faster.\n-If the value is set to 0, the connections to trackers with the\n-stopped event are suppressed.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    tracker_maximum_response_lengthint1024*1024
    \n-

    this is the maximum number of bytes in a tracker response. If a\n-response size passes this number of bytes it will be rejected and\n-the connection will be closed. On gzipped responses this size is\n-measured on the uncompressed data. So, if you get 20 bytes of gzip\n-response that'll expand to 2 megabytes, it will be interrupted\n-before the entire response has been uncompressed (assuming the\n-limit is lower than 2 MiB).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    piece_timeoutint20
    torrent_missing_piece_length6The .torrent file does not have a piece length entry
    \n-

    the number of seconds from a request is sent until it times out if\n-no piece response is returned.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_missing_name7The .torrent file does not have a name entry
    request_timeoutint60
    torrent_invalid_name8The .torrent file's name entry is invalid
    \n-

    the number of seconds one block (16 kiB) is expected to be received\n-within. If it's not, the block is requested from a different peer

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_invalid_length9The length of a file, or of the whole .torrent file is invalid.\n+Either negative or not an integer
    request_queue_timeint3
    torrent_file_parse_failed10Failed to parse a file entry in the .torrent
    \n-

    the length of the request queue given in the number of seconds it\n-should take for the other end to send all the pieces. i.e. the\n-actual number of requests depends on the download rate and this\n-number.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_missing_pieces11The pieces field is missing or invalid in the .torrent file
    max_allowed_in_request_queueint2000
    torrent_invalid_hashes12The pieces string has incorrect length
    \n-

    the number of outstanding block requests a peer is allowed to queue\n-up in the client. If a peer sends more requests than this (before\n-the first one has been sent) the last request will be dropped. the\n-higher this is, the faster upload speeds the client can get to a\n-single peer.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    too_many_pieces_in_torrent13The .torrent file has more pieces than is supported by libtorrent
    max_out_request_queueint500
    invalid_swarm_metadata14The metadata (.torrent file) that was received from the swarm\n+matched the info-hash, but failed to be parsed
    \n-

    max_out_request_queue is the maximum number of outstanding\n-requests to send to a peer. This limit takes precedence over\n-request_queue_time. i.e. no matter the download speed, the\n-number of outstanding requests will never exceed this limit.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_bencoding15The file or buffer is not correctly bencoded
    whole_pieces_thresholdint20
    no_files_in_torrent16The .torrent file does not contain any files
    \n-

    if a whole piece can be downloaded in this number of seconds, or\n-less, the peer_connection will prefer to request whole pieces at a\n-time from this peer. The benefit of this is to better utilize disk\n-caches by doing localized accesses and also to make it easier to\n-identify bad peers if a piece fails the hash check.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_escaped_string17The string was not properly url-encoded as expected
    peer_timeoutint120
    session_is_closing18Operation is not permitted since the session is shutting down
    \n-

    peer_timeout is the number of seconds the peer connection\n-should wait (for any activity on the peer connection) before\n-closing it due to time out. 120 seconds is\n-specified in the protocol specification. After half\n-the time out, a keep alive message is sent.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n \n+\n \n-\n-
    nametypedefault
    duplicate_torrent19There's already a torrent with that info-hash added to the\n+session
    urlseed_timeoutint
    invalid_torrent_handle20The supplied torrent_handle is not referring to a valid torrent
    \n-

    same as peer_timeout, but only applies to url-seeds. this is\n-usually set lower, because web servers are expected to be more\n-reliable.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    urlseed_pipeline_sizeint5
    \n-

    controls the pipelining size of url and http seeds. i.e. the number of HTTP\n-request to keep outstanding before waiting for the first one to\n-complete. It's common for web servers to limit this to a relatively\n-low number, like 5

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    urlseed_wait_retryint30
    \n-

    number of seconds until a new retry of a url-seed takes place.\n-Default retry value for http-seeds that don't provide\n-a valid retry-after header.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_entry_type21The type requested from the entry did not match its type
    file_pool_sizeint40
    missing_info_hash_in_uri22The specified URI does not contain a valid info-hash
    \n-

    sets the upper limit on the total number of files this session will\n-keep open. The reason why files are left open at all is that some\n-anti virus software hooks on every file close, and scans the file\n-for viruses. deferring the closing of the files will be the\n-difference between a usable system and a completely hogged down\n-system. Most operating systems also has a limit on the total number\n-of file descriptors a process may have open.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    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
    max_failcountint3
    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.
    \n-

    max_failcount is the maximum times we try to\n-connect to a peer before stop connecting again. If a\n-peer succeeds, the failure counter is reset. If a\n-peer is retrieved from a peer source (other than DHT)\n-the failcount is decremented by one, allowing another\n-try.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    url_parse_error25The URL did not conform to URL syntax and failed to be parsed
    min_reconnect_timeint60
    peer_sent_empty_piece26The peer sent a piece message of length 0
    \n-

    the number of seconds to wait to reconnect to a peer. this time is\n-multiplied with the failcount.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    parse_failed27A bencoded structure was corrupt and failed to be parsed
    peer_connect_timeoutint15
    invalid_file_tag28The fast resume file was missing or had an invalid file version\n+tag
    \n-

    peer_connect_timeout the number of seconds to wait after a\n-connection attempt is initiated to a peer until it is considered as\n-having timed out. This setting is especially important in case the\n-number of half-open connections are limited, since stale half-open\n-connection may delay the connection of other peers considerably.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n \n+\n \n-\n-
    nametypedefault
    missing_info_hash29The fast resume file was missing or had an invalid info-hash
    connection_speedint
    mismatching_info_hash30The info-hash did not match the torrent
    \n-

    connection_speed is the number of connection attempts that are\n-made per second. If a number < 0 is specified, it will default to\n-200 connections per second. If 0 is specified, it means don't make\n-outgoing connections at all.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    inactivity_timeoutint600
    \n-

    if a peer is uninteresting and uninterested for longer than this\n-number of seconds, it will be disconnected.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_hostname31The URL contained an invalid hostname
    unchoke_intervalint15
    invalid_port32The URL had an invalid port
    \n-

    unchoke_interval is the number of seconds between\n-chokes/unchokes. On this interval, peers are re-evaluated for being\n-choked/unchoked. This is defined as 30 seconds in the protocol, and\n-it should be significantly longer than what it takes for TCP to\n-ramp up to it's max rate.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    port_blocked33The port is blocked by the port-filter, and prevented the\n+connection
    optimistic_unchoke_intervalint30
    expected_close_bracket_in_address34The IPv6 address was expected to end with "]"
    \n-

    optimistic_unchoke_interval is the number of seconds between\n-each optimistic unchoke. On this timer, the currently\n-optimistically unchoked peer will change.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    destructing_torrent35The torrent is being destructed, preventing the operation to\n+succeed
    num_wantint200
    timed_out36The connection timed out
    \n-

    num_want is the number of peers we want from each tracker\n-request. It defines what is sent as the &num_want= parameter to\n-the tracker.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    upload_upload_connection37The peer is upload only, and we are upload only. There's no point\n+in keeping the connection
    initial_picker_thresholdint4
    uninteresting_upload_peer38The peer is upload only, and we're not interested in it. There's\n+no point in keeping the connection
    \n-

    initial_picker_threshold specifies the number of pieces we need\n-before we switch to rarest first picking. The first\n-initial_picker_threshold pieces in any torrent are picked at random\n-, the following pieces are picked in rarest first order.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_info_hash39The peer sent an unknown info-hash
    allowed_fast_set_sizeint5
    torrent_paused40The torrent is paused, preventing the operation from succeeding
    \n-

    the number of allowed pieces to send to peers that supports the\n-fast extensions

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_have41The peer sent an invalid have message, either wrong size or\n+referring to a piece that doesn't exist in the torrent
    suggest_modeintsettings_pack::no_piece_suggestions
    invalid_bitfield_size42The bitfield message had the incorrect size
    \n-

    suggest_mode controls whether or not libtorrent will send out\n-suggest messages to create a bias of its peers to request certain\n-pieces. The modes are:

    \n-
      \n-
    • no_piece_suggestions which will not send out suggest messages.
    • \n-
    • suggest_read_cache which will send out suggest messages for\n-the most recent pieces that are in the read cache.
    • \n-
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    too_many_requests_when_choked43The peer kept requesting pieces after it was choked, possible\n+abuse attempt.
    max_queued_disk_bytesint1024 * 1024
    invalid_piece44The peer sent a piece message that does not correspond to a\n+piece request sent by the client
    \n-

    max_queued_disk_bytes is the maximum number of bytes, to\n-be written to disk, that can wait in the disk I/O thread queue.\n-This queue is only for waiting for the disk I/O thread to receive\n-the job and either write it to disk or insert it in the write\n-cache. When this limit is reached, the peer connections will stop\n-reading data from their sockets, until the disk thread catches up.\n-Setting this too low will severely limit your download rate.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_memory45memory allocation failed
    handshake_timeoutint10
    torrent_aborted46The torrent is aborted, preventing the operation to succeed
    \n-

    the number of seconds to wait for a handshake response from a peer.\n-If no response is received within this time, the peer is\n-disconnected.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n+\n \n+\n \n-\n-
    nametypedefault
    self_connection47The peer is a connection to ourself, no point in keeping it
    send_buffer_low_watermarkint10 * 1024
    invalid_piece_size48The peer sent a piece message with invalid size, either negative\n+or greater than one block
    send_buffer_watermarkint500 * 1024
    timed_out_no_interest49The peer has not been interesting or interested in us for too\n+long, no point in keeping it around
    send_buffer_watermark_factorint
    timed_out_inactivity50The peer has not said anything in a long time, possibly dead
    \n-

    send_buffer_low_watermark the minimum send buffer target size\n-(send buffer includes bytes pending being read from disk). For good\n-and snappy seeding performance, set this fairly high, to at least\n-fit a few blocks. This is essentially the initial window size which\n-will determine how fast we can ramp up the send rate

    \n-

    if the send buffer has fewer bytes than send_buffer_watermark,\n-we'll read another 16 kiB block onto it. If set too small, upload\n-rate capacity will suffer. If set too high, memory will be wasted.\n-The actual watermark may be lower than this in case the upload rate\n-is low, this is the upper limit.

    \n-

    the current upload rate to a peer is multiplied by this factor to\n-get the send buffer watermark. The factor is specified as a\n-percentage. i.e. 50 -> 0.5 This product is clamped to the\n-send_buffer_watermark setting to not exceed the max. For high\n-speed upload, this should be set to a greater value than 100. For\n-high capacity connections, setting this higher can improve upload\n-performance and disk throughput. Setting it too high may waste RAM\n-and create a bias towards read jobs over write jobs.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    choking_algorithmintsettings_pack::fixed_slots_choker
    seed_choking_algorithmintsettings_pack::round_robin
    \n-

    choking_algorithm specifies which algorithm to use to determine\n-how many peers to unchoke. The unchoking algorithm for\n-downloading torrents is always "tit-for-tat", i.e. the peers we\n-download the fastest from are unchoked.

    \n-

    The options for choking algorithms are defined in the\n-choking_algorithm_t enum.

    \n-

    seed_choking_algorithm controls the seeding unchoke behavior.\n-i.e. How we select which peers to unchoke for seeding torrents.\n-Since a seeding torrent isn't downloading anything, the\n-tit-for-tat mechanism cannot be used. The available options are\n-defined in the seed_choking_algorithm_t enum.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    disk_io_write_modeintDISK_WRITE_MODE
    disk_io_read_modeintsettings_pack::enable_os_cache
    \n-

    determines how files are opened when they're in read only mode\n-versus read and write mode. The options are:

    \n-
    \n-
    enable_os_cache
    \n-
    Files are opened normally, with the OS caching reads and writes.
    \n-
    disable_os_cache
    \n-
    This opens all files in no-cache mode. This corresponds to the\n-OS not letting blocks for the files linger in the cache. This\n-makes sense in order to avoid the bittorrent client to\n-potentially evict all other processes' cache by simply handling\n-high throughput and large files. If libtorrent's read cache is\n-disabled, enabling this may reduce performance.
    \n-
    write_through
    \n-
    flush pieces to disk as they complete validation.
    \n-
    \n-

    One reason to disable caching is that it may help the operating\n-system from growing its file cache indefinitely.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    outgoing_portint0
    num_outgoing_portsint0
    \n-

    this is the first port to use for binding outgoing connections to.\n-This is useful for users that have routers that allow QoS settings\n-based on local port. when binding outgoing connections to specific\n-ports, num_outgoing_ports is the size of the range. It should\n-be more than a few

    \n-
    \n-

    Warning

    \n-

    setting outgoing ports will limit the ability to keep\n-multiple connections to the same client, even for different\n-torrents. It is not recommended to change this setting. Its main\n-purpose is to use as an escape hatch for cheap routers with QoS\n-capability but can only classify flows based on port numbers.

    \n-
    \n-

    It is a range instead of a single port because of the problems with\n-failing to reconnect to peers if a previous socket to that peer and\n-port is in TIME_WAIT state.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    peer_dscpint0x04
    \n-

    peer_dscp determines the DSCP field in the IP header of every\n-packet sent to peers (including web seeds). 0x0 means no marking,\n-0x04 represents Lower Effort. For more details see RFC 8622.

    \n-

    peer_tos is the backwards compatible name for this setting.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    active_downloadsint3
    active_seedsint5
    active_checkingint1
    active_dht_limitint88
    active_tracker_limitint1600
    active_lsd_limitint60
    active_limitint500
    \n-

    for auto managed torrents, these are the limits they are subject\n-to. If there are too many torrents some of the auto managed ones\n-will be paused until some slots free up. active_downloads and\n-active_seeds controls how many active seeding and downloading\n-torrents the queuing mechanism allows. The target number of active\n-torrents is min(active_downloads + active_seeds, active_limit).\n-active_downloads and active_seeds are upper limits on the\n-number of downloading torrents and seeding torrents respectively.\n-Setting the value to -1 means unlimited.

    \n-

    For example if there are 10 seeding torrents and 10 downloading\n-torrents, and active_downloads is 4 and active_seeds is 4,\n-there will be 4 seeds active and 4 downloading torrents. If the\n-settings are active_downloads = 2 and active_seeds = 4,\n-then there will be 2 downloading torrents and 4 seeding torrents\n-active. Torrents that are not auto managed are not counted against\n-these limits.

    \n-

    active_checking is the limit of number of simultaneous checking\n-torrents.

    \n-

    active_limit is a hard limit on the number of active (auto\n-managed) torrents. This limit also applies to slow torrents.

    \n-

    active_dht_limit is the max number of torrents to announce to\n-the DHT.

    \n-

    active_tracker_limit is the max number of torrents to announce\n-to their trackers.

    \n-

    active_lsd_limit is the max number of torrents to announce to\n-the local network over the local service discovery protocol.

    \n-

    You can have more torrents active, even though they are not\n-announced to the DHT, lsd or their tracker. If some peer knows\n-about you for any reason and tries to connect, it will still be\n-accepted, unless the torrent is paused, which means it won't accept\n-any connections.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    auto_manage_intervalint30
    \n-

    auto_manage_interval is the number of seconds between the\n-torrent queue is updated, and rotated.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    seed_time_limitint24 * 60 * 60
    \n-

    this is the limit on the time a torrent has been an active seed\n-(specified in seconds) before it is considered having met the seed\n-limit criteria. See queuing.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    timed_out_no_handshake51The peer did not send a handshake within a reasonable amount of\n+time, it might not be a bittorrent peer
    auto_scrape_intervalint1800
    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
    auto_scrape_min_intervalint300
    invalid_choke53The peer sent an invalid choke message
    \n-

    auto_scrape_interval is the number of seconds between scrapes\n-of queued torrents (auto managed and paused torrents). Auto managed\n-torrents that are paused, are scraped regularly in order to keep\n-track of their downloader/seed ratio. This ratio is used to\n-determine which torrents to seed and which to pause.

    \n-

    auto_scrape_min_interval is the minimum number of seconds\n-between any automatic scrape (regardless of torrent). In case there\n-are a large number of paused auto managed torrents, this puts a\n-limit on how often a scrape request is sent.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_unchoke54The peer send an invalid unchoke message
    max_peerlist_sizeint3000
    invalid_interested55The peer sent an invalid interested message
    max_paused_peerlist_sizeint1000
    invalid_not_interested56The peer sent an invalid not-interested message
    \n-

    max_peerlist_size is the maximum number of peers in the list of\n-known peers. These peers are not necessarily connected, so this\n-number should be much greater than the maximum number of connected\n-peers. Peers are evicted from the cache when the list grows passed\n-90% of this limit, and once the size hits the limit, peers are no\n-longer added to the list. If this limit is set to 0, there is no\n-limit on how many peers we'll keep in the peer list.

    \n-

    max_paused_peerlist_size is the max peer list size used for\n-torrents that are paused. This can be used to save memory for paused\n-torrents, since it's not as important for them to keep a large peer\n-list.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_request57The peer sent an invalid piece request message
    min_announce_intervalint5 * 60
    invalid_hash_list58The peer sent an invalid hash-list message (this is part of the\n+merkle-torrent extension)
    \n-

    this is the minimum allowed announce interval for a tracker. This\n-is specified in seconds and is used as a sanity check on what is\n-returned from a tracker. It mitigates hammering mis-configured\n-trackers.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n \n+\n \n-\n-
    nametypedefault
    invalid_hash_piece59The peer sent an invalid hash-piece message (this is part of the\n+merkle-torrent extension)
    auto_manage_startupint
    invalid_cancel60The peer sent an invalid cancel message
    \n-

    this is the number of seconds a torrent is considered active after\n-it was started, regardless of upload and download speed. This is so\n-that newly started torrents are not considered inactive until they\n-have a fair chance to start downloading.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_dht_port61The peer sent an invalid DHT port-message
    seeding_piece_quotaint20
    invalid_suggest62The peer sent an invalid suggest piece-message
    \n-

    seeding_piece_quota is the number of pieces to send to a peer,\n-when seeding, before rotating in another peer to the unchoke set.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_have_all63The peer sent an invalid have all-message
    max_rejectsint50
    invalid_have_none64The peer sent an invalid have none-message
    \n-

    max_rejects is the number of piece requests we will reject in a\n-row while a peer is choked before the peer is considered abusive\n-and is disconnected.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_reject65The peer sent an invalid reject message
    recv_socket_buffer_sizeint0
    invalid_allow_fast66The peer sent an invalid allow fast-message
    send_socket_buffer_sizeint0
    invalid_extended67The peer sent an invalid extension message ID
    \n-

    specifies the buffer sizes set on peer sockets. 0 means the OS\n-default (i.e. don't change the buffer sizes).\n-The socket buffer sizes are changed using setsockopt() with\n-SOL_SOCKET/SO_RCVBUF and SO_SNDBUFFER.

    \n-

    Note that uTP peers share a single UDP socket buffer for each of the\n-listen_interfaces, along with DHT and UDP tracker traffic.\n-If the buffer size is too small for the combined traffic through the\n-socket, packets may be dropped.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_message68The peer sent an invalid message ID
    max_peer_recv_buffer_sizeint2 * 1024 * 1024
    sync_hash_not_found69The synchronization hash was not found in the encrypted handshake
    \n-

    the max number of bytes a single peer connection's receive buffer is\n-allowed to grow to.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_encryption_constant70The encryption constant in the handshake is invalid
    optimistic_disk_retryint10 * 60
    no_plaintext_mode71The peer does not support plain text, which is the selected mode
    \n-

    optimistic_disk_retry is the number of seconds from a disk\n-write errors occur on a torrent until libtorrent will take it out\n-of the upload mode, to test if the error condition has been fixed.

    \n-

    libtorrent will only do this automatically for auto managed\n-torrents.

    \n-

    You can explicitly take a torrent out of upload only mode using\n-set_upload_mode().

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_rc4_mode72The peer does not support RC4, which is the selected mode
    max_suggest_piecesint16
    unsupported_encryption_mode73The peer does not support any of the encryption modes that the\n+client supports
    \n-

    max_suggest_pieces is the max number of suggested piece indices\n-received from a peer that's remembered. If a peer floods suggest\n-messages, this limit prevents libtorrent from using too much RAM.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    unsupported_encryption_mode_selected74The peer selected an encryption mode that the client did not\n+advertise and does not support
    local_service_announce_intervalint5 * 60
    invalid_pad_size75The pad size used in the encryption handshake is of invalid size
    \n-

    local_service_announce_interval is the time between local\n-network announces for a torrent.\n-This interval is specified in seconds.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_encrypt_handshake76The encryption handshake is invalid
    dht_announce_intervalint15 * 60
    no_incoming_encrypted77The client is set to not support incoming encrypted connections\n+and this is an encrypted connection
    \n-

    dht_announce_interval is the number of seconds between\n-announcing torrents to the distributed hash table (DHT).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_incoming_regular78The client is set to not support incoming regular bittorrent\n+connections, and this is a regular connection
    udp_tracker_token_expiryint60
    duplicate_peer_id79The client is already connected to this peer-ID
    \n-

    udp_tracker_token_expiry is the number of seconds libtorrent\n-will keep UDP tracker connection tokens around for. This is\n-specified to be 60 seconds. The higher this\n-value is, the fewer packets have to be sent to the UDP tracker. In\n-order for higher values to work, the tracker needs to be configured\n-to match the expiration time for tokens.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_removed80Torrent was removed
    num_optimistic_unchoke_slotsint0
    packet_too_large81The packet size exceeded the upper sanity check-limit
    \n-

    num_optimistic_unchoke_slots is the number of optimistic\n-unchoke slots to use.\n-Having a higher number of optimistic unchoke slots mean you will\n-find the good peers faster but with the trade-off to use up more\n-bandwidth. 0 means automatic, where libtorrent opens up 20% of your\n-allowed upload slots as optimistic unchoke slots.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    reserved82 
    max_pex_peersint50
    http_error83The web server responded with an error
    \n-

    the max number of peers we accept from pex messages from a single\n-peer. this limits the number of concurrent peers any of our peers\n-claims to be connected to. If they claim to be connected to more\n-than this, we'll ignore any peer that exceeds this limit

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    missing_location84The web server response is missing a location header
    tick_intervalint500
    invalid_redirection85The web seed redirected to a path that no longer matches the\n+.torrent directory structure
    \n-

    tick_interval specifies the number of milliseconds between\n-internal ticks. This is the frequency with which bandwidth quota is\n-distributed to peers. It should not be more than one second (i.e.\n-1000 ms). Setting this to a low value (around 100) means higher\n-resolution bandwidth quota distribution, setting it to a higher\n-value saves CPU cycles.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    redirecting86The connection was closed because it redirected to a different\n+URL
    share_mode_targetint3
    invalid_range87The HTTP range header is invalid
    \n-

    share_mode_target specifies the target share ratio for share\n-mode torrents. If set to 3, we'll try to upload 3\n-times as much as we download. Setting this very high, will make it\n-very conservative and you might end up not downloading anything\n-ever (and not affecting your share ratio). It does not make any\n-sense to set this any lower than 2. For instance, if only 3 peers\n-need to download the rarest piece, it's impossible to download a\n-single piece and upload it more than 3 times. If the\n-share_mode_target is set to more than 3, nothing is downloaded.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_content_length88The HTTP response did not have a content length
    upload_rate_limitint0
    banned_by_ip_filter89The IP is blocked by the IP filter
    download_rate_limitint0
    too_many_connections90At the connection limit
    \n-

    upload_rate_limit and download_rate_limit sets\n-the session-global limits of upload and download rate limits, in\n-bytes per second. By default peers on the local network are not rate\n-limited.

    \n-

    A value of 0 means unlimited.

    \n-

    For fine grained control over rate limits, including making them apply\n-to local peers, see peer classes.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    peer_banned91The peer is marked as banned
    dht_upload_rate_limitint8000
    stopping_torrent92The torrent is stopping, causing the operation to fail
    \n-

    the number of bytes per second (on average) the DHT is allowed to send.\n-If the incoming requests causes to many bytes to be sent in responses,\n-incoming requests will be dropped until the quota has been replenished.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    too_many_corrupt_pieces93The peer has sent too many corrupt pieces and is banned
    unchoke_slots_limitint8
    torrent_not_ready94The torrent is not ready to receive peers
    \n-

    unchoke_slots_limit is the max number of unchoked peers in the\n-session. The number of unchoke slots may be ignored depending on\n-what choking_algorithm is set to. Setting this limit to -1\n-means unlimited, i.e. all peers will always be unchoked.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    peer_not_constructed95The peer is not completely constructed yet
    connections_limitint200
    session_closing96The session is closing, causing the operation to fail
    \n-

    connections_limit sets a global limit on the number of\n-connections opened. The number of connections is set to a hard\n-minimum of at least two per torrent, so if you set a too low\n-connections limit, and open too many torrents, the limit will not\n-be met.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    optimistic_disconnect97The peer was disconnected in order to leave room for a\n+potentially better peer
    connections_slackint10
    torrent_finished98The torrent is finished
    \n-

    connections_slack is the number of incoming connections\n-exceeding the connection limit to accept in order to potentially\n-replace existing ones.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n \n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    no_router99No UPnP router found
    utp_target_delayint
    metadata_too_large100The metadata message says the metadata exceeds the limit
    utp_gain_factorint3000
    utp_min_timeoutint500
    utp_syn_resendsint2
    utp_fin_resendsint2
    utp_num_resendsint3
    utp_connect_timeoutint3000
    utp_loss_multiplierint50
    \n-

    utp_target_delay is the target delay for uTP sockets in\n-milliseconds. A high value will make uTP connections more\n-aggressive and cause longer queues in the upload bottleneck. It\n-cannot be too low, since the noise in the measurements would cause\n-it to send too slow.\n-utp_gain_factor is the number of bytes the uTP congestion\n-window can increase at the most in one RTT.\n-If this is set too high, the congestion controller reacts\n-too hard to noise and will not be stable, if it's set too low, it\n-will react slow to congestion and not back off as fast.

    \n-

    utp_min_timeout is the shortest allowed uTP socket timeout,\n-specified in milliseconds. The\n-timeout depends on the RTT of the connection, but is never smaller\n-than this value. A connection times out when every packet in a\n-window is lost, or when a packet is lost twice in a row (i.e. the\n-resent packet is lost as well).

    \n-

    The shorter the timeout is, the faster the connection will recover\n-from this situation, assuming the RTT is low enough.\n-utp_syn_resends is the number of SYN packets that are sent (and\n-timed out) before giving up and closing the socket.\n-utp_num_resends is the number of times a packet is sent (and\n-lost or timed out) before giving up and closing the connection.\n-utp_connect_timeout is the number of milliseconds of timeout\n-for the initial SYN packet for uTP connections. For each timed out\n-packet (in a row), the timeout is doubled. utp_loss_multiplier\n-controls how the congestion window is changed when a packet loss is\n-experienced. It's specified as a percentage multiplier for\n-cwnd. Do not change this value unless you know what you're doing.\n-Never set it higher than 100.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    mixed_mode_algorithmintsettings_pack::peer_proportional
    \n-

    The mixed_mode_algorithm determines how to treat TCP\n-connections when there are uTP connections. Since uTP is designed\n-to yield to TCP, there's an inherent problem when using swarms that\n-have both TCP and uTP connections. If nothing is done, uTP\n-connections would often be starved out for bandwidth by the TCP\n-connections. This mode is prefer_tcp. The peer_proportional\n-mode simply looks at the current throughput and rate limits all TCP\n-connections to their proportional share based on how many of the\n-connections are TCP. This works best if uTP connections are not\n-rate limited by the global rate limiter (which they aren't by\n-default).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    listen_queue_sizeint5
    \n-

    listen_queue_size is the value passed in to listen() for the\n-listen socket. It is the number of outstanding incoming connections\n-to queue up while we're not actively waiting for a connection to be\n-accepted. 5 should be sufficient for any\n-normal client. If this is a high performance server which expects\n-to receive a lot of connections, or used in a simulator or test, it\n-might make sense to raise this number. It will not take affect\n-until the listen_interfaces settings is updated.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_metadata_request101The peer sent an invalid metadata request message
    torrent_connect_boostint30
    invalid_metadata_size102The peer advertised an invalid metadata size
    \n-

    torrent_connect_boost is the number of peers to try to connect\n-to immediately when the first tracker response is received for a\n-torrent. This is a boost to given to new torrents to accelerate\n-them starting up. The normal connect scheduler is run once every\n-second, this allows peers to be connected immediately instead of\n-waiting for the session tick to trigger connections.\n-This may not be set higher than 255.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_metadata_offset103The peer sent a message with an invalid metadata offset
    alert_queue_sizeint2000
    invalid_metadata_message104The peer sent an invalid metadata message
    \n-

    alert_queue_size is the maximum number of alerts queued up\n-internally. If alerts are not popped, the queue will eventually\n-fill up to this level. Once the alert queue is full, additional\n-alerts will be dropped, and not delivered to the client. Once the\n-client drains the queue, new alerts may be delivered again. In order\n-to know that alerts have been dropped, see\n-session_handle::dropped_alerts().

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    pex_message_too_large105The peer sent a peer exchange message that was too large
    max_metadata_sizeint3 * 1024 * 10240
    invalid_pex_message106The peer sent an invalid peer exchange message
    \n-

    max_metadata_size is the maximum allowed size (in bytes) to be\n-received by the metadata extension, i.e. magnet links.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_lt_tracker_message107The peer sent an invalid tracker exchange message
    hashing_threadsint1
    too_frequent_pex108The peer sent an pex messages too often. This is a possible\n+attempt of and attack
    \n-

    hashing_threads is the number of disk I/O threads to use for\n-piece hash verification. These threads are in addition to the\n-regular disk I/O threads specified by settings_pack::aio_threads.\n-These threads are only used for full checking of torrents. The\n-hash checking done while downloading are done by the regular disk\n-I/O threads.\n-The hasher threads do not only compute hashes, but also perform\n-the read from disk. On storage optimal for sequential access,\n-such as hard drives, this setting should be set to 1, which is\n-also the default.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    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.
    checking_mem_usageint256
    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.
    \n-

    the number of blocks to keep outstanding at any given time when\n-checking torrents. Higher numbers give faster re-checks but uses\n-more memory. Specified in number of 16 kiB blocks

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    requires_ssl_connection111The peer tried to connect to an SSL torrent without connecting\n+over SSL.
    predictive_piece_announceint0
    invalid_ssl_cert112The peer tried to connect to a torrent with a certificate\n+for a different torrent.
    \n-

    if set to > 0, pieces will be announced to other peers before they\n-are fully downloaded (and before they are hash checked). The\n-intention is to gain 1.5 potential round trip times per downloaded\n-piece. When non-zero, this indicates how many milliseconds in\n-advance pieces should be announced, before they are expected to be\n-completed.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    not_an_ssl_torrent113the torrent is not an SSL torrent, and the operation requires\n+an SSL torrent
    aio_threadsint10
    banned_by_port_filter114peer was banned because its listen port is within a banned port\n+range, as specified by the port_filter.
    \n-

    for some aio back-ends, aio_threads specifies the number of\n-io-threads to use.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_session_handle115The session_handle is not referring to a valid session_impl
    tracker_backoffint250
    invalid_listen_socket116the listen socket associated with this request was closed
    \n-

    tracker_backoff determines how aggressively to back off from\n-retrying failing trackers. This value determines x in the\n-following formula, determining the number of seconds to wait until\n-the next retry:

    \n-
    \n-delay = 5 + 5 * x / 100 * fails^2
    \n-

    This setting may be useful to make libtorrent more or less\n-aggressive in hitting trackers.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_hash_request117 
    share_ratio_limitint200
    invalid_hashes118 
    seed_time_ratio_limitint700
    invalid_hash_reject119 
    \n-

    when a seeding torrent reaches either the share ratio (bytes up /\n-bytes down) or the seed time ratio (seconds as seed / seconds as\n-downloader) or the seed time limit (seconds as seed) it is\n-considered done, and it will leave room for other torrents. These\n-are specified as percentages. Torrents that are considered done will\n-still be allowed to be seeded, they just won't have priority anymore.\n-For more, see queuing.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    deprecated_120120 
    peer_turnoverint4
    deprecated_121121 
    peer_turnover_cutoffint90
    deprecated_122122 
    peer_turnover_intervalint300
    deprecated_123123 
    \n-

    peer_turnover is the percentage of peers to disconnect every\n-turnover peer_turnover_interval (if we're at the peer limit), this\n-is specified in percent when we are connected to more than limit *\n-peer_turnover_cutoff peers disconnect peer_turnover fraction of the\n-peers. It is specified in percent peer_turnover_interval is the\n-interval (in seconds) between optimistic disconnects if the\n-disconnects happen and how many peers are disconnected is\n-controlled by peer_turnover and peer_turnover_cutoff

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    deprecated_124124 
    connect_seed_every_n_downloadint10
    missing_file_sizes130The resume data file is missing the file sizes entry
    \n-

    this setting controls the priority of downloading torrents over\n-seeding or finished torrents when it comes to making peer\n-connections. Peer connections are throttled by the connection_speed\n-and the half-open connection limit. This makes peer connections a\n-limited resource. Torrents that still have pieces to download are\n-prioritized by default, to avoid having many seeding torrents use\n-most of the connection attempts and only give one peer every now\n-and then to the downloading torrent. libtorrent will loop over the\n-downloading torrents to connect a peer each, and every n:th\n-connection attempt, a finished torrent is picked to be allowed to\n-connect to a peer. This setting controls n.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_files_in_resume_data131The resume data file file sizes entry is empty
    max_http_recv_buffer_sizeint4*1024*204
    missing_pieces132The resume data file is missing the pieces and slots entry
    \n-

    the max number of bytes to allow an HTTP response to be when\n-announcing to trackers or downloading .torrent files via the\n-url provided in add_torrent_params.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    mismatching_number_of_files133The number of files in the resume data does not match the number\n+of files in the torrent
    max_retry_port_bindint10
    mismatching_file_size134One of the files on disk has a different size than in the fast\n+resume file
    \n-

    if binding to a specific port fails, should the port be incremented\n-by one and tried again? This setting specifies how many times to\n-retry a failed port bind

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    mismatching_file_timestamp135One of the files on disk has a different timestamp than in the\n+fast resume file
    alert_maskintint
    not_a_dictionary136The resume data file is not a dictionary
    \n-

    a bitmask combining flags from alert_category_t defining which\n-kinds of alerts to receive

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_blocks_per_piece137The blocks per piece entry is invalid in the resume data file
    out_enc_policyintsettings_pack::pe_enabled
    missing_slots138The resume file is missing the slots entry, which is required\n+for torrents with compact allocation. DEPRECATED
    in_enc_policyintsettings_pack::pe_enabled
    too_many_slots139The resume file contains more slots than the torrent
    \n-

    control the settings for incoming and outgoing connections\n-respectively. see enc_policy enum for the available options.\n-Keep in mind that protocol encryption degrades performance in\n-several respects:

    \n-
      \n-
    1. It prevents "zero copy" disk buffers being sent to peers, since\n-each peer needs to mutate the data (i.e. encrypt it) the data\n-must be copied per peer connection rather than sending the same\n-buffer to multiple peers.
    2. \n-
    3. The encryption itself requires more CPU than plain bittorrent\n-protocol. The highest cost is the Diffie Hellman exchange on\n-connection setup.
    4. \n-
    5. The encryption handshake adds several round-trips to the\n-connection setup, and delays transferring data.
    6. \n-
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_slot_list140The slot entry is invalid in the resume data
    allowed_enc_levelintsettings_pack::pe_both
    invalid_piece_index141One index in the slot list is invalid
    \n-

    determines the encryption level of the connections. This setting\n-will adjust which encryption scheme is offered to the other peer,\n-as well as which encryption scheme is selected by the client. See\n-enc_level enum for options.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    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
    inactive_down_rateint2048
    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.
    inactive_up_rateint2048
    http_parse_error150The HTTP header was not correctly formatted
    \n-

    the download and upload rate limits for a torrent to be considered\n-active by the queuing mechanism. A torrent whose download rate is\n-less than inactive_down_rate and whose upload rate is less than\n-inactive_up_rate for auto_manage_startup seconds, is\n-considered inactive, and another queued torrent may be started.\n-This logic is disabled if dont_count_slow_torrents is false.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    http_missing_location151The HTTP response was in the 300-399 range but lacked a location\n+header
    proxy_typeintsettings_pack::none
    http_failed_decompress152The HTTP response was encoded with gzip or deflate but\n+decompressing it failed
    \n-

    proxy to use. see proxy_type_t.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_i2p_router160The URL specified an i2p address, but no i2p router is configured
    proxy_portint0
    no_i2p_endpoint161i2p acceptor is not available yet, can't announce without endpoint
    \n-

    the port of the proxy server

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    scrape_not_available170The tracker URL doesn't support transforming it into a scrape\n+URL. i.e. it doesn't contain "announce.
    i2p_portint0
    invalid_tracker_response171invalid tracker response
    \n-

    sets the i2p SAM bridge port to connect to. set the hostname with\n-the i2p_hostname setting.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_peer_dict172invalid peer dictionary entry. Not a dictionary
    urlseed_max_request_bytesint16 * 1024 * 1024
    tracker_failure173tracker sent a failure message
    \n-

    The maximum request range of an url seed in bytes. This value\n-defines the largest possible sequential web seed request. Lower values\n-are possible but will be ignored if they are lower then piece size.\n-This value should be related to your download speed to prevent\n-libtorrent from creating too many expensive http requests per\n-second. You can select a value as high as you want but keep in mind\n-that libtorrent can't create parallel requests if the first request\n-did already select the whole file.\n-If you combine bittorrent seeds with web seeds and pick strategies\n-like rarest first you may find your web seed requests split into\n-smaller parts because we don't download already picked pieces\n-twice.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_files_entry174missing or invalid files entry
    web_seed_name_lookup_retryint1800
    invalid_hash_entry175missing or invalid hash entry
    \n-

    time to wait until a new retry of a web seed name lookup

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_peers_entry176missing or invalid peers and peers6 entry
    close_file_intervalintCLOSE_FILE_INTERVAL
    invalid_tracker_response_length177UDP tracker response packet has invalid size
    \n-

    the number of seconds between closing the file opened the longest\n-ago. 0 means to disable the feature. The purpose of this is to\n-periodically close files to trigger the operating system flushing\n-disk cache. Specifically it has been observed to be required on\n-windows to not have the disk cache grow indefinitely.\n-This defaults to 240 seconds on windows, and disabled on other\n-systems.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    invalid_tracker_transaction_id178invalid transaction id in UDP tracker response
    utp_cwnd_reduce_timerint100
    invalid_tracker_action179invalid action field in UDP tracker response
    \n-

    When uTP experiences packet loss, it will reduce the congestion\n-window, and not reduce it again for this many milliseconds, even if\n-experiencing another lost packet.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    announce_skipped180skipped announce (because it's assumed to be unreachable over the\n+given source network interface)
    max_web_seed_connectionsint3
    no_entropy200random number generation failed
    \n-

    the max number of web seeds to have connected per torrent at any\n-given time.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    ssrf_mitigation201blocked by SSRF mitigation
    resolver_cache_timeoutint1200
    blocked_by_idna202blocked because IDNA host names are banned
    \n-

    the number of seconds before the internal host name resolver\n-considers a cache value timed out, negative values are interpreted\n-as zero.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_unknown_version210the torrent file has an unknown meta version
    send_not_sent_low_watermarkint16384
    torrent_missing_file_tree211the v2 torrent file has no file tree
    \n-

    specify the not-sent low watermark for socket send buffers. This\n-corresponds to the, Linux-specific, TCP_NOTSENT_LOWAT TCP socket\n-option.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_missing_meta_version212the torrent contains v2 keys but does not specify meta version 2
    rate_choker_initial_thresholdint1024
    torrent_inconsistent_files213the v1 and v2 file metadata does not match
    \n-

    the rate based choker compares the upload rate to peers against a\n-threshold that increases proportionally by its size for every\n-peer it visits, visiting peers in decreasing upload rate. The\n-number of upload slots is determined by the number of peers whose\n-upload rate exceeds the threshold. This option sets the start\n-value for this threshold. A higher value leads to fewer unchoke\n-slots, a lower value leads to more.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_missing_piece_layer214one or more files are missing piece layer hashes
    upnp_lease_durationint3600
    torrent_invalid_piece_layer215a piece layer has the wrong size or failed hash check
    \n-

    The expiration time of UPnP port-mappings, specified in seconds. 0\n-means permanent lease. Some routers do not support expiration times\n-on port-maps (nor correctly returning an error indicating lack of\n-support). In those cases, set this to 0. Otherwise, don't set it any\n-lower than 5 minutes.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    torrent_missing_pieces_root216a v2 file entry has no root hash
    max_concurrent_http_announcesint50
    torrent_inconsistent_hashes217the v1 and v2 hashes do not describe the same data
    \n-

    limits the number of concurrent HTTP tracker announces. Once the\n-limit is hit, tracker requests are queued and issued when an\n-outstanding announce completes.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n \n
    nametypedefault
    torrent_invalid_pad_file218a file in the v2 metadata has the pad attribute set
    dht_max_peers_replyint100
    error_code_max219the number of error codes
    \n-

    the maximum number of peers to send in a reply to get_peers

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

    the number of concurrent search request the node will send when\n-announcing and refreshing the routing table. This parameter is called\n-alpha in the kademlia paper

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_fail_countint20
    \n-

    the maximum number of failed tries to contact a node before it is\n-removed from the routing table. If there are known working nodes that\n-are ready to replace a failing node, it will be replaced immediately,\n-this limit is only used to clear out nodes that don't have any node\n-that can replace them.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_torrentsint2000
    \n-

    the total number of torrents to track from the DHT. This is simply an\n-upper limit to make sure malicious DHT nodes cannot make us allocate\n-an unbounded amount of memory.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_dht_itemsint700
    \n-

    max number of items the DHT will store

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_peersint500
    \n-

    the max number of peers to store per torrent (for the DHT)

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_torrent_search_replyint20
    \n-

    the max number of torrents to return in a torrent search query to the\n-DHT

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_block_timeoutint5 * 60
    \n-

    the number of seconds a DHT node is banned if it exceeds the rate\n-limit. The rate limit is averaged over 10 seconds to allow for bursts\n-above the limit.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_block_ratelimitint5
    \n-

    the max number of packets per second a DHT node is allowed to send\n-without getting banned.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_item_lifetimeint0
    \n-

    the number of seconds a immutable/mutable item will be expired.\n-default is 0, means never expires.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_sample_infohashes_intervalint21600
    \n-

    the info-hashes sample recomputation interval (in seconds).\n-The node will precompute a subset of the tracked info-hashes and return\n-that instead of calculating it upon each request. The permissible range\n-is between 0 and 21600 seconds (inclusive).

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    nametypedefault
    dht_max_infohashes_sample_countint20
    \n-

    the maximum number of elements in the sampled subset of info-hashes.\n-If this number is too big, expect the DHT storage implementations\n-to clamp it in order to allow UDP packets go through

    \n-\n-\n-\n-\n \n \n \n \n-\n-\n+\n+\n \n \n \n-\n-\n-\n-\n-\n-
    nametypedefaultvaluedescription
    max_piece_countint0x200000
    \n-

    max_piece_count is the maximum allowed number of pieces in\n-metadata received via magnet links. Loading large torrents (with\n-more pieces than the default limit) may also require passing in\n-a higher limit to read_resume_data() and\n-torrent_info::parse_info_section(), if those are used.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    cont100 
    metadata_token_limitint2500000
    ok200 
    \n-

    when receiving metadata (torrent file) from peers, this is the\n-max number of bencoded tokens we're willing to parse. This limit\n-is meant to prevent DoS attacks on peers. For very large\n-torrents, this limit may have to be raised.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    created201 
    disk_write_modeintsettings_pack::mmap_write_mode_t::auto_mmap_write
    accepted202 
    \n-

    controls whether disk writes will be made through a memory mapped\n-file or via normal write calls. This only affects the\n-mmap_disk_io. When saving to a non-local drive (network share,\n-NFS or NAS) using memory mapped files is most likely inferior.\n-When writing to a local SSD (especially in DAX mode) using memory\n-mapped files likely gives the best performance.\n-The values for this setting are specified as mmap_write_mode_t.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    no_content204 
    mmap_file_size_cutoffint40
    multiple_choices300 
    \n-

    when using mmap_disk_io, files smaller than this number of blocks\n-will not be memory mapped, but will use normal pread/pwrite\n-operations. This file size limit is specified in 16 kiB blocks.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-
    nametypedefault
    moved_permanently301 
    i2p_inbound_quantityint3
    moved_temporarily302 
    i2p_outbound_quantityint3
    not_modified304 
    i2p_inbound_lengthint3
    bad_request400 
    i2p_outbound_lengthint3
    unauthorized401 
    \n-

    Configures the SAM session\n-quantity of I2P inbound and outbound tunnels [1..16].\n-number of hops for I2P inbound and outbound tunnels [0..7]\n-Changing these will not trigger a reconnect to the SAM bridge,\n-they will take effect the next time the SAM connection is\n-re-established (by restarting or changing i2p_hostname or\n-i2p_port).

    \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_str (int name, std::string 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-   bool has_val (int name) const override;\n-   void clear ();\n-   void clear (int name);\n-   int get_int (int name) const override;\n-   std::string const& get_str (int name) const override;\n-   bool get_bool (int name) const override;\n-   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-      type_mask,\n-      index_mask,\n-   };\n-\n-   enum mmap_write_mode_t\n-   {\n-      always_pwrite,\n-      always_mmap_write,\n-      auto_mmap_write,\n-   };\n-\n-   enum suggest_mode_t\n-   {\n-      no_piece_suggestions,\n-      suggest_read_cache,\n-   };\n-\n-   enum choking_algorithm_t\n-   {\n-      fixed_slots_choker,\n-      rate_based_choker,\n-      deprecated_bittyrant_choker,\n-   };\n-\n-   enum seed_choking_algorithm_t\n-   {\n-      round_robin,\n-      fastest_upload,\n-      anti_leech,\n-   };\n-\n-   enum io_buffer_mode_t\n-   {\n-      enable_os_cache,\n-      deprecated_disable_os_cache_for_aligned_files,\n-      disable_os_cache,\n-      write_through,\n-   };\n-\n-   enum bandwidth_mixed_algo_t\n-   {\n-      prefer_tcp,\n-      peer_proportional,\n-   };\n-\n-   enum enc_policy\n-   {\n-      pe_forced,\n-      pe_enabled,\n-      pe_disabled,\n-   };\n-\n-   enum enc_level\n-   {\n-      pe_plaintext,\n-      pe_rc4,\n-      pe_both,\n-   };\n-\n-   enum proxy_type_t\n-   {\n-      none,\n-      socks4,\n-      socks5,\n-      socks5_pw,\n-      http,\n-      http_pw,\n-   };\n-};\n-
    \n-\n-\n-[report issue]
    \n-

    set_int() set_bool() set_str()

    \n-
    \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_int (int name, int 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-
    \n-bool has_val (int name) const override;\n-
    \n-

    queries whether the specified configuration option has a value set in\n-this pack. name can be any enumeration value from string_types,\n-int_types or bool_types.

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

    clear()

    \n-
    \n-void clear ();\n-
    \n-

    clear the settings pack from all settings

    \n-[report issue]
    \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_str() get_int() get_bool()

    \n-
    \n-int get_int (int name) const override;\n-std::string const& get_str (int name) const override;\n-bool get_bool (int name) const override;\n-
    \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-
    \n-

    enum type_bases

    \n-

    Declared in "libtorrent/settings_pack.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
    namevaluedescription
    forbidden403 
    string_type_base0
    not_found404 
    int_type_base16384
    internal_server_error500 
    bool_type_base32768
    not_implemented501 
    type_mask49152
    bad_gateway502 
    index_mask16383
    service_unavailable503 
    \n-[report issue]
    \n-
    \n-

    enum mmap_write_mode_t

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \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-
    namevaluedescription
    always_pwrite
    no_error0disable writing to disk via mmap, always use normal write calls
    always_mmap_write1prefer using memory mapped files for disk writes (at least for\n-large files where it might make sense)
    auto_mmap_write2determine whether to use pwrite or memory mapped files for disk\n-writes depending on the kind of storage behind the save path
    \n-[report issue]
    \n-
    \n-

    enum suggest_mode_t

    \n-

    Declared in "libtorrent/settings_pack.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-
    namevaluedescriptionNo error
    no_piece_suggestions0 
    invalid_argument402One of the arguments in the request is invalid
    suggest_read_cache1 
    action_failed501The request failed
    \n-[report issue]
    \n-
    \n-

    enum choking_algorithm_t

    \n-

    Declared in "libtorrent/settings_pack.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
    value_not_in_array714The specified value does not exist in the array
    fixed_slots_choker0This is the traditional choker with a fixed number of unchoke\n-slots (as specified by settings_pack::unchoke_slots_limit).
    source_ip_cannot_be_wildcarded715The source IP address cannot be wild-carded, but\n+must be fully specified
    rate_based_choker2

    This opens up unchoke slots based on the upload rate achieved to\n-peers. The more slots that are opened, the marginal upload rate\n-required to open up another slot increases. Configure the initial\n-threshold with settings_pack::rate_choker_initial_threshold.

    \n-

    For more information, see rate based choking.

    \n-
    external_port_cannot_be_wildcarded716The external port cannot be a wildcard, but must\n+be specified
    deprecated_bittyrant_choker3 
    port_mapping_conflict718The port mapping entry specified conflicts with a\n+mapping assigned previously to another client
    \n-[report issue]
    \n-
    \n-

    enum seed_choking_algorithm_t

    \n-

    Declared in "libtorrent/settings_pack.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
    internal_port_must_match_external724Internal and external port value must be the same
    round_robin0which round-robins the peers that are unchoked\n-when seeding. This distributes the upload bandwidth uniformly and\n-fairly. It minimizes the ability for a peer to download everything\n-without redistributing it.
    only_permanent_leases_supported725The NAT implementation only supports permanent\n+lease times on port mappings
    fastest_upload1unchokes the peers we can send to the fastest. This might be a\n-bit more reliable in utilizing all available capacity.
    remote_host_must_be_wildcard726RemoteHost must be a wildcard and cannot be a\n+specific IP address or DNS name
    anti_leech2prioritizes peers who have just started or are\n-just about to finish the download. The intention is to force\n-peers in the middle of the download to trade with each other.\n-This does not just take into account the pieces a peer is\n-reporting having downloaded, but also the pieces we have sent\n-to it.
    external_port_must_be_wildcard727ExternalPort must be a wildcard and cannot be a\n+specific port
    \n-[report issue]
    \n-
    \n-

    enum io_buffer_mode_t

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \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-
    namevaluedescription
    enable_os_cache
    pcp_success0 
    deprecated_disable_os_cache_for_aligned_files
    pcp_unsupp_version1 
    disable_os_cache
    pcp_not_authorized2 
    write_through
    pcp_malformed_request3 
    \n-[report issue]
    \n-
    \n-

    enum bandwidth_mixed_algo_t

    \n-

    Declared in "libtorrent/settings_pack.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
    prefer_tcp0disables the mixed mode bandwidth balancing
    pcp_unsupp_opcode4 
    peer_proportional1does not throttle uTP, throttles TCP to the same proportion\n-of throughput as there are TCP connections
    pcp_unsupp_option5 
    \n-[report issue]
    \n-
    \n-

    enum enc_policy

    \n-

    Declared in "libtorrent/settings_pack.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
    pcp_malformed_option6 
    pe_forced0Only encrypted connections are allowed. Incoming connections that\n-are not encrypted are closed and if the encrypted outgoing\n-connection fails, a non-encrypted retry will not be made.
    pcp_network_failure7 
    pe_enabled1encrypted connections are enabled, but non-encrypted connections\n-are allowed. An incoming non-encrypted connection will be accepted,\n-and if an outgoing encrypted connection fails, a non- encrypted\n-connection will be tried.
    pcp_no_resources8 
    pe_disabled2only non-encrypted connections are allowed.
    pcp_unsupp_protocol9 
    \n-[report issue]
    \n-
    \n-

    enum enc_level

    \n-

    Declared in "libtorrent/settings_pack.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
    pcp_user_ex_quota10 
    pe_plaintext1use only plain text encryption
    pcp_cannot_provide_external11 
    pe_rc42use only RC4 encryption
    pcp_address_mismatch12 
    pe_both3allow both
    pcp_excessive_remote_peers13 
    \n-[report issue]
    \n-
    \n-

    enum proxy_type_t

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \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-
    namevaluedescription
    none
    no_error0No proxy server is used and all other fields are ignored.Not an error
    socks4
    invalid_gzip_header1The server is assumed to be a SOCKS4 server that requires a\n-username.the supplied gzip buffer has invalid header
    socks5
    inflated_data_too_large2The server is assumed to be a SOCKS5 server (RFC 1928) that does\n-not require any authentication. The username and password are\n-ignored.the gzip buffer would inflate to more bytes than the specified\n+maximum size, and was rejected.
    socks5_pw
    data_did_not_terminate3The server is assumed to be a SOCKS5 server that supports plain\n-text username and password authentication (RFC 1929). The\n-username and password specified may be sent to the proxy if it\n-requires.available inflate data did not terminate
    http
    space_exhausted4The server is assumed to be an HTTP proxy. If the transport used\n-for the connection is non-HTTP, the server is assumed to support\n-the CONNECT method. i.e. for web seeds and HTTP trackers, a plain\n-proxy will suffice. The proxy is assumed to not require\n-authorization. The username and password will not be used.output space exhausted before completing inflate
    http_pw
    invalid_block_type5The server is assumed to be an HTTP proxy that requires user\n-authorization. The username and password will be sent to the proxy.invalid block type (type == 3)
    \n-\n-[report issue]
    \n-
    \n-
    \n-

    high_performance_seed() min_memory_usage()

    \n-

    Declared in "libtorrent/session.hpp"

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

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

    \n-

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

    \n-

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

    \n-

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

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

    setting_by_name() name_for_setting()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

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

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

    default_settings()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

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

    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-

    This is a utility function to produce a client ID fingerprint formatted to\n-the most common convention. The fingerprint can be set via the\n-peer_fingerprint setting, in settings_pack.

    \n-

    The name string should contain exactly two characters. These are the\n-characters unique to your client, used to identify it. Make sure not to\n-clash with anybody else. Here are some taken id's:

    \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n \n
    id charsclient
    invalid_stored_block_length6stored block length did not match one's complement
    LTlibtorrent (default)
    too_many_length_or_distance_codes7dynamic block code description: too many length or distance codes
    UTuTorrent
    code_lengths_codes_incomplete8dynamic block code description: code lengths codes incomplete
    UMuTorrent Mac
    repeat_lengths_with_no_first_length9dynamic block code description: repeat lengths with no first length
    qBqBittorrent
    repeat_more_than_specified_lengths10dynamic block code description: repeat more than specified lengths
    BPBitTorrent Pro
    invalid_literal_length_code_lengths11dynamic block code description: invalid literal/length code lengths
    BTBitTorrent
    invalid_distance_code_lengths12dynamic block code description: invalid distance code lengths
    DEDeluge
    invalid_literal_code_in_block13invalid literal/length or distance code in fixed or dynamic block
    AZAzureus
    distance_too_far_back_in_block14distance is too far back in fixed or dynamic block
    TLTribler
    unknown_gzip_error15an unknown error occurred during gzip inflation
    error_code_max16the number of error codes
    \n-

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

    \n-

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

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

    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+

    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+

    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 bitfield\n+struct open_file_state\n {\n-   bitfield () noexcept = default;\n-   bitfield (int bits, bool val);\n-   bitfield (char const* b, int bits);\n-   bitfield (bitfield&& rhs) noexcept = default;\n-   bitfield (bitfield const& rhs);\n-   explicit bitfield (int bits);\n-   void assign (char const* b, int const bits);\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-   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+   file_index_t file_index;\n+   file_open_mode_t open_mode;\n+   time_point last_use;\n };\n 
    \n-[report issue]
    \n-

    bitfield()

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

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

    new_torrent()

    \n
    \n-bool operator[] (int index) const noexcept;\n-bool get_bit (int index) const noexcept;\n+virtual storage_holder new_torrent (storage_params const& p\n+      , std::shared_ptr<void> const& torrent) = 0;\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+

    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-void clear_bit (int index) noexcept;\n-void set_bit (int index) noexcept;\n+virtual void remove_torrent (storage_index_t) = 0;\n 
    \n-

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

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

    all_set()

    \n+

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

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

    async_read() async_write()

    \n
    \n-bool all_set () const noexcept;\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 
    \n-

    returns true if all bits in the bitfield are set

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

    none_set()

    \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-bool none_set () const noexcept;\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-

    returns true if no bit in the bitfield is set

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

    size()

    \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-int size () const noexcept;\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-

    returns the size of the bitfield in bits.

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

    num_words()

    \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-int num_words () const noexcept;\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-

    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+

    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-int num_bytes () const noexcept;\n+virtual void async_release_files (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\n 
    \n-

    returns the number of bytes needed to represent all bits in this\n-bitfield

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

    empty()

    \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-bool empty () const noexcept;\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-

    returns true if the bitfield has zero size.

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

    data()

    \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-char const* data () const noexcept;\n-char* data () noexcept;\n+virtual void async_stop_torrent (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\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+

    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-void swap (bitfield& rhs) noexcept;\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-

    swaps the bit-fields two variables refer to

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

    count()

    \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-int count () const noexcept;\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-

    count the number of bits in the bitfield that are set to 1.

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

    find_first_set()

    \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-int find_first_set () const noexcept;\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-

    returns the index of the first set bit in the bitfield, i.e. 1 bit.

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

    find_last_clear()

    \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-int find_last_clear () const noexcept;\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-

    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+

    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-class hasher\n-{\n-   hasher ();\n-   hasher (hasher const&);\n-   explicit hasher (span<char const> data);\n-   hasher& operator= (hasher const&) &;\n-   hasher (char const* data, int len);\n-   hasher& update (char const* data, int len);\n-   hasher& update (span<char const> data);\n-   sha1_hash final ();\n-   void reset ();\n-};\n+virtual void update_stats_counters (counters& c) const = 0;\n 
    \n-\n-[report issue]
    \n-

    operator=() hasher()

    \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-hasher (hasher const&);\n-explicit hasher (span<char const> data);\n-hasher& operator= (hasher const&) &;\n-hasher (char const* data, int len);\n+virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\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+

    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-hasher& update (char const* data, int len);\n-hasher& update (span<char const> data);\n+virtual void abort (bool wait) = 0;\n 
    \n-

    append the following bytes to what is being hashed

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

    final()

    \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-sha1_hash final ();\n+virtual void submit_jobs () = 0;\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+

    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-void reset ();\n+virtual void settings_updated () = 0;\n 
    \n-

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

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

    hasher256

    \n-

    Declared in "libtorrent/hasher.hpp"

    \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-class hasher256\n+struct storage_holder\n {\n-   hasher256 ();\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 (char const* data, int len);\n-   hasher256& update (span<char const> data);\n-   sha256_hash final ();\n+   storage_holder () = default;\n+   ~storage_holder ();\n+   storage_holder (storage_index_t idx, disk_interface& disk_io);\n+   explicit operator bool () const;\n+   operator storage_index_t () const;\n    void reset ();\n-   ~hasher256 ();\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-\n-[report issue]
    \n-

    operator=() hasher256()

    \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-hasher256 (hasher256 const&);\n-explicit hasher256 (span<char const> data);\n-hasher256 (char const* data, int len);\n-hasher256& operator= (hasher256 const&) &;\n+struct buffer_allocator_interface\n+{\n+   virtual void free_disk_buffer (char* b) = 0;\n+};\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+[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-hasher256& update (char const* data, int len);\n-hasher256& update (span<char const> data);\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 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-

    append the following bytes to what is being hashed

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

    final()

    \n+[report issue]
    \n+

    disk_buffer_holder()

    \n
    \n-sha256_hash final ();\n+disk_buffer_holder (buffer_allocator_interface& alloc\n+      , char* buf, int sz) noexcept;\n 
    \n-

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

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

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

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

    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-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+void swap (disk_buffer_holder& h) noexcept;\n 
    \n-\n-[report issue]
    \n-

    add() remove()

    \n+

    swap pointers of two disk buffer holders.

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

    is_mutable()

    \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+bool is_mutable () const noexcept;\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+

    if this returns true, the buffer may not be modified in place

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

    bool()

    \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+explicit operator bool () const noexcept;\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+

    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-std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+struct disk_observer\n+{\n+   virtual void on_disk () = 0;\n+};\n 
    \n-

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

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

    enum socket_type_t

    \n-

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    tcp_socket0these match the socket types from socket_type.hpp\n-shifted one down
    utp_socket1 
    ssl_tcp_socket2 
    ssl_utp_socket3 
    i2p_socket4 
    num_socket_types5 
    \n-[report issue]
    \n+[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-

    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+

    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 peer_class_info\n+struct settings_interface\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+   virtual void set_str (int name, std::string val) = 0;\n+   virtual void set_bool (int name, bool val) = 0;\n+   virtual bool has_val (int name) const = 0;\n+   virtual void set_int (int name, int 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-
    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+[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-
    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+
    write_only
    \n+
    open the file for writing only
    \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+
    read_write
    \n+
    open the file for reading and writing
    \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+
    rw_mask
    \n+
    the mask for the bits determining read or write mode
    \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+
    sparse
    \n+
    open the file in sparse mode (if supported by the\n+filesystem).
    \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+
    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+
    open the file for random access. This disables read-ahead\n+logic
    \n+
    \n+
    \n+
    mmapped
    \n+
    the file is memory mapped
    \n+
    \n+[report issue]
    \n+
    \n+

    session_params

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n+

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

    \n
    \n-struct storage_error\n+struct session_params\n {\n-   explicit operator bool () const;\n-   void file (file_index_t f);\n-   file_index_t file () const;\n+   session_params (settings_pack&& sp);\n+   session_params (settings_pack const& sp);\n+   session_params ();\n+   session_params (settings_pack&& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n+   session_params (settings_pack const& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n \n-   error_code ec;\n-   operation_t operation;\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-

    bool()

    \n+[report issue]
    \n+

    session_params()

    \n
    \n-explicit operator bool () const;\n+session_params (settings_pack&& sp);\n+session_params (settings_pack const& sp);\n+session_params ();\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+

    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 file (file_index_t f);\n-file_index_t file () const;\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-

    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+

    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-
    operation
    \n-
    A code from operation_t enum, indicating what\n-kind of operation failed.
    \n+[report issue]
    \n+
    extensions
    \n+
    the plugins to add to the session as it is constructed
    \n
    \n-[report issue]
    \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-

    libtorrent_category()

    \n-

    Declared in "libtorrent/error_code.hpp"

    \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-boost::system::error_category& libtorrent_category ();\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&& st);\n+   void set_dht_state (dht::dht_state const& st);\n+   std::vector<torrent_handle> get_torrents () const;\n+   torrent_handle find_torrent (sha1_hash const& info_hash) const;\n+   torrent_handle add_torrent (add_torrent_params const& params);\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&& params);\n+   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+   void async_add_torrent (add_torrent_params const& params);\n+   bool is_paused () const;\n+   void resume ();\n+   void pause ();\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::function<std::shared_ptr<torrent_plugin>(\n+      torrent_handle const&, client_data_t)> ext);\n+   void add_extension (std::shared_ptr<plugin> ext);\n+   void set_ip_filter (ip_filter f);\n+   ip_filter get_ip_filter () const;\n+   void set_port_filter (port_filter const& f);\n+   bool is_listening () const;\n+   unsigned short ssl_listen_port () const;\n+   unsigned short listen_port () const;\n+   void set_peer_class_filter (ip_filter const& f);\n+   ip_filter get_peer_class_filter () const;\n+   void set_peer_class_type_filter (peer_class_type_filter const& f);\n+   peer_class_type_filter get_peer_class_type_filter () const;\n+   peer_class_t create_peer_class (char const* name);\n+   void delete_peer_class (peer_class_t cid);\n+   peer_class_info get_peer_class (peer_class_t cid) const;\n+   void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+   void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+   settings_pack get_settings () const;\n+   void apply_settings (settings_pack 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 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-

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

    is_valid()

    \n
    \n-boost::system::error_category& http_category ();\n+bool is_valid () const;\n 
    \n-

    returns the error_category for HTTP errors

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

    pcp_category()

    \n-

    Declared in "libtorrent/natpmp.hpp"

    \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-boost::system::error_category& pcp_category ();\n+session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n 
    \n-[report issue]
    \n-
    \n-

    upnp_category()

    \n-

    Declared in "libtorrent/upnp.hpp"

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

    the boost.system error category for UPnP errors

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

    gzip_category()

    \n-

    Declared in "libtorrent/gzip.hpp"

    \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-boost::system::error_category& gzip_category ();\n+void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n 
    \n-

    get the error_category for zip errors

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

    socks_category()

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

    \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-boost::system::error_category& socks_category ();\n+void post_session_stats ();\n 
    \n-

    returns the error_category for SOCKS5 errors

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

    i2p_category()

    \n-

    Declared in "libtorrent/i2p_stream.hpp"

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

    returns the error category for I2P errors

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

    bdecode_category()

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n+

    This will cause a dht_stats_alert to be posted.

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

    set_dht_state()

    \n
    \n-boost::system::error_category& bdecode_category ();\n+void set_dht_state (dht::dht_state&& st);\n+void set_dht_state (dht::dht_state const& st);\n 
    \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-
    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.
    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 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/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 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/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+

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

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

    get_torrents() find_torrent()

    \n+
    \n+std::vector<torrent_handle> get_torrents () const;\n+torrent_handle find_torrent (sha1_hash const& info_hash) const;\n+
    \n+

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

    \n+

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

    \n+

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

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

    add_torrent() async_add_torrent()

    \n+
    \n+torrent_handle add_torrent (add_torrent_params const& params);\n+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&& 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 overload that does not take an error_code throws an exception on\n+error and is not available when building without exception support.\n+The torrent_handle returned by add_torrent() can be used to retrieve\n+information about the torrent's progress, its peers etc. It is also\n+used to abort a torrent.

    \n+

    If the torrent you are trying to add already exists in the session (is\n+either queued for checking, being checked or downloading)\n+add_torrent() will throw system_error which derives from\n+std::exception unless duplicate_is_error is set to false. In that\n+case, add_torrent() will return the handle to the existing torrent.

    \n+

    The add_torrent_params class has a flags field. It can be used to\n+control what state the new torrent will be added in. Common flags to\n+want to control are torrent_flags::paused and\n+torrent_flags::auto_managed. In order to add a magnet link that will\n+just download the metadata, but no payload, set the\n+torrent_flags::upload_mode flag.

    \n+

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

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

    pause() is_paused() resume()

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

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

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

    is_dht_running()

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

    is_dht_running() returns true if the DHT support has been started\n+and false otherwise.

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

    set_dht_storage()

    \n+
    \n+void set_dht_storage (dht::dht_storage_constructor_type sc);\n+
    \n+

    set_dht_storage set a dht custom storage constructor function\n+to be used internally when the dht is created.

    \n+

    Since the dht storage is a critical component for the dht behavior,\n+this function will only be effective the next time the dht is started.\n+If you never touch this feature, a default map-memory based storage\n+is used.

    \n+

    If you want to make sure the dht is initially created with your\n+custom storage, create a session with the setting\n+settings_pack::enable_dht to false, set your constructor function\n+and call apply_settings with settings_pack::enable_dht to true.

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

    add_dht_node()

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

    add_dht_node takes a host name and port pair. That endpoint will be\n+pinged, and if a valid DHT reply is received, the node will be added to\n+the routing table.

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

    dht_get_item()

    \n+
    \n+void dht_get_item (sha1_hash const& target);\n+
    \n+

    query the DHT for an immutable item at the target hash.\n+the result is posted as a dht_immutable_item_alert.

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

    dht_get_item()

    \n+
    \n+void dht_get_item (std::array<char, 32> key\n+      , std::string salt = std::string());\n+
    \n+

    query the DHT for a mutable item under the public key key.\n+this is an ed25519 key. salt is optional and may be left\n+as an empty string if no salt is to be used.\n+if the item is found in the DHT, a dht_mutable_item_alert is\n+posted.

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

    dht_put_item()

    \n+
    \n+sha1_hash dht_put_item (entry data);\n+
    \n+

    store the given bencoded data as an immutable item in the DHT.\n+the returned hash is the key that is to be used to look the item\n+up again. It's just the SHA-1 hash of the bencoded form of the\n+structure.

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

    dht_put_item()

    \n+
    \n+void dht_put_item (std::array<char, 32> key\n+      , std::function<void(entry&, std::array<char, 64>&\n+      , std::int64_t&, std::string const&)> cb\n+      , std::string salt = std::string());\n+
    \n+

    store a mutable item. The key is the public key the blob is\n+to be stored under. The optional salt argument is a string that\n+is to be mixed in with the key when determining where in the DHT\n+the value is to be stored. The callback function is called from within\n+the libtorrent network thread once we've found where to store the blob,\n+possibly with the current value stored under the key.\n+The values passed to the callback functions are:

    \n+
    \n+
    entry& value
    \n+
    the current value stored under the key (may be empty). Also expected\n+to be set to the value to be stored by the function.
    \n+
    std::array<char,64>& signature
    \n+
    the signature authenticating the current value. This may be zeros\n+if there is currently no value stored. The function is expected to\n+fill in this buffer with the signature of the new value to store.\n+To generate the signature, you may want to use the\n+sign_mutable_item function.
    \n+
    std::int64_t& seq
    \n+
    current sequence number. May be zero if there is no current value.\n+The function is expected to set this to the new sequence number of\n+the value that is to be stored. Sequence numbers must be monotonically\n+increasing. Attempting to overwrite a value with a lower or equal\n+sequence number will fail, even if the signature is correct.
    \n+
    std::string const& salt
    \n+
    this is the salt that was used for this put call.
    \n+
    \n+

    Since the callback function cb is called from within libtorrent,\n+it is critical to not perform any blocking operations. Ideally not\n+even locking a mutex. Pass any data required for this function along\n+with the function object's context and make the function entirely\n+self-contained. The only reason data blob's value is computed\n+via a function instead of just passing in the new value is to avoid\n+race conditions. If you want to update the value in the DHT, you\n+must first retrieve it, then modify it, then write it back. The way\n+the DHT works, it is natural to always do a lookup before storing and\n+calling the callback in between is convenient.

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

    dht_announce() dht_get_peers()

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

    Both these functions are exposed for advanced custom use of the DHT.\n+All torrents eligible to be announce to the DHT will be automatically,\n+by libtorrent.

    \n+

    For possible flags, see announce_flags_t.

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

    dht_live_nodes()

    \n+
    \n+void dht_live_nodes (sha1_hash const& nid);\n+
    \n+

    Retrieve all the live DHT (identified by nid) nodes. All the\n+nodes id and endpoint will be returned in the list of nodes in the\n+alert dht_live_nodes_alert.\n+Since this alert is a response to an explicit call, it will always be\n+posted, regardless of the alert mask.

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

    dht_sample_infohashes()

    \n+
    \n+void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n+
    \n+

    Query the DHT node specified by ep to retrieve a sample of the\n+info-hashes that the node currently have in their storage.\n+The target is included for iterative lookups so that indexing nodes\n+can perform a key space traversal with a single RPC per node by adjusting\n+the target value for each RPC. It has no effect on the returned sample value.\n+The result is posted as a dht_sample_infohashes_alert.

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

    dht_direct_request()

    \n+
    \n+void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+
    \n+

    Send an arbitrary DHT request directly to the specified endpoint. This\n+function is intended for use by plugins. When a response is received\n+or the request times out, a dht_direct_response_alert will be posted\n+with the response (if any) and the userdata pointer passed in here.\n+Since this alert is a response to an explicit call, it will always be\n+posted, regardless of the alert mask.

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

    add_extension()

    \n+
    \n+void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n+      torrent_handle const&, client_data_t)> ext);\n+void add_extension (std::shared_ptr<plugin> ext);\n+
    \n+

    This function adds an extension to this session. The argument is a\n+function object that is called with a torrent_handle and which should\n+return a std::shared_ptr<torrent_plugin>. To write custom\n+plugins, see libtorrent plugins. For the typical bittorrent client\n+all of these extensions should be added. The main plugins implemented\n+in libtorrent are:

    \n+
    \n+
    uTorrent metadata
    \n+
    Allows peers to download the metadata (.torrent files) from the swarm\n+directly. Makes it possible to join a swarm with just a tracker and\n+info-hash.
    \n+
    \n+
    \n+#include <libtorrent/extensions/ut_metadata.hpp>\n+ses.add_extension(&lt::create_ut_metadata_plugin);\n+
    \n+
    \n+
    uTorrent peer exchange
    \n+
    Exchanges peers between clients.
    \n+
    \n+
    \n+#include <libtorrent/extensions/ut_pex.hpp>\n+ses.add_extension(&lt::create_ut_pex_plugin);\n+
    \n+
    \n+
    smart ban plugin
    \n+
    A plugin that, with a small overhead, can ban peers\n+that sends bad data with very high accuracy. Should\n+eliminate most problems on poisoned torrents.
    \n+
    \n+
    \n+#include <libtorrent/extensions/smart_ban.hpp>\n+ses.add_extension(&lt::create_smart_ban_plugin);\n+
    \n+\n+[report issue]
    \n+
    \n+

    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+

    listen_port() ssl_listen_port() is_listening()

    \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+void set_peer_class_filter (ip_filter const& f);\n+ip_filter get_peer_class_filter () const;\n+
    \n+

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

    \n+

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

    \n+

    For more info, see ip_filter.

    \n+

    For example, to make all peers in the range 200.1.1.0 - 200.1.255.255\n+belong to their own peer class, apply the following filter:

    \n+
    \n+ip_filter f = ses.get_peer_class_filter();\n+peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");\n+f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")\n+        , 1 << static_cast<std::uint32_t>(my_class));\n+ses.set_peer_class_filter(f);\n+
    \n+

    This setting only applies to new connections, it won't affect existing\n+peer connections.

    \n+

    This function is limited to only peer class 0-31, since there are only\n+32 bits in the IP range mapping. Only the set bits matter; no peer\n+class will be removed from a peer as a result of this call, peer\n+classes are only added.

    \n+

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

    \n+

    The get_peer_class_filter() function returns the current filter.

    \n+

    For more information, see peer classes.

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

    get_peer_class_type_filter() set_peer_class_type_filter()

    \n+
    \n+void set_peer_class_type_filter (peer_class_type_filter const& f);\n+peer_class_type_filter get_peer_class_type_filter () const;\n+
    \n+

    Sets and gets the peer class type filter. This is controls automatic\n+peer class assignments to peers based on what kind of socket it is.

    \n+

    It does not only support assigning peer classes, it also supports\n+removing peer classes based on socket type.

    \n+

    The order of these rules being applied are:

    \n+
      \n+
    1. peer-class IP filter
    2. \n+
    3. peer-class type filter, removing classes
    4. \n+
    5. peer-class type filter, adding classes
    6. \n+
    \n+

    For more information, see peer classes.

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

    create_peer_class()

    \n+
    \n+peer_class_t create_peer_class (char const* name);\n+
    \n+

    Creates a new peer class (see peer classes) with the given name. The\n+returned integer is the new peer class identifier. Peer classes may\n+have the same name, so each invocation of this function creates a new\n+class and returns a unique identifier.

    \n+

    Identifiers are assigned from low numbers to higher. So if you plan on\n+using certain peer classes in a call to set_peer_class_filter(),\n+make sure to create those early on, to get low identifiers.

    \n+

    For more information on peer classes, see peer classes.

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

    delete_peer_class()

    \n+
    \n+void delete_peer_class (peer_class_t cid);\n+
    \n+

    This call dereferences the reference count of the specified peer\n+class. When creating a peer class it's automatically referenced by 1.\n+If you want to recycle a peer class, you may call this function. You\n+may only call this function once per peer class you create.\n+Calling it more than once for the same class will lead to memory\n+corruption.

    \n+

    Since peer classes are reference counted, this function will not\n+remove the peer class if it's still assigned to torrents or peers. It\n+will however remove it once the last peer and torrent drops their\n+references to it.

    \n+

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

    \n+

    For more information on peer classes, see peer classes.

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

    set_peer_class() get_peer_class()

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

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

    \n+

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

    \n+

    set_peer_class() sets all the information in the\n+peer_class_info object in the specified peer class. There is no\n+option to only update a single property.

    \n+

    A peer or torrent belonging to more than one class, the highest\n+priority among any of its classes is the one that is taken into\n+account.

    \n+

    For more information, see peer classes.

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

    remove_torrent()

    \n+
    \n+void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+
    \n+

    remove_torrent() will close all peer connections associated with\n+the torrent and tell the tracker that we've stopped participating in\n+the swarm. This operation cannot fail. When it completes, you will\n+receive a torrent_removed_alert.

    \n+

    remove_torrent() is non-blocking, but will remove the torrent from the\n+session synchronously. Calling session_handle::add_torrent() immediately\n+afterward with the same torrent will succeed. Note that this creates a\n+new handle which is not equal to the removed one.

    \n+

    The optional second argument options can be used to delete all the\n+files downloaded by this torrent. To do so, pass in the value\n+session_handle::delete_files. Once the torrent is deleted, a\n+torrent_deleted_alert is posted.

    \n+

    The torrent_handle remains valid for some time after remove_torrent() is\n+called. It will become invalid only after all libtorrent tasks (such as\n+I/O tasks) release their references to the torrent. Until this happens,\n+torrent_handle::is_valid() will return true, and other calls such\n+as torrent_handle::status() will succeed. Because of this, and because\n+remove_torrent() is non-blocking, the following sequence usually\n+succeeds (does not throw system_error):\n+.. code:: c++

    \n+
    \n+session.remove_handle(handle);\n+handle.save_resume_data();
    \n+

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

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

    get_settings() apply_settings()

    \n+
    \n+settings_pack get_settings () const;\n+void apply_settings (settings_pack 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+

    set_alert_notify() pop_alerts() wait_for_alert()

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

    add_port_mapping() delete_port_mapping()

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

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

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

    reopen_network_sockets()

    \n+
    \n+void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n+
    \n+

    Instructs the session to reopen all listen and outgoing sockets.

    \n+

    It's useful in the case your platform doesn't support the built in\n+IP notifier mechanism, or if you have a better more reliable way to\n+detect changes in the IP routing table.

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

    native_handle()

    \n+
    \n+std::shared_ptr<aux::session_impl> native_handle () const;\n+
    \n+

    This function is intended only for use by plugins. This type does\n+not have a stable API and should be relied on as little as possible.

    \n+[report issue]
    \n+
    save_settings
    \n+
    saves settings (i.e. the settings_pack)
    \n+
    \n+[report issue]
    \n+
    save_dht_state
    \n+
    saves dht state such as nodes and node-id, possibly accelerating\n+joining the DHT if provided at next session startup.
    \n+
    \n+[report issue]
    \n+
    save_extension_state
    \n+
    load or save state from plugins
    \n+
    \n+[report issue]
    \n+
    save_ip_filter
    \n+
    load or save the IP filter set on the session
    \n+
    \n+\n+\n+[report issue]
    \n+
    global_peer_class_id tcp_peer_class_id local_peer_class_id
    \n+
    built-in peer classes
    \n+
    \n+[report issue]
    \n+
    delete_files
    \n+
    delete the files belonging to the torrent from disk.\n+including the part-file, if there is one
    \n+
    \n+[report issue]
    \n+
    delete_partfile
    \n+
    delete just the part-file associated with this torrent
    \n+
    \n+[report issue]
    \n+
    paused
    \n+
    when set, the session will start paused. Call\n+session_handle::resume() to start
    \n+
    \n+\n+[report issue]
    \n+
    udp tcp
    \n+
    protocols used by add_port_mapping()
    \n+
    \n+[report issue]
    \n+
    reopen_map_ports
    \n+
    This option indicates if the ports are mapped using natpmp\n+and upnp. If mapping was already made, they are deleted and added\n+again. This only works if natpmp and/or upnp are configured to be\n+enable.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    session_proxy

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

    this is a holder for the internal session implementation object. Once the\n+session destruction is explicitly initiated, this holder is used to\n+synchronize the completion of the shutdown. The lifetime of this object\n+may outlive session, causing the session destructor to not block. The\n+session_proxy destructor will block however, until the underlying session\n+is done shutting down.

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

    session_proxy() operator=() ~session_proxy()

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

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

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

    session

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

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

    \n+

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

    \n+

    see apply_settings().

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

    session()

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

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

    \n+
    \n+

    Warning

    \n+

    The session object does not cleanly terminate with an external\n+io_context. The io_context::run() call must have returned\n+before it's safe to destruct the session. Which means you MUST\n+call session::abort() and save the session_proxy first, then\n+destruct the session object, then sync with the io_context, then\n+destruct the session_proxy object.

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

    ~session()

    \n+
    \n+~session ();\n+
    \n+

    The destructor of session will notify all trackers that our torrents\n+have been shut down. If some trackers are down, they will time out.\n+All this before the destructor of session returns. So, it's advised\n+that any kind of interface (such as windows) are closed before\n+destructing the session object. Because it can take a few second for\n+it to finish. The timeout can be set with apply_settings().

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

    abort()

    \n+
    \n+session_proxy abort ();\n+
    \n+

    In case you want to destruct the session asynchronously, you can\n+request a session destruction proxy. If you don't do this, the\n+destructor of the session object will block while the trackers are\n+contacted. If you keep one session_proxy to the session when\n+destructing it, the destructor will not block, but start to close down\n+the session, the destructor of the proxy will then synchronize the\n+threads. So, the destruction of the session is performed from the\n+session destructor call until the session_proxy destructor\n+call. The session_proxy does not have any operations on it (since\n+the session is being closed down, no operations are allowed on it).\n+The only valid operation is calling the destructor:

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

    write_session_params() write_session_params_buf() read_session_params()

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n+
    \n+entry write_session_params (session_params const& sp\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+session_params read_session_params (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+session_params read_session_params (span<char const> buf\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+
    \n+

    These functions serialize and de-serialize a session_params object to and\n+from bencoded form. The session_params object is used to initialize a new\n+session using the state from a previous one (or by programmatically configure\n+the session up-front).\n+The flags parameter can be used to only save and load certain aspects of the\n+session's state.\n+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+
    \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+   counters& operator= (counters const&) & ;\n    std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n    std::int64_t operator[] (int i) const ;\n-   void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n    void set_value (int c, std::int64_t value) ;\n+   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 inc_stats_counter (int c, std::int64_t value = 1) ;\n@@ -11684,3464 +12095,2086 @@\n \n gauge\n 1\n  \n \n \n \n-

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

    \n-

    By default, only errors are reported. settings_pack::alert_mask can be\n-used to specify which kinds of events should be reported. The alert mask is\n-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-posting alerts. Only alerts that belong to an enabled category are\n-posted. Setting the alert bitmask to 0 will disable all alerts (except those\n-that are non-discardable). Alerts that are responses to API calls such as\n-save_resume_data() and post_session_stats() are non-discardable and will be\n-posted even if their category is disabled.

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

    dht_routing_bucket

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    struct to hold information about a single DHT routing table bucket

    \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 dht_routing_bucket\n+struct add_torrent_params\n {\n-   int num_nodes;\n-   int num_replacements;\n-   int last_active;\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-\n-[report issue]
    \n-
    num_nodes num_replacements
    \n-
    the total number of nodes and replacement nodes\n-in the routing table
    \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-
    last_active
    \n-
    number of seconds since last activity
    \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-
    \n-

    torrent_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is a base class for alerts that are associated with a\n-specific torrent. It contains a handle to the torrent.

    \n-

    Note that by the time the client receives a torrent_alert, its\n-handle member may be invalid.

    \n-
    \n-struct torrent_alert : alert\n-{\n-   std::string message () const override;\n-   char const* torrent_name () const;\n-\n-   torrent_handle handle;\n-};\n-
    \n-[report issue]
    \n-

    message()

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

    returns the message associated with this alert

    \n-[report issue]
    \n-
    handle
    \n-
    The torrent_handle pointing to the torrent this\n-alert is associated with.
    \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+[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-
    \n-

    peer_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The peer alert is a base class for alerts that refer to a specific peer. It includes all\n-the information to identify the peer. i.e. ip and peer-id.

    \n-
    \n-struct peer_alert : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   aux::noexcept_movable<tcp::endpoint> endpoint;\n-   peer_id pid;\n-};\n-
    \n-[report issue]
    \n-
    endpoint
    \n-
    The peer's IP address and port.
    \n+

    Setting this to an absolute path performs slightly better than a\n+relative path.

    \n+
    \n
    \n-[report issue]
    \n-
    pid
    \n-
    the peer ID, if known.
    \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-
    \n-

    tracker_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is a base class used for alerts that are associated with a\n-specific tracker. It derives from torrent_alert since a tracker\n-is also associated with a specific torrent.

    \n-
    \n-struct tracker_alert : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* tracker_url () const;\n-\n-   aux::noexcept_movable<tcp::endpoint> local_endpoint;\n-};\n-
    \n-[report issue]
    \n-

    tracker_url()

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

    returns a 0-terminated string of the tracker's URL

    \n-[report issue]
    \n-
    local_endpoint
    \n-
    endpoint of the listen interface being announced
    \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+[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-

    torrent_removed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The torrent_removed_alert is posted whenever a torrent is removed. Since\n-the torrent handle in its base class will usually be invalid (since the torrent\n-is already removed) it has the info hash as a member, to identify it.\n-It's posted when the alert_category::status bit is set in the alert_mask.

    \n-

    Note that the handle remains valid for some time after\n-torrent_removed_alert is posted, as long as some internal libtorrent\n-task (such as an I/O task) refers to it. Additionally, other alerts like\n-save_resume_data_alert may be posted after torrent_removed_alert.\n-To synchronize on whether the torrent has been removed or not, call\n-torrent_handle::in_session(). This will return true before\n-torrent_removed_alert is posted, and false afterward.

    \n-

    Even though the handle member doesn't point to an existing torrent anymore,\n-it is still useful for comparing to other handles, which may also no\n-longer point to existing torrents, but to the same non-existing torrents.

    \n-

    The torrent_handle acts as a weak_ptr, even though its object no\n-longer exists, it can still compare equal to another weak pointer which\n-points to the same non-existent object.

    \n+
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    set this to the info hash of the torrent to add in case the info-hash\n+is the only known property of the torrent. i.e. you don't have a\n+.torrent file nor a magnet link.\n+To add a magnet link, use parse_magnet_uri() to populate fields in the\n+add_torrent_params object.
    \n+
    \n+\n+[report issue]
    \n+
    max_uploads max_connections
    \n+

    max_uploads, max_connections, upload_limit,\n+download_limit correspond to the set_max_uploads(),\n+set_max_connections(), set_upload_limit() and\n+set_download_limit() functions on torrent_handle. These values let\n+you initialize these settings when the torrent is added, instead of\n+calling these functions immediately following adding it.

    \n+

    -1 means unlimited on these settings just like their counterpart\n+functions on torrent_handle

    \n+

    For fine grained control over rate limits, including making them apply\n+to local peers, see peer classes.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    upload_limit download_limit
    \n+
    the upload and download rate limits for this torrent, specified in\n+bytes per second. -1 means unlimited.
    \n+
    \n+\n+[report issue]
    \n+
    total_uploaded total_downloaded
    \n+
    the total number of bytes uploaded and downloaded by this torrent so\n+far.
    \n+
    \n+\n+\n+[report issue]
    \n+
    active_time finished_time seeding_time
    \n+
    the number of seconds this torrent has spent in started, finished and\n+seeding state so far, respectively.
    \n+
    \n+\n+[report issue]
    \n+
    added_time completed_time
    \n+
    if set to a non-zero value, this is the posix time of when this torrent\n+was first added, including previous runs/sessions. If set to zero, the\n+internal added_time will be set to the time of when add_torrent() is\n+called.
    \n+
    \n+[report issue]
    \n+
    last_seen_complete
    \n+
    if set to non-zero, initializes the time (expressed in posix time) when\n+we last saw a seed or peers that together formed a complete copy of the\n+torrent. If left set to zero, the internal counterpart to this field\n+will be updated when we see a seed or a distributed copies >= 1.0.
    \n+
    \n+\n+\n+[report issue]
    \n+
    num_complete num_incomplete num_downloaded
    \n+

    these field can be used to initialize the torrent's cached scrape data.\n+The scrape data is high level metadata about the current state of the\n+swarm, as returned by the tracker (either when announcing to it or by\n+sending a specific scrape request). num_complete is the number of\n+peers in the swarm that are seeds, or have every piece in the torrent.\n+num_incomplete is the number of peers in the swarm that do not have\n+every piece. num_downloaded is the number of times the torrent has\n+been downloaded (not initiated, but the number of times a download has\n+completed).

    \n+

    Leaving any of these values set to -1 indicates we don't know, or we\n+have not received any scrape data.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    http_seeds url_seeds
    \n+

    URLs can be added to these two lists to specify additional web\n+seeds to be used by the torrent. If the flag_override_web_seeds\n+is set, these will be the _only_ ones to be used. i.e. any web seeds\n+found in the .torrent file will be overridden.

    \n+

    http_seeds expects URLs to web servers implementing the original HTTP\n+seed specification BEP 17.

    \n+

    url_seeds expects URLs to regular web servers, aka "get right" style,\n+specified in BEP 19.

    \n+
    \n+
    \n+[report issue]
    \n+
    peers
    \n+
    peers to add to the torrent, to be tried to be connected to as\n+bittorrent peers.
    \n+
    \n+[report issue]
    \n+
    banned_peers
    \n+
    peers banned from this torrent. The will not be connected to
    \n+
    \n+[report issue]
    \n+
    unfinished_pieces
    \n+
    this is a map of partially downloaded piece. The key is the piece index\n+and the value is a bitfield where each bit represents a 16 kiB block.\n+A set bit means we have that block.
    \n+
    \n+[report issue]
    \n+
    have_pieces
    \n+
    this is a bitfield indicating which pieces we already have of this\n+torrent.
    \n+
    \n+[report issue]
    \n+
    verified_pieces
    \n+
    when in seed_mode, pieces with a set bit in this bitfield have been\n+verified to be valid. Other pieces will be verified the first time a\n+peer requests it.
    \n+
    \n+[report issue]
    \n+
    piece_priorities
    \n+
    this sets the priorities for each individual piece in the torrent. Each\n+element in the vector represent the piece with the same index. If you\n+set both file- and piece priorities, file priorities will take\n+precedence.
    \n+
    \n+[report issue]
    \n+
    merkle_trees
    \n+
    v2 hashes, if known
    \n+
    \n+[report issue]
    \n+
    merkle_tree_mask
    \n+
    if set, indicates which hashes are included in the corresponding\n+vector of merkle_trees. These bitmasks always cover the full\n+tree, a cleared bit means the hash is all zeros (i.e. not set) and\n+set bit means the next hash in the corresponding vector in\n+merkle_trees is the hash for that node. This is an optimization\n+to avoid storing a lot of zeros.
    \n+
    \n+[report issue]
    \n+
    verified_leaf_hashes
    \n+
    bit-fields indicating which v2 leaf hashes have been verified\n+against the root hash. If this vector is empty and merkle_trees is\n+non-empty it implies that all hashes in merkle_trees are verified.
    \n+
    \n+[report issue]
    \n+
    renamed_files
    \n+
    this is a map of file indices in the torrent and new filenames to be\n+applied before the torrent is added.
    \n+
    \n+\n+[report issue]
    \n+
    last_download last_upload
    \n+
    the posix time of the last time payload was received or sent for this\n+torrent, respectively. A value of 0 means we don't know when we last\n+uploaded or downloaded, or we have never uploaded or downloaded any\n+payload for this torrent.
    \n+
    \n+[report issue]
    \n+
    \n+

    client_data_t

    \n+

    Declared in "libtorrent/client_data.hpp"

    \n+

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

    \n
    \n-struct torrent_removed_alert final : torrent_alert\n+struct client_data_t\n {\n-   std::string message () const override;\n+   client_data_t () = default;\n+   explicit client_data_t (T* v);\n+   client_data_t& operator= (T* v);\n+   explicit operator T () const;\n+   T* get () const;\n+   client_data_t& operator= (void*) = delete;\n+   client_data_t& operator= (void const*) = delete;\n+   operator void const* () const = delete;\n+   operator void* () const = delete;\n \n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   info_hash_t info_hashes;\n-   client_data_t userdata;\n+   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n };\n 
    \n-[report issue]
    \n-
    userdata
    \n-
    'userdata` as set in add_torrent_params at torrent creation.\n-This can be used to associate this torrent with related data\n-in the client application more efficiently than info_hashes.
    \n-
    \n-[report issue]
    \n-
    \n-

    read_piece_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when the asynchronous read operation initiated by\n-a call to torrent_handle::read_piece() is completed. If the read failed, the torrent\n-is paused and an error state is set and the buffer member of the alert\n-is 0. If successful, buffer points to a buffer containing all the data\n-of the piece. piece is the piece index that was read. size is the\n-number of bytes that was read.

    \n-

    If the operation fails, error will indicate what went wrong.

    \n+[report issue]
    \n+

    client_data_t()

    \n
    \n-struct read_piece_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   error_code const error;\n-   boost::shared_array<char> const buffer;\n-   piece_index_t const piece;\n-   int const size;\n-};\n+client_data_t () = default;\n 
    \n-[report issue]
    \n-
    \n-

    file_completed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is posted whenever an individual file completes its download. i.e.\n-All pieces overlapping this file have passed their hash check.

    \n+

    construct a nullptr client data

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

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

    \n
    \n-struct file_completed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n+client_data_t& operator= (void*) = delete;\n+client_data_t& operator= (void const*) = delete;\n+operator void const* () const = delete;\n+operator void* () const = delete;\n+
    \n+

    we don't allow type-unsafe operations

    \n+

    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-   file_index_t const index;\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-
    index
    \n-
    refers to the index of the file that completed.
    \n-
    \n-[report issue]
    \n-
    \n-

    file_renamed_alert

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

    create_torrent

    \n+

    Declared in "libtorrent/create_torrent.hpp"

    \n+

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

    \n
    \n-struct file_renamed_alert final : torrent_alert\n+struct create_torrent\n {\n-   std::string message () const override;\n-   char const* new_name () const;\n-   char const* old_name () const;\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 alert_category_t static_category  = alert_category::storage;\n-   file_index_t const index;\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-\n-[report issue]
    \n-

    old_name() new_name()

    \n+[report issue]
    \n+

    create_torrent()

    \n
    \n-char const* new_name () const;\n-char const* old_name () const;\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-

    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+

    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+

    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-

    file_rename_failed_alert

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

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

    generate() generate_buf()

    \n
    \n-struct file_rename_failed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   file_index_t const index;\n-   error_code const error;\n-};\n+entry generate () const;\n+std::vector<char> generate_buf () const;\n 
    \n-\n-[report issue]
    \n-
    index error
    \n-
    refers to the index of the file that was supposed to be renamed,\n-error is the error code returned from the filesystem.
    \n-
    \n-[report issue]
    \n-
    \n-

    performance_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a limit is reached that might have a negative impact on\n-upload or download rate performance.

    \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-struct performance_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   enum performance_warning_t\n-   {\n-      outstanding_disk_buffer_limit_reached,\n-      outstanding_request_limit_reached,\n-      upload_limit_too_low,\n-      download_limit_too_low,\n-      send_buffer_watermark_too_low,\n-      too_many_optimistic_unchoke_slots,\n-      too_high_disk_queue_limit,\n-      aio_limit_reached,\n-      deprecated_bittyrant_with_no_uplimit,\n-      too_few_outgoing_ports,\n-      too_few_file_descriptors,\n-      num_warnings,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::performance_warning;\n-   performance_warning_t const warning_code;\n-};\n+file_storage const& files () const;\n 
    \n-[report issue]
    \n-

    enum performance_warning_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\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
    outstanding_disk_buffer_limit_reached0This warning means that the number of bytes queued to be written to disk\n-exceeds the max disk byte queue setting (settings_pack::max_queued_disk_bytes).\n-This might restrict the download rate, by not queuing up enough write jobs\n-to the disk I/O thread. When this alert is posted, peer connections are\n-temporarily stopped from downloading, until the queued disk bytes have fallen\n-below the limit again. Unless your max_queued_disk_bytes setting is already\n-high, you might want to increase it to get better performance.
    outstanding_request_limit_reached1This is posted when libtorrent would like to send more requests to a peer,\n-but it's limited by settings_pack::max_out_request_queue. The queue length\n-libtorrent is trying to achieve is determined by the download rate and the\n-assumed round-trip-time (settings_pack::request_queue_time). The assumed\n-round-trip-time is not limited to just the network RTT, but also the remote disk\n-access time and message handling time. It defaults to 3 seconds. The target number\n-of outstanding requests is set to fill the bandwidth-delay product (assumed RTT\n-times download rate divided by number of bytes per request). When this alert\n-is posted, there is a risk that the number of outstanding requests is too low\n-and limits the download rate. You might want to increase the max_out_request_queue\n-setting.
    upload_limit_too_low2This warning is posted when the amount of TCP/IP overhead is greater than the\n-upload rate limit. When this happens, the TCP/IP overhead is caused by a much\n-faster download rate, triggering TCP ACK packets. These packets eat into the\n-rate limit specified to libtorrent. When the overhead traffic is greater than\n-the rate limit, libtorrent will not be able to send any actual payload, such\n-as piece requests. This means the download rate will suffer, and new requests\n-can be sent again. There will be an equilibrium where the download rate, on\n-average, is about 20 times the upload rate limit. If you want to maximize the\n-download rate, increase the upload rate limit above 5% of your download capacity.
    download_limit_too_low3This is the same warning as upload_limit_too_low but referring to the download\n-limit instead of upload. This suggests that your download rate limit is much lower\n-than your upload capacity. Your upload rate will suffer. To maximize upload rate,\n-make sure your download rate limit is above 5% of your upload capacity.
    send_buffer_watermark_too_low4

    We're stalled on the disk. We want to write to the socket, and we can write\n-but our send buffer is empty, waiting to be refilled from the disk.\n-This either means the disk is slower than the network connection\n-or that our send buffer watermark is too small, because we can\n-send it all before the disk gets back to us.\n-The number of bytes that we keep outstanding, requested from the disk, is calculated\n-as follows:

    \n-
    \n-min(512, max(upload_rate * send_buffer_watermark_factor / 100, send_buffer_watermark))\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+void set_comment (char const* str);\n 
    \n-

    If you receive this alert, you might want to either increase your send_buffer_watermark\n-or send_buffer_watermark_factor.

    \n-
    too_many_optimistic_unchoke_slots5If the half (or more) of all upload slots are set as optimistic unchoke slots, this\n-warning is issued. You probably want more regular (rate based) unchoke slots.
    too_high_disk_queue_limit6If the disk write queue ever grows larger than half of the cache size, this warning\n-is posted. The disk write queue eats into the total disk cache and leaves very little\n-left for the actual cache. This causes the disk cache to oscillate in evicting large\n-portions of the cache before allowing peers to download any more, onto the disk write\n-queue. Either lower max_queued_disk_bytes or increase cache_size.
    aio_limit_reached7 
    deprecated_bittyrant_with_no_uplimit8 
    too_few_outgoing_ports9This is generated if outgoing peer connections are failing because of address in use\n-errors, indicating that settings_pack::outgoing_ports is set and is too small of\n-a range. Consider not using the outgoing_ports setting at all, or widen the range to\n-include more ports.
    too_few_file_descriptors10 
    num_warnings11 
    \n-[report issue]
    \n-
    \n-
    \n-

    state_changed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    Generated whenever a torrent changes its state.

    \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-struct state_changed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   torrent_status::state_t const state;\n-   torrent_status::state_t const prev_state;\n-};\n+void set_creator (char const* str);\n 
    \n-[report issue]
    \n-
    state
    \n-
    the new state of the torrent.
    \n-
    \n-[report issue]
    \n-
    prev_state
    \n-
    the previous state.
    \n-
    \n-[report issue]
    \n-
    \n-

    tracker_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated on tracker time outs, premature disconnects,\n-invalid response or a HTTP response other than "200 OK". From the alert\n-you can get the handle to the torrent the tracker belongs to.

    \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-struct tracker_error_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-   char const* failure_reason () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n-   int const times_in_row;\n-   error_code const error;\n-   operation_t op;\n-   protocol_version version;\n-};\n+void set_creation_date (std::time_t timestamp);\n 
    \n-[report issue]
    \n-

    failure_reason()

    \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-char const* failure_reason () const;\n+void set_hash (piece_index_t index, sha1_hash const& h);\n 
    \n-

    if the tracker sent a "failure reason" string, it will be returned\n-here.

    \n-[report issue]
    \n-
    times_in_row
    \n-
    This member says how many times in a row this tracker has failed.
    \n-
    \n-[report issue]
    \n-
    error
    \n-
    the error code indicating why the tracker announce failed. If it is\n-is lt::errors::tracker_failure the failure_reason() might contain\n-a more detailed description of why the tracker rejected the request.\n-HTTP status codes indicating errors are also set in this field.
    \n-
    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that was announced
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    tracker_warning_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is triggered if the tracker reply contains a warning field.\n-Usually this means that the tracker announce was successful, but the\n-tracker has a message to the client.

    \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-struct tracker_warning_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-   char const* warning_message () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n-   protocol_version version;\n-};\n+void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n 
    \n-[report issue]
    \n-

    warning_message()

    \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
    \n-char const* warning_message () const;\n+void add_http_seed (string_view url);\n+void add_url_seed (string_view url);\n 
    \n-

    the message associated with this warning

    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that was announced
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    scrape_reply_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a scrape request succeeds.

    \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-struct scrape_reply_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker;\n-   int const incomplete;\n-   int const complete;\n-   protocol_version version;\n-};\n+void add_node (std::pair<std::string, int> node);\n 
    \n-\n-[report issue]
    \n-
    incomplete complete
    \n-
    the data returned in the scrape response. These numbers\n-may be -1 if the response was malformed.
    \n-
    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that was scraped
    \n-
    \n-[report issue]
    \n-
    \n-

    scrape_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    If a scrape request fails, this alert is generated. This might be due\n-to the tracker timing out, refusing connection or returning an http response\n-code indicating an error.

    \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-struct scrape_failed_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-   char const* error_message () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker | alert_category::error;\n-   error_code const error;\n-   protocol_version version;\n-};\n+void add_tracker (string_view url, int tier = 0);\n 
    \n-[report issue]
    \n-

    error_message()

    \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-char const* error_message () const;\n+void set_root_cert (string_view cert);\n 
    \n-

    if the error indicates there is an associated message, this returns\n-that message. Otherwise and empty string.

    \n-[report issue]
    \n-
    error
    \n-
    the error itself. This may indicate that the tracker sent an error\n-message (error::tracker_failure), in which case it can be\n-retrieved by calling error_message().
    \n-
    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that was scraped
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    tracker_reply_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is only for informational purpose. It is generated when a tracker announce\n-succeeds. It is generated regardless what kind of tracker was used, be it UDP, HTTP or\n-the DHT.

    \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-struct tracker_reply_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker;\n-   int const num_peers;\n-   protocol_version version;\n-};\n+void set_priv (bool p);\n+bool priv () const;\n 
    \n-[report issue]
    \n-
    num_peers
    \n-
    tells how many peers the tracker returned in this response. This is\n-not expected to be greater than the num_want settings. These are not necessarily\n-all new peers, some of them may already be connected.
    \n-
    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that was announced
    \n-
    \n-[report issue]
    \n-
    \n-

    dht_reply_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated each time the DHT receives peers from a node. num_peers\n-is the number of peers we received in this packet. Typically these packets are\n-received from multiple DHT nodes, and so the alerts are typically generated\n-a few at a time.

    \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-struct dht_reply_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht | alert_category::tracker;\n-   int const num_peers;\n-};\n+int num_pieces () const;\n 
    \n-[report issue]
    \n-
    \n-

    tracker_announce_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated each time a tracker announce is sent (or attempted to be sent).\n-There are no extra data members in this alert. The url can be found in the base class\n-however.

    \n+

    returns the number of pieces in the associated file_storage object.

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

    piece_range()

    \n
    \n-struct tracker_announce_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::tracker;\n-   event_t const event;\n-   protocol_version version;\n-};\n+index_range<piece_index_t> piece_range () const noexcept;\n 
    \n-[report issue]
    \n-
    event
    \n-
    specifies what event was sent to the tracker. See event_t.
    \n-
    \n-[report issue]
    \n-
    version
    \n-
    the bittorrent protocol version that is announced
    \n-
    \n-[report issue]
    \n-
    \n-

    hash_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a finished piece fails its hash check. You can get the handle\n-to the torrent which got the failed piece and the index of the piece itself from the alert.

    \n+

    all piece indices in the torrent to be created

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

    file_range()

    \n
    \n-struct hash_failed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   piece_index_t const piece_index;\n-};\n+index_range<file_index_t> file_range () const noexcept;\n 
    \n-[report issue]
    \n-
    \n-

    peer_ban_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer is banned because it has sent too many corrupt pieces\n-to us. ip is the endpoint to the peer that was banned.

    \n+

    all file indices in the torrent to be created

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

    file_piece_range()

    \n
    \n-struct peer_ban_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-};\n+index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n 
    \n-[report issue]
    \n-
    \n-

    peer_unsnubbed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer is un-snubbed. Essentially when it was snubbed for stalling\n-sending data, and now it started sending data again.

    \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-struct peer_unsnubbed_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-};\n+std::int64_t total_size () const;\n 
    \n-[report issue]
    \n-
    \n-

    peer_snubbed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer is snubbed, when it stops sending data when we request\n-it.

    \n+

    the total number of bytes of all files and pad files

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

    piece_size() piece_length()

    \n
    \n-struct peer_snubbed_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-};\n+int piece_length () const;\n+int piece_size (piece_index_t i) const;\n 
    \n-[report issue]
    \n-
    \n-

    peer_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer sends invalid data over the peer-peer protocol. The peer\n-will be disconnected, but you get its ip address from the alert, to identify it.

    \n+

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

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

    add_similar_torrent() add_collection()

    \n
    \n-struct peer_error_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-   operation_t op;\n-   error_code const error;\n-};\n+void add_collection (string_view c);\n+void add_similar_torrent (sha1_hash ih);\n 
    \n-[report issue]
    \n-
    op
    \n-
    a 0-terminated string of the low-level operation that failed, or nullptr if\n-there was no low level disk operation.
    \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-
    error
    \n-
    tells you what error caused this alert.
    \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-
    \n-

    peer_connect_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted every time an incoming peer connection both\n-successfully passes the protocol handshake and is associated with a\n-torrent, or an outgoing peer connection attempt succeeds. For arbitrary\n-incoming connections, see incoming_connection_alert.

    \n-
    \n-struct peer_connect_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   enum direction_t\n-   {\n-      in,\n-      out,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::connect;\n-   direction_t direction;\n-   socket_type_t socket_type;\n-};\n-
    \n-[report issue]
    \n-

    enum direction_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    in0 
    out1 
    \n-[report issue]
    \n-
    direction
    \n-
    Tells you if the peer was incoming or outgoing
    \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-
    \n-
    \n-

    peer_disconnected_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer is disconnected for any reason (other than the ones\n-covered by peer_error_alert ).

    \n-
    \n-struct peer_disconnected_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::connect;\n-   socket_type_t const socket_type;\n-   operation_t const op;\n-   error_code const error;\n-   close_reason_t const reason;\n-};\n-
    \n-[report issue]
    \n-
    socket_type
    \n-
    the kind of socket this peer was connected over
    \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-
    op
    \n-
    the operation or level where the error occurred. Specified as an\n-value from the operation_t enum. Defined in operations.hpp.
    \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-
    error
    \n-
    tells you what error caused peer to disconnect.
    \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-
    reason
    \n-
    the reason the peer disconnected (if specified)
    \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-
    \n-

    invalid_request_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is a debug alert that is generated by an incoming invalid piece request.\n-ip is the address of the peer and the request is the actual incoming\n-request from the peer. See peer_request for more info.

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

    add_files()

    \n+

    Declared in "libtorrent/create_torrent.hpp"

    \n
    \n-struct invalid_request_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-   peer_request const request;\n-   bool const we_have;\n-   bool const peer_interested;\n-   bool const withheld;\n-};\n+void add_files (file_storage& fs, std::string const& file\n+   , create_flags_t flags = {});\n+void add_files (file_storage& fs, std::string const& file\n+   , std::function<bool(std::string)> p, create_flags_t flags = {});\n 
    \n-[report issue]
    \n-
    request
    \n-
    the request we received from the peer
    \n-
    \n-[report issue]
    \n-
    we_have
    \n-
    true if we have this piece
    \n-
    \n-[report issue]
    \n-
    peer_interested
    \n-
    true if the peer indicated that it was interested to download before\n-sending the request
    \n-
    \n-[report issue]
    \n-
    withheld
    \n-
    if this is true, the peer is not allowed to download this piece because\n-of super-seeding rules.
    \n-
    \n-[report issue]
    \n-
    \n-

    torrent_finished_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a torrent switches from being a downloader to a seed.\n-It will only be generated once per torrent. It contains a torrent_handle to the\n-torrent in question.

    \n-
    \n-struct torrent_finished_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\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-[report issue]
    \n-
    \n-

    piece_finished_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted every time a piece completes downloading\n-and passes the hash check. This alert derives from torrent_alert\n-which contains the torrent_handle to the torrent the piece belongs to.\n-Note that being downloaded and passing the hash check may happen before\n-the piece is also fully flushed to disk. So torrent_handle::have_piece()\n-may still return false

    \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-struct piece_finished_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   piece_index_t const piece_index;\n-};\n+inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n+void set_piece_hashes (create_torrent& t, std::string const& p\n+   , settings_interface const& settings\n+   , std::function<void(piece_index_t)> const& f, error_code& ec);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p);\n+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+void set_piece_hashes (create_torrent& t, std::string const& p\n+   , settings_interface const& settings, disk_io_constructor_type disk_io\n+   , std::function<void(piece_index_t)> const& f, error_code& ec);\n+void set_piece_hashes (create_torrent& t, std::string const& p\n+   , 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 
    \n-[report issue]
    \n-
    piece_index
    \n-
    the index of the piece that finished
    \n-
    \n-[report issue]
    \n-
    \n-

    request_dropped_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a peer rejects or ignores a piece request.

    \n+

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

    \n+
    \n+void Fun(piece_index_t);\n+
    \n+

    The overloads taking a settings_pack may be used to configure the\n+underlying disk access. Such as settings_pack::aio_threads.

    \n+

    The overloads that don't take an error_code& may throw an exception in case of a\n+file error, the other overloads sets the error code to reflect the error, if any.

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

    info_hash_t

    \n+

    Declared in "libtorrent/info_hash.hpp"

    \n+

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

    \n+
    \n+

    Note

    \n+

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

    \n+
    \n
    \n-struct request_dropped_alert final : peer_alert\n+struct info_hash_t\n {\n-   std::string message () const override;\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+   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-   int const block_index;\n-   piece_index_t const piece_index;\n+   sha1_hash v1;\n+   sha256_hash v2;\n };\n 
    \n-[report issue]
    \n-
    \n-

    block_timeout_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a block request times out.

    \n+[report issue]
    \n+

    info_hash_t()

    \n
    \n-struct block_timeout_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n+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+explicit info_hash_t (sha1_hash h1) noexcept;\n 
    \n-[report issue]
    \n-
    \n-

    block_finished_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a block request receives a response.

    \n+

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

    \n+

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

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

    has_v2() has_v1() has()

    \n
    \n-struct block_finished_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n+bool has (protocol_version v) const;\n+bool has_v2 () const;\n+bool has_v1 () const;\n 
    \n-[report issue]
    \n-
    \n-

    block_downloading_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a block request is sent to a peer.

    \n+

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

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

    get()

    \n
    \n-struct block_downloading_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n+sha1_hash get (protocol_version v) const;\n 
    \n-[report issue]
    \n-
    \n-

    unwanted_block_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a block is received that was not requested or\n-whose request timed out.

    \n+

    returns the has for the specified protocol version

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

    get_best()

    \n
    \n-struct unwanted_block_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n+sha1_hash get_best () const;\n 
    \n-[report issue]
    \n-
    \n-

    storage_moved_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The storage_moved_alert is generated when all the disk IO has\n-completed and the files have been moved, as an effect of a call to\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+

    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-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-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-};\n+template <typename F> void for_each (F f) const;\n 
    \n-\n-[report issue]
    \n-

    old_path() storage_path()

    \n+

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

    \n
    \n-char const* storage_path () const;\n-char const* old_path () const;\n+void(sha1_hash const&, protocol_version);\n 
    \n-

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

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

    storage_moved_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The storage_moved_failed_alert is generated when an attempt to move the storage,\n-via torrent_handle::move_storage(), fails.

    \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 storage_moved_failed_alert final : torrent_alert\n+struct peer_request\n {\n-   std::string message () const override;\n-   char const* file_path () const;\n+   bool operator== (peer_request const& r) const;\n \n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   error_code const error;\n-   operation_t op;\n+   piece_index_t piece;\n+   int start;\n+   int length;\n };\n 
    \n-[report issue]
    \n-

    file_path()

    \n+[report issue]
    \n+

    operator==()

    \n
    \n-char const* file_path () const;\n+bool operator== (peer_request const& r) const;\n 
    \n-

    If the error happened for a specific file, this returns its path.

    \n-[report issue]
    \n-
    op
    \n-
    this indicates what underlying operation caused the error
    \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+[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-

    torrent_deleted_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a request to delete the files of a torrent complete.

    \n-

    This alert is posted in the alert_category::storage category, and that bit\n-needs to be set in the alert_mask.

    \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 torrent_deleted_alert final : torrent_alert\n+struct peer_info\n {\n-   std::string message () const override;\n+   sha256_hash i2p_destination () const;\n \n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   info_hash_t info_hashes;\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-
    info_hashes
    \n-
    The info-hash of the torrent that was just deleted. Most of\n-the time the torrent_handle in the torrent_alert will be invalid by the time\n-this alert arrives, since the torrent is being deleted. The info_hashes member\n-is hence the main way of identifying which torrent just completed the delete.
    \n-
    \n-[report issue]
    \n-
    \n-

    torrent_delete_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a request to delete the files of a torrent fails.\n-Just removing a torrent from the session cannot fail

    \n+[report issue]
    \n+

    i2p_destination()

    \n
    \n-struct torrent_delete_failed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage\n-   | alert_category::error;\n-   error_code const error;\n-   info_hash_t info_hashes;\n-};\n+sha256_hash i2p_destination () const;\n 
    \n-[report issue]
    \n-
    error
    \n-
    tells you why it failed.
    \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-
    info_hashes
    \n-
    the info hash of the torrent whose files failed to be deleted
    \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-[report issue]
    \n-
    \n-

    save_resume_data_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated as a response to a torrent_handle::save_resume_data request.\n-It is generated once the disk IO thread is done writing the state for this torrent.

    \n-
    \n-struct save_resume_data_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   add_torrent_params params;\n-};\n-
    \n-[report issue]
    \n-
    params
    \n-

    the params object is populated with the torrent file whose resume\n-data was saved. It is suitable to be:

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

    save_resume_data_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated instead of save_resume_data_alert if there was an error\n-generating the resume data. error describes what went wrong.

    \n-
    \n-struct save_resume_data_failed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage\n-   | alert_category::error;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error code from the resume_data failure
    \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-
    \n-

    torrent_paused_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated as a response to a torrent_handle::pause request. It is\n-generated once all disk IO is complete and the files in the torrent have been closed.\n-This is useful for synchronizing with the disk.

    \n-
    \n-struct torrent_paused_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    torrent_resumed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated as a response to a torrent_handle::resume() request. It is\n-generated when a torrent goes from a paused state to an active state.

    \n-
    \n-struct torrent_resumed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    torrent_checked_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when a torrent completes checking. i.e. when it transitions\n-out of the checking files state into a state where it is ready to start downloading

    \n-
    \n-struct torrent_checked_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    url_seed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a HTTP seed name lookup fails.

    \n-
    \n-struct url_seed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* server_url () const;\n-   char const* error_message () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer | alert_category::error;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-

    server_url()

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

    the URL the error is associated with

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

    error_message()

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

    in case the web server sent an error message, this function returns\n-it.

    \n-[report issue]
    \n-
    error
    \n-
    the error the web seed encountered. If this is not set, the server\n-sent an error message, call error_message().
    \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-
    \n-
    \n-

    file_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    If the storage fails to read or write files that it needs access to, this alert is\n-generated and the torrent is paused.

    \n-
    \n-struct file_error_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* filename () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status\n-   | alert_category::storage;\n-   error_code const error;\n-   operation_t op;\n-};\n-
    \n-[report issue]
    \n-

    filename()

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

    the file that experienced the error

    \n-[report issue]
    \n-
    error
    \n-
    the error code describing the error.
    \n+[report issue]
    \n+
    interesting
    \n+
    we are interested in pieces from this peer.
    \n
    \n-[report issue]
    \n-
    op
    \n-
    indicates which underlying operation caused the error
    \n+[report issue]
    \n+
    choked
    \n+
    we have choked this peer.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    metadata_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when the metadata has been completely received and the info-hash\n-failed to match it. i.e. the metadata that was received was corrupt. libtorrent will\n-automatically retry to fetch it in this case. This is only relevant when running a\n-torrent-less download, with the metadata extension provided by libtorrent.

    \n-
    \n-struct metadata_failed_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    indicates what failed when parsing the metadata. This error is\n-what's returned from lazy_bdecode().
    \n+[report issue]
    \n+
    remote_interested
    \n+
    the peer is interested in us
    \n
    \n-[report issue]
    \n-
    \n-

    metadata_received_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when the metadata has been completely received and the torrent\n-can start downloading. It is not generated on torrents that are started with metadata, but\n-only those that needs to download it from peers (when utilizing the libtorrent extension).

    \n-

    There are no additional data members in this alert.

    \n-

    Typically, when receiving this alert, you would want to save the torrent file in order\n-to load it back up again when the session is restarted. Here's an example snippet of\n-code to do that:

    \n-
    \n-torrent_handle h = alert->handle();\n-std::shared_ptr<torrent_info const> ti = h.torrent_file();\n-create_torrent ct(*ti);\n-entry te = ct.generate();\n-std::vector<char> buffer;\n-bencode(std::back_inserter(buffer), te);\n-FILE* f = fopen((to_hex(ti->info_hashes().get_best().to_string()) + ".torrent").c_str(), "wb+");\n-if (f) {\n-        fwrite(&buffer[0], 1, buffer.size(), f);\n-        fclose(f);\n-}\n-
    \n-
    \n-struct metadata_received_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    udp_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when there is an error on a UDP socket. The\n-UDP sockets are used for all uTP, DHT and UDP tracker traffic. They are\n-global to the session.

    \n-
    \n-struct udp_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   aux::noexcept_movable<udp::endpoint> endpoint;\n-   operation_t operation;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    endpoint
    \n-
    the source address associated with the error (if any)
    \n+[report issue]
    \n+
    remote_choked
    \n+
    the peer has choked us.
    \n
    \n-[report issue]
    \n-
    operation
    \n-
    the operation that failed
    \n+[report issue]
    \n+
    supports_extensions
    \n+
    means that this peer supports the\n+extension protocol.
    \n
    \n-[report issue]
    \n-
    error
    \n-
    the error code describing the error
    \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-
    \n-

    external_ip_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    Whenever libtorrent learns about the machines external IP, this alert is\n-generated. The external IP address can be acquired from the tracker (if it\n-supports that) or from peers that supports the extension protocol.\n-The address can be accessed through the external_address member.

    \n-
    \n-struct external_ip_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   aux::noexcept_movable<address> external_address;\n-};\n-
    \n-[report issue]
    \n-
    external_address
    \n-
    the IP address that is believed to be our external IP
    \n+[report issue]
    \n+
    local_connection
    \n+
    deprecated synonym for outgoing_connection
    \n
    \n-[report issue]
    \n-
    \n-

    listen_failed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when none of the ports, given in the port range, to\n-session can be opened for listening. The listen_interface member is the\n-interface that failed, error is the error code describing the failure.

    \n-

    In the case an endpoint was created before generating the alert, it is\n-represented by address and port. The combinations of socket type\n-and operation in which such address and port are not valid are:\n-accept - i2p\n-accept - socks5\n-enum_if - tcp

    \n-

    libtorrent may sometimes try to listen on port 0, if all other ports failed.\n-Port 0 asks the operating system to pick a port that's free). If that fails\n-you may see a listen_failed_alert with port 0 even if you didn't ask to\n-listen on it.

    \n-
    \n-struct listen_failed_alert final : alert\n-{\n-   std::string message () const override;\n-   char const* listen_interface () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status | alert_category::error;\n-   error_code const error;\n-   operation_t op;\n-   lt::socket_type_t const socket_type;\n-   aux::noexcept_movable<lt::address> address;\n-   int const port;\n-};\n-
    \n-[report issue]
    \n-

    listen_interface()

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

    the network device libtorrent attempted to listen on, or the IP address

    \n-[report issue]
    \n-
    error
    \n-
    the error the system returned
    \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-
    op
    \n-
    the underlying operation that failed
    \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-
    socket_type
    \n-
    the type of listen socket this alert refers to.
    \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-
    address
    \n-
    the address libtorrent attempted to listen on\n-see alert documentation for validity of this value
    \n+[report issue]
    \n+
    seed
    \n+
    This peer is a seed (it has all the pieces).
    \n
    \n-[report issue]
    \n-
    port
    \n-
    the port libtorrent attempted to listen on\n-see alert documentation for validity of this value
    \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-
    \n-
    \n-

    listen_succeeded_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when the listen port succeeds to be opened on a\n-particular interface. address and port is the endpoint that\n-successfully was opened for listening.

    \n-
    \n-struct listen_succeeded_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   aux::noexcept_movable<lt::address> address;\n-   int const port;\n-   lt::socket_type_t const socket_type;\n-};\n-
    \n-[report issue]
    \n-
    address
    \n-
    the address libtorrent ended up listening on. This address\n-refers to the local interface.
    \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-
    port
    \n-
    the port libtorrent ended up listening on.
    \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-
    socket_type
    \n-
    the type of listen socket this alert refers to.
    \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-
    \n-

    portmap_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a NAT router was successfully found but some\n-part of the port mapping request failed. It contains a text message that\n-may help the user figure out what is wrong. This alert is not generated in\n-case it appears the client is not running on a NAT:ed network or if it\n-appears there is no NAT router that can be remote controlled to add port\n-mappings.

    \n-
    \n-struct portmap_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::port_mapping\n-   | alert_category::error;\n-   port_mapping_t const mapping;\n-   portmap_transport map_transport;\n-   aux::noexcept_movable<address> local_address;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    mapping
    \n-
    refers to the mapping index of the port map that failed, i.e.\n-the index returned from add_mapping().
    \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-
    map_transport
    \n-
    UPnP or NAT-PMP
    \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-
    local_address
    \n-
    the local network the port mapper is running on
    \n+[report issue]
    \n+
    utp_socket
    \n+
    indicates that this socket is a uTP socket
    \n
    \n-[report issue]
    \n-
    error
    \n-
    tells you what failed.
    \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-
    \n-

    portmap_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a NAT router was successfully found and\n-a port was successfully mapped on it. On a NAT:ed network with a NAT-PMP\n-capable router, this is typically generated once when mapping the TCP\n-port and, if DHT is enabled, when the UDP port is mapped.

    \n-
    \n-struct portmap_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::port_mapping;\n-   port_mapping_t const mapping;\n-   int const external_port;\n-   portmap_protocol const map_protocol;\n-   portmap_transport const map_transport;\n-   aux::noexcept_movable<address> local_address;\n-};\n-
    \n-[report issue]
    \n-
    mapping
    \n-
    refers to the mapping index of the port map that failed, i.e.\n-the index returned from add_mapping().
    \n+[report issue]
    \n+
    rc4_encrypted
    \n+
    this connection is obfuscated with RC4
    \n
    \n-[report issue]
    \n-
    external_port
    \n-
    the external port allocated for the mapping.
    \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-
    local_address
    \n-
    the local network the port mapper is running on
    \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-
    \n-

    portmap_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated to log informational events related to either\n-UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP\n-and 1 = UPnP). Displaying these messages to an end user is only useful\n-for debugging the UPnP or NAT-PMP implementation. This alert is only\n-posted if the alert_category::port_mapping_log flag is enabled in\n-the alert mask.

    \n-
    \n-struct portmap_log_alert final : alert\n-{\n-   std::string message () const override;\n-   char const* log_message () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::port_mapping_log;\n-   portmap_transport const map_transport;\n-   aux::noexcept_movable<address> local_address;\n-};\n-
    \n-[report issue]
    \n-

    log_message()

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

    the message associated with this log line

    \n-[report issue]
    \n-
    local_address
    \n-
    the local network the port mapper is running on
    \n+[report issue]
    \n+
    tracker
    \n+
    The peer was received from the tracker.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    fastresume_rejected_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a fast resume file has been passed to\n-add_torrent() but the files on disk did not match the fast resume file.\n-The error_code explains the reason why the resume file was rejected.

    \n-
    \n-struct fastresume_rejected_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* file_path () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status\n-   | alert_category::error;\n-   error_code error;\n-   operation_t op;\n-};\n-
    \n-[report issue]
    \n-

    file_path()

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

    If the error happened to a specific file, this returns the path to it.

    \n-[report issue]
    \n-
    op
    \n-
    the underlying operation that failed
    \n+[report issue]
    \n+
    dht
    \n+
    The peer was received from the kademlia DHT.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    peer_blocked_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when an incoming peer connection, or a peer that's about to be added\n-to our peer list, is blocked for some reason. This could be any of:

    \n-
      \n-
    • the IP filter
    • \n-
    • i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)
    • \n-
    • the port filter
    • \n-
    • the peer has a low port and no_connect_privileged_ports is enabled
    • \n-
    • the protocol of the peer is blocked (uTP/TCP blocking)
    • \n-
    \n-
    \n-struct peer_blocked_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   enum reason_t\n-   {\n-      ip_filter,\n-      port_filter,\n-      i2p_mixed,\n-      privileged_ports,\n-      utp_disabled,\n-      tcp_disabled,\n-      invalid_local_interface,\n-      ssrf_mitigation,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::ip_block;\n-   int const reason;\n-};\n-
    \n-[report issue]
    \n-

    enum reason_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    ip_filter0 
    port_filter1 
    i2p_mixed2 
    privileged_ports3 
    utp_disabled4 
    tcp_disabled5 
    invalid_local_interface6 
    ssrf_mitigation7 
    \n-[report issue]
    \n-
    reason
    \n-
    the reason for the peer being blocked. Is one of the values from the\n-reason_t enum.
    \n+[report issue]
    \n+
    pex
    \n+
    The peer was received from the peer exchange\n+extension.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    dht_announce_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a DHT node announces to an info-hash on our\n-DHT node. It belongs to the alert_category::dht category.

    \n-
    \n-struct dht_announce_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   aux::noexcept_movable<address> ip;\n-   int port;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    dht_get_peers_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when a DHT node sends a get_peers message to\n-our DHT node. It belongs to the alert_category::dht category.

    \n-
    \n-struct dht_get_peers_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    cache_flushed_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when the disk cache has been flushed for a specific\n-torrent as a result of a call to torrent_handle::flush_cache(). This\n-alert belongs to the alert_category::storage category, which must be\n-enabled to let this alert through. The alert is also posted when removing\n-a torrent from the session, once the outstanding cache flush is complete\n-and the torrent does no longer have any files open.

    \n-
    \n-struct cache_flushed_alert final : torrent_alert\n-{\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    lsd_peer_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when we receive a local service discovery message\n-from a peer for a torrent we're currently participating in.

    \n-
    \n-struct lsd_peer_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    trackerid_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted whenever a tracker responds with a trackerid.\n-The tracker ID is like a cookie. libtorrent will store the tracker ID\n-for this tracker and repeat it in subsequent announces.

    \n-
    \n-struct trackerid_alert final : tracker_alert\n-{\n-   std::string message () const override;\n-   char const* tracker_id () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-

    tracker_id()

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

    The tracker ID returned by the tracker

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

    dht_bootstrap_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when the initial DHT bootstrap is done.

    \n-
    \n-struct dht_bootstrap_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    torrent_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is posted whenever a torrent is transitioned into the error state.\n-If the error code is duplicate_torrent (error_code_enum) error, it suggests two magnet\n-links ended up resolving to the same hybrid torrent. For more details,\n-see BitTorrent v2 torrents.

    \n-
    \n-struct torrent_error_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* filename () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error | alert_category::status;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-

    filename()

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

    the filename (or object) the error occurred on.

    \n-[report issue]
    \n-
    error
    \n-
    specifies which error the torrent encountered.
    \n+[report issue]
    \n+
    lsd
    \n+
    The peer was received from the local service\n+discovery (The peer is on the local network).
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    torrent_need_cert_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is always posted for SSL torrents. This is a reminder to the client that\n-the torrent won't work unless torrent_handle::set_ssl_certificate() is called with\n-a valid certificate. Valid certificates MUST be signed by the SSL certificate\n-in the .torrent file.

    \n-
    \n-struct torrent_need_cert_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    incoming_connection_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The incoming connection alert is posted every time we successfully accept\n-an incoming connection, through any mean. The most straight-forward ways\n-of accepting incoming connections are through the TCP listen socket and\n-the UDP listen socket for uTP sockets. However, connections may also be\n-accepted through a Socks5 or i2p listen socket, or via an SSL listen\n-socket.

    \n-
    \n-struct incoming_connection_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer;\n-   socket_type_t socket_type;\n-   aux::noexcept_movable<tcp::endpoint> endpoint;\n-};\n-
    \n-[report issue]
    \n-
    socket_type
    \n-
    tells you what kind of socket the connection was accepted
    \n+[report issue]
    \n+
    resume_data
    \n+
    The peer was added from the fast resume data.
    \n
    \n-[report issue]
    \n-
    endpoint
    \n-
    is the IP address and port the connection came from.
    \n+[report issue]
    \n+
    incoming
    \n+
    we received an incoming connection from this peer
    \n
    \n-[report issue]
    \n-
    \n-

    add_torrent_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is always posted when a torrent was attempted to be added\n-and contains the return status of the add operation. The torrent handle of the new\n-torrent can be found as the handle member in the base class. If adding\n-the torrent failed, error contains the error code.

    \n-
    \n-struct add_torrent_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   add_torrent_params params;\n-   error_code error;\n-};\n-
    \n-[report issue]
    \n-
    params
    \n-

    This contains copies of the most important fields from the original\n-add_torrent_params object, passed to add_torrent() or\n-async_add_torrent(). Specifically, these fields are copied:

    \n-
      \n-
    • version
    • \n-
    • ti
    • \n-
    • name
    • \n-
    • save_path
    • \n-
    • userdata
    • \n-
    • tracker_id
    • \n-
    • flags
    • \n-
    • info_hash
    • \n-
    \n-

    the info_hash field will be updated with the info-hash of the torrent\n-specified by ti.

    \n-
    \n+[report issue]
    \n+
    source
    \n+
    a combination of flags describing from which sources this peer\n+was received. A combination of the peer_source_flags_t above.
    \n
    \n-[report issue]
    \n-
    error
    \n-
    set to the error, if one occurred while adding the torrent.
    \n+\n+[report issue]
    \n+
    up_speed down_speed
    \n+
    the current upload and download speed we have to and from this peer\n+(including any protocol messages). updated about once per second
    \n
    \n-[report issue]
    \n-
    \n-

    state_update_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is only posted when requested by the user, by calling\n-session::post_torrent_updates() on the session. It contains the torrent\n-status of all torrents that changed since last time this message was\n-posted. Its category is alert_category::status, but it's not subject to\n-filtering, since it's only manually posted anyway.

    \n-
    \n-struct state_update_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<torrent_status> status;\n-};\n-
    \n-[report issue]
    \n-
    status
    \n-
    contains the torrent status of all torrents that changed since last\n-time this message was posted. Note that you can map a torrent status\n-to a specific torrent via its handle member. The receiving end is\n-suggested to have all torrents sorted by the torrent_handle or hashed\n-by it, for efficient updates.
    \n+\n+[report issue]
    \n+
    payload_up_speed payload_down_speed
    \n+
    The transfer rates of payload data only updated about once per second
    \n
    \n-[report issue]
    \n-
    \n-

    session_stats_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The session_stats_alert is posted when the user requests session statistics by\n-calling post_session_stats() on the session object. This alert does not\n-have a category, since it's only posted in response to an API call. It\n-is not subject to the alert_mask filter.

    \n-

    the message() member function returns a string representation of the values that\n-properly match the line returned in session_stats_header_alert::message().

    \n-

    this specific output is parsed by tools/parse_session_stats.py\n-if this is changed, that parser should also be changed

    \n-
    \n-struct session_stats_alert final : alert\n-{\n-   std::string message () const override;\n-   span<std::int64_t const> counters () const;\n-\n-   static constexpr alert_category_t static_category  = {};\n-};\n-
    \n-[report issue]
    \n-

    counters()

    \n-
    \n-span<std::int64_t const> counters () const;\n-
    \n-

    An array are a mix of counters and gauges, which meanings can be\n-queries via the session_stats_metrics() function on the session. The\n-mapping from a specific metric to an index into this array is constant\n-for a specific version of libtorrent, but may differ for other\n-versions. The intended usage is to request the mapping, i.e. call\n-session_stats_metrics(), once on startup, and then use that mapping to\n-interpret these values throughout the process' runtime.

    \n-

    For more information, see the session statistics section.

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

    dht_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when something fails in the DHT. This is not necessarily a fatal\n-error, but it could prevent proper operation

    \n-
    \n-struct dht_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error | alert_category::dht;\n-   error_code error;\n-   operation_t op;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error code
    \n+[report issue]
    \n+
    pid
    \n+
    the peer's id as used in the bittorrent protocol. This id can be used\n+to extract 'fingerprints' from the peer. Sometimes it can tell you\n+which client the peer is using. See identify_client()_
    \n
    \n-[report issue]
    \n-
    op
    \n-
    the operation that failed
    \n+[report issue]
    \n+
    queue_bytes
    \n+
    the number of bytes we have requested from this peer, but not yet\n+received.
    \n
    \n-[report issue]
    \n-
    \n-

    dht_immutable_item_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted as a response to a call to session::get_item(),\n-specifically the overload for looking up immutable items in the DHT.

    \n-
    \n-struct dht_immutable_item_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   sha1_hash target;\n-   entry item;\n-};\n-
    \n-[report issue]
    \n-
    target
    \n-
    the target hash of the immutable item. This must\n-match the SHA-1 hash of the bencoded form of item.
    \n+[report issue]
    \n+
    request_timeout
    \n+
    the number of seconds until the current front piece request will time\n+out. This timeout can be adjusted through\n+settings_pack::request_timeout.\n+-1 means that there is not outstanding request.
    \n
    \n-[report issue]
    \n-
    item
    \n-
    the data for this item
    \n+\n+[report issue]
    \n+
    send_buffer_size used_send_buffer
    \n+
    the number of bytes allocated\n+and used for the peer's send buffer, respectively.
    \n
    \n-[report issue]
    \n-
    \n-

    dht_mutable_item_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted as a response to a call to session::get_item(),\n-specifically the overload for looking up mutable items in the DHT.

    \n-
    \n-struct dht_mutable_item_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   std::array<char, 32> key;\n-   std::array<char, 64> signature;\n-   std::int64_t seq;\n-   std::string salt;\n-   entry item;\n-   bool authoritative;\n-};\n-
    \n-[report issue]
    \n-
    key
    \n-
    the public key that was looked up
    \n+\n+\n+[report issue]
    \n+
    receive_buffer_size used_receive_buffer receive_buffer_watermark
    \n+
    the number of bytes\n+allocated and used as receive buffer, respectively.
    \n
    \n-[report issue]
    \n-
    signature
    \n-
    the signature of the data. This is not the signature of the\n-plain encoded form of the item, but it includes the sequence number\n-and possibly the hash as well. See the dht_store document for more\n-information. This is primarily useful for echoing back in a store\n-request.
    \n+[report issue]
    \n+
    num_hashfails
    \n+
    the number of pieces this peer has participated in sending us that\n+turned out to fail the hash check.
    \n
    \n-[report issue]
    \n-
    seq
    \n-
    the sequence number of this item
    \n+[report issue]
    \n+
    download_queue_length
    \n+
    this is the number of requests we have sent to this peer that we\n+haven't got a response for yet
    \n
    \n-[report issue]
    \n-
    salt
    \n-
    the salt, if any, used to lookup and store this item. If no\n-salt was used, this is an empty string
    \n+[report issue]
    \n+
    timed_out_requests
    \n+
    the number of block requests that have timed out, and are still in the\n+download queue
    \n
    \n-[report issue]
    \n-
    item
    \n-
    the data for this item
    \n+[report issue]
    \n+
    busy_requests
    \n+
    the number of busy requests in the download queue. A busy request is a\n+request for a block we've also requested from a different peer
    \n
    \n-[report issue]
    \n-
    authoritative
    \n-
    the last response for mutable data is authoritative.
    \n+[report issue]
    \n+
    requests_in_buffer
    \n+
    the number of requests messages that are currently in the send buffer\n+waiting to be sent.
    \n
    \n-[report issue]
    \n-
    \n-

    dht_put_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this is posted when a DHT put operation completes. This is useful if the\n-client is waiting for a put to complete before shutting down for instance.

    \n-
    \n-struct dht_put_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   sha1_hash target;\n-   std::array<char, 32> public_key;\n-   std::array<char, 64> signature;\n-   std::string salt;\n-   std::int64_t seq;\n-   int num_success;\n-};\n-
    \n-[report issue]
    \n-
    target
    \n-
    the target hash the item was stored under if this was an immutable\n-item.
    \n+[report issue]
    \n+
    target_dl_queue_length
    \n+
    the number of requests that is tried to be maintained (this is\n+typically a function of download speed)
    \n
    \n-\n-\n-\n-[report issue]
    \n-
    public_key signature salt seq
    \n-
    if a mutable item was stored, these are the public key, signature,\n-salt and sequence number the item was stored under.
    \n+[report issue]
    \n+
    upload_queue_length
    \n+
    the number of piece-requests we have received from this peer\n+that we haven't answered with a piece yet.
    \n
    \n-[report issue]
    \n-
    num_success
    \n-
    DHT put operation usually writes item to k nodes, maybe the node\n-is stale so no response, or the node doesn't support 'put', or the\n-token for write is out of date, etc. num_success is the number of\n-successful responses we got from the puts.
    \n+[report issue]
    \n+
    failcount
    \n+
    the number of times this peer has "failed". i.e. failed to connect or\n+disconnected us. The failcount is decremented when we see this peer in\n+a tracker response or peer exchange message.
    \n
    \n-[report issue]
    \n-
    \n-

    i2p_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is used to report errors in the i2p SAM connection

    \n-
    \n-struct i2p_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code error;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error that occurred in the i2p SAM connection
    \n+\n+\n+\n+[report issue]
    \n+
    downloading_piece_index downloading_block_index downloading_progress downloading_total
    \n+
    You can know which piece, and which part of that piece, that is\n+currently being downloaded from a specific peer by looking at these\n+four members. downloading_piece_index is the index of the piece\n+that is currently being downloaded. This may be set to -1 if there's\n+currently no piece downloading from this peer. If it is >= 0, the\n+other three members are valid. downloading_block_index is the\n+index of the block (or sub-piece) that is being downloaded.\n+downloading_progress is the number of bytes of this block we have\n+received from the peer, and downloading_total is the total number\n+of bytes in this block.
    \n
    \n-[report issue]
    \n-
    \n-

    dht_outgoing_get_peers_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is generated when we send a get_peers request\n-It belongs to the alert_category::dht category.

    \n-
    \n-struct dht_outgoing_get_peers_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   sha1_hash info_hash;\n-   sha1_hash obfuscated_info_hash;\n-   aux::noexcept_movable<udp::endpoint> endpoint;\n-};\n-
    \n-[report issue]
    \n-
    info_hash
    \n-
    the info_hash of the torrent we're looking for peers for.
    \n+[report issue]
    \n+
    standard_bittorrent
    \n+
    Regular bittorrent connection
    \n
    \n-[report issue]
    \n-
    obfuscated_info_hash
    \n-
    if this was an obfuscated lookup, this is the info-hash target\n-actually sent to the node.
    \n+[report issue]
    \n+
    web_seed
    \n+
    HTTP connection using the BEP 19 protocol
    \n
    \n-[report issue]
    \n-
    endpoint
    \n-
    the endpoint we're sending this query to
    \n+[report issue]
    \n+
    http_seed
    \n+
    HTTP connection using the BEP 17 protocol
    \n
    \n-[report issue]
    \n-
    \n-

    log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted by some session wide event. Its main purpose is\n-trouble shooting and debugging. It's not enabled by the default alert\n-mask and is enabled by the alert_category::session_log bit.\n-Furthermore, it's by default disabled as a build configuration.

    \n+[report issue]
    \n+
    connection_type
    \n+
    the kind of connection this peer uses. See connection_type_t.
    \n+
    \n+[report issue]
    \n+
    pending_disk_bytes
    \n+
    the number of bytes this peer has pending in the disk-io thread.\n+Downloaded and waiting to be written to disk. This is what is capped\n+by settings_pack::max_queued_disk_bytes.
    \n+
    \n+[report issue]
    \n+
    pending_disk_read_bytes
    \n+
    number of outstanding bytes to read\n+from disk
    \n+
    \n+\n+[report issue]
    \n+
    send_quota receive_quota
    \n+
    the number of bytes this peer has been assigned to be allowed to send\n+and receive until it has to request more quota from the bandwidth\n+manager.
    \n+
    \n+[report issue]
    \n+
    rtt
    \n+
    an estimated round trip time to this peer, in milliseconds. It is\n+estimated by timing the TCP connect(). It may be 0 for\n+incoming connections.
    \n+
    \n+[report issue]
    \n+
    num_pieces
    \n+
    the number of pieces this peer has.
    \n+
    \n+\n+[report issue]
    \n+
    download_rate_peak upload_rate_peak
    \n+
    the highest download and upload rates seen on this connection. They\n+are given in bytes per second. This number is reset to 0 on reconnect.
    \n+
    \n+[report issue]
    \n+
    progress
    \n+
    the progress of the peer in the range [0, 1]. This is always 0 when\n+floating point operations are disabled, instead use progress_ppm.
    \n+
    \n+[report issue]
    \n+
    progress_ppm
    \n+
    indicates the download progress of the peer in the range [0, 1000000]\n+(parts per million).
    \n+
    \n+[report issue]
    \n+
    ip
    \n+
    the IP-address to this peer. The type is an asio endpoint. For\n+more info, see the asio documentation. This field is not valid for\n+i2p peers. Instead use the i2p_destination() function.
    \n+
    \n+[report issue]
    \n+
    local_endpoint
    \n+
    the IP and port pair the socket is bound to locally. i.e. the IP\n+address of the interface it's going out over. This may be useful for\n+multi-homed clients with multiple interfaces to the internet.\n+This field is not valid for i2p peers.
    \n+
    \n+[report issue]
    \n+
    bw_idle
    \n+
    The peer is not waiting for any external events to\n+send or receive data.
    \n+
    \n+[report issue]
    \n+
    bw_limit
    \n+
    The peer is waiting for the rate limiter.
    \n+
    \n+[report issue]
    \n+
    bw_network
    \n+
    The peer has quota and is currently waiting for a\n+network read or write operation to complete. This is\n+the state all peers are in if there are no bandwidth\n+limits.
    \n+
    \n+[report issue]
    \n+
    bw_disk
    \n+
    The peer is waiting for the disk I/O thread to catch\n+up writing buffers to disk before downloading more.
    \n+
    \n+\n+[report issue]
    \n+
    read_state write_state
    \n+
    bitmasks indicating what state this peer\n+is in with regards to sending and receiving data. The states are\n+defined as independent flags of type bandwidth_state_flags_t, in this\n+class.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    piece_block

    \n+

    Declared in "libtorrent/piece_block.hpp"

    \n
    \n-struct log_alert final : alert\n+struct piece_block\n {\n-   std::string message () const override;\n-   char const* log_message () const;\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 constexpr alert_category_t static_category  = alert_category::session_log;\n+   static const piece_block invalid;\n+   piece_index_t piece_index {0};\n+   int block_index  = 0;\n };\n 
    \n-[report issue]
    \n-

    log_message()

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

    make_magnet_uri()

    \n+

    Declared in "libtorrent/magnet_uri.hpp"

    \n
    \n-char const* log_message () const;\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 
    \n-

    returns the log message

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

    torrent_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted by torrent wide events. It's meant to be used for\n-trouble shooting and debugging. It's not enabled by the default alert\n-mask and is enabled by the alert_category::torrent_log bit. By\n-default it is disabled as a build configuration.

    \n+

    Generates a magnet URI from the specified torrent.

    \n+

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

    \n+
    \n+ti, info_hashes, url_seeds, dht_nodes,\n+file_priorities, trackers, name, peers.
    \n+

    Depending on what the use case for the resulting magnet link is, clearing\n+peers and dht_nodes is probably a good idea if the add_torrent_params\n+came from a running torrent. Those lists may be long and be ephemeral.

    \n+

    If none of the info_hashes or ti fields are set, there is not\n+info-hash available, and a magnet link cannot be created. In this case\n+make_magnet_uri() returns an empty string.

    \n+

    The recommended way to generate a magnet link from a torrent_handle is to\n+call save_resume_data(), which will post a save_resume_data_alert\n+containing an add_torrent_params object. This can then be passed to\n+make_magnet_uri().

    \n+

    The overload that takes a torrent_handle will make blocking calls to\n+query information about the torrent. If the torrent handle is invalid,\n+an empty string is returned.

    \n+

    For more information about magnet links, see magnet links.

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

    parse_magnet_uri()

    \n+

    Declared in "libtorrent/magnet_uri.hpp"

    \n
    \n-struct torrent_log_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-   char const* log_message () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::torrent_log;\n-};\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+add_torrent_params parse_magnet_uri (string_view uri);\n 
    \n-[report issue]
    \n-

    log_message()

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

    torrent_peer_equal()

    \n+

    Declared in "libtorrent/torrent_peer.hpp"

    \n
    \n-char const* log_message () const;\n+inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n 
    \n-

    returns the log message

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

    peer_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted by events specific to a peer. It's meant to be used\n-for trouble shooting and debugging. It's not enabled by the default alert\n-mask and is enabled by the alert_category::peer_log bit. By\n-default it is disabled as a build configuration.

    \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-struct peer_log_alert final : peer_alert\n-{\n-   std::string message () const override;\n-   char const* log_message () const;\n-\n-   enum direction_t\n-   {\n-      incoming_message,\n-      outgoing_message,\n-      incoming,\n-      outgoing,\n-      info,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::peer_log;\n-   char const* event_type;\n-   direction_t direction;\n-};\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_buffer (\n+   span<char const> buffer, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename, load_torrent_limits const& cfg);\n 
    \n-[report issue]
    \n-

    log_message()

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

    truncate_files()

    \n+

    Declared in "libtorrent/truncate.hpp"

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

    returns the log message

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

    enum direction_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

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

    enum socket_type_t

    \n+

    Declared in "libtorrent/socket_type.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n
    namevaluedescription
    incoming_message
    tcp0 
    outgoing_message
    socks51 
    incoming
    http2 
    outgoing
    utp3 
    info
    i2p4 
    tcp_ssl5 
    socks5_ssl6 
    http_ssl7 
    utp_ssl8 
    \n-[report issue]
    \n-
    event_type
    \n-
    string literal indicating the kind of event. For messages, this is the\n-message name.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    lsd_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted if the local service discovery socket fails to start properly.\n-it's categorized as alert_category::error.

    \n-
    \n-struct lsd_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   aux::noexcept_movable<address> local_address;\n-   error_code error;\n-};\n-
    \n-[report issue]
    \n-
    local_address
    \n-
    the local network the corresponding local service discovery is running\n-on
    \n-
    \n-[report issue]
    \n-
    error
    \n-
    The error code
    \n-
    \n-[report issue]
    \n-
    \n-

    dht_lookup

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    holds statistics about a current dht_lookup operation.\n-a DHT lookup is the traversal of nodes, looking up a\n-set of target nodes in the DHT for retrieving and possibly\n-storing information in the DHT

    \n-
    \n-struct dht_lookup\n-{\n-   char const* type;\n-   int outstanding_requests;\n-   int timeouts;\n-   int responses;\n-   int branch_factor;\n-   int nodes_left;\n-   int last_sent;\n-   int first_timeout;\n-   sha1_hash target;\n-};\n-
    \n-[report issue]
    \n-
    type
    \n-
    string literal indicating which kind of lookup this is
    \n-
    \n-[report issue]
    \n-
    outstanding_requests
    \n-
    the number of outstanding request to individual nodes\n-this lookup has right now
    \n-
    \n-[report issue]
    \n-
    timeouts
    \n-
    the total number of requests that have timed out so far\n-for this lookup
    \n-
    \n-[report issue]
    \n-
    responses
    \n-
    the total number of responses we have received for this\n-lookup so far for this lookup
    \n-
    \n-[report issue]
    \n-
    branch_factor
    \n-
    the branch factor for this lookup. This is the number of\n-nodes we keep outstanding requests to in parallel by default.\n-when nodes time out we may increase this.
    \n-
    \n-[report issue]
    \n-
    nodes_left
    \n-
    the number of nodes left that could be queries for this\n-lookup. Many of these are likely to be part of the trail\n-while performing the lookup and would never end up actually\n-being queried.
    \n-
    \n-[report issue]
    \n-
    last_sent
    \n-
    the number of seconds ago the\n-last message was sent that's still\n-outstanding
    \n-
    \n-[report issue]
    \n-
    first_timeout
    \n-
    the number of outstanding requests\n-that have exceeded the short timeout\n-and are considered timed out in the\n-sense that they increased the branch\n-factor
    \n-
    \n-[report issue]
    \n-
    target
    \n-
    the node-id or info-hash target for this lookup
    \n-
    \n-[report issue]
    \n-
    \n-

    dht_stats_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    contains current DHT state. Posted in response to session::post_dht_stats().

    \n-
    \n-struct dht_stats_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = {};\n-   std::vector<dht_lookup> active_requests;\n-   std::vector<dht_routing_bucket> routing_table;\n-   sha1_hash nid;\n-   aux::noexcept_movable<udp::endpoint> local_endpoint;\n-};\n-
    \n-[report issue]
    \n-
    active_requests
    \n-
    a vector of the currently running DHT lookups.
    \n-
    \n-[report issue]
    \n-
    routing_table
    \n-
    contains information about every bucket in the DHT routing\n-table.
    \n-
    \n-[report issue]
    \n-
    nid
    \n-
    the node ID of the DHT node instance
    \n-
    \n-[report issue]
    \n-
    local_endpoint
    \n-
    the local socket this DHT node is running on
    \n-
    \n-[report issue]
    \n-
    \n-

    incoming_request_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted every time an incoming request from a peer is accepted and queued\n-up for being serviced. This alert is only posted if\n-the alert_category::incoming_request flag is enabled in the alert\n-mask.

    \n-
    \n-struct incoming_request_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::incoming_request;\n-   peer_request req;\n-};\n-
    \n-[report issue]
    \n-
    req
    \n-
    the request this peer sent to us
    \n-
    \n-[report issue]
    \n-
    \n-

    dht_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    debug logging of the DHT when alert_category::dht_log is set in the alert\n-mask.

    \n-
    \n-struct dht_log_alert final : alert\n-{\n-   std::string message () const override;\n-   char const* log_message () const;\n-\n-   enum dht_module_t\n-   {\n-      tracker,\n-      node,\n-      routing_table,\n-      rpc_manager,\n-      traversal,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_log;\n-   dht_module_t module;\n-};\n-
    \n-[report issue]
    \n-

    log_message()

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

    the log message

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

    enum dht_module_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

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

    enum event_t

    \n+

    Declared in "libtorrent/tracker_manager.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n \n
    namevaluedescription
    tracker
    none0 
    node
    completed1 
    routing_table
    started2 
    rpc_manager
    stopped3 
    traversal
    paused4 
    \n-[report issue]
    \n-
    module
    \n-
    the module, or part, of the DHT that produced this log message.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    dht_pkt_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted every time a DHT message is sent or received. It is\n-only posted if the alert_category::dht_log alert category is\n-enabled. It contains a verbatim copy of the message.

    \n-
    \n-struct dht_pkt_alert final : alert\n-{\n-   std::string message () const override;\n-   span<char const> pkt_buf () const;\n-\n-   enum direction_t\n-   {\n-      incoming,\n-      outgoing,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_log;\n-   direction_t direction;\n-   aux::noexcept_movable<udp::endpoint> node;\n-};\n-
    \n-[report issue]
    \n-

    pkt_buf()

    \n-
    \n-span<char const> pkt_buf () const;\n-
    \n-

    returns a pointer to the packet buffer and size of the packet,\n-respectively. This buffer is only valid for as long as the alert itself\n-is valid, which is owned by libtorrent and reclaimed whenever\n-pop_alerts() is called on the session.

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

    enum direction_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

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

    enum portmap_transport

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n \n \n \n
    namevaluedescription
    incoming
    natpmp0 natpmp can be NAT-PMP or PCP
    outgoing
    upnp1 
    \n-[report issue]
    \n-
    direction
    \n-
    whether this is an incoming or outgoing packet.
    \n-
    \n-[report issue]
    \n-
    node
    \n-
    the DHT node we received this packet from, or sent this packet to\n-(depending on direction).
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    dht_get_peers_reply_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    Posted when we receive a response to a DHT get_peers request.

    \n-
    \n-struct dht_get_peers_reply_alert final : alert\n-{\n-   std::string message () const override;\n-   int num_peers () const;\n-   std::vector<tcp::endpoint> peers () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    dht_direct_response_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is posted exactly once for every call to session_handle::dht_direct_request.\n-If the request failed, response() will return a default constructed bdecode_node.

    \n-
    \n-struct dht_direct_response_alert final : alert\n-{\n-   std::string message () const override;\n-   bdecode_node response () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   client_data_t userdata;\n-   aux::noexcept_movable<udp::endpoint> endpoint;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    picker_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this is posted when one or more blocks are picked by the piece picker,\n-assuming the verbose piece picker logging is enabled (see\n-alert_category::picker_log).

    \n-
    \n-struct picker_log_alert final : peer_alert\n-{\n-   std::string message () const override;\n-   std::vector<piece_block> blocks () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::picker_log;\n-   static constexpr picker_flags_t partial_ratio  = 0_bit;\n-   static constexpr picker_flags_t prioritize_partials  = 1_bit;\n-   static constexpr picker_flags_t rarest_first_partials  = 2_bit;\n-   static constexpr picker_flags_t rarest_first  = 3_bit;\n-   static constexpr picker_flags_t reverse_rarest_first  = 4_bit;\n-   static constexpr picker_flags_t suggested_pieces  = 5_bit;\n-   static constexpr picker_flags_t prio_sequential_pieces  = 6_bit;\n-   static constexpr picker_flags_t sequential_pieces  = 7_bit;\n-   static constexpr picker_flags_t reverse_pieces  = 8_bit;\n-   static constexpr picker_flags_t time_critical  = 9_bit;\n-   static constexpr picker_flags_t random_pieces  = 10_bit;\n-   static constexpr picker_flags_t prefer_contiguous  = 11_bit;\n-   static constexpr picker_flags_t reverse_sequential  = 12_bit;\n-   static constexpr picker_flags_t backup1  = 13_bit;\n-   static constexpr picker_flags_t backup2  = 14_bit;\n-   static constexpr picker_flags_t end_game  = 15_bit;\n-   static constexpr picker_flags_t extent_affinity  = 16_bit;\n-   picker_flags_t const picker_flags;\n-};\n-
    \n-[report issue]
    \n-
    picker_flags
    \n-
    this is a bitmask of which features were enabled for this particular\n-pick. The bits are defined in the picker_flags_t enum.
    \n-
    \n-[report issue]
    \n-
    \n-

    session_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted when the session encounters a serious error,\n-potentially fatal

    \n-
    \n-struct session_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    The error code, if one is associated with this error
    \n-
    \n-[report issue]
    \n-
    \n-

    dht_live_nodes_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

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

    \n-
    \n-struct dht_live_nodes_alert final : alert\n-{\n-   std::string message () const override;\n-   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-

    num_nodes() nodes()

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

    session_stats_header_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The session_stats_header alert is posted the first time\n-post_session_stats() is called

    \n-

    the message() member function returns a string representation of the\n-header that properly match the stats values string returned in\n-session_stats_alert::message().

    \n-

    this specific output is parsed by tools/parse_session_stats.py\n-if this is changed, that parser should also be changed

    \n-
    \n-struct session_stats_header_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = {};\n-};\n-
    \n-[report issue]
    \n-
    \n-

    dht_sample_infohashes_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

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

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

    num_samples() samples()

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

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

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

    num_nodes()

    \n-
    \n-int num_nodes () const;\n-
    \n-

    The total number of nodes returned by nodes().

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

    nodes()

    \n-
    \n-std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n-
    \n-

    This is the set of more DHT nodes returned by the request.

    \n-

    The information is included so that indexing nodes can perform a key\n-space traversal with a single RPC per node by adjusting the target\n-value for each RPC.

    \n-[report issue]
    \n-
    node_id
    \n-
    id of the node the request was sent to (and this response was received from)
    \n-
    \n-[report issue]
    \n-
    endpoint
    \n-
    the node the request was sent to (and this response was received from)
    \n-
    \n-[report issue]
    \n-
    interval
    \n-
    the interval to wait before making another request to this node
    \n-
    \n-[report issue]
    \n-
    num_infohashes
    \n-
    This field indicates how many info-hash keys are currently in the node's storage.\n-If the value is larger than the number of returned samples it indicates that the\n-indexer may obtain additional samples after waiting out the interval.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    block_uploaded_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when a block intended to be sent to a peer is placed in the\n-send buffer. Note that if the connection is closed before the send buffer is sent,\n-the alert may be posted without the bytes having been sent to the peer.\n-It belongs to the alert_category::upload category.

    \n-
    \n-struct block_uploaded_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    alerts_dropped_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

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

    \n-
    \n-struct alerts_dropped_alert final : alert\n-{\n-   std::string message () const override;\n-   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   std::bitset<abi_alert_count> dropped_alerts;\n-};\n-
    \n-[report issue]
    \n-
    dropped_alerts
    \n-
    a bitmask indicating which alerts were dropped. Each bit represents the\n-alert type ID, where bit 0 represents whether any alert of type 0 has\n-been dropped, and so on.
    \n-
    \n-[report issue]
    \n-
    \n-

    socks5_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n-configured. It's enabled with the alert_category::error alert category.

    \n-
    \n-struct socks5_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code error;\n-   operation_t op;\n-   aux::noexcept_movable<tcp::endpoint> ip;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error
    \n-
    \n-[report issue]
    \n-
    op
    \n-
    the operation that failed
    \n-
    \n-[report issue]
    \n-
    ip
    \n-
    the endpoint configured as the proxy
    \n-
    \n-[report issue]
    \n-
    \n-

    file_prio_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when a prioritize_files() or file_priority() update of the file\n-priorities complete, which requires a round-trip to the disk thread.

    \n-

    If the disk operation fails this alert won't be posted, but a\n-file_error_alert is posted instead, and the torrent is stopped.

    \n-
    \n-struct file_prio_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   error_code error;\n-   operation_t op;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error
    \n-
    \n-[report issue]
    \n-
    op
    \n-
    the operation that failed
    \n-
    \n-[report issue]
    \n-
    \n-

    oversized_file_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert may be posted when the initial checking of resume data and files\n-on disk (just existence, not piece hashes) completes. If a file belonging\n-to the torrent is found on disk, but is larger than the file in the\n-torrent, that's when this alert is posted.\n-the client may want to call truncate_files() in that case, or perhaps\n-interpret it as a sign that some other file is in the way, that shouldn't\n-be overwritten.

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

    torrent_conflict_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted when two separate torrents (magnet links) resolve to\n-the same torrent, thus causing the same torrent being added twice. In\n-that case, both torrents enter an error state with duplicate_torrent\n-as the error code. This alert is posted containing the metadata. For more\n-information, see BitTorrent v2 torrents.\n-The torrent this alert originated from was the one that downloaded the

    \n-

    metadata (i.e. the handle member from the torrent_alert base class).

    \n-
    \n-struct torrent_conflict_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   torrent_handle conflicting_torrent;\n-   std::shared_ptr<torrent_info> metadata;\n-};\n-
    \n-[report issue]
    \n-
    conflicting_torrent
    \n-
    the handle to the torrent in conflict. The swarm associated with this\n-torrent handle did not download the metadata, but the downloaded\n-metadata collided with this swarm's info-hash.
    \n-
    \n-[report issue]
    \n-
    metadata
    \n-
    the metadata that was received by one of the torrents in conflict.\n-One way to resolve the conflict is to remove both failing torrents\n-and re-add it using this metadata
    \n-
    \n-[report issue]
    \n-
    \n-

    peer_info_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_peer_info() is called

    \n-
    \n-struct peer_info_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<lt::peer_info> peer_info;\n-};\n-
    \n-[report issue]
    \n-
    peer_info
    \n-
    the list of the currently connected peers
    \n-
    \n-[report issue]
    \n-
    \n-

    file_progress_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_file_progress() is called

    \n-
    \n-struct file_progress_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::file_progress;\n-   aux::vector<std::int64_t, file_index_t> files;\n-};\n-
    \n-[report issue]
    \n-
    files
    \n-
    the list of the files in the torrent
    \n-
    \n-[report issue]
    \n-
    \n-

    piece_info_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_download_queue() is called

    \n-
    \n-struct piece_info_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::piece_progress;\n-   std::vector<partial_piece_info> piece_info;\n-   std::vector<block_info> block_data;\n-};\n-
    \n-[report issue]
    \n-
    piece_info
    \n-
    info about pieces being downloaded for the torrent
    \n-
    \n-[report issue]
    \n-
    block_data
    \n-
    storage for block_info pointers in partial_piece_info objects
    \n-
    \n-[report issue]
    \n-
    \n-

    piece_availability_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_piece_availability() is called

    \n-
    \n-struct piece_availability_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<int> piece_availability;\n-};\n-
    \n-[report issue]
    \n-
    piece_availability
    \n-
    info about pieces being downloaded for the torrent
    \n-
    \n-[report issue]
    \n-
    \n-

    tracker_list_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_trackers() is called

    \n-
    \n-struct tracker_list_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<announce_entry> trackers;\n-};\n-
    \n-[report issue]
    \n-
    trackers
    \n-
    list of trackers and their status for the torrent
    \n-
    \n-[report issue]
    \n-
    \n-

    alert

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-

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

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

    timestamp()

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

    a timestamp is automatically created in the constructor

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

    type()

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

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

    \n-

    e.g:

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

    what()

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

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

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

    message()

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

    generate a string describing the alert and the information bundled\n-with it. This is mainly intended for debug and development use. It is not suitable\n-to use this for applications that may be localized. Instead, handle each alert\n-type individually and extract and render the information from the alert depending\n-on the locale.

    \n-[report issue]
    \n-
    \n-

    category()

    \n-
    \n-virtual alert_category_t category () const noexcept = 0;\n-
    \n-

    returns a bitmask specifying which categories this alert belong to.

    \n-[report issue]
    \n-
    \n-
    \n-

    operation_name()

    \n-

    Declared in "libtorrent/operations.hpp"

    \n-
    \n-char const* operation_name (operation_t op);\n-
    \n-

    maps an operation id (from peer_error_alert and peer_disconnected_alert)\n-to its name. See operation_t for the constants

    \n-[report issue]
    \n-
    \n-

    alert_cast()

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-
    \n-template <typename T> T const* alert_cast (alert const* a);\n-template <typename T> T* alert_cast (alert* a);\n-
    \n-

    When you get an alert, you can use alert_cast<> to attempt to cast the\n-pointer to a specific alert type, in order to query it for more\n-information.

    \n-
    \n-

    Note

    \n-

    alert_cast<> can only cast to an exact alert type, not a base class

    \n-
    \n-[report issue]
    \n-
    \n-

    enum operation_t

    \n-

    Declared in "libtorrent/operations.hpp"

    \n+[report issue]
    \n+
    \n+

    enum portmap_protocol

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\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
    unknown
    none0the error was unexpected and it is unknown which operation caused it 
    bittorrent
    tcp1this is used when the bittorrent logic\n-determines to disconnect 
    iocontrol
    udp2a call to iocontrol failed
    getpeername3a call to getpeername() failed (querying the remote IP of a\n-connection)
    getname4a call to getname failed (querying the local IP of a\n-connection)
    alloc_recvbuf5an attempt to allocate a receive buffer failed
    alloc_sndbuf6an attempt to allocate a send buffer failed
    file_write7writing to a file failed
    file_read8reading from a file failed
    file9a non-read and non-write file operation failed
    sock_write10a socket write operation failed
    sock_read11a socket read operation failed
    sock_open12a call to open(), to create a socket socket failed
    sock_bind13a call to bind() on a socket failed
    available14an attempt to query the number of bytes available to read from a socket\n-failed
    encryption15a call related to bittorrent protocol encryption failed
    connect16an attempt to connect a socket failed
    ssl_handshake17establishing an SSL connection failed
    get_interface18a connection failed to satisfy the bind interface setting
    sock_listen19a call to listen() on a socket
    sock_bind_to_device20a call to the ioctl to bind a socket to a specific network device or\n-adapter
    sock_accept21a call to accept() on a socket
    parse_address22convert a string into a valid network address
    enum_if23enumeration network devices or adapters
    file_stat24invoking stat() on a file
    file_copy25copying a file
    file_fallocate26allocating storage for a file
    file_hard_link27creating a hard link
    file_remove28removing a file
    file_rename29renaming a file
    file_open30opening a file
    mkdir31creating a directory
    check_resume32check fast resume data against files on disk
    exception33an unknown exception
    alloc_cache_piece34allocate space for a piece in the cache
    partfile_move35move a part-file
    partfile_read36read from a part file
    partfile_write37write to a part-file
    hostname_lookup38a hostname lookup 
    symlink39create or read a symlink
    \n+[report issue]
    \n+
    \n+

    enum protocol_version

    \n+

    Declared in "libtorrent/info_hash.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+
    namevaluedescription
    handshake40handshake with a peer or server
    V10The original BitTorrent version, using SHA-1 hashes
    sock_option41set socket option
    V21Version 2 of the BitTorrent protocol, using SHA-256 hashes
    enum_route42enumeration of network routes
    NUM2 
    file_seek43moving read/write position in a file, operation_t::hostname_lookup
    \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 \n-\n-\n-\n+\n+\n+\n \n \n
    namevaluedescription
    timer44an async wait operation on a timer
    bittorrent0 
    file_mmap45call to mmap() (or windows counterpart)
    url_seed1 
    file_truncate46call to ftruncate() (or SetEndOfFile() on windows)
    http_seed2 
    \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

    int

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-
    \n-
    user_alert_id
    \n-
    user defined alerts should use IDs greater than this
    \n+

    Declared in "libtorrent/version.hpp"

    \n+
    \n+
    version_major
    \n+
    the major, minor and tiny versions of libtorrent
    \n
    \n-
    \n-
    num_alert_types
    \n-
    this constant represents "max_alert_index" + 1
    \n+
    \n+
    version_minor
    \n+
    the major, minor and tiny versions of libtorrent
    \n
    \n-[report issue]
    \n-
    \n-

    alert_category_t

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-
    \n-
    error
    \n-

    Enables alerts that report an error. This includes:

    \n-
      \n-
    • tracker errors
    • \n-
    • tracker warnings
    • \n-
    • file errors
    • \n-
    • resume data failures
    • \n-
    • web seed errors
    • \n-
    • .torrent files errors
    • \n-
    • listen socket errors
    • \n-
    • port mapping errors
    • \n-
    \n+
    \n+
    version_tiny
    \n+
    the major, minor and tiny versions of libtorrent
    \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+are present for this torrent and that they all match the hashes in\n+the torrent file. Each time a peer requests to download a block,\n+the piece is verified against the hash, unless it has been verified\n+already. If a hash fails, the torrent will automatically leave the\n+seed mode and recheck all the files. The use case for this mode is\n+if a torrent is created and seeded, or if the user already know\n+that the files are complete, this is a way to avoid the initial\n+file checks, and significantly reduce the startup time.

    \n+

    Setting seed_mode on a torrent without metadata (a\n+.torrent file) is a no-op and will be ignored.

    \n+

    It is not possible to set the seed_mode flag on a torrent after it has\n+been added to a session. It is possible to clear it though.

    \n
    \n
    \n-
    \n-
    peer
    \n-
    Enables alerts when peers send invalid requests, get banned or\n-snubbed.
    \n+
    \n+
    upload_mode
    \n+

    If upload_mode is set, the torrent will be initialized in\n+upload-mode, which means it will not make any piece requests. This\n+state is typically entered on disk I/O errors, and if the torrent\n+is also auto managed, it will be taken out of this state\n+periodically (see settings_pack::optimistic_disk_retry).

    \n+

    This mode can be used to avoid race conditions when\n+adjusting priorities of pieces before allowing the torrent to start\n+downloading.

    \n+

    If the torrent is auto-managed (auto_managed), the torrent\n+will eventually be taken out of upload-mode, regardless of how it\n+got there. If it's important to manually control when the torrent\n+leaves upload mode, don't make it auto managed.

    \n+
    \n
    \n-
    \n-
    port_mapping
    \n-
    Enables alerts for port mapping events. For NAT-PMP and UPnP.
    \n+
    \n+
    share_mode
    \n+

    determines if the torrent should be added in share mode or not.\n+Share mode indicates that we are not interested in downloading the\n+torrent, but merely want to improve our share ratio (i.e. increase\n+it). A torrent started in share mode will do its best to never\n+download more than it uploads to the swarm. If the swarm does not\n+have enough demand for upload capacity, the torrent will not\n+download anything. This mode is intended to be safe to add any\n+number of torrents to, without manual screening, without the risk\n+of downloading more than is uploaded.

    \n+

    A torrent in share mode sets the priority to all pieces to 0,\n+except for the pieces that are downloaded, when pieces are decided\n+to be downloaded. This affects the progress bar, which might be set\n+to "100% finished" most of the time. Do not change file or piece\n+priorities for torrents in share mode, it will make it not work.

    \n+

    The share mode has one setting, the share ratio target, see\n+settings_pack::share_mode_target for more info.

    \n+
    \n
    \n-
    \n-
    storage
    \n-
    Enables alerts for events related to the storage. File errors and\n-synchronization events for moving the storage, renaming files etc.
    \n+
    \n+
    apply_ip_filter
    \n+
    determines if the IP filter should apply to this torrent or not. By\n+default all torrents are subject to filtering by the IP filter\n+(i.e. this flag is set by default). This is useful if certain\n+torrents needs to be exempt for some reason, being an auto-update\n+torrent for instance.
    \n
    \n-
    \n-
    tracker
    \n-
    Enables all tracker events. Includes announcing to trackers,\n-receiving responses, warnings and errors.
    \n+
    \n+
    paused
    \n+
    specifies whether or not the torrent is paused. i.e. it won't connect to the tracker or any of the peers\n+until it's resumed. Note that a paused torrent that also has the\n+auto_managed flag set can be started at any time by libtorrent's queuing\n+logic. See queuing.
    \n
    \n-
    \n-
    connect
    \n-
    Low level alerts for when peers are connected and disconnected.
    \n+
    \n+
    auto_managed
    \n+

    If the torrent is auto-managed (auto_managed), the torrent\n+may be resumed at any point, regardless of how it paused. If it's\n+important to manually control when the torrent is paused and\n+resumed, don't make it auto managed.

    \n+

    If auto_managed is set, the torrent will be queued,\n+started and seeded automatically by libtorrent. When this is set,\n+the torrent should also be started as paused. The default queue\n+order is the order the torrents were added. They are all downloaded\n+in that order. For more details, see queuing.

    \n+
    \n
    \n-
    \n-
    status
    \n-
    Enables alerts for when a torrent or the session changes state.
    \n+
    \n+
    duplicate_is_error
    \n+
    used in add_torrent_params to indicate that it's an error to attempt\n+to add a torrent that's already in the session. If it's not considered an\n+error, a handle to the existing torrent is returned.\n+This flag is not saved by write_resume_data(), since it is only meant for\n+adding torrents.
    \n
    \n-
    \n-
    ip_block
    \n-
    Alerts when a peer is blocked by the ip blocker or port blocker.
    \n+
    \n+
    update_subscribe
    \n+
    on by default and means that this torrent will be part of state\n+updates when calling post_torrent_updates().\n+This flag is not saved by write_resume_data().
    \n
    \n-
    \n-
    performance_warning
    \n-
    Alerts when some limit is reached that might limit the download\n-or upload rate.
    \n+
    \n+
    super_seeding
    \n+
    sets the torrent into super seeding/initial seeding mode. If the torrent\n+is not a seed, this flag has no effect.
    \n
    \n-
    \n-
    dht
    \n-
    Alerts on events in the DHT node. For incoming searches or\n-bootstrapping being done etc.
    \n+
    \n+
    sequential_download
    \n+
    sets the sequential download state for the torrent. In this mode the\n+piece picker will pick pieces with low index numbers before pieces with\n+high indices. The actual pieces that are picked depend on other factors\n+still, such as which pieces a peer has and whether it is in parole mode\n+or "prefer whole pieces"-mode. Sequential mode is not ideal for streaming\n+media. For that, see set_piece_deadline() instead.
    \n
    \n-
    \n-
    stats
    \n-
    If you enable these alerts, you will receive a stats_alert\n-approximately once every second, for every active torrent.\n-These alerts contain all statistics counters for the interval since\n-the lasts stats alert.
    \n+
    \n+
    stop_when_ready
    \n+

    When this flag is set, the torrent will force stop whenever it\n+transitions from a non-data-transferring state into a data-transferring\n+state (referred to as being ready to download or seed). This is useful\n+for torrents that should not start downloading or seeding yet, but want\n+to be made ready to do so. A torrent may need to have its files checked\n+for instance, so it needs to be started and possibly queued for checking\n+(auto-managed and started) but as soon as it's done, it should be\n+stopped.

    \n+

    Force stopped means auto-managed is set to false and it's paused. As\n+if the auto_manages flag is cleared and the paused flag is set on the torrent.

    \n+

    Note that the torrent may transition into a downloading state while\n+setting this flag, and since the logic is edge triggered you may\n+miss the edge. To avoid this race, if the torrent already is in a\n+downloading state when this call is made, it will trigger the\n+stop-when-ready immediately.

    \n+

    When the stop-when-ready logic fires, the flag is cleared. Any\n+subsequent transitions between downloading and non-downloading states\n+will not be affected, until this flag is set again.

    \n+

    The behavior is more robust when setting this flag as part of adding\n+the torrent. See add_torrent_params.

    \n+

    The stop-when-ready flag fixes the inherent race condition of waiting\n+for the state_changed_alert and then call pause(). The download/seeding\n+will most likely start in between posting the alert and receiving the\n+call to pause.

    \n+

    A downloading state is one where peers are being connected. Which means\n+just downloading the metadata via the ut_metadata extension counts\n+as a downloading state. In order to stop a torrent once the metadata\n+has been downloaded, instead set all file priorities to dont_download

    \n+
    \n
    \n-
    \n-
    session_log
    \n-
    Enables debug logging alerts. These are available unless libtorrent\n-was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n-alerts being posted are log_alert and are session wide.
    \n+
    \n+
    override_trackers
    \n+
    when this flag is set, the tracker list in the add_torrent_params\n+object override any trackers from the torrent file. If the flag is\n+not set, the trackers from the add_torrent_params object will be\n+added to the list of trackers used by the torrent.\n+This flag is set by read_resume_data() if there are trackers present in\n+the resume data file. This effectively makes the trackers saved in the\n+resume data take precedence over the original trackers. This includes if\n+there's an empty list of trackers, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
    \n
    \n-
    \n-
    torrent_log
    \n-
    Enables debug logging alerts for torrents. These are available\n-unless libtorrent was built with logging disabled\n-(TORRENT_DISABLE_LOGGING). The alerts being posted are\n-torrent_log_alert and are torrent wide debug events.
    \n+
    \n+
    override_web_seeds
    \n+
    If this flag is set, the web seeds from the add_torrent_params\n+object will override any web seeds in the torrent file. If it's not\n+set, web seeds in the add_torrent_params object will be added to the\n+list of web seeds used by the torrent.\n+This flag is set by read_resume_data() if there are web seeds present in\n+the resume data file. This effectively makes the web seeds saved in the\n+resume data take precedence over the original ones. This includes if\n+there's an empty list of web seeds, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
    \n
    \n-
    \n-
    peer_log
    \n-
    Enables debug logging alerts for peers. These are available unless\n-libtorrent was built with logging disabled\n-(TORRENT_DISABLE_LOGGING). The alerts being posted are\n-peer_log_alert and low-level peer events and messages.
    \n+
    \n+
    need_save_resume
    \n+

    if this flag is set (which it is by default) the torrent will be\n+considered needing to save its resume data immediately, in the\n+category if_metadata_changed. See resume_data_flags_t and\n+save_resume_data() for details.

    \n+

    This flag is cleared by a successful call to save_resume_data()\n+This flag is not saved by write_resume_data(), since it represents an\n+ephemeral state of a running torrent.

    \n+
    \n
    \n-
    \n-
    incoming_request
    \n-
    enables the incoming_request_alert.
    \n+
    \n+
    disable_dht
    \n+
    set this flag to disable DHT for this torrent. This lets you have the DHT\n+enabled for the whole client, and still have specific torrents not\n+participating in it. i.e. not announcing to the DHT nor picking up peers\n+from it.
    \n
    \n-
    \n-
    dht_log
    \n-
    enables dht_log_alert, debug logging for the DHT
    \n+
    \n+
    disable_lsd
    \n+
    set this flag to disable local service discovery for this torrent.
    \n
    \n-
    \n-
    dht_operation
    \n-
    enable events from pure dht operations not related to torrents
    \n+
    \n+
    disable_pex
    \n+
    set this flag to disable peer exchange for this torrent.
    \n
    \n-
    \n-
    port_mapping_log
    \n-
    enables port mapping log events. This log is useful\n-for debugging the UPnP or NAT-PMP implementation
    \n+
    \n+
    no_verify_files
    \n+
    if this flag is set, the resume data will be assumed to be correct\n+without validating it against any files on disk. This may be used when\n+restoring a session by loading resume data from disk. It will save time\n+and also delay any hard disk errors until files are actually needed. If\n+the resume data cannot be trusted, or if a torrent is added for the first\n+time to some save path that may already have some of the files, this flag\n+should not be set.
    \n
    \n-
    \n-
    picker_log
    \n-
    enables verbose logging from the piece picker.
    \n+
    \n+
    default_dont_download
    \n+
    default all file priorities to dont_download. This is useful for adding\n+magnet links where the number of files is unknown, but the\n+file_priorities is still set for some files. Any file not covered by\n+the file_priorities list will be set to normal download priority,\n+unless this flag is set, in which case they will be set to 0\n+(dont_download).
    \n
    \n-
    \n-
    file_progress
    \n-
    alerts when files complete downloading
    \n+
    \n+
    i2p_torrent
    \n+
    this flag makes the torrent be considered an "i2p torrent" for purposes\n+of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n+is disabled, i2p torrents won't add normal peers to its peer list.\n+Note that non i2p torrents may still allow i2p peers (on the off-chance\n+that a tracker return them and the session is configured with a SAM\n+connection).\n+This flag is set automatically when adding a torrent that has at least\n+one tracker whose hostname ends with .i2p.\n+It's also set by parse_magnet_uri() if the tracker list contains such\n+URL.
    \n
    \n-
    \n-
    piece_progress
    \n-
    alerts when pieces complete downloading or fail hash check
    \n+
    \n+
    all
    \n+
    all torrent flags combined. Can conveniently be used when creating masks\n+for flags
    \n
    \n-
    \n-
    upload
    \n-
    alerts when we upload blocks to other peers
    \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-
    block_progress
    \n-
    alerts on individual blocks being requested, downloading, finished,\n-rejected, time-out and cancelled. This is likely to post alerts at a\n-high rate.
    \n+
    \n+
    pex_seed
    \n+
    the peer is a seed
    \n
    \n-
    \n-
    all
    \n-

    The full bitmask, representing all available categories.

    \n-

    since the enum is signed, make sure this isn't\n-interpreted as -1. For instance, boost.python\n-does that and fails when assigning it to an\n-unsigned parameter.

    \n-
    \n+
    \n+
    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 [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@@ -15233,15 +14266,15 @@\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+[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@@ -15527,15 +14560,15 @@\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+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@@ -15711,1078 +14744,5149 @@\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-

    Bencoding is a common representation in bittorrent used for dictionary,\n-list, int and string hierarchies. It's used to encode .torrent files and\n-some messages in the network protocol. libtorrent also uses it to store\n-settings, resume data and other session state.

    \n-

    Strings in bencoded structures do not necessarily represent text.\n-Strings are raw byte buffers of a certain length. If a string is meant to be\n-interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

    \n-

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n-This function builds a tree that points back into the original buffer. The\n-returned bdecode_node will not be valid once the buffer it was parsed out of\n-is discarded.

    \n-

    It's possible to construct an entry from a bdecode_node, if a structure needs\n-to be altered and re-encoded.

    \n-[report issue]
    \n+

    You have some control over session configuration through the session::apply_settings()\n+member function. To change one or more configuration options, create a settings_pack\n+object and fill it with the settings to be set and pass it in to session::apply_settings().

    \n+

    The settings_pack object is a collection of settings updates that are applied\n+to the session when passed to session::apply_settings(). It's empty when\n+constructed.

    \n+

    You have control over proxy and authorization settings and also the user-agent\n+that will be sent to the tracker. The user-agent will also be used to identify the\n+client with other peers.

    \n+

    Each configuration option is named with an enum value inside the\n+settings_pack class. These are the available settings:

    \n+[report issue]
    \n
    \n-
    \n-

    entry

    \n-

    Declared in "libtorrent/entry.hpp"

    \n-

    The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer\n-or a string.

    \n-
    \n-class entry\n-{\n-   data_type type () const;\n-   entry (dictionary_type);\n-   entry (span<char const>);\n-   entry (integer_type);\n-   entry (list_type);\n-   entry (preformatted_type);\n-   entry (U v);\n-   entry (data_type t);\n-   entry (bdecode_node const& n);\n-   entry& operator= (entry const&) &;\n-   entry& operator= (span<char const>) &;\n-   entry& operator= (bdecode_node const&) &;\n-   entry& operator= (dictionary_type) &;\n-   entry& operator= (integer_type) &;\n-   entry& operator= (list_type) &;\n-   entry& operator= (entry&&) & noexcept;\n-   entry& operator= (preformatted_type) &;\n-   entry& operator= (U v) &;\n-   list_type& list ();\n-   dictionary_type const& dict () const;\n-   dictionary_type& dict ();\n-   preformatted_type& preformatted ();\n-   string_type const& string () const;\n-   integer_type const& integer () const;\n-   integer_type& integer ();\n-   list_type const& list () const;\n-   preformatted_type const& preformatted () const;\n-   string_type& string ();\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-   enum data_type\n-   {\n-      int_t,\n-      string_t,\n-      list_t,\n-      dictionary_t,\n-      undefined_t,\n-      preformatted_t,\n-   };\n-};\n-
    \n-[report issue]
    \n-

    type()

    \n-
    \n-data_type type () const;\n-
    \n-

    returns the concrete type of the entry

    \n-[report issue]
    \n-
    \n-

    entry()

    \n-
    \n-entry (dictionary_type);\n-entry (span<char const>);\n-entry (integer_type);\n-entry (list_type);\n-entry (preformatted_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-
    \n-entry (data_type t);\n-
    \n-

    construct an empty entry of the specified type.\n-see data_type enum.

    \n-[report issue]
    \n-
    \n-

    entry()

    \n-
    \n-entry (bdecode_node const& n);\n-
    \n-

    construct from bdecode_node parsed form (see bdecode())

    \n-[report issue]
    \n-
    \n-

    operator=()

    \n-
    \n-entry& operator= (entry const&) &;\n-entry& operator= (span<char const>) &;\n-entry& operator= (bdecode_node const&) &;\n-entry& operator= (dictionary_type) &;\n-entry& operator= (integer_type) &;\n-entry& operator= (list_type) &;\n-entry& operator= (entry&&) & noexcept;\n-entry& operator= (preformatted_type) &;\n-
    \n-

    copies the structure of the right hand side into this\n-entry.

    \n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    list() string() preformatted() dict() integer()

    \n-
    \n-list_type& list ();\n-dictionary_type const& dict () const;\n-dictionary_type& dict ();\n-preformatted_type& preformatted ();\n-string_type const& string () const;\n-integer_type const& integer () const;\n-integer_type& integer ();\n-list_type const& list () const;\n-preformatted_type const& preformatted () const;\n-string_type& string ();\n-
    \n-

    The integer(), string(), list() and dict() functions\n-are accessors that return the respective type. If the entry object\n-isn't of the type you request, the accessor will throw\n-system_error. You can ask an entry for its type through the\n-type() function.

    \n-

    If you want to create an entry you give it the type you want it to\n-have in its constructor, and then use one of the non-const accessors\n-to get a reference which you then can assign the value you want it to\n-have.

    \n-

    The typical code to get info from a torrent file will then look like\n-this:

    \n-
    \n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find("announce");\n-if (i != dict.end())\n-{\n-        std::string tracker_url = i->second.string();\n-        std::cout << tracker_url << "\\n";\n-}\n-
    \n-

    The following code is equivalent, but a little bit shorter:

    \n-
    \n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key("announce"))\n-{\n-        std::string tracker_url = i->string();\n-        std::cout << tracker_url << "\\n";\n-}\n-
    \n-

    To make it easier to extract information from a torrent file, the\n-class torrent_info exists.

    \n-[report issue]
    \n-
    \n-

    swap()

    \n-
    \n-void swap (entry& e);\n-
    \n-

    swaps the content of this with e.

    \n-[report issue]
    \n-
    \n-

    operator[]()

    \n-
    \n-entry 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-

    The non-const versions of the operator[] will return a reference\n-to either the existing element at the given key or, if there is no\n-element with the given key, a reference to a newly inserted element at\n-that key.

    \n-

    The const version of operator[] will only return a reference to an\n-existing element at the given key. If the key is not found, it will\n-throw system_error.

    \n-[report issue]
    \n-
    \n-

    find_key()

    \n+
    \n+

    settings_pack

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n+

    The settings_pack struct, contains the names of all settings as\n+enum values. These values are passed in to the set_str(),\n+set_int(), set_bool() functions, to specify the setting to\n+change.

    \n+

    The settings_pack only stores values for settings that have been\n+explicitly set on this object. However, it can still be queried for\n+settings that have not been set and returns the default value for those\n+settings.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    user_agentstringlibtorrent/
    \n+

    this is the client identification to the tracker. The recommended\n+format of this string is: "client-name/client-version\n+libtorrent/libtorrent-version". This name will not only be used when\n+making HTTP requests, but also when sending extended headers to\n+peers that support that extension. It may not contain r or n

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    announce_ipstringnullptr
    \n+

    announce_ip is the ip address passed along to trackers as the\n+&ip= parameter. If left as the default, that parameter is\n+omitted.

    \n+
    \n+

    Note

    \n+

    This setting is only meant for very special cases where a seed is\n+running on the same host as the tracker, and the tracker accepts\n+the IP parameter (which normal trackers don't). Do not set this\n+option unless you also control the tracker.

    \n+
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    handshake_client_versionstringnullptr
    \n+

    this is the client name and version identifier sent to peers in the\n+handshake message. If this is an empty string, the user_agent is\n+used instead. This string must be a UTF-8 encoded unicode string.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    outgoing_interfacesstring 
    \n+

    This controls which IP address outgoing TCP peer connections are bound\n+to, in addition to controlling whether such connections are also\n+bound to a specific network interface/adapter (bind-to-device).

    \n+

    This string is a comma-separated list of IP addresses and\n+interface names. An empty string will not bind TCP sockets to a\n+device, and let the network stack assign the local address.

    \n+

    A list of names will be used to bind outgoing TCP sockets in a\n+round-robin fashion. An IP address will simply be used to bind()\n+the socket. An interface name will attempt to bind the socket to\n+that interface. If that fails, or is unsupported, one of the IP\n+addresses configured for that interface is used to bind() the\n+socket to. If the interface or adapter doesn't exist, the\n+outgoing peer connection will fail with an error message suggesting\n+the device cannot be found. Adapter names on Unix systems are of\n+the form "eth0", "eth1", "tun0", etc. This may be useful for\n+clients that are multi-homed. Binding an outgoing connection to a\n+local IP does not necessarily make the connection via the\n+associated NIC/Adapter.

    \n+

    When outgoing interfaces are specified, incoming connections or\n+packets sent to a local interface or IP that's not in this list\n+will be rejected with a peer_blocked_alert with\n+invalid_local_interface as the reason.

    \n+

    Note that these are just interface/adapter names or IP addresses.\n+There are no ports specified in this list. IPv6 addresses without\n+port should be specified without enclosing [, ].

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    listen_interfacesstring0.0.0.0:6881,[::]:6881
    \n+

    a comma-separated list of (IP or device name, port) pairs. These are\n+the listen ports that will be opened for accepting incoming uTP and\n+TCP peer connections. These are also used for outgoing uTP and UDP\n+tracker connections and DHT nodes.

    \n+

    It is possible to listen on multiple interfaces and\n+multiple ports. Binding to port 0 will make the operating system\n+pick the port.

    \n+
    \n+

    Note

    \n+

    There are reasons to stick to the same port across sessions,\n+which would mean only using port 0 on the first start, and\n+recording the port that was picked for subsequent startups.\n+Trackers, the DHT and other peers will remember the port they see\n+you use and hand that port out to other peers trying to connect\n+to you, as well as trying to connect to you themselves.

    \n+
    \n+

    A port that has an "s" suffix will accept SSL peer connections. (note\n+that SSL sockets are only available in builds with SSL support)

    \n+

    A port that has an "l" suffix will be considered a local network.\n+i.e. it's assumed to only be able to reach hosts in the same local\n+network as the IP address (based on the netmask associated with the\n+IP, queried from the operating system).

    \n+

    if binding fails, the listen_failed_alert is posted. Once a\n+socket binding succeeds (if it does), the listen_succeeded_alert\n+is posted. There may be multiple failures before a success.

    \n+

    If a device name that does not exist is configured, no listen\n+socket will be opened for that interface. If this is the only\n+interface configured, it will be as if no listen ports are\n+configured.

    \n+

    If no listen ports are configured (e.g. listen_interfaces is an\n+empty string), networking will be disabled. No DHT will start, no\n+outgoing uTP or tracker connections will be made. No incoming TCP\n+or uTP connections will be accepted. (outgoing TCP connections\n+will still be possible, depending on\n+settings_pack::outgoing_interfaces).

    \n+

    For example:\n+[::1]:8888 - will only accept connections on the IPv6 loopback\n+address on port 8888.

    \n+

    eth0:4444,eth1:4444 - will accept connections on port 4444 on\n+any IP address bound to device eth0 or eth1.

    \n+

    [::]:0s - will accept SSL connections on a port chosen by the\n+OS. And not accept non-SSL connections at all.

    \n+

    0.0.0.0:6881,[::]:6881 - binds to all interfaces on port 6881.

    \n+

    10.0.1.13:6881l - binds to the local IP address, port 6881, but\n+only allow talking to peers on the same local network. The netmask\n+is queried from the operating system. Interfaces marked l are\n+not announced to trackers, unless the tracker is also on the same\n+local network.

    \n+

    Windows OS network adapter device name must be specified with GUID.\n+It can be obtained from "netsh lan show interfaces" command output.\n+GUID must be uppercased string embraced in curly brackets.\n+{E4F0B674-0DFC-48BB-98A5-2AA730BDB6D6}:7777 - will accept\n+connections on port 7777 on adapter with this GUID.

    \n+

    For more information, see the Multi-homed hosts section.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_hostnamestring 
    \n+

    when using a proxy, this is the hostname where the proxy is running\n+see proxy_type. Note that when using a proxy, the\n+settings_pack::listen_interfaces setting is overridden and only a\n+single interface is created, just to contact the proxy. This\n+means a proxy cannot be combined with SSL torrents or multiple\n+listen interfaces. This proxy listen interface will not accept\n+incoming TCP connections, will not map ports with any gateway and\n+will not enable local service discovery. All traffic is supposed\n+to be channeled through the proxy.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_usernamestring 
    proxy_passwordstring 
    \n+

    when using a proxy, these are the credentials (if any) to use when\n+connecting to it. see proxy_type

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    i2p_hostnamestring 
    \n+

    sets the i2p SAM bridge to connect to. set the port with the\n+i2p_port setting. Unless this is set, i2p torrents are not\n+supported. This setting is separate from the other proxy settings\n+since i2p torrents and their peers are orthogonal. You can have\n+i2p peers as well as regular peers via a proxy.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    peer_fingerprintstring-LT20A0-
    \n+

    this is the fingerprint for the client. It will be used as the\n+prefix to the peer_id. If this is 20 bytes (or longer) it will be\n+truncated to 20 bytes and used as the entire peer-id

    \n+

    There is a utility function, generate_fingerprint() that can be used\n+to generate a standard client peer ID fingerprint prefix.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_bootstrap_nodesstringdht.libtorrent.org:25401
    \n+

    This is a comma-separated list of IP port-pairs. They will be added\n+to the DHT node (if it's enabled) as back-up nodes in case we don't\n+know of any.

    \n+

    Changing these after the DHT has been started may not have any\n+effect until the DHT is restarted.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    allow_multiple_connections_per_ipboolfalse
    \n+

    determines if connections from the same IP address as existing\n+connections should be rejected or not. Rejecting multiple connections\n+from the same IP address will prevent abusive\n+behavior by peers. The logic for determining whether connections are\n+to the same peer is more complicated with this enabled, and more\n+likely to fail in some edge cases. It is not recommended to enable\n+this feature.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    send_redundant_havebooltrue
    \n+

    send_redundant_have controls if have messages will be sent to\n+peers that already have the piece. This is typically not necessary,\n+but it might be necessary for collecting statistics in some cases.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    use_dht_as_fallbackboolfalse
    \n+

    use_dht_as_fallback determines how the DHT is used. If this is\n+true, the DHT will only be used for torrents where all trackers in\n+its tracker list has failed. Either by an explicit error message or\n+a time out. If this is false, the DHT is used regardless of if the\n+trackers fail or not.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    upnp_ignore_nonroutersboolfalse
    \n+

    upnp_ignore_nonrouters indicates whether or not the UPnP\n+implementation should ignore any broadcast response from a device\n+whose address is not on our subnet. i.e.\n+it's a way to not talk to other people's routers by mistake.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    use_parole_modebooltrue
    \n+

    use_parole_mode specifies if parole mode should be used. Parole\n+mode means that peers that participate in pieces that fail the hash\n+check are put in a mode where they are only allowed to download\n+whole pieces. If the whole piece a peer in parole mode fails the\n+hash check, it is banned. If a peer participates in a piece that\n+passes the hash check, it is taken out of parole mode.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    auto_manage_prefer_seedsboolfalse
    \n+

    if true, prefer seeding torrents when determining which torrents to give\n+active slots to. If false, give preference to downloading torrents

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dont_count_slow_torrentsbooltrue
    \n+

    if dont_count_slow_torrents is true, torrents without any\n+payload transfers are not subject to the active_seeds and\n+active_downloads limits. This is intended to make it more\n+likely to utilize all available bandwidth, and avoid having\n+torrents that don't transfer anything block the active slots.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    close_redundant_connectionsbooltrue
    \n+

    close_redundant_connections specifies whether libtorrent should\n+close connections where both ends have no utility in keeping the\n+connection open. For instance if both ends have completed their\n+downloads, there's no point in keeping it open.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    prioritize_partial_piecesboolfalse
    \n+

    If prioritize_partial_pieces is true, partial pieces are picked\n+before pieces that are more rare. If false, rare pieces are always\n+prioritized, unless the number of partial pieces is growing out of\n+proportion.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    rate_limit_ip_overheadbooltrue
    \n+

    if set to true, the estimated TCP/IP overhead is drained from the\n+rate limiters, to avoid exceeding the limits with the total traffic

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    announce_to_all_tiersboolfalse
    announce_to_all_trackersboolfalse
    \n+

    announce_to_all_trackers controls how multi tracker torrents\n+are treated. If this is set to true, all trackers in the same tier\n+are announced to in parallel. If all trackers in tier 0 fails, all\n+trackers in tier 1 are announced as well. If it's set to false, the\n+behavior is as defined by the multi tracker specification.

    \n+

    announce_to_all_tiers also controls how multi tracker torrents\n+are treated. When this is set to true, one tracker from each tier\n+is announced to. This is the uTorrent behavior. To be compliant\n+with the Multi-tracker specification, set it to false.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    prefer_udp_trackersbooltrue
    \n+

    prefer_udp_trackers: true means that trackers\n+may be rearranged in a way that udp trackers are always tried\n+before http trackers for the same hostname. Setting this to false\n+means that the tracker's tier is respected and there's no\n+preference of one protocol over another.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    disable_hash_checksboolfalse
    \n+

    when set to true, all data downloaded from peers will be assumed to\n+be correct, and not tested to match the hashes in the torrent this\n+is only useful for simulation and testing purposes (typically\n+combined with disabled_storage)

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    allow_i2p_mixedboolfalse
    \n+

    if this is true, i2p torrents are allowed to also get peers from\n+other sources than the tracker, and connect to regular IPs, not\n+providing any anonymization. This may be useful if the user is not\n+interested in the anonymization of i2p, but still wants to be able\n+to connect to i2p peers.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    no_atime_storagebooltrue
    \n+

    no_atime_storage this is a Linux-only option and passes in the\n+O_NOATIME to open() when opening files. This may lead to\n+some disk performance improvements.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    incoming_starts_queued_torrentsboolfalse
    \n+

    incoming_starts_queued_torrents. If a torrent\n+has been paused by the auto managed feature in libtorrent, i.e. the\n+torrent is paused and auto managed, this feature affects whether or\n+not it is automatically started on an incoming connection. The main\n+reason to queue torrents, is not to make them unavailable, but to\n+save on the overhead of announcing to the trackers, the DHT and to\n+avoid spreading one's unchoke slots too thin. If a peer managed to\n+find us, even though we're no in the torrent anymore, this setting\n+can make us start the torrent and serve it.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    report_true_downloadedboolfalse
    \n+

    when set to true, the downloaded counter sent to trackers will\n+include the actual number of payload bytes downloaded including\n+redundant bytes. If set to false, it will not include any redundancy\n+bytes

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    strict_end_game_modebooltrue
    \n+

    strict_end_game_mode controls when a\n+block may be requested twice. If this is true, a block may only\n+be requested twice when there's at least one request to every piece\n+that's left to download in the torrent. This may slow down progress\n+on some pieces sometimes, but it may also avoid downloading a lot\n+of redundant bytes. If this is false, libtorrent attempts to\n+use each peer connection to its max, by always requesting\n+something, even if it means requesting something that has been\n+requested from another peer already.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_outgoing_utpbooltrue
    enable_incoming_utpbooltrue
    enable_outgoing_tcpbooltrue
    enable_incoming_tcpbooltrue
    \n+

    Enables incoming and outgoing, TCP and uTP peer connections.\n+false is disabled and true is enabled. When outgoing\n+connections are disabled, libtorrent will simply not make\n+outgoing peer connections with the specific transport protocol.\n+Disabled incoming peer connections will simply be rejected.\n+These options only apply to peer connections, not tracker- or any\n+other kinds of connections.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    no_recheck_incomplete_resumeboolfalse
    \n+

    no_recheck_incomplete_resume determines if the storage should\n+check the whole files when resume data is incomplete or missing or\n+whether it should simply assume we don't have any of the data. If\n+false, any existing files will be checked.\n+By setting this setting to true, the files won't be checked, but\n+will go straight to download mode.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    anonymous_modeboolfalse
    \n+

    anonymous_mode: When set to true, the client tries to hide\n+its identity to a certain degree.

    \n+
      \n+
    • A generic user-agent will be\n+used for trackers (except for private torrents).
    • \n+
    • Your local IPv4 and IPv6 address won't be sent as query string\n+parameters to private trackers.
    • \n+
    • If announce_ip is configured, it will not be sent to trackers
    • \n+
    • The client version will not be sent to peers in the extension\n+handshake.
    • \n+
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    report_web_seed_downloadsbooltrue
    \n+

    specifies whether downloads from web seeds is reported to the\n+tracker or not. Turning it off also excludes web\n+seed traffic from other stats and download rate reporting via the\n+libtorrent API.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    seeding_outgoing_connectionsbooltrue
    \n+

    seeding_outgoing_connections determines if seeding (and\n+finished) torrents should attempt to make outgoing connections or\n+not. It may be set to false in very\n+specific applications where the cost of making outgoing connections\n+is high, and there are no or small benefits of doing so. For\n+instance, if no nodes are behind a firewall or a NAT, seeds don't\n+need to make outgoing connections.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    no_connect_privileged_portsboolfalse
    \n+

    when this is true, libtorrent will not attempt to make outgoing\n+connections to peers whose port is < 1024. This is a safety\n+precaution to avoid being part of a DDoS attack

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    smooth_connectsbooltrue
    \n+

    smooth_connects means the number of\n+connection attempts per second may be limited to below the\n+connection_speed, in case we're close to bump up against the\n+limit of number of connections. The intention of this setting is to\n+more evenly distribute our connection attempts over time, instead\n+of attempting to connect in batches, and timing them out in\n+batches.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    always_send_user_agentboolfalse
    \n+

    always send user-agent in every web seed request. If false, only\n+the first request per http connection will include the user agent

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    apply_ip_filter_to_trackersbooltrue
    \n+

    apply_ip_filter_to_trackers determines\n+whether the IP filter applies to trackers as well as peers. If this\n+is set to false, trackers are exempt from the IP filter (if there\n+is one). If no IP filter is set, this setting is irrelevant.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    ban_web_seedsbooltrue
    \n+

    when true, web seeds sending bad data will be banned

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    support_share_modebooltrue
    \n+

    if false, prevents libtorrent to advertise share-mode support

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    report_redundant_bytesbooltrue
    \n+

    if this is true, the number of redundant bytes is sent to the\n+tracker

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    listen_system_port_fallbackbooltrue
    \n+

    if this is true, libtorrent will fall back to listening on a port\n+chosen by the operating system (i.e. binding to port 0). If a\n+failure is preferred, set this to false.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    announce_crypto_supportbooltrue
    \n+

    when this is true, and incoming encrypted connections are enabled,\n+&supportcrypt=1 is included in http tracker announces

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_upnpbooltrue
    \n+

    Starts and stops the UPnP service. When started, the listen port\n+and the DHT port are attempted to be forwarded on local UPnP router\n+devices.

    \n+

    The upnp object returned by start_upnp() can be used to add and\n+remove arbitrary port mappings. Mapping status is returned through\n+the portmap_alert and the portmap_error_alert. The object will be\n+valid until stop_upnp() is called. See upnp and nat pmp.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_natpmpbooltrue
    \n+

    Starts and stops the NAT-PMP service. When started, the listen port\n+and the DHT port are attempted to be forwarded on the router\n+through NAT-PMP.

    \n+

    The natpmp object returned by start_natpmp() can be used to add\n+and remove arbitrary port mappings. Mapping status is returned\n+through the portmap_alert and the portmap_error_alert. The object\n+will be valid until stop_natpmp() is called. See\n+upnp and nat pmp.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_lsdbooltrue
    \n+

    Starts and stops Local Service Discovery. This service will\n+broadcast the info-hashes of all the non-private torrents on the\n+local network to look for peers on the same swarm within multicast\n+reach.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_dhtbooltrue
    \n+

    starts the dht node and makes the trackerless service available to\n+torrents.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    prefer_rc4boolfalse
    \n+

    if the allowed encryption level is both, setting this to true will\n+prefer RC4 if both methods are offered, plain text otherwise

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_hostnamesbooltrue
    \n+

    if true, hostname lookups are done via the configured proxy (if\n+any). This is only supported by SOCKS5 and HTTP.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_peer_connectionsbooltrue
    \n+

    if true, peer connections are made (and accepted) over the\n+configured proxy, if any. Web seeds as well as regular bittorrent\n+peer connections are considered "peer connections". Anything\n+transporting actual torrent payload (trackers and DHT traffic are\n+not considered peer connections).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    auto_sequentialbooltrue
    \n+

    if this setting is true, torrents with a very high availability of\n+pieces (and seeds) are downloaded sequentially. This is more\n+efficient for the disk I/O. With many seeds, the download order is\n+unlikely to matter anyway

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_tracker_connectionsbooltrue
    \n+

    if true, tracker connections are made over the configured proxy, if\n+any.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_ip_notifierbooltrue
    \n+

    Starts and stops the internal IP table route changes notifier.

    \n+

    The current implementation supports multiple platforms, and it is\n+recommended to have it enable, but you may want to disable it if\n+it's supported but unreliable, or if you have a better way to\n+detect the changes. In the later case, you should manually call\n+session_handle::reopen_network_sockets to ensure network\n+changes are taken in consideration.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_prefer_verified_node_idsbooltrue
    \n+

    when this is true, nodes whose IDs are derived from their source\n+IP according to BEP 42 are preferred in the routing table.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_restrict_routing_ipsbooltrue
    \n+

    determines if the routing table entries should restrict entries to one\n+per IP. This defaults to true, which helps mitigate some attacks on\n+the DHT. It prevents adding multiple nodes with IPs with a very close\n+CIDR distance.

    \n+

    when set, nodes whose IP address that's in the same /24 (or /64 for\n+IPv6) range in the same routing table bucket. This is an attempt to\n+mitigate node ID spoofing attacks also restrict any IP to only have a\n+single entry in the whole routing table

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_restrict_search_ipsbooltrue
    \n+

    determines if DHT searches should prevent adding nodes with IPs with\n+very close CIDR distance. This also defaults to true and helps\n+mitigate certain attacks on the DHT.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_extended_routing_tablebooltrue
    \n+

    makes the first buckets in the DHT routing table fit 128, 64, 32 and\n+16 nodes respectively, as opposed to the standard size of 8. All other\n+buckets have size 8 still.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_aggressive_lookupsbooltrue
    \n+

    slightly changes the lookup behavior in terms of how many outstanding\n+requests we keep. Instead of having branch factor be a hard limit, we\n+always keep branch factor outstanding requests to the closest nodes.\n+i.e. every time we get results back with closer nodes, we query them\n+right away. It lowers the lookup times at the cost of more outstanding\n+queries.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_privacy_lookupsboolfalse
    \n+

    when set, perform lookups in a way that is slightly more expensive,\n+but which minimizes the amount of information leaked about you.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_enforce_node_idboolfalse
    \n+

    when set, node's whose IDs that are not correctly generated based on\n+its external IP are ignored. When a query arrives from such node, an\n+error message is returned with a message saying "invalid node ID".

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_ignore_dark_internetbooltrue
    \n+

    ignore DHT messages from parts of the internet we wouldn't expect to\n+see any traffic from

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_read_onlyboolfalse
    \n+

    when set, the other nodes won't keep this node in their routing\n+tables, it's meant for low-power and/or ephemeral devices that\n+cannot support the DHT, it is also useful for mobile devices which\n+are sensitive to network traffic and battery life.\n+this node no longer responds to 'query' messages, and will place a\n+'ro' key (value = 1) in the top-level message dictionary of outgoing\n+query messages.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    piece_extent_affinityboolfalse
    \n+

    when this is true, create an affinity for downloading 4 MiB extents\n+of adjacent pieces. This is an attempt to achieve better disk I/O\n+throughput by downloading larger extents of bytes, for torrents with\n+small piece sizes

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    validate_https_trackersbooltrue
    \n+

    when set to true, the certificate of HTTPS trackers and HTTPS web\n+seeds will be validated against the system's certificate store\n+(as defined by OpenSSL). If the system does not have a\n+certificate store, this option may have to be disabled in order\n+to get trackers and web seeds to work).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    ssrf_mitigationbooltrue
    \n+

    when enabled, tracker and web seed requests are subject to\n+certain restrictions.

    \n+

    An HTTP(s) tracker requests to localhost (loopback)\n+must have the request path start with "/announce". This is the\n+conventional bittorrent tracker request. Any other HTTP(S)\n+tracker request to loopback will be rejected. This applies to\n+trackers that redirect to loopback as well.

    \n+

    Web seeds that end up on the client's local network (i.e. in a\n+private IP address range) may not include query string arguments.\n+This applies to web seeds redirecting to the local network as\n+well.

    \n+

    Web seeds on global IPs (i.e. not local network) may not redirect\n+to a local network address

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    allow_idnaboolfalse
    \n+

    when disabled, any tracker or web seed with an IDNA hostname\n+(internationalized domain name) is ignored. This is a security\n+precaution to avoid various unicode encoding attacks that might\n+happen at the application level.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    enable_set_file_valid_databoolfalse
    \n+

    when set to true, enables the attempt to use SetFileValidData()\n+to pre-allocate disk space. This system call will only work when\n+running with Administrator privileges on Windows, and so this\n+setting is only relevant in that scenario. Using\n+SetFileValidData() poses a security risk, as it may reveal\n+previously deleted information from the disk.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    socks5_udp_send_local_epboolfalse
    \n+

    When using a SOCKS5 proxy, UDP traffic is routed through the\n+proxy by sending a UDP ASSOCIATE command. If this option is true,\n+the UDP ASSOCIATE command will include the IP address and\n+listen port to the local UDP socket. This indicates to the proxy\n+which source endpoint to expect our packets from. The benefit is\n+that incoming packets can be forwarded correctly, before any\n+outgoing packets are sent. The risk is that if there's a NAT\n+between the client and the proxy, the IP address specified in the\n+protocol may not be valid from the proxy's point of view.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    tracker_completion_timeoutint30
    \n+

    tracker_completion_timeout is the number of seconds the tracker\n+connection will wait from when it sent the request until it\n+considers the tracker to have timed-out.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    tracker_receive_timeoutint10
    \n+

    tracker_receive_timeout is the number of seconds to wait to\n+receive any data from the tracker. If no data is received for this\n+number of seconds, the tracker will be considered as having timed\n+out. If a tracker is down, this is the kind of timeout that will\n+occur.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    stop_tracker_timeoutint5
    \n+

    stop_tracker_timeout is the number of seconds to wait when\n+sending a stopped message before considering a tracker to have\n+timed out. This is usually shorter, to make the client quit faster.\n+If the value is set to 0, the connections to trackers with the\n+stopped event are suppressed.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    tracker_maximum_response_lengthint1024*1024
    \n+

    this is the maximum number of bytes in a tracker response. If a\n+response size passes this number of bytes it will be rejected and\n+the connection will be closed. On gzipped responses this size is\n+measured on the uncompressed data. So, if you get 20 bytes of gzip\n+response that'll expand to 2 megabytes, it will be interrupted\n+before the entire response has been uncompressed (assuming the\n+limit is lower than 2 MiB).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    piece_timeoutint20
    \n+

    the number of seconds from a request is sent until it times out if\n+no piece response is returned.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    request_timeoutint60
    \n+

    the number of seconds one block (16 kiB) is expected to be received\n+within. If it's not, the block is requested from a different peer

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    request_queue_timeint3
    \n+

    the length of the request queue given in the number of seconds it\n+should take for the other end to send all the pieces. i.e. the\n+actual number of requests depends on the download rate and this\n+number.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_allowed_in_request_queueint2000
    \n+

    the number of outstanding block requests a peer is allowed to queue\n+up in the client. If a peer sends more requests than this (before\n+the first one has been sent) the last request will be dropped. the\n+higher this is, the faster upload speeds the client can get to a\n+single peer.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_out_request_queueint500
    \n+

    max_out_request_queue is the maximum number of outstanding\n+requests to send to a peer. This limit takes precedence over\n+request_queue_time. i.e. no matter the download speed, the\n+number of outstanding requests will never exceed this limit.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    whole_pieces_thresholdint20
    \n+

    if a whole piece can be downloaded in this number of seconds, or\n+less, the peer_connection will prefer to request whole pieces at a\n+time from this peer. The benefit of this is to better utilize disk\n+caches by doing localized accesses and also to make it easier to\n+identify bad peers if a piece fails the hash check.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    peer_timeoutint120
    \n+

    peer_timeout is the number of seconds the peer connection\n+should wait (for any activity on the peer connection) before\n+closing it due to time out. 120 seconds is\n+specified in the protocol specification. After half\n+the time out, a keep alive message is sent.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    urlseed_timeoutint20
    \n+

    same as peer_timeout, but only applies to url-seeds. this is\n+usually set lower, because web servers are expected to be more\n+reliable.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    urlseed_pipeline_sizeint5
    \n+

    controls the pipelining size of url and http seeds. i.e. the number of HTTP\n+request to keep outstanding before waiting for the first one to\n+complete. It's common for web servers to limit this to a relatively\n+low number, like 5

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    urlseed_wait_retryint30
    \n+

    number of seconds until a new retry of a url-seed takes place.\n+Default retry value for http-seeds that don't provide\n+a valid retry-after header.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    file_pool_sizeint40
    \n+

    sets the upper limit on the total number of files this session will\n+keep open. The reason why files are left open at all is that some\n+anti virus software hooks on every file close, and scans the file\n+for viruses. deferring the closing of the files will be the\n+difference between a usable system and a completely hogged down\n+system. Most operating systems also has a limit on the total number\n+of file descriptors a process may have open.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_failcountint3
    \n+

    max_failcount is the maximum times we try to\n+connect to a peer before stop connecting again. If a\n+peer succeeds, the failure counter is reset. If a\n+peer is retrieved from a peer source (other than DHT)\n+the failcount is decremented by one, allowing another\n+try.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    min_reconnect_timeint60
    \n+

    the number of seconds to wait to reconnect to a peer. this time is\n+multiplied with the failcount.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    peer_connect_timeoutint15
    \n+

    peer_connect_timeout the number of seconds to wait after a\n+connection attempt is initiated to a peer until it is considered as\n+having timed out. This setting is especially important in case the\n+number of half-open connections are limited, since stale half-open\n+connection may delay the connection of other peers considerably.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    connection_speedint30
    \n+

    connection_speed is the number of connection attempts that are\n+made per second. If a number < 0 is specified, it will default to\n+200 connections per second. If 0 is specified, it means don't make\n+outgoing connections at all.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    inactivity_timeoutint600
    \n+

    if a peer is uninteresting and uninterested for longer than this\n+number of seconds, it will be disconnected.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    unchoke_intervalint15
    \n+

    unchoke_interval is the number of seconds between\n+chokes/unchokes. On this interval, peers are re-evaluated for being\n+choked/unchoked. This is defined as 30 seconds in the protocol, and\n+it should be significantly longer than what it takes for TCP to\n+ramp up to it's max rate.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    optimistic_unchoke_intervalint30
    \n+

    optimistic_unchoke_interval is the number of seconds between\n+each optimistic unchoke. On this timer, the currently\n+optimistically unchoked peer will change.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    num_wantint200
    \n+

    num_want is the number of peers we want from each tracker\n+request. It defines what is sent as the &num_want= parameter to\n+the tracker.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    initial_picker_thresholdint4
    \n+

    initial_picker_threshold specifies the number of pieces we need\n+before we switch to rarest first picking. The first\n+initial_picker_threshold pieces in any torrent are picked at random\n+, the following pieces are picked in rarest first order.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    allowed_fast_set_sizeint5
    \n+

    the number of allowed pieces to send to peers that supports the\n+fast extensions

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    suggest_modeintsettings_pack::no_piece_suggestions
    \n+

    suggest_mode controls whether or not libtorrent will send out\n+suggest messages to create a bias of its peers to request certain\n+pieces. The modes are:

    \n+
      \n+
    • no_piece_suggestions which will not send out suggest messages.
    • \n+
    • suggest_read_cache which will send out suggest messages for\n+the most recent pieces that are in the read cache.
    • \n+
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_queued_disk_bytesint1024 * 1024
    \n+

    max_queued_disk_bytes is the maximum number of bytes, to\n+be written to disk, that can wait in the disk I/O thread queue.\n+This queue is only for waiting for the disk I/O thread to receive\n+the job and either write it to disk or insert it in the write\n+cache. When this limit is reached, the peer connections will stop\n+reading data from their sockets, until the disk thread catches up.\n+Setting this too low will severely limit your download rate.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    handshake_timeoutint10
    \n+

    the number of seconds to wait for a handshake response from a peer.\n+If no response is received within this time, the peer is\n+disconnected.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    send_buffer_low_watermarkint10 * 1024
    send_buffer_watermarkint500 * 1024
    send_buffer_watermark_factorint50
    \n+

    send_buffer_low_watermark the minimum send buffer target size\n+(send buffer includes bytes pending being read from disk). For good\n+and snappy seeding performance, set this fairly high, to at least\n+fit a few blocks. This is essentially the initial window size which\n+will determine how fast we can ramp up the send rate

    \n+

    if the send buffer has fewer bytes than send_buffer_watermark,\n+we'll read another 16 kiB block onto it. If set too small, upload\n+rate capacity will suffer. If set too high, memory will be wasted.\n+The actual watermark may be lower than this in case the upload rate\n+is low, this is the upper limit.

    \n+

    the current upload rate to a peer is multiplied by this factor to\n+get the send buffer watermark. The factor is specified as a\n+percentage. i.e. 50 -> 0.5 This product is clamped to the\n+send_buffer_watermark setting to not exceed the max. For high\n+speed upload, this should be set to a greater value than 100. For\n+high capacity connections, setting this higher can improve upload\n+performance and disk throughput. Setting it too high may waste RAM\n+and create a bias towards read jobs over write jobs.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    choking_algorithmintsettings_pack::fixed_slots_choker
    seed_choking_algorithmintsettings_pack::round_robin
    \n+

    choking_algorithm specifies which algorithm to use to determine\n+how many peers to unchoke. The unchoking algorithm for\n+downloading torrents is always "tit-for-tat", i.e. the peers we\n+download the fastest from are unchoked.

    \n+

    The options for choking algorithms are defined in the\n+choking_algorithm_t enum.

    \n+

    seed_choking_algorithm controls the seeding unchoke behavior.\n+i.e. How we select which peers to unchoke for seeding torrents.\n+Since a seeding torrent isn't downloading anything, the\n+tit-for-tat mechanism cannot be used. The available options are\n+defined in the seed_choking_algorithm_t enum.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    disk_io_write_modeintDISK_WRITE_MODE
    disk_io_read_modeintsettings_pack::enable_os_cache
    \n+

    determines how files are opened when they're in read only mode\n+versus read and write mode. The options are:

    \n+
    \n+
    enable_os_cache
    \n+
    Files are opened normally, with the OS caching reads and writes.
    \n+
    disable_os_cache
    \n+
    This opens all files in no-cache mode. This corresponds to the\n+OS not letting blocks for the files linger in the cache. This\n+makes sense in order to avoid the bittorrent client to\n+potentially evict all other processes' cache by simply handling\n+high throughput and large files. If libtorrent's read cache is\n+disabled, enabling this may reduce performance.
    \n+
    write_through
    \n+
    flush pieces to disk as they complete validation.
    \n+
    \n+

    One reason to disable caching is that it may help the operating\n+system from growing its file cache indefinitely.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    outgoing_portint0
    num_outgoing_portsint0
    \n+

    this is the first port to use for binding outgoing connections to.\n+This is useful for users that have routers that allow QoS settings\n+based on local port. when binding outgoing connections to specific\n+ports, num_outgoing_ports is the size of the range. It should\n+be more than a few

    \n+
    \n+

    Warning

    \n+

    setting outgoing ports will limit the ability to keep\n+multiple connections to the same client, even for different\n+torrents. It is not recommended to change this setting. Its main\n+purpose is to use as an escape hatch for cheap routers with QoS\n+capability but can only classify flows based on port numbers.

    \n+
    \n+

    It is a range instead of a single port because of the problems with\n+failing to reconnect to peers if a previous socket to that peer and\n+port is in TIME_WAIT state.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    peer_dscpint0x04
    \n+

    peer_dscp determines the DSCP field in the IP header of every\n+packet sent to peers (including web seeds). 0x0 means no marking,\n+0x04 represents Lower Effort. For more details see RFC 8622.

    \n+

    peer_tos is the backwards compatible name for this setting.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    active_downloadsint3
    active_seedsint5
    active_checkingint1
    active_dht_limitint88
    active_tracker_limitint1600
    active_lsd_limitint60
    active_limitint500
    \n+

    for auto managed torrents, these are the limits they are subject\n+to. If there are too many torrents some of the auto managed ones\n+will be paused until some slots free up. active_downloads and\n+active_seeds controls how many active seeding and downloading\n+torrents the queuing mechanism allows. The target number of active\n+torrents is min(active_downloads + active_seeds, active_limit).\n+active_downloads and active_seeds are upper limits on the\n+number of downloading torrents and seeding torrents respectively.\n+Setting the value to -1 means unlimited.

    \n+

    For example if there are 10 seeding torrents and 10 downloading\n+torrents, and active_downloads is 4 and active_seeds is 4,\n+there will be 4 seeds active and 4 downloading torrents. If the\n+settings are active_downloads = 2 and active_seeds = 4,\n+then there will be 2 downloading torrents and 4 seeding torrents\n+active. Torrents that are not auto managed are not counted against\n+these limits.

    \n+

    active_checking is the limit of number of simultaneous checking\n+torrents.

    \n+

    active_limit is a hard limit on the number of active (auto\n+managed) torrents. This limit also applies to slow torrents.

    \n+

    active_dht_limit is the max number of torrents to announce to\n+the DHT.

    \n+

    active_tracker_limit is the max number of torrents to announce\n+to their trackers.

    \n+

    active_lsd_limit is the max number of torrents to announce to\n+the local network over the local service discovery protocol.

    \n+

    You can have more torrents active, even though they are not\n+announced to the DHT, lsd or their tracker. If some peer knows\n+about you for any reason and tries to connect, it will still be\n+accepted, unless the torrent is paused, which means it won't accept\n+any connections.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    auto_manage_intervalint30
    \n+

    auto_manage_interval is the number of seconds between the\n+torrent queue is updated, and rotated.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    seed_time_limitint24 * 60 * 60
    \n+

    this is the limit on the time a torrent has been an active seed\n+(specified in seconds) before it is considered having met the seed\n+limit criteria. See queuing.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    auto_scrape_intervalint1800
    auto_scrape_min_intervalint300
    \n+

    auto_scrape_interval is the number of seconds between scrapes\n+of queued torrents (auto managed and paused torrents). Auto managed\n+torrents that are paused, are scraped regularly in order to keep\n+track of their downloader/seed ratio. This ratio is used to\n+determine which torrents to seed and which to pause.

    \n+

    auto_scrape_min_interval is the minimum number of seconds\n+between any automatic scrape (regardless of torrent). In case there\n+are a large number of paused auto managed torrents, this puts a\n+limit on how often a scrape request is sent.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_peerlist_sizeint3000
    max_paused_peerlist_sizeint1000
    \n+

    max_peerlist_size is the maximum number of peers in the list of\n+known peers. These peers are not necessarily connected, so this\n+number should be much greater than the maximum number of connected\n+peers. Peers are evicted from the cache when the list grows passed\n+90% of this limit, and once the size hits the limit, peers are no\n+longer added to the list. If this limit is set to 0, there is no\n+limit on how many peers we'll keep in the peer list.

    \n+

    max_paused_peerlist_size is the max peer list size used for\n+torrents that are paused. This can be used to save memory for paused\n+torrents, since it's not as important for them to keep a large peer\n+list.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    min_announce_intervalint5 * 60
    \n+

    this is the minimum allowed announce interval for a tracker. This\n+is specified in seconds and is used as a sanity check on what is\n+returned from a tracker. It mitigates hammering mis-configured\n+trackers.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    auto_manage_startupint60
    \n+

    this is the number of seconds a torrent is considered active after\n+it was started, regardless of upload and download speed. This is so\n+that newly started torrents are not considered inactive until they\n+have a fair chance to start downloading.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    seeding_piece_quotaint20
    \n+

    seeding_piece_quota is the number of pieces to send to a peer,\n+when seeding, before rotating in another peer to the unchoke set.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_rejectsint50
    \n+

    max_rejects is the number of piece requests we will reject in a\n+row while a peer is choked before the peer is considered abusive\n+and is disconnected.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    recv_socket_buffer_sizeint0
    send_socket_buffer_sizeint0
    \n+

    specifies the buffer sizes set on peer sockets. 0 means the OS\n+default (i.e. don't change the buffer sizes).\n+The socket buffer sizes are changed using setsockopt() with\n+SOL_SOCKET/SO_RCVBUF and SO_SNDBUFFER.

    \n+

    Note that uTP peers share a single UDP socket buffer for each of the\n+listen_interfaces, along with DHT and UDP tracker traffic.\n+If the buffer size is too small for the combined traffic through the\n+socket, packets may be dropped.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_peer_recv_buffer_sizeint2 * 1024 * 1024
    \n+

    the max number of bytes a single peer connection's receive buffer is\n+allowed to grow to.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    optimistic_disk_retryint10 * 60
    \n+

    optimistic_disk_retry is the number of seconds from a disk\n+write errors occur on a torrent until libtorrent will take it out\n+of the upload mode, to test if the error condition has been fixed.

    \n+

    libtorrent will only do this automatically for auto managed\n+torrents.

    \n+

    You can explicitly take a torrent out of upload only mode using\n+set_upload_mode().

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_suggest_piecesint16
    \n+

    max_suggest_pieces is the max number of suggested piece indices\n+received from a peer that's remembered. If a peer floods suggest\n+messages, this limit prevents libtorrent from using too much RAM.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    local_service_announce_intervalint5 * 60
    \n+

    local_service_announce_interval is the time between local\n+network announces for a torrent.\n+This interval is specified in seconds.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_announce_intervalint15 * 60
    \n+

    dht_announce_interval is the number of seconds between\n+announcing torrents to the distributed hash table (DHT).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    udp_tracker_token_expiryint60
    \n+

    udp_tracker_token_expiry is the number of seconds libtorrent\n+will keep UDP tracker connection tokens around for. This is\n+specified to be 60 seconds. The higher this\n+value is, the fewer packets have to be sent to the UDP tracker. In\n+order for higher values to work, the tracker needs to be configured\n+to match the expiration time for tokens.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    num_optimistic_unchoke_slotsint0
    \n+

    num_optimistic_unchoke_slots is the number of optimistic\n+unchoke slots to use.\n+Having a higher number of optimistic unchoke slots mean you will\n+find the good peers faster but with the trade-off to use up more\n+bandwidth. 0 means automatic, where libtorrent opens up 20% of your\n+allowed upload slots as optimistic unchoke slots.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_pex_peersint50
    \n+

    the max number of peers we accept from pex messages from a single\n+peer. this limits the number of concurrent peers any of our peers\n+claims to be connected to. If they claim to be connected to more\n+than this, we'll ignore any peer that exceeds this limit

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    tick_intervalint500
    \n+

    tick_interval specifies the number of milliseconds between\n+internal ticks. This is the frequency with which bandwidth quota is\n+distributed to peers. It should not be more than one second (i.e.\n+1000 ms). Setting this to a low value (around 100) means higher\n+resolution bandwidth quota distribution, setting it to a higher\n+value saves CPU cycles.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    share_mode_targetint3
    \n+

    share_mode_target specifies the target share ratio for share\n+mode torrents. If set to 3, we'll try to upload 3\n+times as much as we download. Setting this very high, will make it\n+very conservative and you might end up not downloading anything\n+ever (and not affecting your share ratio). It does not make any\n+sense to set this any lower than 2. For instance, if only 3 peers\n+need to download the rarest piece, it's impossible to download a\n+single piece and upload it more than 3 times. If the\n+share_mode_target is set to more than 3, nothing is downloaded.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    upload_rate_limitint0
    download_rate_limitint0
    \n+

    upload_rate_limit and download_rate_limit sets\n+the session-global limits of upload and download rate limits, in\n+bytes per second. By default peers on the local network are not rate\n+limited.

    \n+

    A value of 0 means unlimited.

    \n+

    For fine grained control over rate limits, including making them apply\n+to local peers, see peer classes.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_upload_rate_limitint8000
    \n+

    the number of bytes per second (on average) the DHT is allowed to send.\n+If the incoming requests causes to many bytes to be sent in responses,\n+incoming requests will be dropped until the quota has been replenished.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    unchoke_slots_limitint8
    \n+

    unchoke_slots_limit is the max number of unchoked peers in the\n+session. The number of unchoke slots may be ignored depending on\n+what choking_algorithm is set to. Setting this limit to -1\n+means unlimited, i.e. all peers will always be unchoked.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    connections_limitint200
    \n+

    connections_limit sets a global limit on the number of\n+connections opened. The number of connections is set to a hard\n+minimum of at least two per torrent, so if you set a too low\n+connections limit, and open too many torrents, the limit will not\n+be met.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    connections_slackint10
    \n+

    connections_slack is the number of incoming connections\n+exceeding the connection limit to accept in order to potentially\n+replace existing ones.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    utp_target_delayint100
    utp_gain_factorint3000
    utp_min_timeoutint500
    utp_syn_resendsint2
    utp_fin_resendsint2
    utp_num_resendsint3
    utp_connect_timeoutint3000
    utp_loss_multiplierint50
    \n+

    utp_target_delay is the target delay for uTP sockets in\n+milliseconds. A high value will make uTP connections more\n+aggressive and cause longer queues in the upload bottleneck. It\n+cannot be too low, since the noise in the measurements would cause\n+it to send too slow.\n+utp_gain_factor is the number of bytes the uTP congestion\n+window can increase at the most in one RTT.\n+If this is set too high, the congestion controller reacts\n+too hard to noise and will not be stable, if it's set too low, it\n+will react slow to congestion and not back off as fast.

    \n+

    utp_min_timeout is the shortest allowed uTP socket timeout,\n+specified in milliseconds. The\n+timeout depends on the RTT of the connection, but is never smaller\n+than this value. A connection times out when every packet in a\n+window is lost, or when a packet is lost twice in a row (i.e. the\n+resent packet is lost as well).

    \n+

    The shorter the timeout is, the faster the connection will recover\n+from this situation, assuming the RTT is low enough.\n+utp_syn_resends is the number of SYN packets that are sent (and\n+timed out) before giving up and closing the socket.\n+utp_num_resends is the number of times a packet is sent (and\n+lost or timed out) before giving up and closing the connection.\n+utp_connect_timeout is the number of milliseconds of timeout\n+for the initial SYN packet for uTP connections. For each timed out\n+packet (in a row), the timeout is doubled. utp_loss_multiplier\n+controls how the congestion window is changed when a packet loss is\n+experienced. It's specified as a percentage multiplier for\n+cwnd. Do not change this value unless you know what you're doing.\n+Never set it higher than 100.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    mixed_mode_algorithmintsettings_pack::peer_proportional
    \n+

    The mixed_mode_algorithm determines how to treat TCP\n+connections when there are uTP connections. Since uTP is designed\n+to yield to TCP, there's an inherent problem when using swarms that\n+have both TCP and uTP connections. If nothing is done, uTP\n+connections would often be starved out for bandwidth by the TCP\n+connections. This mode is prefer_tcp. The peer_proportional\n+mode simply looks at the current throughput and rate limits all TCP\n+connections to their proportional share based on how many of the\n+connections are TCP. This works best if uTP connections are not\n+rate limited by the global rate limiter (which they aren't by\n+default).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    listen_queue_sizeint5
    \n+

    listen_queue_size is the value passed in to listen() for the\n+listen socket. It is the number of outstanding incoming connections\n+to queue up while we're not actively waiting for a connection to be\n+accepted. 5 should be sufficient for any\n+normal client. If this is a high performance server which expects\n+to receive a lot of connections, or used in a simulator or test, it\n+might make sense to raise this number. It will not take affect\n+until the listen_interfaces settings is updated.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    torrent_connect_boostint30
    \n+

    torrent_connect_boost is the number of peers to try to connect\n+to immediately when the first tracker response is received for a\n+torrent. This is a boost to given to new torrents to accelerate\n+them starting up. The normal connect scheduler is run once every\n+second, this allows peers to be connected immediately instead of\n+waiting for the session tick to trigger connections.\n+This may not be set higher than 255.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    alert_queue_sizeint2000
    \n+

    alert_queue_size is the maximum number of alerts queued up\n+internally. If alerts are not popped, the queue will eventually\n+fill up to this level. Once the alert queue is full, additional\n+alerts will be dropped, and not delivered to the client. Once the\n+client drains the queue, new alerts may be delivered again. In order\n+to know that alerts have been dropped, see\n+session_handle::dropped_alerts().

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_metadata_sizeint3 * 1024 * 10240
    \n+

    max_metadata_size is the maximum allowed size (in bytes) to be\n+received by the metadata extension, i.e. magnet links.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    hashing_threadsint1
    \n+

    hashing_threads is the number of disk I/O threads to use for\n+piece hash verification. These threads are in addition to the\n+regular disk I/O threads specified by settings_pack::aio_threads.\n+These threads are only used for full checking of torrents. The\n+hash checking done while downloading are done by the regular disk\n+I/O threads.\n+The hasher threads do not only compute hashes, but also perform\n+the read from disk. On storage optimal for sequential access,\n+such as hard drives, this setting should be set to 1, which is\n+also the default.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    checking_mem_usageint256
    \n+

    the number of blocks to keep outstanding at any given time when\n+checking torrents. Higher numbers give faster re-checks but uses\n+more memory. Specified in number of 16 kiB blocks

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    predictive_piece_announceint0
    \n+

    if set to > 0, pieces will be announced to other peers before they\n+are fully downloaded (and before they are hash checked). The\n+intention is to gain 1.5 potential round trip times per downloaded\n+piece. When non-zero, this indicates how many milliseconds in\n+advance pieces should be announced, before they are expected to be\n+completed.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    aio_threadsint10
    \n+

    for some aio back-ends, aio_threads specifies the number of\n+io-threads to use.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    tracker_backoffint250
    \n+

    tracker_backoff determines how aggressively to back off from\n+retrying failing trackers. This value determines x in the\n+following formula, determining the number of seconds to wait until\n+the next retry:

    \n+
    \n+delay = 5 + 5 * x / 100 * fails^2
    \n+

    This setting may be useful to make libtorrent more or less\n+aggressive in hitting trackers.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    share_ratio_limitint200
    seed_time_ratio_limitint700
    \n+

    when a seeding torrent reaches either the share ratio (bytes up /\n+bytes down) or the seed time ratio (seconds as seed / seconds as\n+downloader) or the seed time limit (seconds as seed) it is\n+considered done, and it will leave room for other torrents. These\n+are specified as percentages. Torrents that are considered done will\n+still be allowed to be seeded, they just won't have priority anymore.\n+For more, see queuing.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    peer_turnoverint4
    peer_turnover_cutoffint90
    peer_turnover_intervalint300
    \n+

    peer_turnover is the percentage of peers to disconnect every\n+turnover peer_turnover_interval (if we're at the peer limit), this\n+is specified in percent when we are connected to more than limit *\n+peer_turnover_cutoff peers disconnect peer_turnover fraction of the\n+peers. It is specified in percent peer_turnover_interval is the\n+interval (in seconds) between optimistic disconnects if the\n+disconnects happen and how many peers are disconnected is\n+controlled by peer_turnover and peer_turnover_cutoff

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    connect_seed_every_n_downloadint10
    \n+

    this setting controls the priority of downloading torrents over\n+seeding or finished torrents when it comes to making peer\n+connections. Peer connections are throttled by the connection_speed\n+and the half-open connection limit. This makes peer connections a\n+limited resource. Torrents that still have pieces to download are\n+prioritized by default, to avoid having many seeding torrents use\n+most of the connection attempts and only give one peer every now\n+and then to the downloading torrent. libtorrent will loop over the\n+downloading torrents to connect a peer each, and every n:th\n+connection attempt, a finished torrent is picked to be allowed to\n+connect to a peer. This setting controls n.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_http_recv_buffer_sizeint4*1024*204
    \n+

    the max number of bytes to allow an HTTP response to be when\n+announcing to trackers or downloading .torrent files via the\n+url provided in add_torrent_params.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_retry_port_bindint10
    \n+

    if binding to a specific port fails, should the port be incremented\n+by one and tried again? This setting specifies how many times to\n+retry a failed port bind

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    alert_maskintint
    \n+

    a bitmask combining flags from alert_category_t defining which\n+kinds of alerts to receive

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    out_enc_policyintsettings_pack::pe_enabled
    in_enc_policyintsettings_pack::pe_enabled
    \n+

    control the settings for incoming and outgoing connections\n+respectively. see enc_policy enum for the available options.\n+Keep in mind that protocol encryption degrades performance in\n+several respects:

    \n+
      \n+
    1. It prevents "zero copy" disk buffers being sent to peers, since\n+each peer needs to mutate the data (i.e. encrypt it) the data\n+must be copied per peer connection rather than sending the same\n+buffer to multiple peers.
    2. \n+
    3. The encryption itself requires more CPU than plain bittorrent\n+protocol. The highest cost is the Diffie Hellman exchange on\n+connection setup.
    4. \n+
    5. The encryption handshake adds several round-trips to the\n+connection setup, and delays transferring data.
    6. \n+
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    allowed_enc_levelintsettings_pack::pe_both
    \n+

    determines the encryption level of the connections. This setting\n+will adjust which encryption scheme is offered to the other peer,\n+as well as which encryption scheme is selected by the client. See\n+enc_level enum for options.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    inactive_down_rateint2048
    inactive_up_rateint2048
    \n+

    the download and upload rate limits for a torrent to be considered\n+active by the queuing mechanism. A torrent whose download rate is\n+less than inactive_down_rate and whose upload rate is less than\n+inactive_up_rate for auto_manage_startup seconds, is\n+considered inactive, and another queued torrent may be started.\n+This logic is disabled if dont_count_slow_torrents is false.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_typeintsettings_pack::none
    \n+

    proxy to use. see proxy_type_t.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    proxy_portint0
    \n+

    the port of the proxy server

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    i2p_portint0
    \n+

    sets the i2p SAM bridge port to connect to. set the hostname with\n+the i2p_hostname setting.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    urlseed_max_request_bytesint16 * 1024 * 1024
    \n+

    The maximum request range of an url seed in bytes. This value\n+defines the largest possible sequential web seed request. Lower values\n+are possible but will be ignored if they are lower then piece size.\n+This value should be related to your download speed to prevent\n+libtorrent from creating too many expensive http requests per\n+second. You can select a value as high as you want but keep in mind\n+that libtorrent can't create parallel requests if the first request\n+did already select the whole file.\n+If you combine bittorrent seeds with web seeds and pick strategies\n+like rarest first you may find your web seed requests split into\n+smaller parts because we don't download already picked pieces\n+twice.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    web_seed_name_lookup_retryint1800
    \n+

    time to wait until a new retry of a web seed name lookup

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    close_file_intervalintCLOSE_FILE_INTERVAL
    \n+

    the number of seconds between closing the file opened the longest\n+ago. 0 means to disable the feature. The purpose of this is to\n+periodically close files to trigger the operating system flushing\n+disk cache. Specifically it has been observed to be required on\n+windows to not have the disk cache grow indefinitely.\n+This defaults to 240 seconds on windows, and disabled on other\n+systems.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    utp_cwnd_reduce_timerint100
    \n+

    When uTP experiences packet loss, it will reduce the congestion\n+window, and not reduce it again for this many milliseconds, even if\n+experiencing another lost packet.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_web_seed_connectionsint3
    \n+

    the max number of web seeds to have connected per torrent at any\n+given time.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    resolver_cache_timeoutint1200
    \n+

    the number of seconds before the internal host name resolver\n+considers a cache value timed out, negative values are interpreted\n+as zero.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    send_not_sent_low_watermarkint16384
    \n+

    specify the not-sent low watermark for socket send buffers. This\n+corresponds to the, Linux-specific, TCP_NOTSENT_LOWAT TCP socket\n+option.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    rate_choker_initial_thresholdint1024
    \n+

    the rate based choker compares the upload rate to peers against a\n+threshold that increases proportionally by its size for every\n+peer it visits, visiting peers in decreasing upload rate. The\n+number of upload slots is determined by the number of peers whose\n+upload rate exceeds the threshold. This option sets the start\n+value for this threshold. A higher value leads to fewer unchoke\n+slots, a lower value leads to more.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    upnp_lease_durationint3600
    \n+

    The expiration time of UPnP port-mappings, specified in seconds. 0\n+means permanent lease. Some routers do not support expiration times\n+on port-maps (nor correctly returning an error indicating lack of\n+support). In those cases, set this to 0. Otherwise, don't set it any\n+lower than 5 minutes.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_concurrent_http_announcesint50
    \n+

    limits the number of concurrent HTTP tracker announces. Once the\n+limit is hit, tracker requests are queued and issued when an\n+outstanding announce completes.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_peers_replyint100
    \n+

    the maximum number of peers to send in a reply to get_peers

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_search_branchingint5
    \n+

    the number of concurrent search request the node will send when\n+announcing and refreshing the routing table. This parameter is called\n+alpha in the kademlia paper

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_fail_countint20
    \n+

    the maximum number of failed tries to contact a node before it is\n+removed from the routing table. If there are known working nodes that\n+are ready to replace a failing node, it will be replaced immediately,\n+this limit is only used to clear out nodes that don't have any node\n+that can replace them.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_torrentsint2000
    \n+

    the total number of torrents to track from the DHT. This is simply an\n+upper limit to make sure malicious DHT nodes cannot make us allocate\n+an unbounded amount of memory.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_dht_itemsint700
    \n+

    max number of items the DHT will store

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_peersint500
    \n+

    the max number of peers to store per torrent (for the DHT)

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_torrent_search_replyint20
    \n+

    the max number of torrents to return in a torrent search query to the\n+DHT

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_block_timeoutint5 * 60
    \n+

    the number of seconds a DHT node is banned if it exceeds the rate\n+limit. The rate limit is averaged over 10 seconds to allow for bursts\n+above the limit.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_block_ratelimitint5
    \n+

    the max number of packets per second a DHT node is allowed to send\n+without getting banned.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_item_lifetimeint0
    \n+

    the number of seconds a immutable/mutable item will be expired.\n+default is 0, means never expires.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_sample_infohashes_intervalint21600
    \n+

    the info-hashes sample recomputation interval (in seconds).\n+The node will precompute a subset of the tracked info-hashes and return\n+that instead of calculating it upon each request. The permissible range\n+is between 0 and 21600 seconds (inclusive).

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    dht_max_infohashes_sample_countint20
    \n+

    the maximum number of elements in the sampled subset of info-hashes.\n+If this number is too big, expect the DHT storage implementations\n+to clamp it in order to allow UDP packets go through

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    max_piece_countint0x200000
    \n+

    max_piece_count is the maximum allowed number of pieces in\n+metadata received via magnet links. Loading large torrents (with\n+more pieces than the default limit) may also require passing in\n+a higher limit to read_resume_data() and\n+torrent_info::parse_info_section(), if those are used.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    metadata_token_limitint2500000
    \n+

    when receiving metadata (torrent file) from peers, this is the\n+max number of bencoded tokens we're willing to parse. This limit\n+is meant to prevent DoS attacks on peers. For very large\n+torrents, this limit may have to be raised.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    disk_write_modeintsettings_pack::mmap_write_mode_t::auto_mmap_write
    \n+

    controls whether disk writes will be made through a memory mapped\n+file or via normal write calls. This only affects the\n+mmap_disk_io. When saving to a non-local drive (network share,\n+NFS or NAS) using memory mapped files is most likely inferior.\n+When writing to a local SSD (especially in DAX mode) using memory\n+mapped files likely gives the best performance.\n+The values for this setting are specified as mmap_write_mode_t.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    mmap_file_size_cutoffint40
    \n+

    when using mmap_disk_io, files smaller than this number of blocks\n+will not be memory mapped, but will use normal pread/pwrite\n+operations. This file size limit is specified in 16 kiB blocks.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    nametypedefault
    i2p_inbound_quantityint3
    i2p_outbound_quantityint3
    i2p_inbound_lengthint3
    i2p_outbound_lengthint3
    \n+

    Configures the SAM session\n+quantity of I2P inbound and outbound tunnels [1..16].\n+number of hops for I2P inbound and outbound tunnels [0..7]\n+Changing these will not trigger a reconnect to the SAM bridge,\n+they will take effect the next time the SAM connection is\n+re-established (by restarting or changing i2p_hostname or\n+i2p_port).

    \n
    \n-entry const* find_key (string_view key) const;\n-entry* find_key (string_view key);\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+   bool has_val (int name) const override;\n+   void clear ();\n+   void clear (int name);\n+   int get_int (int name) const override;\n+   std::string const& get_str (int name) const override;\n+   bool get_bool (int name) const override;\n+   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+      type_mask,\n+      index_mask,\n+   };\n+\n+   enum mmap_write_mode_t\n+   {\n+      always_pwrite,\n+      always_mmap_write,\n+      auto_mmap_write,\n+   };\n+\n+   enum suggest_mode_t\n+   {\n+      no_piece_suggestions,\n+      suggest_read_cache,\n+   };\n+\n+   enum choking_algorithm_t\n+   {\n+      fixed_slots_choker,\n+      rate_based_choker,\n+      deprecated_bittyrant_choker,\n+   };\n+\n+   enum seed_choking_algorithm_t\n+   {\n+      round_robin,\n+      fastest_upload,\n+      anti_leech,\n+   };\n+\n+   enum io_buffer_mode_t\n+   {\n+      enable_os_cache,\n+      deprecated_disable_os_cache_for_aligned_files,\n+      disable_os_cache,\n+      write_through,\n+   };\n+\n+   enum bandwidth_mixed_algo_t\n+   {\n+      prefer_tcp,\n+      peer_proportional,\n+   };\n+\n+   enum enc_policy\n+   {\n+      pe_forced,\n+      pe_enabled,\n+      pe_disabled,\n+   };\n+\n+   enum enc_level\n+   {\n+      pe_plaintext,\n+      pe_rc4,\n+      pe_both,\n+   };\n+\n+   enum proxy_type_t\n+   {\n+      none,\n+      socks4,\n+      socks5,\n+      socks5_pw,\n+      http,\n+      http_pw,\n+   };\n+};\n 
    \n-

    These functions requires the entry to be a dictionary, if it isn't\n-they will throw system_error.

    \n-

    They will look for an element at the given key in the dictionary, if\n-the element cannot be found, they will return nullptr. If an element\n-with the given key is found, the return a pointer to it.

    \n-[report issue]
    \n-
    \n-

    to_string()

    \n+\n+\n+[report issue]
    \n+

    set_str() set_bool() set_int()

    \n
    \n-std::string to_string (bool single_line = false) const;\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 
    \n-

    returns a pretty-printed string representation\n-of the bencoded structure, with JSON-style syntax

    \n-[report issue]
    \n-
    \n-

    enum data_type

    \n-

    Declared in "libtorrent/entry.hpp"

    \n+

    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+
    \n+bool has_val (int name) const override;\n+
    \n+

    queries whether the specified configuration option has a value set in\n+this pack. name can be any enumeration value from string_types,\n+int_types or bool_types.

    \n+[report issue]
    \n+
    \n+

    clear()

    \n+
    \n+void clear ();\n+
    \n+

    clear the settings pack from all settings

    \n+[report issue]
    \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_str() get_bool() get_int()

    \n+
    \n+int get_int (int name) const override;\n+std::string const& get_str (int name) const override;\n+bool get_bool (int name) const override;\n+
    \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+
    \n+

    enum type_bases

    \n+

    Declared in "libtorrent/settings_pack.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
    string_type_base0 
    int_type_base16384 
    bool_type_base32768 
    type_mask49152 
    index_mask16383 
    \n+[report issue]
    \n+
    \n+

    enum mmap_write_mode_t

    \n+

    Declared in "libtorrent/settings_pack.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
    always_pwrite0disable writing to disk via mmap, always use normal write calls
    always_mmap_write1prefer using memory mapped files for disk writes (at least for\n+large files where it might make sense)
    auto_mmap_write2determine whether to use pwrite or memory mapped files for disk\n+writes depending on the kind of storage behind the save path
    \n+[report issue]
    \n+
    \n+

    enum suggest_mode_t

    \n+

    Declared in "libtorrent/settings_pack.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
    no_piece_suggestions0 
    suggest_read_cache1 
    \n+[report issue]
    \n+
    \n+

    enum choking_algorithm_t

    \n+

    Declared in "libtorrent/settings_pack.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
    fixed_slots_choker0This is the traditional choker with a fixed number of unchoke\n+slots (as specified by settings_pack::unchoke_slots_limit).
    rate_based_choker2

    This opens up unchoke slots based on the upload rate achieved to\n+peers. The more slots that are opened, the marginal upload rate\n+required to open up another slot increases. Configure the initial\n+threshold with settings_pack::rate_choker_initial_threshold.

    \n+

    For more information, see rate based choking.

    \n+
    deprecated_bittyrant_choker3 
    \n+[report issue]
    \n+
    \n+

    enum seed_choking_algorithm_t

    \n+

    Declared in "libtorrent/settings_pack.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+
    namevaluedescription
    round_robin0which round-robins the peers that are unchoked\n+when seeding. This distributes the upload bandwidth uniformly and\n+fairly. It minimizes the ability for a peer to download everything\n+without redistributing it.
    fastest_upload1unchokes the peers we can send to the fastest. This might be a\n+bit more reliable in utilizing all available capacity.
    anti_leech2prioritizes peers who have just started or are\n+just about to finish the download. The intention is to force\n+peers in the middle of the download to trade with each other.\n+This does not just take into account the pieces a peer is\n+reporting having downloaded, but also the pieces we have sent\n+to it.
    \n+[report issue]
    \n+
    \n+

    enum io_buffer_mode_t

    \n+

    Declared in "libtorrent/settings_pack.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
    int_t
    enable_os_cache0 
    string_t
    deprecated_disable_os_cache_for_aligned_files1 
    list_t
    disable_os_cache2 
    dictionary_t
    write_through3 
    undefined_t
    \n+[report issue]
    \n+
    \n+

    enum bandwidth_mixed_algo_t

    \n+

    Declared in "libtorrent/settings_pack.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
    prefer_tcp0disables the mixed mode bandwidth balancing
    peer_proportional1does not throttle uTP, throttles TCP to the same proportion\n+of throughput as there are TCP connections
    \n+[report issue]
    \n+
    \n+

    enum enc_policy

    \n+

    Declared in "libtorrent/settings_pack.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
    pe_forced0Only encrypted connections are allowed. Incoming connections that\n+are not encrypted are closed and if the encrypted outgoing\n+connection fails, a non-encrypted retry will not be made.
    pe_enabled1encrypted connections are enabled, but non-encrypted connections\n+are allowed. An incoming non-encrypted connection will be accepted,\n+and if an outgoing encrypted connection fails, a non- encrypted\n+connection will be tried.
    pe_disabled2only non-encrypted connections are allowed.
    \n+[report issue]
    \n+
    \n+

    enum enc_level

    \n+

    Declared in "libtorrent/settings_pack.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
    pe_plaintext1use only plain text encryption
    pe_rc42use only RC4 encryption
    pe_both3allow both
    \n+[report issue]
    \n+
    \n+

    enum proxy_type_t

    \n+

    Declared in "libtorrent/settings_pack.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
    namevaluedescription
    none0No proxy server is used and all other fields are ignored.
    socks41The server is assumed to be a SOCKS4 server that requires a\n+username.
    socks52The server is assumed to be a SOCKS5 server (RFC 1928) that does\n+not require any authentication. The username and password are\n+ignored.
    socks5_pw3The server is assumed to be a SOCKS5 server that supports plain\n+text username and password authentication (RFC 1929). The\n+username and password specified may be sent to the proxy if it\n+requires.
    http4 The server is assumed to be an HTTP proxy. If the transport used\n+for the connection is non-HTTP, the server is assumed to support\n+the CONNECT method. i.e. for web seeds and HTTP trackers, a plain\n+proxy will suffice. The proxy is assumed to not require\n+authorization. The username and password will not be used.
    preformatted_t
    http_pw5 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-[report issue]
    \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-
    \n-

    bencode()

    \n-

    Declared in "libtorrent/bencode.hpp"

    \n-
    \n-template<class OutIt> int bencode (OutIt out, const entry& e);\n-
    \n-

    This function will encode data to bencoded form.

    \n-

    The entry class is the internal representation of the bencoded data\n-and it can be used to retrieve information, an entry can also be build by\n-the program and given to bencode() to encode it into the OutIt\n-iterator.

    \n-

    OutIt is an OutputIterator. It's a template and usually\n-instantiated as ostream_iterator or back_insert_iterator. This\n-function assumes the value_type of the iterator is a char.\n-In order to encode entry e into a buffer, do:

    \n-
    \n-std::vector<char> buf;\n-bencode(std::back_inserter(buf), e);\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-
      \n-
    • register extension messages (sent in the extension handshake), see\n-extensions.
    • \n-
    • add data and parse data from the extension handshake.
    • \n-
    • send extension messages and standard bittorrent messages.
    • \n-
    • override or block the handling of standard bittorrent messages.
    • \n-
    • save and restore state via the session state
    • \n-
    • see all alerts that are posted
    • \n-
    \n-
    \n-
    \n-

    a word of caution

    \n-

    Writing your own plugin is a very easy way to introduce serious bugs such as\n-dead locks and race conditions. Since a plugin has access to internal\n-structures it is also quite easy to sabotage libtorrent's operation.

    \n-

    All the callbacks are always called from the libtorrent network thread. In\n-case portions of your plugin are called from other threads, typically the main\n-thread, you cannot use any of the member functions on the internal structures\n-in libtorrent, since those require being called from the libtorrent network\n-thread . Furthermore, you also need to synchronize your own shared data\n-within the plugin, to make sure it is not accessed at the same time from the\n-libtorrent thread (through a callback). If you need to send out a message\n-from another thread, it is advised to use an internal queue, and do the\n-actual sending in tick().

    \n-

    Since the plugin interface gives you easy access to internal structures, it\n-is not supported as a stable API. Plugins should be considered specific to a\n-specific version of libtorrent. Although, in practice the internals mostly\n-don't change that dramatically.

    \n-
    \n-
    \n-

    plugin-interface

    \n-

    The plugin interface consists of three base classes that the plugin may\n-implement. These are called plugin, torrent_plugin and peer_plugin.\n-They are found in the <libtorrent/extensions.hpp> header.

    \n-

    These plugins are instantiated for each session, torrent and possibly each peer,\n-respectively.

    \n-

    For plugins that only need per torrent state, it is enough to only implement\n-torrent_plugin and pass a constructor function or function object to\n-session::add_extension() or torrent_handle::add_extension() (if the\n-torrent has already been started and you want to hook in the extension at\n-run-time).

    \n-

    The signature of the function is:

    \n-
    \n-std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);\n-
    \n-

    The second argument is the userdata passed to session::add_torrent() or\n-torrent_handle::add_extension().

    \n-

    The function should return a std::shared_ptr<torrent_plugin> which\n-may or may not be 0. If it is a nullptr, the extension is simply ignored\n-for this torrent. If it is a valid pointer (to a class inheriting\n-torrent_plugin), it will be associated with this torrent and callbacks\n-will be made on torrent events.

    \n-

    For more elaborate plugins which require session wide state, you would\n-implement plugin, construct an object (in a std::shared_ptr) and pass\n-it in to session::add_extension().

    \n-
    \n-
    \n-

    custom alerts

    \n-

    Since plugins are running within internal libtorrent threads, one convenient\n-way to communicate with the client is to post custom alerts.

    \n-

    The expected interface of any alert, apart from deriving from the alert\n-base class, looks like this:

    \n-
    \n-static const int alert_type = <unique alert ID>;\n-virtual int type() const { return alert_type; }\n-\n-virtual std::string message() const;\n-\n-static const alert_category_t static_category = <bitmask of alert::category_t flags>;\n-virtual alert_category_t category() const { return static_category; }\n-\n-virtual char const* what() const { return <string literal of the name of this alert>; }\n-
    \n-

    The alert_type is used for the type-checking in alert_cast. It must\n-not collide with any other alert. The built-in alerts in libtorrent will\n-not use alert type IDs greater than user_alert_id. When defining your\n-own alert, make sure it's greater than this constant.

    \n-

    type() is the run-time equivalence of the alert_type.

    \n-

    The message() virtual function is expected to construct a useful\n-string representation of the alert and the event or data it represents.\n-Something convenient to put in a log file for instance.

    \n-

    clone() is used internally to copy alerts. The suggested implementation\n-of simply allocating a new instance as a copy of *this is all that's\n-expected.

    \n-

    The static category is required for checking whether or not the category\n-for a specific alert is enabled or not, without instantiating the alert.\n-The category virtual function is the run-time equivalence.

    \n-

    The what() virtual function may simply be a string literal of the class\n-name of your alert.

    \n-

    For more information, see the alert section.

    \n-[report issue]
    \n-
    \n-

    plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    this is the base class for a session plugin. One primary feature\n-is that it is notified of all torrents that are added to the session,\n-and can add its own torrent_plugins.

    \n-
    \n-struct plugin\n-{\n-   virtual feature_flags_t implemented_features ();\n-   virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n-   virtual void added (session_handle const&);\n-   virtual void abort ();\n-   virtual bool on_dht_request (string_view /* query */\n-      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n-      , entry& /* response */);\n-   virtual void on_alert (alert const*);\n-   virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n-      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n-   virtual void on_tick ();\n-   virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n-   virtual std::map<std::string, std::string> save_state () const;\n-   virtual void load_state (std::map<std::string, std::string> const&);\n-\n-   static constexpr feature_flags_t optimistic_unchoke_feature  = 1_bit;\n-   static constexpr feature_flags_t tick_feature  = 2_bit;\n-   static constexpr feature_flags_t dht_request_feature  = 3_bit;\n-   static constexpr feature_flags_t alert_feature  = 4_bit;\n-   static constexpr feature_flags_t unknown_torrent_feature  = 5_bit;\n-};\n-
    \n-[report issue]
    \n-

    implemented_features()

    \n-
    \n-virtual feature_flags_t implemented_features ();\n-
    \n-

    This function is expected to return a bitmask indicating which features\n-this plugin implements. Some callbacks on this object may not be called\n-unless the corresponding feature flag is returned here. Note that\n-callbacks may still be called even if the corresponding feature is not\n-specified in the return value here. See feature_flags_t for possible\n-flags to return.

    \n-[report issue]
    \n-
    \n-

    new_torrent()

    \n-
    \n-virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n-
    \n-

    this is called by the session every time a new torrent is added.\n-The torrent* points to the internal torrent object created\n-for the new torrent. The client_data_t is the userdata pointer as\n-passed in via add_torrent_params.

    \n-

    If the plugin returns a torrent_plugin instance, it will be added\n-to the new torrent. Otherwise, return an empty shared_ptr to a\n-torrent_plugin (the default).

    \n-[report issue]
    \n-
    \n-

    added()

    \n-
    \n-virtual void added (session_handle const&);\n-
    \n-

    called when plugin is added to a session

    \n-[report issue]
    \n-
    \n-

    abort()

    \n-
    \n-virtual void abort ();\n-
    \n-

    called when the session is aborted\n-the plugin should perform any cleanup necessary to allow the session's\n-destruction (e.g. cancel outstanding async operations)

    \n-[report issue]
    \n-
    \n-

    on_dht_request()

    \n-
    \n-virtual bool on_dht_request (string_view /* query */\n-      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n-      , entry& /* response */);\n-
    \n-

    called when a dht request is received.\n-If your plugin expects this to be called, make sure to include the flag\n-dht_request_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    on_alert()

    \n-
    \n-virtual void on_alert (alert const*);\n-
    \n-

    called when an alert is posted alerts that are filtered are not posted.\n-If your plugin expects this to be called, make sure to include the flag\n-alert_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    on_unknown_torrent()

    \n-
    \n-virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n-      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n-
    \n-

    return true if the add_torrent_params should be added

    \n-[report issue]
    \n-
    \n-

    on_tick()

    \n-
    \n-virtual void on_tick ();\n-
    \n-

    called once per second.\n-If your plugin expects this to be called, make sure to include the flag\n-tick_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    get_unchoke_priority()

    \n-
    \n-virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n-
    \n-

    called when choosing peers to optimistically unchoke. The return value\n-indicates the peer's priority for unchoking. Lower return values\n-correspond to higher priority. Priorities above 2^63-1 are reserved.\n-If your plugin has no priority to assign a peer it should return 2^64-1.\n-If your plugin expects this to be called, make sure to include the flag\n-optimistic_unchoke_feature in the return value from implemented_features().\n-If multiple plugins implement this function the lowest return value\n-(i.e. the highest priority) is used.

    \n-[report issue]
    \n-
    \n-

    load_state()

    \n-
    \n-virtual void load_state (std::map<std::string, std::string> const&);\n-
    \n-

    called on startup while loading settings state from the session_params

    \n-[report issue]
    \n-
    optimistic_unchoke_feature
    \n-
    include this bit if your plugin needs to alter the order of the\n-optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n-callback be called.
    \n-
    \n-[report issue]
    \n-
    tick_feature
    \n-
    include this bit if your plugin needs to have on_tick() called
    \n-
    \n-[report issue]
    \n-
    dht_request_feature
    \n-
    include this bit if your plugin needs to have on_dht_request()\n-called
    \n-
    \n-[report issue]
    \n-
    alert_feature
    \n-
    include this bit if your plugin needs to have on_alert()\n-called
    \n-
    \n-[report issue]
    \n-
    unknown_torrent_feature
    \n-
    include this bit if your plugin needs to have on_unknown_torrent()\n-called even if there is no active torrent in the session
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    torrent_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    Torrent plugins are associated with a single torrent and have a number\n-of functions called at certain events. Many of its functions have the\n-ability to change or override the default libtorrent behavior.

    \n-
    \n-struct torrent_plugin\n-{\n-   virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n-   virtual void on_piece_failed (piece_index_t);\n-   virtual void on_piece_pass (piece_index_t);\n-   virtual void tick ();\n-   virtual bool on_resume ();\n-   virtual bool on_pause ();\n-   virtual void on_files_checked ();\n-   virtual void on_state (torrent_status::state_t);\n-   virtual void on_add_peer (tcp::endpoint const&,\n-      peer_source_flags_t, add_peer_flags_t);\n-\n-   static constexpr add_peer_flags_t first_time  = 1_bit;\n-   static constexpr add_peer_flags_t filtered  = 2_bit;\n-};\n-
    \n-[report issue]
    \n-

    new_connection()

    \n-
    \n-virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n-
    \n-

    This function is called each time a new peer is connected to the torrent. You\n-may choose to ignore this by just returning a default constructed\n-shared_ptr (in which case you don't need to override this member\n-function).

    \n-

    If you need an extension to the peer connection (which most plugins do) you\n-are supposed to return an instance of your peer_plugin class. Which in\n-turn will have its hook functions called on event specific to that peer.

    \n-

    The peer_connection_handle will be valid as long as the shared_ptr\n-is being held by the torrent object. So, it is generally a good idea to not\n-keep a shared_ptr to your own peer_plugin. If you want to keep references\n-to it, use weak_ptr.

    \n-

    If this function throws an exception, the connection will be closed.

    \n-\n-[report issue]
    \n-
    \n-

    on_piece_pass() on_piece_failed()

    \n-
    \n-virtual void on_piece_failed (piece_index_t);\n-virtual void on_piece_pass (piece_index_t);\n-
    \n-

    These hooks are called when a piece passes the hash check or fails the hash\n-check, respectively. The index is the piece index that was downloaded.\n-It is possible to access the list of peers that participated in sending the\n-piece through the torrent and the piece_picker.

    \n-[report issue]
    \n-
    \n-

    tick()

    \n-
    \n-virtual void tick ();\n-
    \n-

    This hook is called approximately once per second. It is a way of making it\n-easy for plugins to do timed events, for sending messages or whatever.

    \n-\n-[report issue]
    \n-
    \n-

    on_resume() on_pause()

    \n-
    \n-virtual bool on_resume ();\n-virtual bool on_pause ();\n-
    \n-

    These hooks are called when the torrent is paused and resumed respectively.\n-The return value indicates if the event was handled. A return value of\n-true indicates that it was handled, and no other plugin after this one\n-will have this hook function called, and the standard handler will also not be\n-invoked. So, returning true effectively overrides the standard behavior of\n-pause or resume.

    \n-

    Note that if you call pause() or resume() on the torrent from your\n-handler it will recurse back into your handler, so in order to invoke the\n-standard handler, you have to keep your own state on whether you want standard\n-behavior or overridden behavior.

    \n-[report issue]
    \n-
    \n-

    on_files_checked()

    \n-
    \n-virtual void on_files_checked ();\n-
    \n-

    This function is called when the initial files of the torrent have been\n-checked. If there are no files to check, this function is called immediately.

    \n-

    i.e. This function is always called when the torrent is in a state where it\n-can start downloading.

    \n-[report issue]
    \n-
    \n-

    on_state()

    \n-
    \n-virtual void on_state (torrent_status::state_t);\n-
    \n-

    called when the torrent changes state\n-the state is one of torrent_status::state_t\n-enum members

    \n-[report issue]
    \n-
    \n-

    on_add_peer()

    \n-
    \n-virtual void on_add_peer (tcp::endpoint const&,\n-      peer_source_flags_t, add_peer_flags_t);\n-
    \n-

    called every time a new peer is added to the peer list.\n-This is before the peer is connected to. For flags, see\n-torrent_plugin::flags_t. The source argument refers to\n-the source where we learned about this peer from. It's a\n-bitmask, because many sources may have told us about the same\n-peer. For peer source flags, see peer_info::peer_source_flags.

    \n-[report issue]
    \n-
    first_time
    \n-
    this is the first time we see this peer
    \n-
    \n-[report issue]
    \n-
    filtered
    \n-
    this peer was not added because it was\n-filtered by the IP filter
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    peer_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    peer plugins are associated with a specific peer. A peer could be\n-both a regular bittorrent peer (bt_peer_connection) or one of the\n-web seed connections (web_peer_connection or http_seed_connection).\n-In order to only attach to certain peers, make your\n-torrent_plugin::new_connection only return a plugin for certain peer\n-connection types

    \n-
    \n-struct peer_plugin\n-{\n-   virtual string_view type () const;\n-   virtual void add_handshake (entry&);\n-   virtual void on_disconnect (error_code const&);\n-   virtual void on_connected ();\n-   virtual bool on_handshake (span<char const>);\n-   virtual bool on_extension_handshake (bdecode_node const&);\n-   virtual bool on_not_interested ();\n-   virtual bool on_have (piece_index_t);\n-   virtual bool on_choke ();\n-   virtual bool on_have_all ();\n-   virtual bool on_unchoke ();\n-   virtual bool on_interested ();\n-   virtual bool on_have_none ();\n-   virtual bool on_request (peer_request const&);\n-   virtual bool on_allowed_fast (piece_index_t);\n-   virtual bool on_dont_have (piece_index_t);\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_cancel (peer_request const&);\n-   virtual bool on_reject (peer_request const&);\n-   virtual bool on_suggest (piece_index_t);\n-   virtual void sent_suggest (piece_index_t);\n-   virtual void sent_choke ();\n-   virtual void sent_have_none ();\n-   virtual void sent_request (peer_request const&);\n-   virtual void sent_cancel (peer_request const&);\n-   virtual void sent_reject_request (peer_request const&);\n-   virtual void sent_have_all ();\n-   virtual void sent_allow_fast (piece_index_t);\n-   virtual void sent_not_interested ();\n-   virtual void sent_interested ();\n-   virtual void sent_piece (peer_request const&);\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 tick ();\n-   virtual bool write_request (peer_request const&);\n-};\n-
    \n-[report issue]
    \n-

    type()

    \n-
    \n-virtual string_view type () const;\n-
    \n-

    This function is expected to return the name of\n-the plugin.

    \n-[report issue]
    \n-
    \n-

    add_handshake()

    \n-
    \n-virtual void add_handshake (entry&);\n-
    \n-

    can add entries to the extension handshake\n-this is not called for web seeds

    \n-[report issue]
    \n-
    \n-

    on_disconnect()

    \n-
    \n-virtual void on_disconnect (error_code const&);\n-
    \n-

    called when the peer is being disconnected.

    \n-[report issue]
    \n-
    \n-

    on_connected()

    \n-
    \n-virtual void on_connected ();\n-
    \n-

    called when the peer is successfully connected. Note that\n-incoming connections will have been connected by the time\n-the peer plugin is attached to it, and won't have this hook\n-called.

    \n-[report issue]
    \n-
    \n-

    on_handshake()

    \n-
    \n-virtual bool on_handshake (span<char const>);\n-
    \n-

    this is called when the initial bittorrent handshake is received.\n-Returning false means that the other end doesn't support this extension\n-and will remove it from the list of plugins. this is not called for web\n-seeds

    \n-[report issue]
    \n-
    \n-

    on_extension_handshake()

    \n-
    \n-virtual bool on_extension_handshake (bdecode_node const&);\n-
    \n-

    called when the extension handshake from the other end is received\n-if this returns false, it means that this extension isn't\n-supported by this peer. It will result in this peer_plugin\n-being removed from the peer_connection and destructed.\n-this is not called for web seeds

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    on_have_all() on_unchoke() on_allowed_fast() on_interested() on_not_interested() on_bitfield() on_have_none() on_choke() on_request() on_have() on_dont_have()

    \n-
    \n-virtual bool on_not_interested ();\n-virtual bool on_have (piece_index_t);\n-virtual bool on_choke ();\n-virtual bool on_have_all ();\n-virtual bool on_unchoke ();\n-virtual bool on_interested ();\n-virtual bool on_have_none ();\n-virtual bool on_request (peer_request const&);\n-virtual bool on_allowed_fast (piece_index_t);\n-virtual bool on_dont_have (piece_index_t);\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-
    \n-

    on_piece()

    \n-
    \n-virtual bool on_piece (peer_request const& /*piece*/\n-      , span<char const> /*buf*/);\n-
    \n-

    This function is called when the peer connection is receiving\n-a piece. buf points (non-owning pointer) to the data in an\n-internal immutable disk buffer. The length of the data is specified\n-in the length member of the piece parameter.\n-returns true to indicate that the piece is handled and the\n-rest of the logic should be ignored.

    \n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    sent_interested() sent_not_interested() sent_unchoke() sent_have() sent_piece()

    \n-
    \n-virtual void sent_not_interested ();\n-virtual void sent_interested ();\n-virtual void sent_piece (peer_request const&);\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-
    \n-

    called after piece data has been sent to the peer\n-this can be used for stats book keeping

    \n-[report issue]
    \n-
    \n-

    can_disconnect()

    \n-
    \n-virtual bool can_disconnect (error_code const& /*ec*/);\n-
    \n-

    called when libtorrent think this peer should be disconnected.\n-if the plugin returns false, the peer will not be disconnected.

    \n-[report issue]
    \n-
    \n-

    on_extended()

    \n-
    \n-virtual bool on_extended (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-
    \n-

    called when an extended message is received. If returning true,\n-the message is not processed by any other plugin and if false\n-is returned the next plugin in the chain will receive it to\n-be able to handle it. This is not called for web seeds.\n-thus function may be called more than once per incoming message, but\n-only the last of the calls will the body size equal the length.\n-i.e. Every time another fragment of the message is received, this\n-function will be called, until finally the whole message has been\n-received. The purpose of this is to allow early disconnects for invalid\n-messages and for reporting progress of receiving large messages.

    \n-[report issue]
    \n-
    \n-

    on_unknown_message()

    \n-
    \n-virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-
    \n-

    this is not called for web seeds

    \n-\n-[report issue]
    \n-
    \n-

    on_piece_pass() on_piece_failed()

    \n-
    \n-virtual void on_piece_failed (piece_index_t);\n-virtual void on_piece_pass (piece_index_t);\n-
    \n-

    called when a piece that this peer participated in either\n-fails or passes the hash_check

    \n-[report issue]
    \n-
    \n-

    tick()

    \n-
    \n-virtual void tick ();\n-
    \n-

    called approximately once every second

    \n-[report issue]
    \n-
    \n-

    write_request()

    \n-
    \n-virtual bool write_request (peer_request const&);\n-
    \n-

    called each time a request message is to be sent. If true\n-is returned, the original request message won't be sent and\n-no other plugin will have this function called.

    \n-[report issue]
    \n-
    \n-
    \n-

    crypto_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-
    \n-struct crypto_plugin\n-{\n-   virtual void set_outgoing_key (span<char const> key) = 0;\n-   virtual void set_incoming_key (span<char const> key) = 0;\n-   encrypt (span<span<char>> /*send_vec*/) = 0;\n-   virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n-};\n-
    \n-[report issue]
    \n-

    decrypt()

    \n-
    \n-virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n-
    \n-

    decrypt the provided buffers.\n-returns is a tuple representing the values\n-(consume, produce, packet_size)

    \n-

    consume is set to the number of bytes which should be trimmed from the\n-head of the buffers, default is 0

    \n-

    produce is set to the number of bytes of payload which are now ready to\n-be sent to the upper layer. default is the number of bytes passed in receive_vec

    \n-

    packet_size is set to the minimum number of bytes which must be read to\n-advance the next step of decryption. default is 0

    \n-[report issue]
    \n+[report issue]
    \n
    \n-
    \n-

    peer_connection_handle

    \n-

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n-

    the peer_connection_handle class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions

    \n-
    \n-struct peer_connection_handle\n-{\n-   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n-   connection_type type () const;\n-   peer_plugin const* find_plugin (string_view type) const;\n-   void add_extension (std::shared_ptr<peer_plugin>);\n-   bool is_seed () const;\n-   bool upload_only () const;\n-   peer_id const& pid () const;\n-   bool has_piece (piece_index_t i) const;\n-   bool is_choked () const;\n-   bool is_interesting () const;\n-   bool is_peer_interested () const;\n-   bool has_peer_choked () const;\n-   void choke_this_peer ();\n-   void maybe_unchoke_this_peer ();\n-   void get_peer_info (peer_info& p) const;\n-   torrent_handle associated_torrent () const;\n-   tcp::endpoint const& remote () const;\n-   tcp::endpoint local_endpoint () const;\n-   bool is_outgoing () const;\n-   bool is_connecting () const;\n-   bool is_disconnecting () const;\n-   void disconnect (error_code const& ec, operation_t op\n-      , disconnect_severity_t = peer_connection_interface::normal);\n-   bool ignore_unchoke_slots () const;\n-   bool on_local_network () const;\n-   bool failed () const;\n-   void peer_log (peer_log_alert::direction_t direction\n-      , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n-   bool should_log (peer_log_alert::direction_t direction) const;\n-   bool can_disconnect (error_code const& ec) const;\n-   bool has_metadata () const;\n-   bool in_handshake () const;\n-   void send_buffer (char const* begin, int size);\n-   time_point time_of_last_unchoke () const;\n-   std::time_t last_seen_complete () const;\n-   bool operator< (peer_connection_handle const& o) const;\n-   bool operator== (peer_connection_handle const& o) const;\n-   bool operator!= (peer_connection_handle const& o) const;\n-   std::shared_ptr<peer_connection> native_handle () const;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    bt_peer_connection_handle

    \n-

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n-

    The bt_peer_connection_handle provides a handle to the internal bittorrent\n-peer connection object to plugins. It's low level and may not be a stable API\n-across libtorrent versions.

    \n+
    \n+

    generate_fingerprint()

    \n+

    Declared in "libtorrent/fingerprint.hpp"

    \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_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+std::string generate_fingerprint (std::string name\n+   , int major, int minor = 0, int revision = 0, int tag = 0);\n 
    \n-[report issue]
    \n-
    \n-

    create_ut_metadata_plugin()

    \n-

    Declared in "libtorrent/extensions/ut_metadata.hpp"

    \n+

    This is a utility function to produce a client ID fingerprint formatted to\n+the most common convention. The fingerprint can be set via the\n+peer_fingerprint setting, in settings_pack.

    \n+

    The name string should contain exactly two characters. These are the\n+characters unique to your client, used to identify it. Make sure not to\n+clash with anybody else. Here are some taken id's:

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    id charsclient
    LTlibtorrent (default)
    UTuTorrent
    UMuTorrent Mac
    qBqBittorrent
    BPBitTorrent Pro
    BTBitTorrent
    DEDeluge
    AZAzureus
    TLTribler
    \n+

    There's an informal directory of client id's here.

    \n+

    The major, minor, revision and tag parameters are used to\n+identify the version of your client.

    \n+\n+[report issue]
    \n+
    \n+

    high_performance_seed() min_memory_usage()

    \n+

    Declared in "libtorrent/session.hpp"

    \n
    \n-std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n+settings_pack high_performance_seed ();\n+settings_pack min_memory_usage ();\n 
    \n-

    constructor function for the ut_metadata extension. The ut_metadata\n-extension allows peers to request the .torrent file (or more\n-specifically the info-dictionary of the .torrent file) from each\n-other. This is the main building block in making magnet links work.\n-This extension is enabled by default unless explicitly disabled in\n-the session constructor.

    \n-

    This can either be passed in the add_torrent_params::extensions field, or\n-via torrent_handle::add_extension().

    \n-[report issue]
    \n-
    \n-

    create_smart_ban_plugin()

    \n-

    Declared in "libtorrent/extensions/smart_ban.hpp"

    \n+

    The default values of the session settings are set for a regular\n+bittorrent client running on a desktop system. There are functions that\n+can set the session settings to pre set settings for other environments.\n+These can be used for the basis, and should be tweaked to fit your needs\n+better.

    \n+

    min_memory_usage returns settings that will use the minimal amount of\n+RAM, at the potential expense of upload and download performance. It\n+adjusts the socket buffer sizes, disables the disk cache, lowers the send\n+buffer watermarks so that each connection only has at most one block in\n+use at any one time. It lowers the outstanding blocks send to the disk\n+I/O thread so that connections only have one block waiting to be flushed\n+to disk at any given time. It lowers the max number of peers in the peer\n+list for torrents. It performs multiple smaller reads when it hashes\n+pieces, instead of reading it all into memory before hashing.

    \n+

    This configuration is intended to be the starting point for embedded\n+devices. It will significantly reduce memory usage.

    \n+

    high_performance_seed returns settings optimized for a seed box,\n+serving many peers and that doesn't do any downloading. It has a 128 MB\n+disk cache and has a limit of 400 files in its file pool. It support fast\n+upload rates by allowing large send buffers.

    \n+\n+[report issue]
    \n+
    \n+

    name_for_setting() setting_by_name()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n
    \n-std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n+int setting_by_name (string_view name);\n+char const* name_for_setting (int s);\n 
    \n-

    constructor function for the smart ban extension. The extension keeps\n-track of the data peers have sent us for failing pieces and once the\n-piece completes and passes the hash check bans the peers that turned\n-out to have sent corrupt data.\n-This function can either be passed in the add_torrent_params::extensions\n-field, or via torrent_handle::add_extension().

    \n-[report issue]
    \n-
    \n-

    create_ut_pex_plugin()

    \n-

    Declared in "libtorrent/extensions/ut_pex.hpp"

    \n+

    converts a setting integer (from the enums string_types, int_types or\n+bool_types) to a string, and vice versa.

    \n+[report issue]
    \n+
    \n+

    default_settings()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n
    \n-std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);\n+settings_pack default_settings ();\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+

    returns a settings_pack with every setting set to its default value

    \n [report issue]
    \n
    \n

    ip_filter

    \n

    Declared in "libtorrent/ip_filter.hpp"

    \n

    The ip_filter class is a set of rules that uniquely categorizes all\n ip addresses as allowed or disallowed. The default constructor creates\n a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n the IPv4 range, and the equivalent range covering all addresses for the\n IPv6 range).

    \n

    A default constructed ip_filter does not filter any address.

    \n
    \n struct ip_filter\n {\n-   ip_filter& operator= (ip_filter&&);\n+   ip_filter ();\n+   ip_filter (ip_filter const&);\n    ~ip_filter ();\n    ip_filter& operator= (ip_filter const&);\n    ip_filter (ip_filter&&);\n-   ip_filter (ip_filter const&);\n-   ip_filter ();\n+   ip_filter& operator= (ip_filter&&);\n    bool empty () const;\n    void add_rule (address const& first, address const& last, std::uint32_t flags);\n    std::uint32_t access (address const& addr) const;\n    filter_tuple_t export_filter () const;\n \n    enum access_flags\n    {\n@@ -16866,20 +19970,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&&);\n+   port_filter& operator= (port_filter const&);\n    ~port_filter ();\n-   port_filter (port_filter&&);\n-   port_filter (port_filter const&);\n+   port_filter& operator= (port_filter&&);\n    port_filter ();\n-   port_filter& operator= (port_filter const&);\n+   port_filter (port_filter const&);\n+   port_filter (port_filter&&);\n    void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n    std::uint32_t access (std::uint16_t port) const;\n \n    enum access_flags\n    {\n       blocked,\n    };\n@@ -16922,3120 +20026,16 @@\n blocked\n 1\n this flag indicates that destination ports in the\n range should not be connected to\n \n \n \n-[report issue]
    \n-
    \n-
    \n-

    bdecode_node

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-

    Sometimes it's important to get a non-owning reference to the root node (\n-to be able to copy it as a reference for instance). For that, use the\n-non_owning() member function.

    \n-

    There are 5 different types of nodes, see type_t.

    \n-
    \n-struct bdecode_node\n-{\n-   bdecode_node () = default;\n-   bdecode_node (bdecode_node&&) noexcept;\n-   bdecode_node& operator= (bdecode_node const&) &;\n-   bdecode_node (bdecode_node const&);\n-   bdecode_node& operator= (bdecode_node&&) & = default;\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-   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-   int list_size () 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-   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-   int dict_size () const;\n-   bdecode_node dict_find_int (string_view key) const;\n-   bdecode_node dict_find_dict (string_view key) const;\n-   std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-   bdecode_node dict_find_string (string_view key) const;\n-   bdecode_node dict_find (string_view key) const;\n-   std::int64_t int_value () const;\n-   std::ptrdiff_t string_offset () const;\n-   char const* string_ptr () const;\n-   int string_length () 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-

    operator=() bdecode_node()

    \n-
    \n-bdecode_node (bdecode_node&&) noexcept;\n-bdecode_node& operator= (bdecode_node const&) &;\n-bdecode_node (bdecode_node const&);\n-bdecode_node& operator= (bdecode_node&&) & = default;\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_offset() data_section()

    \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_string_value_at() list_size() list_int_value_at() list_at()

    \n-
    \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-int list_size () const;\n-
    \n-

    functions with the list_ prefix operate on lists. These functions are\n-only valid if type() == list_t. list_at() returns the item\n-in the list at index i. i may not be greater than or equal to the\n-size of the list. size() returns the size of the list.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    dict_find_string_value() dict_at() dict_find_int() dict_find() dict_at_node() dict_find_string() dict_find_list() dict_find_dict() dict_size() dict_find_int_value()

    \n-
    \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-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-int dict_size () const;\n-bdecode_node dict_find_int (string_view key) const;\n-bdecode_node dict_find_dict (string_view key) const;\n-std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-bdecode_node dict_find_string (string_view key) const;\n-bdecode_node dict_find (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_value() string_ptr() string_offset() string_length()

    \n-
    \n-std::ptrdiff_t string_offset () const;\n-char const* string_ptr () const;\n-int string_length () 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-[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 storage_params\n-{\n-   storage_params (file_storage const& f, file_storage const* mf\n-      , std::string const& sp, storage_mode_t const sm\n-      , aux::vector<download_priority_t, file_index_t> const& prio\n-      , sha1_hash const& ih);\n-\n-   file_storage const& files;\n-   file_storage const* mapped_files  = nullptr;\n-   std::string const& path;\n-   storage_mode_t mode {storage_mode_sparse};\n-   aux::vector<download_priority_t, file_index_t> const& priorities;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    file_slice

    \n-

    Declared in "libtorrent/file_storage.hpp"

    \n-

    represents a window of a file in a torrent.

    \n-

    The file_index refers to the index of the file (in the torrent_info).\n-To get the path and filename, use file_path() and give the file_index\n-as argument. The offset is the byte offset in the file where the range\n-starts, and size is the number of bytes this range is. The size + offset\n-will never be greater than the file size.

    \n-
    \n-struct file_slice\n-{\n-   file_index_t file_index;\n-   std::int64_t offset;\n-   std::int64_t size;\n-};\n-
    \n-[report issue]
    \n-
    file_index
    \n-
    the index of the file
    \n-
    \n-[report issue]
    \n-
    offset
    \n-
    the offset from the start of the file, in bytes
    \n-
    \n-[report issue]
    \n-
    size
    \n-
    the size of the window, in bytes
    \n-
    \n-[report issue]
    \n-
    \n-

    file_storage

    \n-

    Declared in "libtorrent/file_storage.hpp"

    \n-

    The file_storage class represents a file list and the piece\n-size. Everything necessary to interpret a regular bittorrent storage\n-file structure.

    \n-
    \n-class file_storage\n-{\n-   bool is_valid () const;\n-   void reserve (int num_files);\n-   void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file (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 (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-   std::string const& name () const;\n-   void set_name (std::string const& n);\n-   void swap (file_storage& ti) noexcept;\n-   void canonicalize ();\n-   sha256_hash root (file_index_t index) 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_size (file_index_t index) const;\n-   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n-   std::string symlink (file_index_t index) const;\n-   sha1_hash hash (file_index_t index) const;\n-   std::time_t mtime (file_index_t index) const;\n-   char const* root_ptr (file_index_t const index) const;\n-   std::int64_t file_offset (file_index_t index) const;\n-   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_block_node (file_index_t index) const;\n-   int file_first_piece_node (file_index_t index) const;\n-   std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n-   void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n-   file_flags_t file_flags (file_index_t index) const;\n-   bool file_absolute_path (file_index_t index) const;\n-   file_index_t file_index_at_piece (piece_index_t piece) const;\n-   file_index_t file_index_at_offset (std::int64_t offset) const;\n-   file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n-   piece_index_t piece_index_at_file (file_index_t f) const;\n-   void sanitize_symlinks ();\n-   bool v2 () const;\n-\n-   static constexpr file_flags_t flag_pad_file  = 0_bit;\n-   static constexpr file_flags_t flag_hidden  = 1_bit;\n-   static constexpr file_flags_t flag_executable  = 2_bit;\n-   static constexpr file_flags_t flag_symlink  = 3_bit;\n-};\n-
    \n-[report issue]
    \n-

    is_valid()

    \n-
    \n-bool is_valid () const;\n-
    \n-

    returns true if the piece length has been initialized\n-on the file_storage. This is typically taken as a proxy\n-of whether the file_storage as a whole is initialized or\n-not.

    \n-[report issue]
    \n-
    \n-

    reserve()

    \n-
    \n-void reserve (int num_files);\n-
    \n-

    allocates space for num_files in the internal file list. This can\n-be used to avoid reallocating the internal file list when the number\n-of files to be added is known up-front.

    \n-\n-[report issue]
    \n-
    \n-

    add_file() add_file_borrow()

    \n-
    \n-void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-void add_file (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 (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-

    Adds a file to the file storage. The add_file_borrow version\n-expects that filename is the file name (without a path) of\n-the file that's being added.\n-This memory is borrowed, i.e. it is the caller's\n-responsibility to make sure it stays valid throughout the lifetime\n-of this file_storage object or any copy of it. The same thing applies\n-to filehash, which is an optional pointer to a 20 byte binary\n-SHA-1 hash of the file.

    \n-

    if filename is empty, the filename from path is used and not\n-borrowed.

    \n-

    The path argument is the full path (in the torrent file) to\n-the file to add. Note that this is not supposed to be an absolute\n-path, but it is expected to include the name of the torrent as the\n-first path element.

    \n-

    file_size is the size of the file in bytes.

    \n-

    The file_flags argument sets attributes on the file. The file\n-attributes is an extension and may not work in all bittorrent clients.

    \n-

    For possible file attributes, see file_storage::flags_t.

    \n-

    The mtime argument is optional and can be set to 0. If non-zero,\n-it is the posix time of the last modification time of this file.

    \n-

    symlink_path is the path the file is a symlink to. To make this a\n-symlink you also need to set the file_storage::flag_symlink file flag.

    \n-

    root_hash is an optional pointer to a 32 byte SHA-256 hash, being\n-the merkle tree root hash for this file. This is only used for v2\n-torrents. If the root hash is specified for one file, it has to\n-be specified for all, otherwise this function will fail.\n-Note that the buffer root_hash points to must out-live the\n-file_storage object, it will not be copied. This parameter is only\n-used when loading torrents, that already have their file hashes\n-computed. When creating torrents, the file hashes will be computed by\n-the piece hashes.

    \n-

    If more files than one are added, certain restrictions to their paths\n-apply. In a multi-file file storage (torrent), all files must share\n-the same root directory.

    \n-

    That is, the first path element of all files must be the same.\n-This shared path element is also set to the name of the torrent. It\n-can be changed by calling set_name.

    \n-

    The overloads that take an error_code reference will report failures\n-via that variable, otherwise system_error is thrown.

    \n-[report issue]
    \n-
    \n-

    rename_file()

    \n-
    \n-void rename_file (file_index_t index, std::string const& new_filename);\n-
    \n-

    renames the file at index to new_filename. Keep in mind\n-that filenames are expected to be UTF-8 encoded.

    \n-[report issue]
    \n-
    \n-

    map_block()

    \n-
    \n-std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n-      , std::int64_t size) const;\n-
    \n-

    returns a list of file_slice objects representing the portions of\n-files the specified piece index, byte offset and size range overlaps.\n-this is the inverse mapping of map_file().

    \n-

    Preconditions of this function is that the input range is within the\n-torrents address space. piece may not be negative and

    \n-
    \n-piece * piece_size + offset + size
    \n-

    may not exceed the total size of the torrent.

    \n-[report issue]
    \n-
    \n-

    map_file()

    \n-
    \n-peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n-
    \n-

    returns a peer_request representing the piece index, byte offset\n-and size the specified file range overlaps. This is the inverse\n-mapping over map_block(). Note that the peer_request return type\n-is meant to hold bittorrent block requests, which may not be larger\n-than 16 kiB. Mapping a range larger than that may return an overflown\n-integer.

    \n-[report issue]
    \n-
    \n-

    num_files()

    \n-
    \n-int num_files () const noexcept;\n-
    \n-

    returns the number of files in the file_storage

    \n-[report issue]
    \n-
    \n-

    end_file()

    \n-
    \n-file_index_t end_file () const noexcept;\n-
    \n-

    returns the index of the one-past-end file in the file storage

    \n-[report issue]
    \n-
    \n-

    file_range()

    \n-
    \n-index_range<file_index_t> file_range () const noexcept;\n-
    \n-

    returns an implementation-defined type that can be used as the\n-container in a range-for loop. Where the values are the indices of all\n-files in the file_storage.

    \n-[report issue]
    \n-
    \n-

    total_size()

    \n-
    \n-std::int64_t total_size () const;\n-
    \n-

    returns the total number of bytes all the files in this torrent spans

    \n-\n-[report issue]
    \n-
    \n-

    set_num_pieces() num_pieces()

    \n-
    \n-void set_num_pieces (int n);\n-int num_pieces () const;\n-
    \n-

    set and get the number of pieces in the torrent

    \n-[report issue]
    \n-
    \n-

    end_piece()

    \n-
    \n-piece_index_t end_piece () const;\n-
    \n-

    returns the index of the one-past-end piece in the file storage

    \n-[report issue]
    \n-
    \n-

    last_piece()

    \n-
    \n-piece_index_t last_piece () const;\n-
    \n-

    returns the index of the last piece in the torrent. The last piece is\n-special in that it may be smaller than the other pieces (and the other\n-pieces are all the same size).

    \n-[report issue]
    \n-
    \n-

    piece_range()

    \n-
    \n-index_range<piece_index_t> piece_range () const noexcept;\n-
    \n-

    returns an implementation-defined type that can be used as the\n-container in a range-for loop. Where the values are the indices of all\n-pieces in the file_storage.

    \n-\n-[report issue]
    \n-
    \n-

    set_piece_length() piece_length()

    \n-
    \n-void set_piece_length (int l);\n-int piece_length () const;\n-
    \n-

    set and get the size of each piece in this torrent. It must be a power of two\n-and at least 16 kiB.

    \n-[report issue]
    \n-
    \n-

    piece_size()

    \n-
    \n-int piece_size (piece_index_t index) const;\n-
    \n-

    returns the piece size of index. This will be the same as piece_length(), except\n-for the last piece, which may be shorter.

    \n-[report issue]
    \n-
    \n-

    piece_size2()

    \n-
    \n-int piece_size2 (piece_index_t index) const;\n-
    \n-

    Returns the size of the given piece. If the piece spans multiple files,\n-only the first file is considered part of the piece. This is used for\n-v2 torrents, where all files are piece aligned and padded. i.e. The pad\n-files are not considered part of the piece for this purpose.

    \n-[report issue]
    \n-
    \n-

    blocks_in_piece2()

    \n-
    \n-int blocks_in_piece2 (piece_index_t index) const;\n-
    \n-

    returns the number of blocks in the specified piece, for v2 torrents.

    \n-[report issue]
    \n-
    \n-

    blocks_per_piece()

    \n-
    \n-int blocks_per_piece () const;\n-
    \n-

    returns the number of blocks there are in the typical piece. There\n-may be fewer in the last piece)

    \n-\n-[report issue]
    \n-
    \n-

    name() set_name()

    \n-
    \n-std::string const& name () const;\n-void set_name (std::string const& n);\n-
    \n-

    set and get the name of this torrent. For multi-file torrents, this is also\n-the name of the root directory all the files are stored in.

    \n-[report issue]
    \n-
    \n-

    swap()

    \n-
    \n-void swap (file_storage& ti) noexcept;\n-
    \n-

    swap all content of this with ti.

    \n-[report issue]
    \n-
    \n-

    canonicalize()

    \n-
    \n-void canonicalize ();\n-
    \n-

    arrange files and padding to match the canonical form required\n-by BEP 52

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
    \n-\n-
    \n-

    file_piece_range() file_num_pieces() file_num_blocks()

    \n-
    \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_piece_node() file_first_block_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-
    \n-

    index of first piece node in the merkle tree

    \n-[report issue]
    \n-
    \n-

    file_path_hash()

    \n-
    \n-std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n-
    \n-

    returns the crc32 hash of file_path(index)

    \n-[report issue]
    \n-
    \n-

    all_path_hashes()

    \n-
    \n-void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n-
    \n-

    this will add the CRC32 hash of all directory entries to the table. No\n-filename will be included, just directories. Every depth of directories\n-are added separately to allow test for collisions with files at all\n-levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32\n-hashes for foo, foo/bar and foo/bar/baz will be added to\n-the set.

    \n-[report issue]
    \n-
    \n-

    file_flags()

    \n-
    \n-file_flags_t file_flags (file_index_t index) const;\n-
    \n-

    returns a bitmask of flags from file_flags_t that apply\n-to file at index.

    \n-[report issue]
    \n-
    \n-

    file_absolute_path()

    \n-
    \n-bool file_absolute_path (file_index_t index) const;\n-
    \n-

    returns true if the file at the specified index has been renamed to\n-have an absolute path, i.e. is not anchored in the save path of the\n-torrent.

    \n-\n-[report issue]
    \n-
    \n-

    file_index_at_piece() file_index_at_offset()

    \n-
    \n-file_index_t file_index_at_piece (piece_index_t piece) const;\n-file_index_t file_index_at_offset (std::int64_t offset) const;\n-
    \n-

    returns the index of the file at the given offset in the torrent

    \n-[report issue]
    \n-
    \n-

    file_index_for_root()

    \n-
    \n-file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n-
    \n-

    finds the file with the given root hash and returns its index\n-if there is no file with the root hash, file_index_t{-1} is returned

    \n-[report issue]
    \n-
    \n-

    piece_index_at_file()

    \n-
    \n-piece_index_t piece_index_at_file (file_index_t f) const;\n-
    \n-

    returns the piece index the given file starts at

    \n-[report issue]
    \n-
    \n-

    sanitize_symlinks()

    \n-
    \n-void sanitize_symlinks ();\n-
    \n-

    validate any symlinks, to ensure they all point to\n-other files or directories inside this storage. Any invalid symlinks\n-are updated to point to themselves.

    \n-[report issue]
    \n-
    \n-

    v2()

    \n-
    \n-bool v2 () const;\n-
    \n-

    returns true if this torrent contains v2 metadata.

    \n-[report issue]
    \n-
    flag_pad_file
    \n-
    the file is a pad file. It's required to contain zeros\n-at it will not be saved to disk. Its purpose is to make\n-the following file start on a piece boundary.
    \n-
    \n-[report issue]
    \n-
    flag_hidden
    \n-
    this file has the hidden attribute set. This is primarily\n-a windows attribute
    \n-
    \n-[report issue]
    \n-
    flag_executable
    \n-
    this file has the executable attribute set.
    \n-
    \n-[report issue]
    \n-
    flag_symlink
    \n-
    this file is a symbolic link. It should have a link\n-target string associated with it.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    default_disk_io_constructor()

    \n-

    Declared in "libtorrent/session.hpp"

    \n-
    \n-std::unique_ptr<disk_interface> default_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
    \n-

    the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage\n-will be constructed, otherwise the portable posix storage.

    \n-[report issue]
    \n-
    \n-

    posix_disk_io_constructor()

    \n-

    Declared in "libtorrent/posix_disk_io.hpp"

    \n-
    \n-std::unique_ptr<disk_interface> posix_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
    \n-

    this is a simple posix disk I/O back-end, used for systems that don't\n-have a 64 bit virtual address space or don't support memory mapped files.\n-It's implemented using portable C file functions and is single-threaded.

    \n-[report issue]
    \n-
    \n-

    mmap_disk_io_constructor()

    \n-

    Declared in "libtorrent/mmap_disk_io.hpp"

    \n-
    \n-std::unique_ptr<disk_interface> mmap_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
    \n-

    constructs a memory mapped file disk I/O object.

    \n-[report issue]
    \n-
    \n-

    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-

    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-

    announce_infohash

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-
    \n-struct announce_infohash\n-{\n-   std::string message;\n-   error_code last_error;\n-   int scrape_incomplete  = -1;\n-   int scrape_complete  = -1;\n-   int scrape_downloaded  = -1;\n-   std::uint8_t fails : 7;\n-   bool updating : 1;\n-   bool start_sent : 1;\n-   bool complete_sent : 1;\n-};\n-
    \n-[report issue]
    \n-
    message
    \n-
    if this tracker has returned an error or warning message\n-that message is stored here
    \n-
    \n-[report issue]
    \n-
    last_error
    \n-
    if this tracker failed the last time it was contacted\n-this error code specifies what error occurred
    \n-
    \n-\n-\n-[report issue]
    \n-
    scrape_incomplete scrape_complete scrape_downloaded
    \n-
    if this tracker has returned scrape data, these fields are filled in\n-with valid numbers. Otherwise they are set to -1. incomplete counts\n-the number of current downloaders. complete counts the number of\n-current peers completed the download, or "seeds". downloaded is the\n-cumulative number of completed downloads.
    \n-
    \n-[report issue]
    \n-
    fails
    \n-
    the number of times in a row we have failed to announce to this\n-tracker.
    \n-
    \n-[report issue]
    \n-
    updating
    \n-
    true while we're waiting for a response from the tracker.
    \n-
    \n-[report issue]
    \n-
    start_sent
    \n-
    set to true when we get a valid response from an announce\n-with event=started. If it is set, we won't send start in the subsequent\n-announces.
    \n-
    \n-[report issue]
    \n-
    complete_sent
    \n-
    set to true when we send a event=completed.
    \n-
    \n-[report issue]
    \n-
    \n-

    announce_endpoint

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-

    announces are sent to each tracker using every listen socket\n-this class holds information about one listen socket for one tracker

    \n-
    \n-struct announce_endpoint\n-{\n-   announce_endpoint ();\n-\n-   tcp::endpoint local_endpoint;\n-   aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n-   bool enabled  = true;\n-};\n-
    \n-[report issue]
    \n-
    local_endpoint
    \n-
    the local endpoint of the listen interface associated with this endpoint
    \n-
    \n-[report issue]
    \n-
    info_hashes
    \n-
    info_hashes[0] is the v1 info hash (SHA1)\n-info_hashes[1] is the v2 info hash (truncated SHA-256)
    \n-
    \n-[report issue]
    \n-
    enabled
    \n-
    set to false to not announce from this endpoint
    \n-
    \n-[report issue]
    \n-
    \n-

    announce_entry

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-

    this class holds information about one bittorrent tracker, as it\n-relates to a specific torrent.

    \n-
    \n-struct announce_entry\n-{\n-   announce_entry& operator= (announce_entry const&) &;\n-   explicit announce_entry (string_view u);\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-   };\n-\n-   std::string url;\n-   std::string trackerid;\n-   std::vector<announce_endpoint> endpoints;\n-   std::uint8_t tier  = 0;\n-   std::uint8_t fail_limit  = 0;\n-   std::uint8_t source:4;\n-   bool verified:1;\n-};\n-
    \n-\n-\n-[report issue]
    \n-

    operator=() announce_entry() ~announce_entry()

    \n-
    \n-announce_entry& operator= (announce_entry const&) &;\n-explicit announce_entry (string_view u);\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-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    source_torrent1the tracker was part of the .torrent file
    source_client2the tracker was added programmatically via the add_tracker() function
    source_magnet_link4the tracker was part of a magnet link
    source_tex8the tracker was received from the swarm via tracker exchange
    \n-[report issue]
    \n-
    url
    \n-
    tracker URL as it appeared in the torrent file
    \n-
    \n-[report issue]
    \n-
    trackerid
    \n-
    the current &trackerid= argument passed to the tracker.\n-this is optional and is normally empty (in which case no\n-trackerid is sent).
    \n-
    \n-[report issue]
    \n-
    endpoints
    \n-
    each local listen socket (endpoint) will announce to the tracker. This\n-list contains state per endpoint.
    \n-
    \n-[report issue]
    \n-
    tier
    \n-
    the tier this tracker belongs to
    \n-
    \n-[report issue]
    \n-
    fail_limit
    \n-
    the max number of failures to announce to this tracker in\n-a row, before this tracker is not used anymore. 0 means unlimited
    \n-
    \n-[report issue]
    \n-
    source
    \n-
    a bitmask specifying which sources we got this tracker from.
    \n-
    \n-[report issue]
    \n-
    verified
    \n-
    set to true the first time we receive a valid response\n-from this tracker.
    \n-
    \n-

    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-
    \n-
    \n-

    create_torrent

    \n-

    Declared in "libtorrent/create_torrent.hpp"

    \n-

    This class holds state for creating a torrent. After having added\n-all information to it, call create_torrent::generate() to generate\n-the torrent. The entry that's returned can then be bencoded into a\n-.torrent file using bencode().

    \n-
    \n-struct create_torrent\n-{\n-   explicit create_torrent (torrent_info const& ti);\n-   explicit create_torrent (file_storage& fs, int piece_size = 0\n-      , create_flags_t flags = {});\n-   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_size (piece_index_t i) const;\n-   int piece_length () const;\n-   void add_similar_torrent (sha1_hash ih);\n-   void add_collection (string_view c);\n-\n-   static constexpr create_flags_t modification_time  = 2_bit;\n-   static constexpr create_flags_t symlinks  = 3_bit;\n-   static constexpr create_flags_t v2_only  = 5_bit;\n-   static constexpr create_flags_t v1_only  = 6_bit;\n-   static constexpr create_flags_t canonical_files  = 7_bit;\n-   static constexpr create_flags_t no_attributes  = 8_bit;\n-   static constexpr create_flags_t canonical_files_no_tail_padding  = 9_bit;\n-};\n-
    \n-[report issue]
    \n-

    create_torrent()

    \n-
    \n-explicit create_torrent (torrent_info const& ti);\n-explicit create_torrent (file_storage& fs, int piece_size = 0\n-      , create_flags_t flags = {});\n-
    \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-

    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-entry generate () const;\n-std::vector<char> generate_buf () const;\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-
    \n-file_storage const& files () const;\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-
    \n-void set_comment (char const* str);\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-
    \n-void set_creator (char const* str);\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-
    \n-void set_creation_date (std::time_t timestamp);\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-
    \n-void set_hash (piece_index_t index, sha1_hash const& h);\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-
    \n-void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\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-
    \n-void add_http_seed (string_view url);\n-void add_url_seed (string_view url);\n-
    \n-

    This adds a url seed to the torrent. You can have any number of url seeds. For a\n-single file torrent, this should be an HTTP url, pointing to a file with identical\n-content as the file of the torrent. For a multi-file torrent, it should point to\n-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-void add_node (std::pair<std::string, int> node);\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-
    \n-void add_tracker (string_view url, int tier = 0);\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-
    \n-void set_root_cert (string_view cert);\n-
    \n-

    This function sets an X.509 certificate in PEM format to the torrent. This makes the\n-torrent an SSL torrent. An SSL torrent requires that each peer has a valid certificate\n-signed by this root certificate. For SSL torrents, all peers are connecting over SSL\n-connections. For more information, see the section on ssl torrents.

    \n-

    The string is not the path to the cert, it's the actual content of the\n-certificate.

    \n-\n-[report issue]
    \n-
    \n-

    priv() set_priv()

    \n-
    \n-void set_priv (bool p);\n-bool priv () const;\n-
    \n-

    Sets and queries the private flag of the torrent.\n-Torrents with the private flag set ask the client to not use any other\n-sources than the tracker for peers, and to not use DHT to advertise itself publicly,\n-only the tracker.

    \n-[report issue]
    \n-
    \n-

    num_pieces()

    \n-
    \n-int num_pieces () const;\n-
    \n-

    returns the number of pieces in the associated file_storage object.

    \n-[report issue]
    \n-
    \n-

    piece_range()

    \n-
    \n-index_range<piece_index_t> piece_range () const noexcept;\n-
    \n-

    all piece indices in the torrent to be created

    \n-[report issue]
    \n-
    \n-

    file_range()

    \n-
    \n-index_range<file_index_t> file_range () const noexcept;\n-
    \n-

    all file indices in the torrent to be created

    \n-[report issue]
    \n-
    \n-

    file_piece_range()

    \n-
    \n-index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n-
    \n-

    for v2 and hybrid torrents only, the pieces in the\n-specified file, specified as delta from the first piece in the file.\n-i.e. the first index is 0.

    \n-[report issue]
    \n-
    \n-

    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-int piece_size (piece_index_t i) const;\n-int piece_length () const;\n-
    \n-

    piece_length() returns the piece size of all pieces but the\n-last one. piece_size() returns the size of the specified piece.\n-these functions are just forwarding to the associated file_storage.

    \n-\n-[report issue]
    \n-
    \n-

    add_similar_torrent() add_collection()

    \n-
    \n-void add_similar_torrent (sha1_hash ih);\n-void add_collection (string_view c);\n-
    \n-

    Add similar torrents (by info-hash) or collections of similar torrents.\n-Similar torrents are expected to share some files with this torrent.\n-Torrents sharing a collection name with this torrent are also expected\n-to share files with this torrent. A torrent may have more than one\n-collection and more than one similar torrents. For more information,\n-see BEP 38.

    \n-[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-
    \n-
    \n-

    add_files()

    \n-

    Declared in "libtorrent/create_torrent.hpp"

    \n-
    \n-void add_files (file_storage& fs, std::string const& file\n-   , create_flags_t flags = {});\n-void add_files (file_storage& fs, std::string const& file\n-   , std::function<bool(std::string)> p, create_flags_t flags = {});\n-
    \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-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-void set_piece_hashes (create_torrent& t, std::string const& p\n-   , std::function<void(piece_index_t)> const& f, error_code& ec);\n-void set_piece_hashes (create_torrent& t, std::string const& p\n-   , settings_interface const& settings\n-   , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n-   , 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-
    \n-

    This function will assume that the files added to the torrent file exists at path\n-p, read those files and hash the content and set the hashes in the create_torrent\n-object. The optional function f is called in between every hash that is set. f\n-must have the following signature:

    \n-
    \n-void Fun(piece_index_t);\n-
    \n-

    The overloads taking a settings_pack may be used to configure the\n-underlying disk access. Such as settings_pack::aio_threads.

    \n-

    The overloads that don't take an error_code& may throw an exception in case of a\n-file error, the other overloads sets the error code to reflect the error, if any.

    \n-[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-

    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-
    \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-[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-
    \n-[report issue]
    \n-
    requested
    \n-
    the number of blocks that are in the requested state
    \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-
    \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-
    \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-   std::vector<partial_piece_info> get_download_queue () 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-   void clear_piece_deadlines () const;\n-   std::vector<std::int64_t> 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 replace_trackers (std::vector<announce_entry> const&) const;\n-   std::vector<announce_entry> trackers () const;\n-   void add_tracker (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 add_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 set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n-   torrent_flags_t flags () const;\n-   void unset_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 () const;\n-   bool need_save_resume_data (resume_data_flags_t flags) const;\n-   void queue_position_bottom () const;\n-   void queue_position_up () const;\n-   void queue_position_top () const;\n-   queue_position_t queue_position () const;\n-   void queue_position_down () 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-   download_priority_t piece_priority (piece_index_t index) 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-   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 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 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-   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-   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-[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 post_peer_info () const;\n-void get_peer_info (std::vector<peer_info>& v) const;\n-
    \n-

    Query information about connected peers for this torrent. If the\n-torrent_handle is invalid, it will throw a system_error exception.

    \n-

    post_peer_info() is asynchronous and will trigger the posting of\n-a peer_info_alert. The alert contain a list of peer_info objects, one\n-for each connected peer.

    \n-

    get_peer_info() is synchronous and takes a reference to a vector\n-that will be cleared and filled with one entry for each peer\n-connected to this torrent, given the handle is valid. Each entry in\n-the vector contains information about that particular peer. See\n-peer_info.

    \n-\n-[report issue]
    \n-
    \n-

    post_status() status()

    \n-
    \n-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-void get_download_queue (std::vector<partial_piece_info>& queue) const;\n-void post_download_queue () const;\n-std::vector<partial_piece_info> get_download_queue () const;\n-
    \n-

    post_download_queue() triggers a download_queue_alert to be\n-posted.\n-get_download_queue() is a synchronous call and returns a vector\n-with information about pieces that are partially downloaded or not\n-downloaded but partially requested. See partial_piece_info for the\n-fields in the returned vector.

    \n-\n-\n-[report issue]
    \n-
    \n-

    reset_piece_deadline() clear_piece_deadlines() set_piece_deadline()

    \n-
    \n-void reset_piece_deadline (piece_index_t index) const;\n-void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n-void clear_piece_deadlines () const;\n-
    \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-

    post_file_progress() file_progress()

    \n-
    \n-std::vector<std::int64_t> 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-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-

    trackers() post_trackers() add_tracker() replace_trackers()

    \n-
    \n-void post_trackers () const;\n-void replace_trackers (std::vector<announce_entry> const&) const;\n-std::vector<announce_entry> trackers () const;\n-void add_tracker (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-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() remove_url_seed() url_seeds()

    \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-
    \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-
    \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-
    \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-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-

    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-bool set_metadata (span<char const> metadata) const;\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-
    \n-bool is_valid () const;\n-
    \n-

    Returns true if this handle refers to a valid torrent and false if it\n-hasn't been initialized or if the torrent it refers to has been\n-removed from the session AND destructed.

    \n-

    To tell if the torrent_handle is in the session, use\n-torrent_handle::in_session(). This will return true before\n-session_handle::remove_torrent() is called, and false\n-afterward.

    \n-

    Clients should only use is_valid() to determine if the result of\n-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-

    pause() resume()

    \n-
    \n-void resume () const;\n-void pause (pause_flags_t flags = {}) const;\n-
    \n-

    pause(), and resume() will disconnect all peers and reconnect\n-all peers respectively. When a torrent is paused, it will however\n-remember all share ratios to all peers and remember all potential (not\n-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-

    flags() unset_flags() set_flags()

    \n-
    \n-void set_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 unset_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-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-void flush_cache () const;\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-
    \n-void force_recheck () const;\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-
    \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-
    \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-bool need_save_resume_data () const;\n-bool need_save_resume_data (resume_data_flags_t flags) 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_top() queue_position() queue_position_up() queue_position_bottom() queue_position_down()

    \n-
    \n-void queue_position_bottom () const;\n-void queue_position_up () const;\n-void queue_position_top () const;\n-queue_position_t queue_position () 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-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-void queue_position_set (queue_position_t p) const;\n-
    \n-

    updates the position in the queue for this torrent. The relative order\n-of all other torrents remain intact but their numerical queue position\n-shifts to make space for this torrent's new position

    \n-\n-[report issue]
    \n-
    \n-

    set_ssl_certificate() set_ssl_certificate_buffer()

    \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-
    \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-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-

    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-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-

    post_piece_availability() piece_availability()

    \n-
    \n-void piece_availability (std::vector<int>& avail) const;\n-void post_piece_availability () const;\n-
    \n-

    The piece availability is the number of peers that we are connected\n-that has advertised having a particular piece. This is the information\n-that libtorrent uses in order to prefer picking rare pieces.

    \n-

    post_piece_availability() will trigger a piece_availability_alert\n-to be posted.

    \n-

    piece_availability() fills the specified std::vector<int>\n-with the availability for each piece in this torrent. libtorrent does\n-not keep track of availability for seeds, so if the torrent is\n-seeding the availability for all pieces is reported as 0.

    \n-\n-\n-[report issue]
    \n-
    \n-

    get_piece_priorities() piece_priority() prioritize_pieces()

    \n-
    \n-download_priority_t piece_priority (piece_index_t index) 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-void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n-
    \n-

    These functions are used to set and get the priority of individual\n-pieces. By default all pieces have priority 4. That means that the\n-random rarest first algorithm is effectively active for all pieces.\n-You may however change the priority of individual pieces. There are 8\n-priority levels. 0 means not to download the piece at all. Otherwise,\n-lower priority values means less likely to be picked. Piece priority\n-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-

    get_file_priorities() prioritize_files() file_priority()

    \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-
    \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-
    \n-void force_dht_announce () const;\n-void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n-void force_lsd_announce () const;\n-
    \n-

    force_reannounce() will force this torrent to do another tracker\n-request, to receive new peers. The seconds argument specifies how\n-many seconds from now to issue the tracker announces.

    \n-

    If the tracker's min_interval has not passed since the last\n-announce, the forced announce will be scheduled to happen immediately\n-as the min_interval expires. This is to honor trackers minimum\n-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-void scrape_tracker (int idx = -1) const;\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() download_limit() set_download_limit() upload_limit()

    \n-
    \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-

    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-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-

    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-void clear_peers ();\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-

    set_max_uploads() max_uploads()

    \n-
    \n-void set_max_uploads (int max_uploads) const;\n-int max_uploads () const;\n-
    \n-

    set_max_uploads() sets the maximum number of peers that's unchoked\n-at the same time on this torrent. If you set this to -1, there will be\n-no limit. This defaults to infinite. The primary setting controlling\n-this is the global unchoke slots limit, set by unchoke_slots_limit in\n-settings_pack.

    \n-

    max_uploads() returns the current settings.

    \n-\n-[report issue]
    \n-
    \n-

    set_max_connections() max_connections()

    \n-
    \n-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-connections_limit in settings_pack.

    \n-

    max_connections() returns the current settings.

    \n-[report issue]
    \n-
    \n-

    move_storage()

    \n-
    \n-void move_storage (std::string const& save_path\n-      , move_flags_t flags = move_flags_t::always_replace_files\n-      ) 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-
    \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_hashes() info_hash()

    \n-
    \n-sha1_hash info_hash () const;\n-info_hash_t info_hashes () 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-
    \n-

    comparison operators. The order of the torrents is unspecified\n-but stable.

    \n-[report issue]
    \n-
    \n-

    id()

    \n-
    \n-std::uint32_t id () 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-
    \n-std::shared_ptr<torrent> native_handle () 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-
    \n-client_data_t userdata () const;\n-
    \n-

    returns the userdata pointer as set in add_torrent_params

    \n-[report issue]
    \n-
    \n-

    in_session()

    \n-
    \n-bool in_session () 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-
    \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-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
    \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@@ -20285,14 +20285,25 @@\n 
    nodes
    \n
    the bootstrap nodes saved from the buckets node
    \n \n [report issue]
    \n
    nodes6
    \n
    the bootstrap nodes saved from the IPv6 buckets node
    \n
    \n+[report issue]
    \n+
    \n+

    dht_default_storage_constructor()

    \n+

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n+
    \n+std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n+   settings_interface const& settings);\n+
    \n+

    constructor for the default DHT storage. The DHT storage is responsible\n+for maintaining peers and mutable and immutable items announced and\n+stored/put to the DHT node.

    \n [report issue]
    \n
    \n

    sign_mutable_item()

    \n

    Declared in "libtorrent/kademlia/item.hpp"

    \n
    \n signature sign_mutable_item (\n    span<char const> v\n@@ -20303,25 +20314,14 @@\n 
    \n

    given a byte range v and an optional byte range salt, a\n sequence number, public key pk (must be 32 bytes) and a secret key\n sk (must be 64 bytes), this function produces a signature which\n is written into a 64 byte buffer pointed to by sig. The caller\n is responsible for allocating the destination buffer that's passed in\n as the sig argument. Typically it would be allocated on the stack.

    \n-[report issue]
    \n-
    \n-

    dht_default_storage_constructor()

    \n-

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n-
    \n-std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n-   settings_interface const& settings);\n-
    \n-

    constructor for the default DHT storage. The DHT storage is responsible\n-for maintaining peers and mutable and immutable items announced and\n-stored/put to the DHT node.

    \n [report issue]
    \n
    \n

    announce_flags_t

    \n

    Declared in "libtorrent/kademlia/announce_flags.hpp"

    \n
    \n
    seed
    \n
    announce to DHT as a seed
    \n@@ -20332,35 +20332,35 @@\n your source UDP port as your listen port, rather than the one specified in\n the message. This may improve the chances of traversing NATs when using uTP.\n
    \n
    \n
    ssl_torrent
    \n
    Specify the port number for the SSL listen socket in the DHT announce.
    \n
    \n-\n-[report issue]
    \n-
    \n-

    write_resume_data_buf() write_resume_data()

    \n+\n+[report issue]
    \n+
    \n+

    write_resume_data() write_resume_data_buf()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n std::vector<char> write_resume_data_buf (add_torrent_params const& atp);\n entry write_resume_data (add_torrent_params const& atp);\n 
    \n

    this function turns the resume data in an add_torrent_params object\n 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 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 
    \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@@ -20374,17 +20374,17 @@\n

      Declared in "libtorrent/read_resume_data.hpp"

      \n
      \n add_torrent_params read_resume_data (bdecode_node const& rd\n    , error_code& ec, int piece_limit = 0x200000);\n add_torrent_params read_resume_data (bdecode_node const& rd\n    , int piece_limit = 0x200000);\n add_torrent_params read_resume_data (span<char const> buffer\n-   , error_code& ec, load_torrent_limits const& cfg = {});\n-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 
      \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@@ -20460,18 +20460,18 @@\n \n

      Verifies the signature on the given message using pk

      \n [report issue]
    \n
    \n

    ed25519_add_scalar()

    \n

    Declared in "libtorrent/kademlia/ed25519.hpp"

    \n
    \n-secret_key ed25519_add_scalar (secret_key const& sk\n-   , std::array<char, 32> const& scalar);\n public_key ed25519_add_scalar (public_key const& pk\n    , std::array<char, 32> const& scalar);\n+secret_key ed25519_add_scalar (secret_key const& sk\n+   , std::array<char, 32> const& scalar);\n 
    \n

    Adds a scalar to the given key pair where scalar is a 32 byte buffer\n (possibly generated with ed25519_create_seed), generating a new key pair.

    \n

    You can calculate the public key sum without knowing the private key and\n vice versa by passing in null for the key you don't know. This is useful\n when a third party (an authoritative server for example) needs to enforce\n randomness on a key pair while only knowing the public key of the other\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,256 +1,98 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.10\n _\bh_\bo_\bm_\be\n Table of contents\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- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)\n- o _\bi_\bs_\b__\bd_\bh_\bt_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b(_\b)\n- o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bd_\bh_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)_\b _\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n- o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)\n- o _\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 _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- o _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n- o _\br_\be_\bo_\bp_\be_\bn_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bs_\bo_\bc_\bk_\be_\bt_\bs_\b(_\b)\n- o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n- * _\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- * _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt_\b(_\b)\n- o _\bh_\ba_\bs_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)\n- o _\bg_\be_\bt_\b(_\b)\n- o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n- o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n- * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n- o _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b)\n- * _\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- * _\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)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\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- * _\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 _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n- * _\be_\bn_\bu_\bm_\b _\be_\bv_\be_\bn_\bt_\b__\bt\n- * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n- * _\be_\bn_\bu_\bm_\b _\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- * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n- * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bi_\bn_\bt\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\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- * _\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 _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\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__\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- 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- * _\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- * _\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+ * _\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- * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\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 _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\ba_\bt_\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(_\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+ _\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__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\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__\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__\bp_\bt_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\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- * _\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+ * _\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 _\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 _\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 _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n+ o _\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 _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\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+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)\n+ o _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+ o _\bf_\bl_\bu_\bs_\bh_\b__\bc_\ba_\bc_\bh_\be_\b(_\b)\n+ o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b(_\b)\n+ o _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bn_\be_\be_\bd_\b__\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\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(_\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 _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\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__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n+ o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n+ o _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n+ o _\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_\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 _\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 _\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 _\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)\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(_\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- * _\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__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bt_\br_\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__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n- o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n- o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n- * _\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- * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n- * _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n- o _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n- o _\ba_\bs_\bs_\bi_\bg_\bn_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n- o _\ba_\bl_\bl_\b__\bs_\be_\bt_\b(_\b)\n- o _\bn_\bo_\bn_\be_\b__\bs_\be_\bt_\b(_\b)\n- o _\bs_\bi_\bz_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bw_\bo_\br_\bd_\bs_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bb_\by_\bt_\be_\bs_\b(_\b)\n- o _\be_\bm_\bp_\bt_\by_\b(_\b)\n- o _\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n- * _\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 _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n- o _\br_\be_\bs_\be_\bt_\b(_\b)\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\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- * _\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__\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- * _\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- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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 _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n- * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n- * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n- * _\be_\bn_\bu_\bm_\b _\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- * _\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+ 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 * _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n * _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bu_\br_\bl_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n- o _\bo_\bl_\bd_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\be_\bw_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ o _\bn_\be_\bw_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bo_\bl_\bd_\b__\bn_\ba_\bm_\be_\b(_\b)\n * _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n o _\be_\bn_\bu_\bm_\b _\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\b__\bt\n * _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bf_\ba_\bi_\bl_\bu_\br_\be_\b__\br_\be_\ba_\bs_\bo_\bn_\b(_\b)\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\b__\ba_\bl_\be_\br_\bt\n@@ -347,18 +189,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_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)_\b _\bn_\bo_\bd_\be_\bs_\b(_\b)\n+ o _\bn_\bo_\bd_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bh_\be_\ba_\bd_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\ba_\bl_\be_\br_\bt\n- o _\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@@ -375,31 +217,14 @@\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- * _\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- * _\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 _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\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 * _\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@@ -410,203 +235,378 @@\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 _\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__\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\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__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n- _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\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__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)\n- _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n+ o _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n+ _\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(_\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__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\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__\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)\n _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\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__\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__\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__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n- * _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\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 _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\ba_\bl_\bl_\bo_\bw_\b(_\b)\n+ o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\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 _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n- o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n- o _\be_\bx_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n- * _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n- o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n- o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\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__\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)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)\n- o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\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(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)\n- _\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)\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__\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)\n- o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\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 _\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+ * _\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- * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n- * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n+ o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n+ o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n+ o _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\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 _\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)_\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_\b2_\b(_\b)_\b _\bv_\b1_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n+ o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\bp_\br_\bi_\bv_\b(_\b)\n+ o _\bi_\bs_\b__\bi_\b2_\bp_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bt_\br_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\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+ * _\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+ * _\be_\bn_\bt_\br_\by\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\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 * _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be\n * _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b__\bb_\bo_\br_\br_\bo_\bw_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\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__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ o _\bs_\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__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)\n- _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bh_\ba_\bs_\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__\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 _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\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__\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__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\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_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\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 * _\be_\bn_\bu_\bm_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n- o _\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+ * _\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+ * _\bi_\b2_\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+ * _\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+ * _\bu_\bp_\bn_\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+ * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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 _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n+ * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+ * _\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_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n+ * _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\ba_\bd_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\bw_\br_\bi_\bt_\be_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\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+ * _\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+ * _\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+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ o _\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 _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\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 _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\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 _\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)_\b _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n+ o _\br_\be_\bo_\bp_\be_\bn_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bs_\bo_\bc_\bk_\be_\bt_\bs_\b(_\b)\n+ o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n+ * _\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(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ * _\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+ * _\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 _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bv_\bo_\bi_\bd_\b*_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n o _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b)_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bb_\bu_\bf_\b(_\b)\n o _\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\bo_\bm_\bm_\be_\bn_\bt_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bo_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\br_\bo_\bo_\bt_\b__\bc_\be_\br_\bt_\b(_\b)\n- o _\bp_\br_\bi_\bv_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\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- * _\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 _\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 _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\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 _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n- o _\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- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)\n- o _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\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__\bt_\bo_\bp_\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__\bu_\bp_\b(_\b)\n- _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)\n- o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\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(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\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 _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\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)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\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 _\bd_\bo_\bw_\bn_\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- _\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+ * _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)\n+ o _\bg_\be_\bt_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n+ o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n+ * _\bp_\be_\be_\br_\b__\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+ * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\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_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n+ * _\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+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\be_\bv_\be_\bn_\bt_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl\n+ * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n+ * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n+ * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n+ * _\bi_\bn_\bt\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\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+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\be_\b__\bt\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n+ o _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\ba_\bl_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bg_\be_\bt_\b__\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+ * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+ * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+ * _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n+ * _\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 * _\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@@ -614,5546 +614,1332 @@\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n- * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\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- * _\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__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)\n * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\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* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-this is a holder for the internal _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object. Once the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n-the completion of the shutdown. The lifetime of this object may outlive\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n-down.\n-struct session_proxy\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn holds all state that spans multiple torrents. Among other things it\n-runs the network loop and manages all torrents. Once it's created, the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-object will spawn the main thread that will do all the work. The main thread\n-will be idle as long it doesn't have any torrents to participate in.\n-You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session_handle::\n-apply_settings() member function. To change one or more configuration options,\n-create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n-it in to session::apply_settings().\n-see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n-struct session : session_handle\n-{\n- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& 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&& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n- session_proxy a\bab\bbo\bor\brt\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& 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&& params);\n-Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n-order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n-it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n-before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n-The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n-passing in session::paused). Note that add_default_plugins do not have an\n-affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n-the plugins to use.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n-Overload of the constructor that takes an external io_context to run the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n-multiple sessions on a single io_context, or low resource systems where\n-additional threads are expensive and sharing an io_context with other events is\n-fine.\n-Warning\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n-io_context::run() call m\bmu\bus\bst\bt have returned before it's safe to destruct the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn. Which means you M\bMU\bUS\bST\bT call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b:_\b:_\ba_\bb_\bo_\br_\bt_\b(_\b) and save the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-first, then destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn object, then sync with the io_context, then\n-destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n-The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n-shut down. If some trackers are down, they will time out. All this before the\n-destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n-(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n-can take a few second for it to finish. The timeout can be set with\n-_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-session_proxy a\bab\bbo\bor\brt\bt ();\n-In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-object will block while the trackers are contacted. If you keep one\n-session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n-block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n-then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n-from the session destructor call until the session_proxy destructor call. The\n-session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n-closed down, no operations are allowed on it). The only valid operation is\n-calling the destructor:\n-struct session_proxy {};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n-started.\n-struct session_params\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\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 (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 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_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-this class provides a non-owning handle to a _\bs_\be_\bs_\bs_\bi_\bo_\bn and a subset of the\n-interface of the _\bs_\be_\bs_\bs_\bi_\bo_\bn class. If the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is destructed any\n-handle to it will no longer be valid. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return false and any\n-operation on it will throw a system_error exception, with error code\n-invalid_session_handle.\n-struct session_handle\n-{\n- bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags =\n-save_state_flags_t::all()) const;\n- void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector* ret\n- , status_flags_t flags = {}) const;\n- std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n- std::function const& pred\n- , status_flags_t flags = {}) const;\n- void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n- void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n- void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n- void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n- void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n- std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n- torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n- 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- 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 const& params, error_code&\n-ec);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n- void 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::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- ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n- void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n- void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n- unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n- unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n- ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n- peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n- peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n- peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n- void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n- 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 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 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-[_\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 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-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 const& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n-void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& 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 const& params, error_code& ec);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n-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 overload that does not take an error_code throws an exception on error and\n-is not available when building without exception support. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n-returned by _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) can be used to retrieve information about the\n-torrent's progress, its peers etc. It is also used to abort a torrent.\n-If the torrent you are trying to add already exists in the _\bs_\be_\bs_\bs_\bi_\bo_\bn (is either\n-queued for checking, being checked or downloading) add_torrent() will throw\n-system_error which derives from std::exception unless duplicate_is_error is set\n-to false. In that case, _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will return the handle to the existing\n-torrent.\n-The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs class has a flags field. It can be used to control what\n-state the new torrent will be added in. Common flags to want to control are\n-torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n-link that will just download the metadata, but no payload, set the\n-torrent_flags::upload_mode flag.\n-Special consideration has to be taken when adding hybrid torrents (i.e.\n-torrents that are BitTorrent v2 torrents that are backwards compatible with\n-v1). For more details, see _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpa\bau\bus\bse\be ();\n-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).\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::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-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n-void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n-Sets a filter that will be used to reject and accept incoming as well as\n-outgoing connections based on their originating ip address. The default filter\n-will allow connections to any ip address. To build a set of rules for which\n-addresses are accepted and not, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-Each time a peer is blocked because of the IP filter, a _\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n-generated. get_ip_filter() Returns the _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See\n-_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n-apply _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br f to incoming and outgoing peers. a port filter will reject\n-making outgoing peer connections to certain remote ports. The main intention is\n-to be able to avoid triggering certain anti-virus software by connecting to\n-SMTP, FTP ports.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n-bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n-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* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n-ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n-Sets the peer class filter for this _\bs_\be_\bs_\bs_\bi_\bo_\bn. All new peer connections will take\n-this into account and be added to the peer classes specified by this filter,\n-based on the peer's IP address.\n-The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n-represents a peer class. The least significant bit represents class 0, the next\n-bit class 1 and so on.\n-For more info, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n-their own peer class, apply the following filter:\n-ip_filter f = ses.get_peer_class_filter();\n-peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n-f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n- , 1 << static_cast(my_class));\n-ses.set_peer_class_filter(f);\n-This setting only applies to new connections, it won't affect existing peer\n-connections.\n-This function is limited to only peer class 0-31, since there are only 32 bits\n-in the IP range mapping. Only the set bits matter; no peer class will be\n-removed from a peer as a result of this call, peer classes are only added.\n-The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_filter are 32 bits.\n-The get_peer_class_filter() function returns the current filter.\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n-peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n-Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n-assignments to peers based on what kind of socket it is.\n-It does not only support assigning peer classes, it also supports removing peer\n-classes based on socket type.\n-The order of these rules being applied are:\n- 1. peer-class IP filter\n- 2. peer-class type filter, removing classes\n- 3. peer-class type filter, adding classes\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n-Creates a new peer class (see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs) with the given name. The returned\n-integer is the new peer class identifier. Peer classes may have the same name,\n-so each invocation of this function creates a new class and returns a unique\n-identifier.\n-Identifiers are assigned from low numbers to higher. So if you plan on using\n-certain peer classes in a call to _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b), make sure to create\n-those early on, to get low identifiers.\n-For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n-This call dereferences the reference count of the specified peer class. When\n-creating a peer class it's automatically referenced by 1. If you want to\n-recycle a peer class, you may call this function. You may only call this\n-function o\bon\bnc\bce\be per peer class you create. Calling it more than once for the same\n-class will lead to memory corruption.\n-Since peer classes are reference counted, this function will not remove the\n-peer class if it's still assigned to torrents or peers. It will however remove\n-it once the last peer and torrent drops their references to it.\n-There is no need to call this function for custom peer classes. All peer\n-classes will be properly destructed when the _\bs_\be_\bs_\bs_\bi_\bo_\bn object destructs.\n-For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n-These functions queries information from a peer class and updates the\n-configuration of a peer class, respectively.\n-cid must refer to an existing peer class. If it does not, the return value of\n-get_peer_class() is undefined.\n-set_peer_class() sets all the information in the _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo object in the\n-specified peer class. There is no option to only update a single property.\n-A peer or torrent belonging to more than one class, the highest priority among\n-any of its classes is the one that is taken into account.\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n-remove_torrent() will close all peer connections associated with the torrent\n-and tell the tracker that we've stopped participating in the swarm. This\n-operation cannot fail. When it completes, you will receive a\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n-_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, but will remove the torrent from the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-synchronously. Calling _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) immediately afterward with\n-the same torrent will succeed. Note that this creates a new handle which is not\n-equal to the removed one.\n-The optional second argument options can be used to delete all the files\n-downloaded by this torrent. To do so, pass in the value session_handle::\n-delete_files. Once the torrent is deleted, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted.\n-The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be remains valid for some time after _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n-called. It will become invalid only after all libtorrent tasks (such as I/\n-O tasks) release their references to the torrent. Until this happens,\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return true, and other calls such as\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) will succeed. Because of this, and because\n-_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, the following sequence usually succeeds (does\n-not throw system_error): .. code:: c++\n- session.remove_handle(handle); handle.save_resume_data();\n-Note that when a queued or downloading torrent is removed, its position in the\n-download queue is vacated and every subsequent torrent in the queue has their\n-queue positions updated. This can potentially cause a large state_update to be\n-posted. When removing all torrents, it is advised to remove them from the back\n-of the queue, to minimize the shifting.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-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 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* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void 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* 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-[_\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* 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-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-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-These functions serialize and de-serialize a session_params object to and from\n-bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-using the state from a previous one (or by programmatically configure the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n-certain aspects of the session's state. The _buf suffix indicates the function\n-operates on buffer rather than the bencoded structure. The torrents in a\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n-separately.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\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- 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 (sha1_hash h1) noexcept;\n- bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n- bool h\bha\bas\bs (protocol_version v) const;\n- bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n- sha1_hash g\bge\bet\bt (protocol_version v) const;\n- sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n- friend bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (info_hash_t const& lhs, info_hash_t const& rhs);\n- friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (info_hash_t const& lhs, info_hash_t const& rhs)\n-noexcept;\n- template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (info_hash_t const& o) const;\n- friend std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, info_hash_t const& ih);\n-\n- sha1_hash v1;\n- sha256_hash v2;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-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-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 (sha1_hash h1) noexcept;\n-The default constructor creates an object that has neither a v1 or v2 hash.\n-For backwards compatibility, make it possible to construct directly from a v1\n-hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n-implicitness is deprecated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs(\b()\b) h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) *\b**\b**\b**\b**\b*\n-bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n-bool h\bha\bas\bs (protocol_version v) const;\n-bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n-returns true if the corresponding info hash is present in this object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash g\bge\bet\bt (protocol_version v) const;\n-returns the has for the specified protocol version\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbe\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n-returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n-info-hash\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n-template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n-calls the function object f for each hash that is available. starting with v1.\n-The signature of F is:\n-void(sha1_hash const&, protocol_version);\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-holds information and statistics about one peer that libtorrent is connected to\n-struct peer_info\n-{\n- sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n-\n- std::string client;\n- typed_bitfield pieces;\n- std::int64_t total_download;\n- std::int64_t total_upload;\n- time_duration last_request;\n- time_duration last_active;\n- time_duration download_queue_time;\n- static constexpr peer_flags_t i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg = 0_bit;\n- static constexpr peer_flags_t c\bch\bho\bok\bke\bed\bd = 1_bit;\n- static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd = 2_bit;\n- static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_c\bch\bho\bok\bke\bed\bd = 3_bit;\n- static constexpr peer_flags_t s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs = 4_bit;\n- static constexpr peer_flags_t o\bou\but\btg\bgo\boi\bin\bng\bg_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n- static constexpr peer_flags_t l\blo\boc\bca\bal\bl_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n- static constexpr peer_flags_t h\bha\ban\bnd\bds\bsh\bha\bak\bke\be = 6_bit;\n- static constexpr peer_flags_t c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg = 7_bit;\n- static constexpr peer_flags_t o\bon\bn_\b_p\bpa\bar\bro\bol\ble\be = 9_bit;\n- static constexpr peer_flags_t s\bse\bee\bed\bd = 10_bit;\n- static constexpr peer_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be = 11_bit;\n- static constexpr peer_flags_t s\bsn\bnu\bub\bbb\bbe\bed\bd = 12_bit;\n- static constexpr peer_flags_t u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by = 13_bit;\n- static constexpr peer_flags_t e\ben\bnd\bdg\bga\bam\bme\be_\b_m\bmo\bod\bde\be = 14_bit;\n- static constexpr peer_flags_t h\bho\bol\ble\bep\bpu\bun\bnc\bch\bhe\bed\bd = 15_bit;\n- static constexpr peer_flags_t i\bi2\b2p\bp_\b_s\bso\boc\bck\bke\bet\bt = 16_bit;\n- static constexpr peer_flags_t u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt = 17_bit;\n- static constexpr peer_flags_t s\bss\bsl\bl_\b_s\bso\boc\bck\bke\bet\bt = 18_bit;\n- static constexpr peer_flags_t r\brc\bc4\b4_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 19_bit;\n- static constexpr peer_flags_t p\bpl\bla\bai\bin\bnt\bte\bex\bxt\bt_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 20_bit;\n- peer_flags_t flags;\n- static constexpr peer_source_flags_t t\btr\bra\bac\bck\bke\ber\br = 0_bit;\n- static constexpr peer_source_flags_t d\bdh\bht\bt = 1_bit;\n- static constexpr peer_source_flags_t p\bpe\bex\bx = 2_bit;\n- static constexpr peer_source_flags_t l\bls\bsd\bd = 3_bit;\n- static constexpr peer_source_flags_t r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba = 4_bit;\n- static constexpr peer_source_flags_t i\bin\bnc\bco\bom\bmi\bin\bng\bg = 5_bit;\n- peer_source_flags_t source;\n- int up_speed;\n- int down_speed;\n- int payload_up_speed;\n- int payload_down_speed;\n- peer_id pid;\n- int queue_bytes;\n- int request_timeout;\n- int send_buffer_size;\n- int used_send_buffer;\n- int receive_buffer_size;\n- int used_receive_buffer;\n- int receive_buffer_watermark;\n- int num_hashfails;\n- int download_queue_length;\n- int timed_out_requests;\n- int busy_requests;\n- int requests_in_buffer;\n- int target_dl_queue_length;\n- int upload_queue_length;\n- int failcount;\n- piece_index_t downloading_piece_index;\n- int downloading_block_index;\n- int downloading_progress;\n- int downloading_total;\n- static constexpr connection_type_t s\bst\bta\ban\bnd\bda\bar\brd\bd_\b_b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt = 0_bit;\n- static constexpr connection_type_t w\bwe\beb\bb_\b_s\bse\bee\bed\bd = 1_bit;\n- static constexpr connection_type_t h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd = 2_bit;\n- connection_type_t connection_type;\n- int pending_disk_bytes;\n- int pending_disk_read_bytes;\n- int send_quota;\n- int receive_quota;\n- int rtt;\n- int num_pieces;\n- int download_rate_peak;\n- int upload_rate_peak;\n- float progress;\n- int progress_ppm;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt ip;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_i\bid\bdl\ble\be = 0_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_l\bli\bim\bmi\bit\bt = 1_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_n\bne\bet\btw\bwo\bor\brk\bk = 2_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_d\bdi\bis\bsk\bk = 4_bit;\n- bandwidth_state_flags_t read_state;\n- bandwidth_state_flags_t write_state;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n-If this peer is an i2p peer, this function returns the destination address of\n-the peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- client\n- A human readable string describing the software at the other end of the\n- connection. In some cases this information is not available, then it will\n- contain a string that may give away something about which software is\n- running in the other end. In the case of a web seed, the server type and\n- version will be a part of this string. This is UTF-8 encoded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pieces\n- a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, with one bit per piece in the torrent. Each bit tells you if\n- the peer has that piece (if it's set to 1) or if the peer miss that piece\n- (set to 0).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_download total_upload\n- the total number of bytes downloaded from and uploaded to this peer.\n- These numbers do not include the protocol chatter, but only the payload\n- data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_request last_active\n- the time since we last sent a request to this peer and since any transfer\n- occurred with this peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_queue_time\n- the time until all blocks in the request queue will be downloaded\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- interesting\n- w\bwe\be are interested in pieces from this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- choked\n- w\bwe\be have choked this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_interested\n- the peer is interested in u\bus\bs\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_choked\n- the peer has choked u\bus\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- supports_extensions\n- means that this peer supports the _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- outgoing_connection\n- The connection was initiated by us, the peer has a listen port open, and\n- that port is the same as in the address of this peer. If this flag is not\n- set, this peer connection was opened by this peer connecting to us.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_connection\n- deprecated synonym for outgoing_connection\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- handshake\n- The connection is opened, and waiting for the handshake. Until the\n- handshake is done, the peer cannot be identified.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connecting\n- The connection is in a half-open state (i.e. it is being connected).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- on_parole\n- The peer has participated in a piece that failed the hash check, and is\n- now \"on parole\", which means we're only requesting whole pieces from this\n- peer until it either fails that piece or proves that it doesn't send bad\n- data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- seed\n- This peer is a seed (it has all the pieces).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- optimistic_unchoke\n- This peer is subject to an optimistic unchoke. It has been unchoked for a\n- while to see if it might unchoke us in return an earn an upload/unchoke\n- slot. If it doesn't within some period of time, it will be choked and\n- another peer will be optimistically unchoked.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- snubbed\n- This peer has recently failed to send a block within the request timeout\n- from when the request was sent. We're currently picking one block at a\n- time from this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_only\n- This peer has either explicitly (with an extension) or implicitly (by\n- becoming a seed) told us that it will not downloading anything more,\n- regardless of which pieces we have.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- endgame_mode\n- This means the last time this peer picket a piece, it could not pick as\n- many as it wanted because there were not enough free ones. i.e. all\n- pieces this peer has were already requested from other peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- holepunched\n- This flag is set if the peer was in holepunch mode when the connection\n- succeeded. This typically only happens if both peers are behind a NAT and\n- the peers connect via the NAT holepunch mechanism.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- i2p_socket\n- indicates that this socket is running on top of the I2P transport.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- utp_socket\n- indicates that this socket is a uTP socket\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ssl_socket\n- indicates that this socket is running on top of an SSL (TLS) channel\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- rc4_encrypted\n- this connection is obfuscated with RC4\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- plaintext_encrypted\n- the handshake of this connection was obfuscated with a Diffie-Hellman\n- exchange\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- tells you in which state the peer is in. It is set to any combination of\n- the peer_flags_t flags above.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tracker\n- The peer was received from the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht\n- The peer was received from the kademlia DHT.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pex\n- The peer was received from the peer exchange extension.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- lsd\n- The peer was received from the local service discovery (The peer is on\n- the local network).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- resume_data\n- The peer was added from the fast resume data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- incoming\n- we received an incoming connection from this peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- source\n- a combination of flags describing from which sources this peer was\n- received. A combination of the peer_source_flags_t above.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- up_speed down_speed\n- the current upload and download speed we have to and from this peer\n- (including any protocol messages). updated about once per second\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- payload_up_speed payload_down_speed\n- The transfer rates of payload data only updated about once per second\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pid\n- the peer's id as used in the bittorrent protocol. This id can be used to\n- extract 'fingerprints' from the peer. Sometimes it can tell you which\n- client the peer is using. See identify_client()_\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- queue_bytes\n- the number of bytes we have requested from this peer, but not yet\n- received.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- request_timeout\n- the number of seconds until the current front piece request will time\n- out. This timeout can be adjusted through settings_pack::request_timeout.\n- -1 means that there is not outstanding request.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- send_buffer_size used_send_buffer\n- the number of bytes allocated and used for the peer's send buffer,\n- respectively.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- receive_buffer_size used_receive_buffer receive_buffer_watermark\n- the number of bytes allocated and used as receive buffer, respectively.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_hashfails\n- the number of pieces this peer has participated in sending us that turned\n- out to fail the hash check.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_queue_length\n- this is the number of requests we have sent to this peer that we haven't\n- got a response for yet\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- timed_out_requests\n- the number of block requests that have timed out, and are still in the\n- download queue\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- busy_requests\n- the number of busy requests in the download queue. A busy request is a\n- request for a block we've also requested from a different peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- requests_in_buffer\n- the number of requests messages that are currently in the send buffer\n- waiting to be sent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- target_dl_queue_length\n- the number of requests that is tried to be maintained (this is typically\n- a function of download speed)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_queue_length\n- the number of piece-requests we have received from this peer that we\n- haven't answered with a piece yet.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- failcount\n- the number of times this peer has \"failed\". i.e. failed to connect or\n- disconnected us. The failcount is decremented when we see this peer in a\n- tracker response or peer exchange message.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- downloading_piece_index downloading_block_index downloading_progress\n- downloading_total\n- You can know which piece, and which part of that piece, that is currently\n- being downloaded from a specific peer by looking at these four members.\n- downloading_piece_index is the index of the piece that is currently being\n- downloaded. This may be set to -1 if there's currently no piece\n- downloading from this peer. If it is >= 0, the other three members are\n- valid. downloading_block_index is the index of the block (or sub-piece)\n- that is being downloaded. downloading_progress is the number of bytes of\n- this block we have received from the peer, and downloading_total is the\n- total number of bytes in this block.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- standard_bittorrent\n- Regular bittorrent connection\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- web_seed\n- HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b9 protocol\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- http_seed\n- HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b7 protocol\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connection_type\n- the kind of connection this peer uses. See connection_type_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pending_disk_bytes\n- the number of bytes this peer has pending in the disk-io thread.\n- Downloaded and waiting to be written to disk. This is what is capped by\n- settings_pack::max_queued_disk_bytes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pending_disk_read_bytes\n- number of outstanding bytes to read from disk\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- send_quota receive_quota\n- the number of bytes this peer has been assigned to be allowed to send and\n- receive until it has to request more quota from the bandwidth manager.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- rtt\n- an estimated round trip time to this peer, in milliseconds. It is\n- estimated by timing the TCP connect(). It may be 0 for incoming\n- connections.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_pieces\n- the number of pieces this peer has.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_rate_peak upload_rate_peak\n- the highest download and upload rates seen on this connection. They are\n- given in bytes per second. This number is reset to 0 on reconnect.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress\n- the progress of the peer in the range [0, 1]. This is always 0 when\n- floating point operations are disabled, instead use progress_ppm.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress_ppm\n- indicates the download progress of the peer in the range [0, 1000000]\n- (parts per million).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ip\n- the IP-address to this peer. The type is an asio endpoint. For more info,\n- see the _\ba_\bs_\bi_\bo documentation. This field is not valid for i2p peers.\n- Instead use the _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b) function.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_endpoint\n- the IP and port pair the socket is bound to locally. i.e. the IP address\n- of the interface it's going out over. This may be useful for multi-homed\n- clients with multiple interfaces to the internet. This field is not valid\n- for i2p peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_idle\n- The peer is not waiting for any external events to send or receive data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_limit\n- The peer is waiting for the rate limiter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_network\n- The peer has quota and is currently waiting for a network read or write\n- operation to complete. This is the state all peers are in if there are no\n- bandwidth limits.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_disk\n- The peer is waiting for the disk I/O thread to catch up writing buffers\n- to disk before downloading more.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- read_state write_state\n- bitmasks indicating what state this peer is in with regards to sending\n- and receiving data. The states are defined as independent flags of type\n- bandwidth_state_flags_t, in this class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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* 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) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span buffer);\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* 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 (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-and dht_nodes is probably a good idea if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs came from a\n-running torrent. Those lists may be long and be ephemeral.\n-If none of the info_hashes or ti fields are set, there is not info-hash\n-available, and a magnet link cannot be created. In this case _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-returns an empty string.\n-The recommended way to generate a magnet link from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is to call\n-_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), which will post a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt containing an\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This can then be passed to _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b).\n-The overload that takes a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be will make blocking calls to query\n-information about the torrent. If the torrent handle is invalid, an empty\n-string is returned.\n-For more information about magnet links, see _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri);\n-void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n-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* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n-returns the libtorrent version as string form in this format:\n-\"...\"\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n-inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n-rhs);\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n-|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\bev\bve\ben\bnt\bt_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\ba_\br_\bt_\be_\bd_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\ba_\bu_\bs_\be_\bd_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bb_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm 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-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_p\bpr\bro\bot\bto\boc\bco\bol\bl *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\bn_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bc_\bp_\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bd_\bp_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n- dont_download\n- Don't download the file or piece. Partial pieces may still be downloaded\n- when setting file priorities.\n- default_priority\n- The default priority for files and pieces.\n- low_priority\n- The lowest priority for files and pieces.\n- top_priority\n- The highest priority for files and pieces.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bex\bx_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n- pex_encryption\n- the peer supports protocol encryption\n- pex_seed\n- the peer is a seed\n- pex_utp\n- the peer supports the uTP, transport protocol over UDP.\n- pex_holepunch\n- the peer supports the holepunch extension If this flag is received from a\n- peer, it can be used as a rendezvous point in case direct connections to\n- the peer fail\n- pex_lt_v2\n- protocol v2 this is not a standard flag, it is only used internally\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_major\n- the major, minor and tiny versions of libtorrent\n- version_minor\n- the major, minor and tiny versions of libtorrent\n- version_tiny\n- the major, minor and tiny versions of libtorrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n- seed_mode\n- If seed_mode is set, libtorrent will assume that all files are present\n- for this torrent and that they all match the hashes in the torrent file.\n- Each time a peer requests to download a block, the piece is verified\n- against the hash, unless it has been verified already. If a hash fails,\n- the torrent will automatically leave the seed mode and recheck all the\n- files. The use case for this mode is if a torrent is created and seeded,\n- or if the user already know that the files are complete, this is a way to\n- avoid the initial file checks, and significantly reduce the startup time.\n- Setting seed_mode on a torrent without metadata (a .torrent file) is a\n- no-op and will be ignored.\n- It is not possible to s\bse\bet\bt the seed_mode flag on a torrent after it has\n- been added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. It is possible to c\bcl\ble\bea\bar\br it though.\n- upload_mode\n- If upload_mode is set, the torrent will be initialized in upload-mode,\n- which means it will not make any piece requests. This state is typically\n- entered on disk I/O errors, and if the torrent is also auto managed, it\n- will be taken out of this state periodically (see settings_pack::\n- optimistic_disk_retry).\n- This mode can be used to avoid race conditions when adjusting priorities\n- of pieces before allowing the torrent to start downloading.\n- If the torrent is auto-managed (auto_managed), the torrent will\n- eventually be taken out of upload-mode, regardless of how it got there.\n- If it's important to manually control when the torrent leaves upload\n- mode, don't make it auto managed.\n- share_mode\n- determines if the torrent should be added in s\bsh\bha\bar\bre\be m\bmo\bod\bde\be or not. Share\n- mode indicates that we are not interested in downloading the torrent, but\n- merely want to improve our share ratio (i.e. increase it). A torrent\n- started in share mode will do its best to never download more than it\n- uploads to the swarm. If the swarm does not have enough demand for upload\n- capacity, the torrent will not download anything. This mode is intended\n- to be safe to add any number of torrents to, without manual screening,\n- without the risk of downloading more than is uploaded.\n- A torrent in share mode sets the priority to all pieces to 0, except for\n- the pieces that are downloaded, when pieces are decided to be downloaded.\n- This affects the progress bar, which might be set to \"100% finished\" most\n- of the time. Do not change file or piece priorities for torrents in share\n- mode, it will make it not work.\n- The share mode has one setting, the share ratio target, see\n- settings_pack::share_mode_target for more info.\n- apply_ip_filter\n- determines if the IP filter should apply to this torrent or not. By\n- default all torrents are subject to filtering by the IP filter (i.e. this\n- flag is set by default). This is useful if certain torrents needs to be\n- exempt for some reason, being an auto-update torrent for instance.\n- paused\n- specifies whether or not the torrent is paused. i.e. it won't connect to\n- the tracker or any of the peers until it's resumed. Note that a paused\n- torrent that also has the auto_managed flag set can be started at any\n- time by libtorrent's queuing logic. See _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- auto_managed\n- If the torrent is auto-managed (auto_managed), the torrent may be resumed\n- at any point, regardless of how it paused. If it's important to manually\n- control when the torrent is paused and resumed, don't make it auto\n- managed.\n- If auto_managed is set, the torrent will be queued, started and seeded\n- automatically by libtorrent. When this is set, the torrent should also be\n- started as paused. The default queue order is the order the torrents were\n- added. They are all downloaded in that order. For more details, see\n- _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- duplicate_is_error\n- used in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs to indicate that it's an error to attempt to\n- add a torrent that's already in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. If it's not considered an\n- error, a handle to the existing torrent is returned. This flag is not\n- saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it is only meant for adding torrents.\n- update_subscribe\n- on by default and means that this torrent will be part of state updates\n- when calling _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b). This flag is not saved by\n- _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n- super_seeding\n- sets the torrent into super seeding/initial seeding mode. If the torrent\n- is not a seed, this flag has no effect.\n- sequential_download\n- sets the sequential download state for the torrent. In this mode the\n- piece picker will pick pieces with low index numbers before pieces with\n- high indices. The actual pieces that are picked depend on other factors\n- still, such as which pieces a peer has and whether it is in parole mode\n- or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n- media. For that, see _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) instead.\n- stop_when_ready\n- When this flag is set, the torrent will f\bfo\bor\brc\bce\be s\bst\bto\bop\bp whenever it\n- transitions from a non-data-transferring state into a data-transferring\n- state (referred to as being ready to download or seed). This is useful\n- for torrents that should not start downloading or seeding yet, but want\n- to be made ready to do so. A torrent may need to have its files checked\n- for instance, so it needs to be started and possibly queued for checking\n- (auto-managed and started) but as soon as it's done, it should be\n- stopped.\n- F\bFo\bor\brc\bce\be s\bst\bto\bop\bpp\bpe\bed\bd means auto-managed is set to false and it's paused. As if\n- the auto_manages flag is cleared and the paused flag is set on the\n- torrent.\n- Note that the torrent may transition into a downloading state while\n- setting this flag, and since the logic is edge triggered you may miss the\n- edge. To avoid this race, if the torrent already is in a downloading\n- state when this call is made, it will trigger the stop-when-ready\n- immediately.\n- When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n- transitions between downloading and non-downloading states will not be\n- affected, until this flag is set again.\n- The behavior is more robust when setting this flag as part of adding the\n- torrent. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n- The stop-when-ready flag fixes the inherent race condition of waiting for\n- the _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt and then call _\bp_\ba_\bu_\bs_\be_\b(_\b). The download/seeding will\n- most likely start in between posting the _\ba_\bl_\be_\br_\bt and receiving the call to\n- pause.\n- A downloading state is one where peers are being connected. Which means\n- just downloading the metadata via the ut_metadata extension counts as a\n- downloading state. In order to stop a torrent once the metadata has been\n- downloaded, instead set all file priorities to dont_download\n- override_trackers\n- when this flag is set, the tracker list in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n- override any trackers from the torrent file. If the flag is not set, the\n- trackers from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of\n- trackers used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n- there are trackers present in the resume data file. This effectively\n- makes the trackers saved in the resume data take precedence over the\n- original trackers. This includes if there's an empty list of trackers, to\n- support the case where they were explicitly removed in the previous\n- _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- override_web_seeds\n- If this flag is set, the web seeds from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n- will override any web seeds in the torrent file. If it's not set, web\n- seeds in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of web\n- seeds used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n- there are web seeds present in the resume data file. This effectively\n- makes the web seeds saved in the resume data take precedence over the\n- original ones. This includes if there's an empty list of web seeds, to\n- support the case where they were explicitly removed in the previous\n- _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- need_save_resume\n- if this flag is set (which it is by default) the torrent will be\n- considered needing to save its resume data immediately, in the category\n- if_metadata_changed. See resume_data_flags_t and _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) for\n- details.\n- This flag is cleared by a successful call to _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) This flag\n- is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it represents an ephemeral\n- state of a running torrent.\n- disable_dht\n- set this flag to disable DHT for this torrent. This lets you have the DHT\n- enabled for the whole client, and still have specific torrents not\n- participating in it. i.e. not announcing to the DHT nor picking up peers\n- from it.\n- disable_lsd\n- set this flag to disable local service discovery for this torrent.\n- disable_pex\n- set this flag to disable peer exchange for this torrent.\n- no_verify_files\n- if this flag is set, the resume data will be assumed to be correct\n- without validating it against any files on disk. This may be used when\n- restoring a _\bs_\be_\bs_\bs_\bi_\bo_\bn by loading resume data from disk. It will save time\n- and also delay any hard disk errors until files are actually needed. If\n- the resume data cannot be trusted, or if a torrent is added for the first\n- time to some save path that may already have some of the files, this flag\n- should not be set.\n- default_dont_download\n- default all file priorities to dont_download. This is useful for adding\n- magnet links where the number of files is unknown, but the\n- file_priorities is still set for some files. Any file not covered by the\n- file_priorities list will be set to normal download priority, unless this\n- flag is set, in which case they will be set to 0 (dont_download).\n- i2p_torrent\n- this flag makes the torrent be considered an \"i2p torrent\" for purposes\n- of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n- is disabled, i2p torrents won't add normal peers to its peer list. Note\n- that non i2p torrents may still allow i2p peers (on the off-chance that a\n- tracker return them and the _\bs_\be_\bs_\bs_\bi_\bo_\bn is configured with a SAM connection).\n- This flag is set automatically when adding a torrent that has at least\n- one tracker whose hostname ends with .i2p. It's also set by\n- _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n- all\n- all torrent flags combined. Can conveniently be used when creating masks\n- for flags\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs contains all the information in a .torrent file along\n-with all information necessary to add that torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. The key fields\n-when adding a torrent are:\n- * ti - the immutable info-dict part of the torrent\n- * info_hash - when you don't have the metadata (.torrent file). This\n- uniquely identifies the torrent and can validate the info-dict when\n- received from the swarm.\n-In order to add a torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn, one of those fields must be set in\n-addition to save_path. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object can then be passed into\n-one of the session::add_torrent() overloads or session::async_add_torrent().\n-If you only specify the info-hash, the torrent file will be downloaded from\n-peers, which requires them to support the metadata extension. For the metadata\n-extension to work, libtorrent must be built with extensions enabled\n-(TORRENT_DISABLE_EXTENSIONS must not be defined). It also takes an optional\n-name argument. This may be left empty in case no name should be assigned to the\n-torrent. In case it's not, the name is used for the torrent as long as it\n-doesn't have metadata. See torrent_handle::name.\n-The add_torrent_params is also used when requesting resume data for a torrent.\n-It can be saved to and restored from a file and added back to a new _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n-For serialization and de-serialization of add_torrent_params objects, see\n-_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n-The add_torrent_params is also used to represent a parsed .torrent file. It can\n-be loaded via _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b), _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b) and\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b). It can be saved via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b).\n-struct add_torrent_params\n-{\n- int v\bve\ber\brs\bsi\bio\bon\bn = LIBTORRENT_VERSION_NUM;\n- std::shared_ptr ti;\n- aux::noexcept_movable> trackers;\n- aux::noexcept_movable> tracker_tiers;\n- aux::noexcept_movable>> dht_nodes;\n- std::string name;\n- std::string save_path;\n- storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n- client_data_t userdata;\n- aux::noexcept_movable> file_priorities;\n- std::string trackerid;\n- torrent_flags_t f\bfl\bla\bag\bgs\bs = torrent_flags::default_flags;\n- info_hash_t info_hashes;\n- int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs = -1;\n- int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = -1;\n- int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bde\bed\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = 0;\n- int a\bac\bct\bti\biv\bve\be_\b_t\bti\bim\bme\be = 0;\n- int f\bfi\bin\bni\bis\bsh\bhe\bed\bd_\b_t\bti\bim\bme\be = 0;\n- int s\bse\bee\bed\bdi\bin\bng\bg_\b_t\bti\bim\bme\be = 0;\n- std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n- int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = -1;\n- aux::noexcept_movable> http_seeds;\n- aux::noexcept_movable> url_seeds;\n- aux::noexcept_movable> peers;\n- aux::noexcept_movable> banned_peers;\n- aux::noexcept_movable> unfinished_pieces;\n- typed_bitfield have_pieces;\n- typed_bitfield verified_pieces;\n- aux::noexcept_movable> piece_priorities;\n- aux::vector, file_index_t> merkle_trees;\n- aux::vector, file_index_t> merkle_tree_mask;\n- aux::vector, file_index_t> verified_leaf_hashes;\n- aux::noexcept_movable> renamed_files;\n- std::time_t l\bla\bas\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::time_t l\bla\bas\bst\bt_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- version\n- filled in by the constructor and should be left untouched. It is used for\n- forward binary compatibility.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ti\n- _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object with the torrent to add. Unless the info_hash is set,\n- this is required to be initialized.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackers\n- If the torrent doesn't have a tracker, but relies on the DHT to find\n- peers, the trackers can specify tracker URLs for the torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tracker_tiers\n- the tiers the URLs in trackers belong to. Trackers belonging to different\n- tiers may be treated differently, as defined by the multi tracker\n- extension. This is optional, if not specified trackers are assumed to be\n- part of tier 0, or whichever the last tier was as iterating over the\n- trackers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_nodes\n- a list of hostname and port pairs, representing DHT nodes to be added to\n- the _\bs_\be_\bs_\bs_\bi_\bo_\bn (if DHT is enabled). The hostname may be an IP address.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- name\n- in case there's no other name in this torrent, this name will be used.\n- The name out of the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object takes precedence if available.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_path\n- the path where the torrent is or will be stored.\n- Note\n- On windows this path (and other paths) are interpreted as UNC paths. This\n- means they must use backslashes as directory separators and may not\n- contain the special directories \".\" or \"..\".\n- Setting this to an absolute path performs slightly better than a relative\n- path.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- storage_mode\n- One of the values from _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt. For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be\n- _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- userdata\n- The userdata parameter is optional and will be passed on to the extension\n- constructor functions, if any (see _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)). It\n- will also be stored in the torrent object and can be retrieved by calling\n- _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- file_priorities\n- can be set to control the initial file priorities when adding a torrent.\n- The semantics are the same as for torrent_handle::prioritize_files(). The\n- file priorities specified in here take precedence over those specified in\n- the resume data, if any. If this vector of file priorities is shorter\n- than the number of files in the torrent, the remaining files (not covered\n- by this) will still have the default download priority. This default can\n- be changed by setting the default_dont_download torrent_flag.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackerid\n- the default tracker id to be used when announcing to trackers. By default\n- this is empty, and no tracker ID is used, since this is an optional\n- argument. If a tracker returns a tracker ID, that ID is used instead of\n- this.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- flags controlling aspects of this torrent and how it's added. See\n- _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt for details.\n- Note\n- The flags field is initialized with default flags by the constructor. In\n- order to preserve default behavior when clearing or setting other flags,\n- make sure to bitwise OR or in a flag or bitwise AND the inverse of a flag\n- to clear it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- info_hashes\n- set this to the info hash of the torrent to add in case the info-hash is\n- the only known property of the torrent. i.e. you don't have a .torrent\n- file nor a magnet link. To add a magnet link, use _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) to\n- populate fields in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_uploads max_connections\n- max_uploads, max_connections, upload_limit, download_limit correspond to\n- the set_max_uploads(), set_max_connections(), set_upload_limit() and\n- set_download_limit() functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. These values let you\n- initialize these settings when the torrent is added, instead of calling\n- these functions immediately following adding it.\n- -1 means unlimited on these settings just like their counterpart\n- functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n- For fine grained control over rate limits, including making them apply to\n- local peers, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_limit download_limit\n- the upload and download rate limits for this torrent, specified in bytes\n- per second. -1 means unlimited.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_uploaded total_downloaded\n- the total number of bytes uploaded and downloaded by this torrent so far.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- active_time finished_time seeding_time\n- the number of seconds this torrent has spent in started, finished and\n- seeding state so far, respectively.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- added_time completed_time\n- if set to a non-zero value, this is the posix time of when this torrent\n- was first added, including previous runs/sessions. If set to zero, the\n- internal added_time will be set to the time of when _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n- called.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_seen_complete\n- if set to non-zero, initializes the time (expressed in posix time) when\n- we last saw a seed or peers that together formed a complete copy of the\n- torrent. If left set to zero, the internal counterpart to this field will\n- be updated when we see a seed or a distributed copies >= 1.0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_complete num_incomplete num_downloaded\n- these field can be used to initialize the torrent's cached scrape data.\n- The scrape data is high level metadata about the current state of the\n- swarm, as returned by the tracker (either when announcing to it or by\n- sending a specific scrape request). num_complete is the number of peers\n- in the swarm that are seeds, or have every piece in the torrent.\n- num_incomplete is the number of peers in the swarm that do not have every\n- piece. num_downloaded is the number of times the torrent has been\n- downloaded (not initiated, but the number of times a download has\n- completed).\n- Leaving any of these values set to -1 indicates we don't know, or we have\n- not received any scrape data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- http_seeds url_seeds\n- URLs can be added to these two lists to specify additional web seeds to\n- be used by the torrent. If the flag_override_web_seeds is set, these will\n- be the _only_ ones to be used. i.e. any web seeds found in the .torrent\n- file will be overridden.\n- http_seeds expects URLs to web servers implementing the original HTTP\n- seed specification _\bB_\bE_\bP_\b _\b1_\b7.\n- url_seeds expects URLs to regular web servers, aka \"get right\" style,\n- specified in _\bB_\bE_\bP_\b _\b1_\b9.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- peers\n- peers to add to the torrent, to be tried to be connected to as bittorrent\n- peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- banned_peers\n- peers banned from this torrent. The will not be connected to\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- unfinished_pieces\n- this is a map of partially downloaded piece. The key is the piece index\n- and the value is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd where each bit represents a 16 kiB block. A\n- set bit means we have that block.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- have_pieces\n- this is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd indicating which pieces we already have of this\n- torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_pieces\n- when in seed_mode, pieces with a set bit in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd have been\n- verified to be valid. Other pieces will be verified the first time a peer\n- requests it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece_priorities\n- this sets the priorities for each individual piece in the torrent. Each\n- element in the vector represent the piece with the same index. If you set\n- both file- and piece priorities, file priorities will take precedence.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- merkle_trees\n- v2 hashes, if known\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- merkle_tree_mask\n- if set, indicates which hashes are included in the corresponding vector\n- of merkle_trees. These bitmasks always cover the full tree, a cleared bit\n- means the hash is all zeros (i.e. not set) and set bit means the next\n- hash in the corresponding vector in merkle_trees is the hash for that\n- node. This is an optimization to avoid storing a lot of zeros.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_leaf_hashes\n- bit-fields indicating which v2 leaf hashes have been verified against the\n- root hash. If this vector is empty and merkle_trees is non-empty it\n- implies that all hashes in merkle_trees are verified.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- renamed_files\n- this is a map of file indices in the torrent and new filenames to be\n- applied before the torrent is added.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_download last_upload\n- the posix time of the last time payload was received or sent for this\n- torrent, respectively. A value of 0 means we don't know when we last\n- uploaded or downloaded, or we have never uploaded or downloaded any\n- payload for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n-passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.\n-struct client_data_t\n-{\n- c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n- explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n- 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 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*) = 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) c\bco\bon\bns\bst\bt*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\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 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*) = delete;\n-we don't allow type-unsafe operations\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* 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+*\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- 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_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+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+ type_t t\bty\byp\bpe\be () const noexcept;\n+ explicit operator b\bbo\boo\bol\bl () const noexcept;\n+ bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n+ std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n+ span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n+ 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+ 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_l\bli\bis\bst\bt (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+ 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+ 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_d\bdi\bic\bct\bt (string_view key) const;\n+ std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+ std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+ std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n+ string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+ std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+ 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+ 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- 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+ 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* 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_r\bre\bea\bad\bd(\b()\b) a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n-virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n- , char const* buf, std::shared_ptr o\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n-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+*\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- 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+*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+For owning nodes, the copy will create a copy of the tree, but the underlying\n+buffer remains the same.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flush_piece\n- this flag instructs a hash job that we just completed this piece, and it\n- should be flushed to disk\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* 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 () = 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+*\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**\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_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 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 int g\bge\bet\bt_\b_i\bin\bnt\bt (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-};\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**\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+*\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* 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+*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) l\bli\bis\bst\bt_\b_a\bat\bt(\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**\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+*\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()\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_d\bdi\bic\bct\bt(\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_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\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 (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+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n+std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n+ , std::int64_t default_val = 0) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+Functions with the dict_ prefix operates on dictionaries. They are only valid\n+if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n+cannot use the 0-terminated string overloads, but have to use string_view\n+instead. dict_find_list will return a valid bdecode_node if the key is found\n+_and_ it is a list. Otherwise it will return a default-constructed\n+_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n+Functions with the _value suffix return the value of the node directly, rather\n+than the nodes. In case the node is not found, or it has a different type, a\n+default value is returned (which can be specified).\n+dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n+Keys are only allowed to be strings. dict_at_node() also returns the (key,\n+value)-pair, but the key is returned as a bdecode_node (and it will always be a\n+string).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\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+*\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* 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+*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+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+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* 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+*\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* ~\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+*\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* 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+*\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* 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+*\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* 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+*\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* 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+*\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\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+*\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* 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- open the file for random access. This disables read-ahead logic\n- mmapped\n- the file is memory mapped\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+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n+ , int depth_limit = 100, int token_limit = 2000000);\n+This function decodes/parses bdecoded data (for example a .torrent file). The\n+data structure is returned in the ret argument. the buffer to parse is\n+specified by the start of the buffer as well as the end, i.e. one byte past the\n+end. If the buffer fails to parse, the function returns a non-zero value and\n+fills in ec with the error code. The optional argument error_pos, if set to\n+non-nullptr, will be set to the byte offset into the buffer where the parse\n+failure occurred.\n+depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the function,\n+be careful not to set it too high).\n+token_limit is the max number of tokens allowed to be parsed from the buffer.\n+This is simply a sanity check to not have unbounded memory usage.\n+The resulting bdecode_node is an o\bow\bwn\bni\bin\bng\bg node. That means it will be holding the\n+whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n+objects will simply have references to the root or owning bdecode_node. If the\n+root node is destructed, all other nodes that refer to anything in that tree\n+become invalid.\n+However, the underlying buffer passed in to this function (start, end) must\n+also remain valid while the bdecoded tree is used. The parsed tree produced by\n+this function does not copy any data out of the buffer, but simply produces\n+references back into it.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-the _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by holds information about a web seed (also known as URL seed\n-or HTTP seed). It is essentially a URL with some state associated with it. For\n-more information, see _\bB_\bE_\bP_\b _\b1_\b7 and _\bB_\bE_\bP_\b _\b1_\b9.\n-struct web_seed_entry\n+*\b**\b**\b**\b**\b**\b* 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- 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+ _\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 type_t\n+ enum block_state_t\n {\n- url_seed,\n- http_seed,\n+ none,\n+ requested,\n+ writing,\n+ finished,\n };\n \n- std::string url;\n- std::string auth;\n- headers_t extra_headers;\n- std::uint8_t type;\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= (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+*\b**\b**\b**\b**\b* p\bpe\bee\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+_\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n+The peer is the ip address of the peer this block was downloaded from.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b* 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- url\n- The URL of the web seed\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- 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+ 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- extra_headers\n- Any extra HTTP headers that need to be passed to the web seed\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- type\n- The type of web seed (see _\bt_\by_\bp_\be_\b__\bt)\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-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_l\bli\bim\bmi\bit\bts\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents that\n-cause excessive memory allocations.\n-struct load_torrent_limits\n+*\b**\b**\b**\b**\b**\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- 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+ 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- max_buffer_size\n- the max size of a .torrent file to load into RAM\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- max_pieces\n- the max number of pieces allowed in the torrent\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- max_decode_depth\n- the max recursion depth in the bdecoded structure\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- max_decode_tokens\n- the max number of bdecode tokens\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-*\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+ 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+ 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+*\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- 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 (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 (span buffer, error_code& ec, from_span_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 (std::string const& filename);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n- ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n- file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n- file_storage const& f\bfi\bil\ble\bes\bs () const;\n- void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n- void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n- 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- 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- void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n- std::vector const& w\bwe\beb\bb_\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\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n- void 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::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- 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- 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+ 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+ void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+ torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+ void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+ void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ 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+ 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+ 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 p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n+ void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n+ void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ void 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- 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+ void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n+ void r\bre\bes\bsu\bum\bme\be () const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) 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 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+ queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n+ void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params\n+ , std::string const& passphrase = \"\");\n+ void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n+ std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\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\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+ void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n+ 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+ 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 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+ std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n+ void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n+ download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n+ void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+ void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n+{}) const;\n+ void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+ void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n+ int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n+ void s\bse\bet\bt_\b_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+ 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< (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-*\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 (bdecode_node const& torrent_file);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 (span buffer, error_code& ec, from_span_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 (std::string const& filename);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\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+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be () noexcept = default;\n+constructs a torrent handle that does not refer to a torrent. i.e. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+will return false.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\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-*\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+*\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-*\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+*\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* 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\n- , announce_entry::tracker_source source);\n-void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n-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+*\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-*\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+*\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+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+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-*\b**\b**\b**\b**\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) 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) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n-std::vector const& w\bwe\beb\bb_\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\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n-void 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-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+*\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+std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+post_download_queue() triggers a download_queue_alert to be posted.\n+get_download_queue() is a synchronous call and returns a vector with\n+information about pieces that are partially downloaded or not downloaded but\n+partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n vector.\n-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 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+*\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) 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) *\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+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-*\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+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+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-*\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 e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n-index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n-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+*\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-*\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+*\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* 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+*\b**\b**\b**\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) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\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 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 [_\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+*\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) 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) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+add_url_seed() adds another url to the torrent's list of url seeds. If the\n+given url already exists in that list, the call has no effect. The torrent will\n+connect to the server and try to download pieces from it, unless it's paused,\n+queued, checking or seeding. remove_url_seed() removes the given url if it\n+exists already. url_seeds() return a set of the url seeds currently in this\n+torrent. Note that URLs that fails may be removed automatically from the list.\n+See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\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 r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n+void a\bad\bdd\bd_\b_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* 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+*\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-*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n-Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n-Otherwise returns an empty string. The certificate is the public certificate in\n-x509 format.\n+*\b**\b**\b**\b**\b* s\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 *\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+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-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n-This function looks up keys from the info-dictionary of the loaded torrent\n-file. It can be used to access extension values put in the .torrent file. If\n-the specified key cannot be found, it returns nullptr.\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\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-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n-returns a the raw info section of the torrent file. The underlying buffer is\n-still owned by the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+*\b**\b**\b**\b**\b* u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+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 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+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-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n-return the bytes of the piece layer hashes for the specified file. If the file\n-doesn't have a piece layer, an empty span is returned. The span size is\n-divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller\n-than or equal to the piece size, the files \"root hash\" is the hash of the file\n-and is not saved separately in the \"piece layers\" field, but this function\n-still returns the root hash of the file in that case.\n+*\b**\b**\b**\b**\b* 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-*\b**\b**\b**\b**\b* f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n-clears the piece layers from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo. This is done by the _\bs_\be_\bs_\bs_\bi_\bo_\bn when\n-a torrent is added, to avoid storing it twice. The piece layer (or other hashes\n-part of the merkle tree) are stored in the internal torrent object.\n-You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session::\n-apply_settings() member function. To change one or more configuration options,\n-create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object and fill it with the settings to be set and pass\n-it in to session::apply_settings().\n-The _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object is a collection of settings updates that are applied\n-to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when passed to session::apply_settings(). It's empty when\n-constructed.\n-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+*\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-*\b**\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk *\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 settings_pack struct, contains the names of all settings as enum values.\n-These values are passed in to the set_str(), set_int(), set_bool() functions,\n-to specify the setting to change.\n-The settings_pack only stores values for settings that have been explicitly set\n-on this object. However, it can still be queried for settings that have not\n-been set and returns the default value for those settings.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b |\n-|_\bu_\bs_\be_\br_\b__\ba_\bg_\be_\bn_\bt_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/|\n-this is the client identification to the tracker. The recommended format of\n-this string is: \"client-name/client-version libtorrent/libtorrent-version\".\n-This name will not only be used when making HTTP requests, but also when\n-sending extended headers to peers that support that extension. It may not\n-contain r or 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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bp_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bn_\bu_\bl_\bl_\bp_\bt_\br|\n-announce_ip is the ip address passed along to trackers as the &ip= parameter.\n-If left as the default, that parameter is omitted.\n-Note\n-This setting is only meant for very special cases where a seed is running on\n-the same host as the tracker, and the tracker accepts the IP parameter (which\n-normal trackers don't). Do not set this option unless you also control the\n-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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b__\bc_\bl_\bi_\be_\bn_\bt_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bn_\bu_\bl_\bl_\bp_\bt_\br|\n-this is the client name and version identifier sent to peers in the handshake\n-message. If this is an empty string, the user_agent is used instead. This\n-string must be a UTF-8 encoded unicode string.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n-This controls which IP address outgoing TCP peer connections are bound to, in\n-addition to controlling whether such connections are also bound to a specific\n-network interface/adapter (b\bbi\bin\bnd\bd-\b-t\bto\bo-\b-d\bde\bev\bvi\bic\bce\be).\n-This string is a comma-separated list of IP addresses and interface names. An\n-empty string will not bind TCP sockets to a device, and let the network stack\n-assign the local address.\n-A list of names will be used to bind outgoing TCP sockets in a round-robin\n-fashion. An IP address will simply be used tobind()the socket. An interface\n-name will attempt to bind the socket to that interface. If that fails, or is\n-unsupported, one of the IP addresses configured for that interface is used\n-tobind()the socket to. If the interface or adapter doesn't exist, the outgoing\n-peer connection will fail with an error message suggesting the device cannot be\n-found. Adapter names on Unix systems are of the form \"eth0\", \"eth1\", \"tun0\",\n-etc. This may be useful for clients that are multi-homed. Binding an outgoing\n-connection to a local IP does not necessarily make the connection via the\n-associated NIC/Adapter.\n-When outgoing interfaces are specified, incoming connections or packets sent to\n-a local interface or IP that's n\bno\bot\bt in this list will be rejected with a\n-_\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt with invalid_local_interface as the reason.\n-Note that these are just interface/adapter names or IP addresses. There are no\n-ports specified in this list. IPv6 addresses without port should be specified\n-without enclosing [, ].\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b0_\b._\b0_\b._\b0_\b._\b0_\b:_\b6_\b8_\b8_\b1_\b,_\b[_\b:_\b:_\b]_\b:_\b6_\b8_\b8_\b1|\n-a comma-separated list of (IP or device name, port) pairs. These are the listen\n-ports that will be opened for accepting incoming uTP and TCP peer connections.\n-These are also used for o\bou\but\btg\bgo\boi\bin\bng\bg uTP and UDP tracker connections and DHT nodes.\n-It is possible to listen on multiple interfaces and multiple ports. Binding to\n-port 0 will make the operating system pick the port.\n-Note\n-There are reasons to stick to the same port across sessions, which would mean\n-only using port 0 on the first start, and recording the port that was picked\n-for subsequent startups. Trackers, the DHT and other peers will remember the\n-port they see you use and hand that port out to other peers trying to connect\n-to you, as well as trying to connect to you themselves.\n-A port that has an \"s\" suffix will accept SSL peer connections. (note that SSL\n-sockets are only available in builds with SSL support)\n-A port that has an \"l\" suffix will be considered a local network. i.e. it's\n-assumed to only be able to reach hosts in the same local network as the IP\n-address (based on the netmask associated with the IP, queried from the\n-operating system).\n-if binding fails, the _\bl_\bi_\bs_\bt_\be_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted. Once a socket binding\n-succeeds (if it does), the _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bu_\bc_\bc_\be_\be_\bd_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted. There may be\n-multiple failures before a success.\n-If a device name that does not exist is configured, no listen socket will be\n-opened for that interface. If this is the only interface configured, it will be\n-as if no listen ports are configured.\n-If no listen ports are configured (e.g. listen_interfaces is an empty string),\n-networking will be disabled. No DHT will start, no outgoing uTP or tracker\n-connections will be made. No incoming TCP or uTP connections will be accepted.\n-(outgoing TCP connections will still be possible, depending on _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n-_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs).\n-For example: [::1]:8888 - will only accept connections on the IPv6 loopback\n-address on port 8888.\n-eth0:4444,eth1:4444 - will accept connections on port 4444 on any IP address\n-bound to device eth0 or eth1.\n-[::]:0s - will accept SSL connections on a port chosen by the OS. And not\n-accept non-SSL connections at all.\n-0.0.0.0:6881,[::]:6881 - binds to all interfaces on port 6881.\n-10.0.1.13:6881l - binds to the local IP address, port 6881, but only allow\n-talking to peers on the same local network. The netmask is queried from the\n-operating system. Interfaces marked l are not announced to trackers, unless the\n-tracker is also on the same local network.\n-Windows OS network adapter device name must be specified with GUID. It can be\n-obtained from \"netsh lan show interfaces\" command output. GUID must be\n-uppercased string embraced in curly brackets. {E4F0B674-0DFC-48BB-98A5-\n-2AA730BDB6D6}:7777 - will accept connections on port 7777 on adapter with this\n-GUID.\n-For more information, see the _\bM_\bu_\bl_\bt_\bi_\b-_\bh_\bo_\bm_\be_\bd_\b _\bh_\bo_\bs_\bt_\bs section.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n-when using a proxy, this is the hostname where the proxy is running see\n-proxy_type. Note that when using a proxy, the _\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\n-setting is overridden and only a single interface is created, just to contact\n-the proxy. This means a proxy cannot be combined with SSL torrents or multiple\n-listen interfaces. This proxy listen interface will not accept incoming TCP\n-connections, will not map ports with any gateway and will not enable local\n-service discovery. All traffic is supposed to be channeled through the proxy.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n-|_\bp_\br_\bo_\bx_\by_\b__\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n-when using a proxy, these are the credentials (if any) to use when connecting\n-to it. see proxy_type\n- _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\b2_\bp_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n-sets the _\bi_\b2_\bp SAM bridge to connect to. set the port with the i2p_port setting.\n-Unless this is set, i2p torrents are not supported. This setting is separate\n-from the other proxy settings since i2p torrents and their peers are\n-orthogonal. You can have i2p peers as well as regular peers via a proxy.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b |\n-|_\bp_\be_\be_\br_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b-_\bL_\bT_\b2_\b0_\bA_\b0_\b-|\n-this is the fingerprint for the client. It will be used as the prefix to the\n-peer_id. If this is 20 bytes (or longer) it will be truncated to 20 bytes and\n-used as the entire peer-id\n-There is a utility function, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b) that can be used to\n-generate a standard client peer ID fingerprint prefix.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bh_\bt_\b__\bb_\bo_\bo_\bt_\bs_\bt_\br_\ba_\bp_\b__\bn_\bo_\bd_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bd_\bh_\bt_\b._\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bo_\br_\bg_\b:_\b2_\b5_\b4_\b0_\b1|\n-This is a comma-separated list of IP port-pairs. They will be added to the DHT\n-node (if it's enabled) as back-up nodes in case we don't know of any.\n-Changing these after the DHT has been started may not have any effect until the\n-DHT is restarted.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\bl_\bo_\bw_\b__\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bp_\be_\br_\b__\bi_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-determines if connections from the same IP address as existing connections\n-should be rejected or not. Rejecting multiple connections from the same IP\n-address will prevent abusive behavior by peers. The logic for determining\n-whether connections are to the same peer is more complicated with this enabled,\n-and more likely to fail in some edge cases. It is not recommended to enable\n-this feature.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\be_\bn_\bd_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bh_\ba_\bv_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-send_redundant_have controls if have messages will be sent to peers that\n-already have the piece. This is typically not necessary, but it might be\n-necessary for collecting statistics in some cases.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bs_\be_\b__\bd_\bh_\bt_\b__\ba_\bs_\b__\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-use_dht_as_fallback determines how the DHT is used. If this is true, the DHT\n-will only be used for torrents where all trackers in its tracker list has\n-failed. Either by an explicit error message or a time out. If this is false,\n-the DHT is used regardless of if the trackers fail or 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bp_\bn_\bp_\b__\bi_\bg_\bn_\bo_\br_\be_\b__\bn_\bo_\bn_\br_\bo_\bu_\bt_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-upnp_ignore_nonrouters indicates whether or not the UPnP implementation should\n-ignore any broadcast response from a device whose address is not on our subnet.\n-i.e. it's a way to not talk to other people's routers by mistake.\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bs_\be_\b__\bp_\ba_\br_\bo_\bl_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-use_parole_mode specifies if parole mode should be used. Parole mode means that\n-peers that participate in pieces that fail the hash check are put in a mode\n-where they are only allowed to download whole pieces. If the whole piece a peer\n-in parole mode fails the hash check, it is banned. If a peer participates in a\n-piece that passes the hash check, it is taken out of parole mode.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bp_\br_\be_\bf_\be_\br_\b__\bs_\be_\be_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-if true, prefer seeding torrents when determining which torrents to give active\n-slots to. If false, give preference to downloading torrents\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bo_\bn_\bt_\b__\bc_\bo_\bu_\bn_\bt_\b__\bs_\bl_\bo_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if dont_count_slow_torrents is true, torrents without any payload transfers are\n-not subject to the active_seeds and active_downloads limits. This is intended\n-to make it more likely to utilize all available bandwidth, and avoid having\n-torrents that don't transfer anything block the active slots.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bl_\bo_\bs_\be_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-close_redundant_connections specifies whether libtorrent should close\n-connections where both ends have no utility in keeping the connection open. For\n-instance if both ends have completed their downloads, there's no point in\n-keeping it open.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-If prioritize_partial_pieces is true, partial pieces are picked before pieces\n-that are more rare. If false, rare pieces are always prioritized, unless the\n-number of partial pieces is growing out of proportion.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b__\bi_\bp_\b__\bo_\bv_\be_\br_\bh_\be_\ba_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if set to true, the estimated TCP/IP overhead is drained from the rate\n-limiters, to avoid exceeding the limits with the total traffic\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bt_\bo_\b__\ba_\bl_\bl_\b__\bt_\bi_\be_\br_\bs_\b _\b _\b _\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bt_\bo_\b__\ba_\bl_\bl_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-announce_to_all_trackers controls how multi tracker torrents are treated. If\n-this is set to true, all trackers in the same tier are announced to in\n-parallel. If all trackers in tier 0 fails, all trackers in tier 1 are announced\n-as well. If it's set to false, the behavior is as defined by the multi tracker\n-specification.\n-announce_to_all_tiers also controls how multi tracker torrents are treated.\n-When this is set to true, one tracker from each tier is announced to. This is\n-the uTorrent behavior. To be compliant with the Multi-tracker specification,\n-set it to false.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\be_\bf_\be_\br_\b__\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-prefer_udp_trackers: true means that trackers may be rearranged in a way that\n-udp trackers are always tried before http trackers for the same hostname.\n-Setting this to false means that the tracker's tier is respected and there's no\n-preference of one protocol over another.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bh_\ba_\bs_\bh_\b__\bc_\bh_\be_\bc_\bk_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set to true, all data downloaded from peers will be assumed to be correct,\n-and not tested to match the hashes in the torrent this is only useful for\n-simulation and testing purposes (typically combined with disabled_storage)\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\bl_\bo_\bw_\b__\bi_\b2_\bp_\b__\bm_\bi_\bx_\be_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-if this is true, i2p torrents are allowed to also get peers from other sources\n-than the tracker, and connect to regular IPs, not providing any anonymization.\n-This may be useful if the user is not interested in the anonymization of i2p,\n-but still wants to be able to connect to i2p peers.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bn_\bo_\b__\ba_\bt_\bi_\bm_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-no_atime_storage this is a Linux-only option and passes in the O_NOATIME to\n-open() when opening files. This may lead to some disk performance improvements.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bs_\bt_\ba_\br_\bt_\bs_\b__\bq_\bu_\be_\bu_\be_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-incoming_starts_queued_torrents. If a torrent has been paused by the auto\n-managed feature in libtorrent, i.e. the torrent is paused and auto managed,\n-this feature affects whether or not it is automatically started on an incoming\n-connection. The main reason to queue torrents, is not to make them unavailable,\n-but to save on the overhead of announcing to the trackers, the DHT and to avoid\n-spreading one's unchoke slots too thin. If a peer managed to find us, even\n-though we're no in the torrent anymore, this setting can make us start the\n-torrent and serve it.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bp_\bo_\br_\bt_\b__\bt_\br_\bu_\be_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set to true, the downloaded counter sent to trackers will include the\n-actual number of payload bytes downloaded including redundant bytes. If set to\n-false, it will not include any redundancy bytes\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bt_\br_\bi_\bc_\bt_\b__\be_\bn_\bd_\b__\bg_\ba_\bm_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-strict_end_game_mode controls when a block may be requested twice. If this is\n-true, a block may only be requested twice when there's at least one request to\n-every piece that's left to download in the torrent. This may slow down progress\n-on some pieces sometimes, but it may also avoid downloading a lot of redundant\n-bytes. If this is false, libtorrent attempts to use each peer connection to its\n-max, by always requesting something, even if it means requesting something that\n-has been requested from another peer already.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bu_\bt_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bu_\bt_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bt_\bc_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bt_\bc_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-Enables incoming and outgoing, TCP and uTP peer connections. false is disabled\n-and true is enabled. When outgoing connections are disabled, libtorrent will\n-simply not make outgoing peer connections with the specific transport protocol.\n-Disabled incoming peer connections will simply be rejected. These options only\n-apply to peer connections, not tracker- or any other kinds of connections.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bn_\bo_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b__\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-no_recheck_incomplete_resume determines if the storage should check the whole\n-files when resume data is incomplete or missing or whether it should simply\n-assume we don't have any of the data. If false, any existing files will be\n-checked. By setting this setting to true, the files won't be checked, but will\n-go straight to download mode.\n- _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bn_\bo_\bn_\by_\bm_\bo_\bu_\bs_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-anonymous_mode: When set to true, the client tries to hide its identity to a\n-certain degree.\n- * A generic user-agent will be used for trackers (except for private\n- torrents).\n- * Your local IPv4 and IPv6 address won't be sent as query string parameters\n- to private trackers.\n- * If announce_ip is configured, it will not be sent to trackers\n- * The client version will not be sent to peers in the extension handshake.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bp_\bo_\br_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-specifies whether downloads from web seeds is reported to the tracker or not.\n-Turning it off also excludes web seed traffic from other stats and download\n-rate reporting via the libtorrent API.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\be_\be_\bd_\bi_\bn_\bg_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-seeding_outgoing_connections determines if seeding (and finished) torrents\n-should attempt to make outgoing connections or not. It may be set to false in\n-very specific applications where the cost of making outgoing connections is\n-high, and there are no or small benefits of doing so. For instance, if no nodes\n-are behind a firewall or a NAT, seeds don't need to make outgoing connections.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bn_\bo_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\br_\bi_\bv_\bi_\bl_\be_\bg_\be_\bd_\b__\bp_\bo_\br_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when this is true, libtorrent will not attempt to make outgoing connections to\n-peers whose port is < 1024. This is a safety precaution to avoid being part of\n-a DDoS attack\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bm_\bo_\bo_\bt_\bh_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-smooth_connects means the number of connection attempts per second may be\n-limited to below the connection_speed, in case we're close to bump up against\n-the limit of number of connections. The intention of this setting is to more\n-evenly distribute our connection attempts over time, instead of attempting to\n-connect in batches, and timing them out in batches.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\bw_\ba_\by_\bs_\b__\bs_\be_\bn_\bd_\b__\bu_\bs_\be_\br_\b__\ba_\bg_\be_\bn_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-always send user-agent in every web seed request. If false, only the first\n-request per http connection will include the user agent\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bp_\bp_\bl_\by_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b__\bt_\bo_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-apply_ip_filter_to_trackers determines whether the IP filter applies to\n-trackers as well as peers. If this is set to false, trackers are exempt from\n-the IP filter (if there is one). If no IP filter is set, this setting is\n-irrelevant.\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bb_\ba_\bn_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-when true, web seeds sending bad data will be banned\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b__\bs_\bh_\ba_\br_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if false, prevents libtorrent to advertise share-mode support\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bp_\bo_\br_\bt_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bb_\by_\bt_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if this is true, the number of redundant bytes is sent to the 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\by_\bs_\bt_\be_\bm_\b__\bp_\bo_\br_\bt_\b__\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if this is true, libtorrent will fall back to listening on a port chosen by the\n-operating system (i.e. binding to port 0). If a failure is preferred, set this\n-to false.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-when this is true, and incoming encrypted connections are enabled,\n-&supportcrypt=1 is included in http tracker announces\n- _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bu_\bp_\bn_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-Starts and stops the UPnP service. When started, the listen port and the DHT\n-port are attempted to be forwarded on local UPnP router devices.\n-The upnp object returned by start_upnp() can be used to add and remove\n-arbitrary port mappings. Mapping status is returned through the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\ba_\bl_\be_\br_\bt\n-and the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt. The object will be valid until stop_upnp() is\n-called. See _\bu_\bp_\bn_\bp_\b _\ba_\bn_\bd_\b _\bn_\ba_\bt_\b _\bp_\bm_\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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bn_\ba_\bt_\bp_\bm_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-Starts and stops the NAT-PMP service. When started, the listen port and the DHT\n-port are attempted to be forwarded on the router through NAT-PMP.\n-The natpmp object returned by start_natpmp() can be used to add and remove\n-arbitrary port mappings. Mapping status is returned through the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\ba_\bl_\be_\br_\bt\n-and the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt. The object will be valid until stop_natpmp() is\n-called. See _\bu_\bp_\bn_\bp_\b _\ba_\bn_\bd_\b _\bn_\ba_\bt_\b _\bp_\bm_\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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bl_\bs_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-Starts and stops Local Service Discovery. This service will broadcast the info-\n-hashes of all the non-private torrents on the local network to look for peers\n-on the same swarm within multicast reach.\n- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bd_\bh_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-starts the dht node and makes the trackerless service available to torrents.\n- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\be_\bf_\be_\br_\b__\br_\bc_\b4_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-if the allowed encryption level is both, setting this to true will prefer RC4\n-if both methods are offered, plain text otherwise\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if true, hostname lookups are done via the configured proxy (if any). This is\n-only supported by SOCKS5 and HTTP.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if true, peer connections are made (and accepted) over the configured proxy, if\n-any. Web seeds as well as regular bittorrent peer connections are considered\n-\"peer connections\". Anything transporting actual torrent payload (trackers and\n-DHT traffic are not considered peer connections).\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bu_\bt_\bo_\b__\bs_\be_\bq_\bu_\be_\bn_\bt_\bi_\ba_\bl_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if this setting is true, torrents with a very high availability of pieces (and\n-seeds) are downloaded sequentially. This is more efficient for the disk I/O.\n-With many seeds, the download order is unlikely to matter anyway\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-if true, tracker connections are made over the configured proxy, if any.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-Starts and stops the internal IP table route changes notifier.\n-The current implementation supports multiple platforms, and it is recommended\n-to have it enable, but you may want to disable it if it's supported but\n-unreliable, or if you have a better way to detect the changes. In the later\n-case, you should manually call session_handle::reopen_network_sockets to ensure\n-network changes are taken in consideration.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bp_\br_\be_\bf_\be_\br_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-when this is true, nodes whose IDs are derived from their source IP according\n-to _\bB_\bE_\bP_\b _\b4_\b2 are preferred in the routing table.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bi_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-determines if the routing table entries should restrict entries to one per IP.\n-This defaults to true, which helps mitigate some attacks on the DHT. It\n-prevents adding multiple nodes with IPs with a very close CIDR distance.\n-when set, nodes whose IP address that's in the same /24 (or /64 for IPv6) range\n-in the same routing table bucket. This is an attempt to mitigate node ID\n-spoofing attacks also restrict any IP to only have a single _\be_\bn_\bt_\br_\by in the whole\n-routing table\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\bi_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-determines if DHT searches should prevent adding nodes with IPs with very close\n-CIDR distance. This also defaults to true and helps mitigate certain attacks on\n-the DHT.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\be_\bx_\bt_\be_\bn_\bd_\be_\bd_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-makes the first buckets in the DHT routing table fit 128, 64, 32 and 16 nodes\n-respectively, as opposed to the standard size of 8. All other buckets have size\n-8 still.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\ba_\bg_\bg_\br_\be_\bs_\bs_\bi_\bv_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-slightly changes the lookup behavior in terms of how many outstanding requests\n-we keep. Instead of having branch factor be a hard limit, we always keep b\bbr\bra\ban\bnc\bch\bh\n-f\bfa\bac\bct\bto\bor\br outstanding requests to the closest nodes. i.e. every time we get\n-results back with closer nodes, we query them right away. It lowers the lookup\n-times at the cost of more outstanding queries.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bp_\br_\bi_\bv_\ba_\bc_\by_\b__\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set, perform lookups in a way that is slightly more expensive, but which\n-minimizes the amount of information leaked about you.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\be_\bn_\bf_\bo_\br_\bc_\be_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set, node's whose IDs that are not correctly generated based on its\n-external IP are ignored. When a query arrives from such node, an error message\n-is returned with a message saying \"invalid node ID\".\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bi_\bg_\bn_\bo_\br_\be_\b__\bd_\ba_\br_\bk_\b__\bi_\bn_\bt_\be_\br_\bn_\be_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-ignore DHT messages from parts of the internet we wouldn't expect to see any\n-traffic from\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\br_\be_\ba_\bd_\b__\bo_\bn_\bl_\by_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set, the other nodes won't keep this node in their routing tables, it's\n-meant for low-power and/or ephemeral devices that cannot support the DHT, it is\n-also useful for mobile devices which are sensitive to network traffic and\n-battery life. this node no longer responds to 'query' messages, and will place\n-a 'ro' key (value = 1) in the top-level message dictionary of outgoing query\n-messages.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\bi_\be_\bc_\be_\b__\be_\bx_\bt_\be_\bn_\bt_\b__\ba_\bf_\bf_\bi_\bn_\bi_\bt_\by_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when this is true, create an affinity for downloading 4 MiB extents of adjacent\n-pieces. This is an attempt to achieve better disk I/O throughput by downloading\n-larger extents of bytes, for torrents with small piece 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\b__\bh_\bt_\bt_\bp_\bs_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-when set to true, the certificate of HTTPS trackers and HTTPS web seeds will be\n-validated against the system's certificate store (as defined by OpenSSL). If\n-the system does not have a certificate store, this option may have to be\n-disabled in order to get trackers and web seeds to work).\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bs_\br_\bf_\b__\bm_\bi_\bt_\bi_\bg_\ba_\bt_\bi_\bo_\bn_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n-when enabled, tracker and web seed requests are subject to certain\n-restrictions.\n-An HTTP(s) tracker requests to localhost (loopback) must have the request path\n-start with \"/announce\". This is the conventional bittorrent tracker request.\n-Any other HTTP(S) tracker request to loopback will be rejected. This applies to\n-trackers that redirect to loopback as well.\n-Web seeds that end up on the client's local network (i.e. in a private IP\n-address range) may not include query string arguments. This applies to web\n-seeds redirecting to the local network as well.\n-Web seeds on global IPs (i.e. not local network) may not redirect to a local\n-network 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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\bl_\bo_\bw_\b__\bi_\bd_\bn_\ba_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when disabled, any tracker or web seed with an IDNA hostname (internationalized\n-domain name) is ignored. This is a security precaution to avoid various unicode\n-encoding attacks that might happen at the application level.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bs_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bv_\ba_\bl_\bi_\bd_\b__\bd_\ba_\bt_\ba_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-when set to true, enables the attempt to use SetFileValidData() to pre-allocate\n-disk space. This system call will only work when running with Administrator\n-privileges on Windows, and so this setting is only relevant in that scenario.\n-Using SetFileValidData() poses a security risk, as it may reveal previously\n-deleted information from the disk.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bu_\bd_\bp_\b__\bs_\be_\bn_\bd_\b__\bl_\bo_\bc_\ba_\bl_\b__\be_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n-When using a SOCKS5 proxy, UDP traffic is routed through the proxy by sending a\n-UDP ASSOCIATE command. If this option is true, the UDP ASSOCIATE command will\n-include the IP address and listen port to the local UDP socket. This indicates\n-to the proxy which source endpoint to expect our packets from. The benefit is\n-that incoming packets can be forwarded correctly, before any outgoing packets\n-are sent. The risk is that if there's a NAT between the client and the proxy,\n-the IP address specified in the protocol may not be valid from the proxy's\n-point of view.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bo_\bn_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-tracker_completion_timeout is the number of seconds the tracker connection will\n-wait from when it sent the request until it considers the tracker to have\n-timed-out.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-tracker_receive_timeout is the number of seconds to wait to receive any data\n-from the tracker. If no data is received for this number of seconds, the\n-tracker will be considered as having timed out. If a tracker is down, this is\n-the kind of timeout that will occur.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bt_\bo_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-stop_tracker_timeout is the number of seconds to wait when sending a stopped\n-message before considering a tracker to have timed out. This is usually\n-shorter, to make the client quit faster. If the value is set to 0, the\n-connections to trackers with the stopped event are suppressed.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b |\n-|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b*_\b1_\b0_\b2_\b4|\n-this is the maximum number of bytes in a tracker response. If a response size\n-passes this number of bytes it will be rejected and the connection will be\n-closed. On gzipped responses this size is measured on the uncompressed data.\n-So, if you get 20 bytes of gzip response that'll expand to 2 megabytes, it will\n-be interrupted before the entire response has been uncompressed (assuming the\n-limit is lower than 2 MiB).\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\bi_\be_\bc_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-the number of seconds from a request is sent until it times out if no piece\n-response is returned.\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n-the number of seconds one block (16 kiB) is expected to be received within. If\n-it's not, the block is requested from a different 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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b__\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-the length of the request queue given in the number of seconds it should take\n-for the other end to send all the pieces. i.e. the actual number of requests\n-depends on the download rate and this number.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bi_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n-the number of outstanding block requests a peer is allowed to queue up in the\n-client. If a peer sends more requests than this (before the first one has been\n-sent) the last request will be dropped. the higher this is, the faster upload\n-speeds the client can get to a single 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bo_\bu_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n-max_out_request_queue is the maximum number of outstanding requests to send to\n-a peer. This limit takes precedence over request_queue_time. i.e. no matter the\n-download speed, the number of outstanding requests will never exceed this\n-limit.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bw_\bh_\bo_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-if a whole piece can be downloaded in this number of seconds, or less, the\n-peer_connection will prefer to request whole pieces at a time from this peer.\n-The benefit of this is to better utilize disk caches by doing localized\n-accesses and also to make it easier to identify bad peers if a piece fails the\n-hash check.\n- _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\be_\be_\br_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b2_\b0_\b _\b _\b _\b |\n-peer_timeout is the number of seconds the peer connection should wait (for any\n-activity on the peer connection) before closing it due to time out. 120 seconds\n-is specified in the protocol specification. After half the time out, a keep\n-alive message is sent.\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-same as peer_timeout, but only applies to url-seeds. this is usually set lower,\n-because web servers are expected to be more reliable.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bp_\bi_\bp_\be_\bl_\bi_\bn_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-controls the pipelining size of url and http seeds. i.e. the number of HTTP\n-request to keep outstanding before waiting for the first one to complete. It's\n-common for web servers to limit this to a relatively low number, like 5\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bw_\ba_\bi_\bt_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-number of seconds until a new retry of a url-seed takes place. Default retry\n-value for http-seeds that don't provide a valid retry-after header.\n- _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bf_\bi_\bl_\be_\b__\bp_\bo_\bo_\bl_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b0_\b _\b _\b _\b _\b |\n-sets the upper limit on the total number of files this _\bs_\be_\bs_\bs_\bi_\bo_\bn will keep open.\n-The reason why files are left open at all is that some anti virus software\n-hooks on every file close, and scans the file for viruses. deferring the\n-closing of the files will be the difference between a usable system and a\n-completely hogged down system. Most operating systems also has a limit on the\n-total number of file descriptors a process may have open.\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bf_\ba_\bi_\bl_\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-max_failcount is the maximum times we try to connect to a peer before stop\n-connecting again. If a peer succeeds, the failure counter is reset. If a peer\n-is retrieved from a peer source (other than DHT) the failcount is decremented\n-by one, allowing another try.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\bi_\bn_\b__\br_\be_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n-the number of seconds to wait to reconnect to a peer. this time is multiplied\n-with the failcount.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b _\b _\b _\b |\n-peer_connect_timeout the number of seconds to wait after a connection attempt\n-is initiated to a peer until it is considered as having timed out. This setting\n-is especially important in case the number of half-open connections are\n-limited, since stale half-open connection may delay the connection of other\n-peers considerably.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bs_\bp_\be_\be_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-connection_speed is the number of connection attempts that are made per second.\n-If a number < 0 is specified, it will default to 200 connections per second. If\n-0 is specified, it means don't make outgoing connections at 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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\bi_\bt_\by_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b0_\b _\b _\b _\b |\n-if a peer is uninteresting and uninterested for longer than this number of\n-seconds, it will be disconnected.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b _\b _\b _\b |\n-unchoke_interval is the number of seconds between chokes/unchokes. On this\n-interval, peers are re-evaluated for being choked/unchoked. This is defined as\n-30 seconds in the protocol, and it should be significantly longer than what it\n-takes for TCP to ramp up to it's max rate.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-optimistic_unchoke_interval is the number of seconds between each o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc\n-unchoke. On this timer, the currently optimistically unchoked peer will change.\n- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bn_\bu_\bm_\b__\bw_\ba_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n-num_want is the number of peers we want from each tracker request. It defines\n-what is sent as the &num_want= parameter to the 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bp_\bi_\bc_\bk_\be_\br_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b _\b _\b _\b _\b _\b |\n-initial_picker_threshold specifies the number of pieces we need before we\n-switch to rarest first picking. The first initial_picker_threshold pieces in\n-any torrent are picked at random , the following pieces are picked in rarest\n-first order.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b__\bs_\be_\bt_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-the number of allowed pieces to send to peers that supports the fast extensions\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n-|_\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bn_\bo_\b__\bp_\bi_\be_\bc_\be_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs|\n-suggest_mode controls whether or not libtorrent will send out suggest messages\n-to create a bias of its peers to request certain pieces. The modes are:\n- * no_piece_suggestions which will not send out suggest messages.\n- * suggest_read_cache which will send out suggest messages for the most\n- recent pieces that are in the read cache.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b |\n-|_\bm_\ba_\bx_\b__\bq_\bu_\be_\bu_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bb_\by_\bt_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n-max_queued_disk_bytes is the maximum number of bytes, to be written to disk,\n-that can wait in the disk I/O thread queue. This queue is only for waiting for\n-the disk I/O thread to receive the job and either write it to disk or insert it\n-in the write cache. When this limit is reached, the peer connections will stop\n-reading data from their sockets, until the disk thread catches up. Setting this\n-too low will severely limit your download rate.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-the number of seconds to wait for a handshake response from a peer. If no\n-response is received within this time, the peer is disconnected.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b |\n-|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bl_\bo_\bw_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b*_\b _\b1_\b0_\b2_\b4_\b |\n-|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b*_\b _\b1_\b0_\b2_\b4|\n-|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b__\bf_\ba_\bc_\bt_\bo_\br_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b _\b _\b _\b |\n-send_buffer_low_watermark the minimum send buffer target size (send buffer\n-includes bytes pending being read from disk). For good and snappy seeding\n-performance, set this fairly high, to at least fit a few blocks. This is\n-essentially the initial window size which will determine how fast we can ramp\n-up the send rate\n-if the send buffer has fewer bytes than send_buffer_watermark, we'll read\n-another 16 kiB block onto it. If set too small, upload rate capacity will\n-suffer. If set too high, memory will be wasted. The actual watermark may be\n-lower than this in case the upload rate is low, this is the upper limit.\n-the current upload rate to a peer is multiplied by this factor to get the send\n-buffer watermark. The factor is specified as a percentage. i.e. 50 -> 0.5 This\n-product is clamped to the send_buffer_watermark setting to not exceed the max.\n-For high speed upload, this should be set to a greater value than 100. For high\n-capacity connections, setting this higher can improve upload performance and\n-disk throughput. Setting it too high may waste RAM and create a bias towards\n-read jobs over write jobs.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n-|_\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bf_\bi_\bx_\be_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b__\bc_\bh_\bo_\bk_\be_\br|\n-|_\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\br_\bo_\bu_\bn_\bd_\b__\br_\bo_\bb_\bi_\bn_\b _\b _\b _\b _\b _\b _\b |\n-choking_algorithm specifies which algorithm to use to determine how many peers\n-to unchoke. The unchoking algorithm for downloading torrents is always \"tit-\n-for-tat\", i.e. the peers we download the fastest from are unchoked.\n-The options for choking algorithms are defined in the _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt enum.\n-seed_choking_algorithm controls the seeding unchoke behavior. i.e. How we\n-select which peers to unchoke for seeding torrents. Since a seeding torrent\n-isn't downloading anything, the tit-for-tat mechanism cannot be used. The\n-available options are defined in the _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt enum.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\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_\bi_\bs_\bk_\b__\bi_\bo_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bD_\bI_\bS_\bK_\b__\bW_\bR_\bI_\bT_\bE_\b__\bM_\bO_\bD_\bE_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\br_\be_\ba_\bd_\b__\bm_\bo_\bd_\be_\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\bh_\be|\n-determines how files are opened when they're in read only mode versus read and\n-write mode. The options are:\n- enable_os_cache\n- Files are opened normally, with the OS caching reads and writes.\n- disable_os_cache\n- This opens all files in no-cache mode. This corresponds to the OS not\n- letting blocks for the files linger in the cache. This makes sense in\n- order to avoid the bittorrent client to potentially evict all other\n- processes' cache by simply handling high throughput and large files. If\n- libtorrent's read cache is disabled, enabling this may reduce\n- performance.\n- write_through\n- flush pieces to disk as they complete validation.\n-One reason to disable caching is that it may help the operating system from\n-growing its file cache indefinitely.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-|_\bn_\bu_\bm_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bp_\bo_\br_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-this is the first port to use for binding outgoing connections to. This is\n-useful for users that have routers that allow QoS settings based on local port.\n-when binding outgoing connections to specific ports, num_outgoing_ports is the\n-size of the range. It should be more than a few\n-Warning\n-setting outgoing ports will limit the ability to keep multiple connections to\n-the same client, even for different torrents. It is not recommended to change\n-this setting. Its main purpose is to use as an escape hatch for cheap routers\n-with QoS capability but can only classify flows based on port numbers.\n-It is a range instead of a single port because of the problems with failing to\n-reconnect to peers if a previous socket to that peer and port is in TIME_WAIT\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- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\be_\be_\br_\b__\bd_\bs_\bc_\bp_\b|_\bi_\bn_\bt_\b _\b|_\b0_\bx_\b0_\b4_\b _\b _\b |\n-peer_dscp determines the DSCP field in the IP header of every packet sent to\n-peers (including web seeds). 0x0 means no marking, 0x04 represents Lower\n-Effort. For more details see _\bR_\bF_\bC_\b _\b8_\b6_\b2_\b2.\n-peer_tos is the backwards compatible name for this setting.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bs_\be_\be_\bd_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b _\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bh_\bt_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b8_\b8_\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b0_\b0_\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bl_\bs_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n-for auto managed torrents, these are the limits they are subject to. If there\n-are too many torrents some of the auto managed ones will be paused until some\n-slots free up. active_downloads and active_seeds controls how many active\n-seeding and downloading torrents the queuing mechanism allows. The target\n-number of active torrents is min(active_downloads + active_seeds,\n-active_limit). active_downloads and active_seeds are upper limits on the number\n-of downloading torrents and seeding torrents respectively. Setting the value to\n--1 means unlimited.\n-For example if there are 10 seeding torrents and 10 downloading torrents, and\n-active_downloads is 4 and active_seeds is 4, there will be 4 seeds active and 4\n-downloading torrents. If the settings are active_downloads = 2 and active_seeds\n-= 4, then there will be 2 downloading torrents and 4 seeding torrents active.\n-Torrents that are not auto managed are not counted against these limits.\n-active_checking is the limit of number of simultaneous checking torrents.\n-active_limit is a hard limit on the number of active (auto managed) torrents.\n-This limit also applies to slow torrents.\n-active_dht_limit is the max number of torrents to announce to the DHT.\n-active_tracker_limit is the max number of torrents to announce to their\n-trackers.\n-active_lsd_limit is the max number of torrents to announce to the local network\n-over the local service discovery protocol.\n-You can have more torrents a\bac\bct\bti\biv\bve\be, even though they are not announced to the\n-DHT, lsd or their tracker. If some peer knows about you for any reason and\n-tries to connect, it will still be accepted, unless the torrent is paused,\n-which means it won't accept any connections.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-auto_manage_interval is the number of seconds between the torrent queue is\n-updated, and rotated.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b |\n-|_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b4_\b _\b*_\b _\b6_\b0_\b _\b*_\b _\b6_\b0|\n-this is the limit on the time a torrent has been an active seed (specified in\n-seconds) before it is considered having met the seed limit criteria. See\n-_\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bu_\bt_\bo_\b__\bs_\bc_\br_\ba_\bp_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b8_\b0_\b0_\b _\b _\b |\n-|_\ba_\bu_\bt_\bo_\b__\bs_\bc_\br_\ba_\bp_\be_\b__\bm_\bi_\bn_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b _\b _\b _\b |\n-auto_scrape_interval is the number of seconds between scrapes of queued\n-torrents (auto managed and paused torrents). Auto managed torrents that are\n-paused, are scraped regularly in order to keep track of their downloader/seed\n-ratio. This ratio is used to determine which torrents to seed and which to\n-pause.\n-auto_scrape_min_interval is the minimum number of seconds between any automatic\n-scrape (regardless of torrent). In case there are a large number of paused auto\n-managed torrents, this puts a limit on how often a scrape request is sent.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n-|_\bm_\ba_\bx_\b__\bp_\ba_\bu_\bs_\be_\bd_\b__\bp_\be_\be_\br_\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b0_\b _\b _\b |\n-max_peerlist_size is the maximum number of peers in the list of known peers.\n-These peers are not necessarily connected, so this number should be much\n-greater than the maximum number of connected peers. Peers are evicted from the\n-cache when the list grows passed 90% of this limit, and once the size hits the\n-limit, peers are no longer added to the list. If this limit is set to 0, there\n-is no limit on how many peers we'll keep in the peer list.\n-max_paused_peerlist_size is the max peer list size used for torrents that are\n-paused. This can be used to save memory for paused torrents, since it's not as\n-important for them to keep a large peer list.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\bi_\bn_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n-this is the minimum allowed announce interval for a tracker. This is specified\n-in seconds and is used as a sanity check on what is returned from a tracker. It\n-mitigates hammering mis-configured trackers.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bs_\bt_\ba_\br_\bt_\bu_\bp_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n-this is the number of seconds a torrent is considered active after it was\n-started, regardless of upload and download speed. This is so that newly started\n-torrents are not considered inactive until they have a fair chance to start\n-downloading.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\be_\be_\bd_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b__\bq_\bu_\bo_\bt_\ba_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-seeding_piece_quota is the number of pieces to send to a peer, when seeding,\n-before rotating in another peer to the unchoke set.\n- _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\br_\be_\bj_\be_\bc_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n-max_rejects is the number of piece requests we will reject in a row while a\n-peer is choked before the peer is considered abusive and is disconnected.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bc_\bv_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-|_\bs_\be_\bn_\bd_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-specifies the buffer sizes set on peer sockets. 0 means the OS default (i.e.\n-don't change the buffer sizes). The socket buffer sizes are changed using\n-setsockopt() with SOL_SOCKET/SO_RCVBUF and SO_SNDBUFFER.\n-Note that uTP peers share a single UDP socket buffer for each of the\n-listen_interfaces, along with DHT and UDP tracker traffic. If the buffer size\n-is too small for the combined traffic through the socket, packets may be\n-dropped.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bm_\ba_\bx_\b__\bp_\be_\be_\br_\b__\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n-the max number of bytes a single peer connection's receive buffer is allowed to\n-grow 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bd_\bi_\bs_\bk_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b*_\b _\b6_\b0|\n-optimistic_disk_retry is the number of seconds from a disk write errors occur\n-on a torrent until libtorrent will take it out of the upload mode, to test if\n-the error condition has been fixed.\n-libtorrent will only do this automatically for auto managed torrents.\n-You can explicitly take a torrent out of upload only mode using set_upload_mode\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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b _\b _\b _\b _\b |\n-max_suggest_pieces is the max number of suggested piece indices received from a\n-peer that's remembered. If a peer floods suggest messages, this limit prevents\n-libtorrent from using too much RAM.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bl_\bo_\bc_\ba_\bl_\b__\bs_\be_\br_\bv_\bi_\bc_\be_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n-local_service_announce_interval is the time between local network announces for\n-a torrent. This interval is specified in seconds.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b*_\b _\b6_\b0|\n-dht_announce_interval is the number of seconds between announcing torrents to\n-the distributed hash table (DHT).\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bt_\bo_\bk_\be_\bn_\b__\be_\bx_\bp_\bi_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n-udp_tracker_token_expiry is the number of seconds libtorrent will keep UDP\n-tracker connection tokens around for. This is specified to be 60 seconds. The\n-higher this value is, the fewer packets have to be sent to the UDP tracker. In\n-order for higher values to work, the tracker needs to be configured to match\n-the expiration time for tokens.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bn_\bu_\bm_\b__\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-num_optimistic_unchoke_slots is the number of optimistic unchoke slots to use.\n-Having a higher number of optimistic unchoke slots mean you will find the good\n-peers faster but with the trade-off to use up more bandwidth. 0 means\n-automatic, where libtorrent opens up 20% of your allowed upload slots as\n-optimistic unchoke slots.\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bp_\be_\bx_\b__\bp_\be_\be_\br_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n-the max number of peers we accept from pex messages from a single peer. this\n-limits the number of concurrent peers any of our peers claims to be connected\n-to. If they claim to be connected to more than this, we'll ignore any peer that\n-exceeds this limit\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bt_\bi_\bc_\bk_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n-tick_interval specifies the number of milliseconds between internal ticks. This\n-is the frequency with which bandwidth quota is distributed to peers. It should\n-not be more than one second (i.e. 1000 ms). Setting this to a low value (around\n-100) means higher resolution bandwidth quota distribution, setting it to a\n-higher value saves CPU cycles.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bh_\ba_\br_\be_\b__\bm_\bo_\bd_\be_\b__\bt_\ba_\br_\bg_\be_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-share_mode_target specifies the target share ratio for share mode torrents. If\n-set to 3, we'll try to upload 3 times as much as we download. Setting this very\n-high, will make it very conservative and you might end up not downloading\n-anything ever (and not affecting your share ratio). It does not make any sense\n-to set this any lower than 2. For instance, if only 3 peers need to download\n-the rarest piece, it's impossible to download a single piece and upload it more\n-than 3 times. If the share_mode_target is set to more than 3, nothing is\n-downloaded.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bp_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-|_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-upload_rate_limit and download_rate_limit sets the session-global limits of\n-upload and download rate limits, in bytes per second. By default peers on the\n-local network are not rate limited.\n-A value of 0 means unlimited.\n-For fine grained control over rate limits, including making them apply to local\n-peers, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b8_\b0_\b0_\b0_\b _\b _\b |\n-the number of bytes per second (on average) the DHT is allowed to send. If the\n-incoming requests causes to many bytes to be sent in responses, incoming\n-requests will be dropped until the quota has been replenished.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b8_\b _\b _\b _\b _\b _\b |\n-unchoke_slots_limit is the max number of unchoked peers in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. The\n-number of unchoke slots may be ignored depending on what choking_algorithm is\n-set to. Setting this limit to -1 means unlimited, i.e. all peers will always be\n-unchoked.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n-connections_limit sets a global limit on the number of connections opened. The\n-number of connections is set to a hard minimum of at least two per torrent, so\n-if you set a too low connections limit, and open too many torrents, the limit\n-will not be met.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bs_\bl_\ba_\bc_\bk_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-connections_slack is the number of incoming connections exceeding the\n-connection limit to accept in order to potentially replace existing ones.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bt_\bp_\b__\bt_\ba_\br_\bg_\be_\bt_\b__\bd_\be_\bl_\ba_\by_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bg_\ba_\bi_\bn_\b__\bf_\ba_\bc_\bt_\bo_\br_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bm_\bi_\bn_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bs_\by_\bn_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bf_\bi_\bn_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bn_\bu_\bm_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bl_\bo_\bs_\bs_\b__\bm_\bu_\bl_\bt_\bi_\bp_\bl_\bi_\be_\br_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n-utp_target_delay is the target delay for uTP sockets in milliseconds. A high\n-value will make uTP connections more aggressive and cause longer queues in the\n-upload bottleneck. It cannot be too low, since the noise in the measurements\n-would cause it to send too slow. utp_gain_factor is the number of bytes the uTP\n-congestion window can increase at the most in one RTT. If this is set too high,\n-the congestion controller reacts too hard to noise and will not be stable, if\n-it's set too low, it will react slow to congestion and not back off as fast.\n-utp_min_timeout is the shortest allowed uTP socket timeout, specified in\n-milliseconds. The timeout depends on the RTT of the connection, but is never\n-smaller than this value. A connection times out when every packet in a window\n-is lost, or when a packet is lost twice in a row (i.e. the resent packet is\n-lost as well).\n-The shorter the timeout is, the faster the connection will recover from this\n-situation, assuming the RTT is low enough. utp_syn_resends is the number of SYN\n-packets that are sent (and timed out) before giving up and closing the socket.\n-utp_num_resends is the number of times a packet is sent (and lost or timed out)\n-before giving up and closing the connection. utp_connect_timeout is the number\n-of milliseconds of timeout for the initial SYN packet for uTP connections. For\n-each timed out packet (in a row), the timeout is doubled. utp_loss_multiplier\n-controls how the congestion window is changed when a packet loss is\n-experienced. It's specified as a percentage multiplier for cwnd. Do not change\n-this value unless you know what you're doing. Never set it higher than 100.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n-|_\bm_\bi_\bx_\be_\bd_\b__\bm_\bo_\bd_\be_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\be_\br_\b__\bp_\br_\bo_\bp_\bo_\br_\bt_\bi_\bo_\bn_\ba_\bl|\n-The mixed_mode_algorithm determines how to treat TCP connections when there are\n-uTP connections. Since uTP is designed to yield to TCP, there's an inherent\n-problem when using swarms that have both TCP and uTP connections. If nothing is\n-done, uTP connections would often be starved out for bandwidth by the TCP\n-connections. This mode is prefer_tcp. The peer_proportional mode simply looks\n-at the current throughput and rate limits all TCP connections to their\n-proportional share based on how many of the connections are TCP. This works\n-best if uTP connections are not rate limited by the global rate limiter (which\n-they aren't by default).\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bq_\bu_\be_\bu_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-listen_queue_size is the value passed in to listen() for the listen socket. It\n-is the number of outstanding incoming connections to queue up while we're not\n-actively waiting for a connection to be accepted. 5 should be sufficient for\n-any normal client. If this is a high performance server which expects to\n-receive a lot of connections, or used in a simulator or test, it might make\n-sense to raise this number. It will not take affect until the listen_interfaces\n-settings is updated.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bb_\bo_\bo_\bs_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n-torrent_connect_boost is the number of peers to try to connect to immediately\n-when the first tracker response is received for a torrent. This is a boost to\n-given to new torrents to accelerate them starting up. The normal connect\n-scheduler is run once every second, this allows peers to be connected\n-immediately instead of waiting for the _\bs_\be_\bs_\bs_\bi_\bo_\bn tick to trigger connections.\n-This may not be set higher than 255.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\be_\br_\bt_\b__\bq_\bu_\be_\bu_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n-alert_queue_size is the maximum number of alerts queued up internally. If\n-alerts are not popped, the queue will eventually fill up to this level. Once\n-the _\ba_\bl_\be_\br_\bt queue is full, additional alerts will be dropped, and not delivered\n-to the client. Once the client drains the queue, new alerts may be delivered\n-again. In order to know that alerts have been dropped, see session_handle::\n-dropped_alerts().\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bm_\ba_\bx_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4_\b0|\n-max_metadata_size is the maximum allowed size (in bytes) to be received by the\n-metadata extension, i.e. magnet links.\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bh_\ba_\bs_\bh_\bi_\bn_\bg_\b__\bt_\bh_\br_\be_\ba_\bd_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b _\b _\b _\b _\b _\b |\n-hashing_threads is the number of disk I/O threads to use for piece hash\n-verification. These threads are i\bin\bn a\bad\bdd\bdi\bit\bti\bio\bon\bn to the regular disk I/O threads\n-specified by _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\ba_\bi_\bo_\b__\bt_\bh_\br_\be_\ba_\bd_\bs. These threads are only used for full\n-checking of torrents. The hash checking done while downloading are done by the\n-regular disk I/O threads. The _\bh_\ba_\bs_\bh_\be_\br threads do not only compute hashes, but\n-also perform the read from disk. On storage optimal for sequential access, such\n-as hard drives, this setting should be set to 1, which is also the default.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bm_\be_\bm_\b__\bu_\bs_\ba_\bg_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b6_\b _\b _\b _\b |\n-the number of blocks to keep outstanding at any given time when checking\n-torrents. Higher numbers give faster re-checks but uses more memory. Specified\n-in number of 16 kiB blocks\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\be_\bd_\bi_\bc_\bt_\bi_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-if set to > 0, pieces will be announced to other peers before they are fully\n-downloaded (and before they are hash checked). The intention is to gain 1.5\n-potential round trip times per downloaded piece. When non-zero, this indicates\n-how many milliseconds in advance pieces should be announced, before they are\n-expected to be completed.\n- _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bi_\bo_\b__\bt_\bh_\br_\be_\ba_\bd_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-for some aio back-ends, aio_threads specifies the number of io-threads to use.\n- _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bb_\ba_\bc_\bk_\bo_\bf_\bf_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b0_\b _\b _\b _\b |\n-tracker_backoff determines how aggressively to back off from retrying failing\n-trackers. This value determines x\bx in the following formula, determining the\n-number of seconds to wait until the next retry:\n- delay = 5 + 5 * x / 100 * fails^2\n-This setting may be useful to make libtorrent more or less aggressive in\n-hitting trackers.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\bh_\ba_\br_\be_\b__\br_\ba_\bt_\bi_\bo_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n-|_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\b__\br_\ba_\bt_\bi_\bo_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b7_\b0_\b0_\b _\b _\b _\b |\n-when a seeding torrent reaches either the share ratio (bytes up / bytes down)\n-or the seed time ratio (seconds as seed / seconds as downloader) or the seed\n-time limit (seconds as seed) it is considered done, and it will leave room for\n-other torrents. These are specified as percentages. Torrents that are\n-considered done will still be allowed to be seeded, they just won't have\n-priority anymore. For more, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b4_\b _\b _\b _\b _\b _\b |\n-|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b__\bc_\bu_\bt_\bo_\bf_\bf_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b9_\b0_\b _\b _\b _\b _\b |\n-|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b _\b _\b _\b |\n-peer_turnover is the percentage of peers to disconnect every turnover\n-peer_turnover_interval (if we're at the peer limit), this is specified in\n-percent when we are connected to more than limit * peer_turnover_cutoff peers\n-disconnect peer_turnover fraction of the peers. It is specified in percent\n-peer_turnover_interval is the interval (in seconds) between optimistic\n-disconnects if the disconnects happen and how many peers are disconnected is\n-controlled by peer_turnover and peer_turnover_cutoff\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bs_\be_\be_\bd_\b__\be_\bv_\be_\br_\by_\b__\bn_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-this setting controls the priority of downloading torrents over seeding or\n-finished torrents when it comes to making peer connections. Peer connections\n-are throttled by the connection_speed and the half-open connection limit. This\n-makes peer connections a limited resource. Torrents that still have pieces to\n-download are prioritized by default, to avoid having many seeding torrents use\n-most of the connection attempts and only give one peer every now and then to\n-the downloading torrent. libtorrent will loop over the downloading torrents to\n-connect a peer each, and every n:th connection attempt, a finished torrent is\n-picked to be allowed to connect to a peer. This setting controls 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b |\n-|_\bm_\ba_\bx_\b__\bh_\bt_\bt_\bp_\b__\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b*_\b1_\b0_\b2_\b4_\b*_\b2_\b0_\b4|\n-the max number of bytes to allow an HTTP response to be when announcing to\n-trackers or downloading .torrent files via the url provided in\n-add_torrent_params.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\br_\be_\bt_\br_\by_\b__\bp_\bo_\br_\bt_\b__\bb_\bi_\bn_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n-if binding to a specific port fails, should the port be incremented by one and\n-tried again? This setting specifies how many times to retry a failed port bind\n- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk_\b|_\bi_\bn_\bt_\b _\b|_\bi_\bn_\bt_\b _\b _\b _\b |\n-a bitmask combining flags from _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt defining which kinds of alerts\n-to receive\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bo_\bu_\bt_\b__\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\be_\bn_\ba_\bb_\bl_\be_\bd|\n-|_\bi_\bn_\b__\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by_\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\be_\bn_\ba_\bb_\bl_\be_\bd|\n-control the settings for incoming and outgoing connections respectively. see\n-_\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by enum for the available options. Keep in mind that protocol\n-encryption degrades performance in several respects:\n- 1. It prevents \"zero copy\" disk buffers being sent to peers, since each peer\n- needs to mutate the data (i.e. encrypt it) the data must be copied per\n- peer connection rather than sending the same buffer to multiple peers.\n- 2. The encryption itself requires more CPU than plain bittorrent protocol.\n- The highest cost is the Diffie Hellman exchange on connection setup.\n- 3. The encryption handshake adds several round-trips to the connection\n- setup, and delays transferring 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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\bb_\bo_\bt_\bh|\n-determines the encryption level of the connections. This setting will adjust\n-which encryption scheme is offered to the other peer, as well as which\n-encryption scheme is selected by the client. See _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl enum for options.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bo_\bw_\bn_\b__\br_\ba_\bt_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b4_\b8_\b _\b _\b |\n-|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\be_\b__\bu_\bp_\b__\br_\ba_\bt_\be_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b4_\b8_\b _\b _\b |\n-the download and upload rate limits for a torrent to be considered active by\n-the queuing mechanism. A torrent whose download rate is less than\n-inactive_down_rate and whose upload rate is less than inactive_up_rate for\n-auto_manage_startup seconds, is considered inactive, and another queued torrent\n-may be started. This logic is disabled if dont_count_slow_torrents is false.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bn_\bo_\bn_\be|\n-proxy to use. see _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bp_\br_\bo_\bx_\by_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-the port of the proxy server\n- _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\b2_\bp_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-sets the _\bi_\b2_\bp SAM bridge port to connect to. set the hostname with the\n-i2p_hostname setting.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bm_\ba_\bx_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bb_\by_\bt_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n-The maximum request range of an url seed in bytes. This value defines the\n-largest possible sequential web seed request. Lower values are possible but\n-will be ignored if they are lower then piece size. This value should be related\n-to your download speed to prevent libtorrent from creating too many expensive\n-http requests per second. You can select a value as high as you want but keep\n-in mind that libtorrent can't create parallel requests if the first request did\n-already select the whole file. If you combine bittorrent seeds with web seeds\n-and pick strategies like rarest first you may find your web seed requests split\n-into smaller parts because we don't download already picked pieces twice.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b8_\b0_\b0_\b _\b _\b |\n-time to wait until a new retry of a web seed name lookup\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bl_\bo_\bs_\be_\b__\bf_\bi_\bl_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\bC_\bL_\bO_\bS_\bE_\b__\bF_\bI_\bL_\bE_\b__\bI_\bN_\bT_\bE_\bR_\bV_\bA_\bL|\n-the number of seconds between closing the file opened the longest ago. 0 means\n-to disable the feature. The purpose of this is to periodically close files to\n-trigger the operating system flushing disk cache. Specifically it has been\n-observed to be required on windows to not have the disk cache grow\n-indefinitely. This defaults to 240 seconds on windows, and disabled on other\n-systems.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bt_\bp_\b__\bc_\bw_\bn_\bd_\b__\br_\be_\bd_\bu_\bc_\be_\b__\bt_\bi_\bm_\be_\br_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n-When uTP experiences packet loss, it will reduce the congestion window, and not\n-reduce it again for this many milliseconds, even if experiencing another lost\n-packet.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-the max number of web seeds to have connected per torrent at any given time.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b__\bc_\ba_\bc_\bh_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b2_\b0_\b0_\b _\b _\b |\n-the number of seconds before the internal host name resolver considers a cache\n-value timed out, negative values are interpreted as zero.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bs_\be_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\be_\bn_\bt_\b__\bl_\bo_\bw_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b3_\b8_\b4_\b _\b |\n-specify the not-sent low watermark for socket send buffers. This corresponds to\n-the, Linux-specific, TCP_NOTSENT_LOWAT TCP socket option.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\br_\ba_\bt_\be_\b__\bc_\bh_\bo_\bk_\be_\br_\b__\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b _\b _\b |\n-the rate based choker compares the upload rate to peers against a threshold\n-that increases proportionally by its size for every peer it visits, visiting\n-peers in decreasing upload rate. The number of upload slots is determined by\n-the number of peers whose upload rate exceeds the threshold. This option sets\n-the start value for this threshold. A higher value leads to fewer unchoke\n-slots, a lower value leads to 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bu_\bp_\bn_\bp_\b__\bl_\be_\ba_\bs_\be_\b__\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b6_\b0_\b0_\b _\b _\b |\n-The expiration time of UPnP port-mappings, specified in seconds. 0 means\n-permanent lease. Some routers do not support expiration times on port-maps (nor\n-correctly returning an error indicating lack of support). In those cases, set\n-this to 0. Otherwise, don't set it any lower than 5 minutes.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\ba_\bx_\b__\bc_\bo_\bn_\bc_\bu_\br_\br_\be_\bn_\bt_\b__\bh_\bt_\bt_\bp_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n-limits the number of concurrent HTTP tracker announces. Once the limit is hit,\n-tracker requests are queued and issued when an outstanding announce completes.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bs_\b__\br_\be_\bp_\bl_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n-the maximum number of peers to send in a reply to get_peers\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\bb_\br_\ba_\bn_\bc_\bh_\bi_\bn_\bg_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-the number of concurrent search request the node will send when announcing and\n-refreshing the routing table. This parameter is called alpha in the kademlia\n-paper\n- _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bf_\ba_\bi_\bl_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-the maximum number of failed tries to contact a node before it is removed from\n-the routing table. If there are known working nodes that are ready to replace a\n-failing node, it will be replaced immediately, this limit is only used to clear\n-out nodes that don't have any node that can replace them.\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n-the total number of torrents to track from the DHT. This is simply an upper\n-limit to make sure malicious DHT nodes cannot make us allocate an unbounded\n-amount of memory.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bd_\bh_\bt_\b__\bi_\bt_\be_\bm_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b7_\b0_\b0_\b _\b _\b _\b |\n-max number of items the DHT will store\n- _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n-the max number of peers to store per torrent (for the DHT)\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\br_\be_\bp_\bl_\by_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-the max number of torrents to return in a torrent search query to the DHT\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n-the number of seconds a DHT node is banned if it exceeds the rate limit. The\n-rate limit is averaged over 10 seconds to allow for bursts above the limit.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\ba_\bt_\be_\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n-the max number of packets per second a DHT node is allowed to send without\n-getting banned.\n- _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bi_\bt_\be_\bm_\b__\bl_\bi_\bf_\be_\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-the number of seconds a immutable/mutable item will be expired. default is 0,\n-means never expires.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b1_\b6_\b0_\b0_\b _\b |\n-the info-hashes sample recomputation interval (in seconds). The node will\n-precompute a subset of the tracked info-hashes and return that instead of\n-calculating it upon each request. The permissible range is between 0 and 21600\n-seconds (inclusive).\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n-the maximum number of elements in the sampled subset of info-hashes. If this\n-number is too big, expect the DHT storage implementations to clamp it in order\n-to allow UDP packets go through\n- _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b |\n-|_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\bx_\b2_\b0_\b0_\b0_\b0_\b0|\n-max_piece_count is the maximum allowed number of pieces in metadata received\n-via magnet links. Loading large torrents (with more pieces than the default\n-limit) may also require passing in a higher limit to _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b), if those are used.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bt_\bo_\bk_\be_\bn_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b0_\b0_\b0_\b0_\b0|\n-when receiving metadata (torrent file) from peers, this is the max number of\n-bencoded tokens we're willing to parse. This limit is meant to prevent DoS\n-attacks on peers. For very large torrents, this limit may have to be raised.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n-|_\bd_\bi_\bs_\bk_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt_\b:_\b:_\ba_\bu_\bt_\bo_\b__\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be|\n-controls whether disk writes will be made through a memory mapped file or via\n-normal write calls. This only affects the mmap_disk_io. When saving to a non-\n-local drive (network share, NFS or NAS) using memory mapped files is most\n-likely inferior. When writing to a local SSD (especially in DAX mode) using\n-memory mapped files likely gives the best performance. The values for this\n-setting are specified as _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\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 _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bm_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b__\bc_\bu_\bt_\bo_\bf_\bf_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b0_\b _\b _\b _\b _\b |\n-when using mmap_disk_io, files smaller than this number of blocks will not be\n-memory mapped, but will use normal pread/pwrite operations. This file size\n-limit is specified in 16 kiB blocks.\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n-|_\bi_\b2_\bp_\b__\bi_\bn_\bb_\bo_\bu_\bn_\bd_\b__\bq_\bu_\ba_\bn_\bt_\bi_\bt_\by_\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b__\bo_\bu_\bt_\bb_\bo_\bu_\bn_\bd_\b__\bq_\bu_\ba_\bn_\bt_\bi_\bt_\by_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b__\bi_\bn_\bb_\bo_\bu_\bn_\bd_\b__\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b__\bo_\bu_\bt_\bb_\bo_\bu_\bn_\bd_\b__\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n-Configures the SAM _\bs_\be_\bs_\bs_\bi_\bo_\bn quantity of I2P inbound and outbound tunnels\n-[1..16]. number of hops for I2P inbound and outbound tunnels [0..7] Changing\n-these will not trigger a reconnect to the SAM bridge, they will take effect the\n-next time the SAM connection is re-established (by restarting or changing\n-i2p_hostname or i2p_port).\n-struct settings_pack final : settings_interface\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- 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_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_i\bin\bnt\bt (int name, int val) override;\n- bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n- void c\bcl\ble\bea\bar\br ();\n- void c\bcl\ble\bea\bar\br (int name);\n- int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n- std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n- bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n- 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- type_mask,\n- index_mask,\n- };\n-\n- enum mmap_write_mode_t\n- {\n- always_pwrite,\n- always_mmap_write,\n- auto_mmap_write,\n- };\n-\n- enum suggest_mode_t\n- {\n- no_piece_suggestions,\n- suggest_read_cache,\n- };\n-\n- enum choking_algorithm_t\n- {\n- fixed_slots_choker,\n- rate_based_choker,\n- deprecated_bittyrant_choker,\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- enum seed_choking_algorithm_t\n- {\n- round_robin,\n- fastest_upload,\n- anti_leech,\n- };\n+while (outstanding_resume_data > 0)\n+{\n+ alert const* a = ses.wait_for_alert(seconds(30));\n \n- enum io_buffer_mode_t\n- {\n- enable_os_cache,\n- deprecated_disable_os_cache_for_aligned_files,\n- disable_os_cache,\n- write_through,\n- };\n+ // if we don't get an alert within 30 seconds, abort\n+ if (a == nullptr) break;\n \n- enum bandwidth_mixed_algo_t\n- {\n- prefer_tcp,\n- peer_proportional,\n- };\n+ std::vector alerts;\n+ ses.pop_alerts(&alerts);\n \n- enum enc_policy\n- {\n- pe_forced,\n- pe_enabled,\n- pe_disabled,\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- enum enc_level\n- {\n- pe_plaintext,\n- pe_rc4,\n- pe_both,\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- enum proxy_type_t\n- {\n- none,\n- socks4,\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_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_s\bst\btr\br(\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_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_i\bin\bnt\bt (int name, int 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-pack. name can be any enumeration value from string_types, int_types or\n-bool_types.\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-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_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n-int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n-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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|\n-|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bt_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b _\b _\b _\b|_\b1_\b6_\b3_\b8_\b4_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bb_\bo_\bo_\bl_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b _\b _\b|_\b3_\b2_\b7_\b6_\b8_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\by_\bp_\be_\b__\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b9_\b1_\b5_\b2_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bd_\be_\bx_\b__\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b3_\b8_\b3_\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* e\ben\bnu\bum\bm m\bmm\bma\bap\bp_\b_w\bwr\bri\bit\bte\be_\b_m\bmo\bod\bde\be_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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 |\n-|always_pwrite |0 |disable writing to disk via mmap, always use normal |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b _\bc_\ba_\bl_\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 |\n-|always_mmap_write|1 |prefer using memory mapped files for disk writes (at|\n-|_\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_\ba_\bs_\bt_\b _\bf_\bo_\br_\b _\bl_\ba_\br_\bg_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b _\bm_\bi_\bg_\bh_\bt_\b _\bm_\ba_\bk_\be_\b _\bs_\be_\bn_\bs_\be_\b)_\b _\b _\b _\b |\n-| | |determine whether to use pwrite or memory mapped |\n-|auto_mmap_write |2 |files for disk writes depending on the kind 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|_\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bb_\be_\bh_\bi_\bn_\bd_\b _\bt_\bh_\be_\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 |\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\bsu\bug\bgg\bge\bes\bst\bt_\b_m\bmo\bod\bde\be_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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__\bp_\bi_\be_\bc_\be_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\br_\be_\ba_\bd_\b__\bc_\ba_\bc_\bh_\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* e\ben\bnu\bum\bm c\bch\bho\bok\bki\bin\bng\bg_\b_a\bal\blg\bgo\bor\bri\bit\bth\bhm\bm_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 the traditional choker with a fixed|\n-|fixed_slots_choker |0 |number of unchoke slots (as specified 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|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b)_\b._\b _\b _\b _\b _\b _\b _\b |\n-| | |This opens up unchoke slots based on the |\n-| | |upload rate achieved to peers. The more |\n-| | |slots that are opened, the marginal upload |\n-| | |rate required to open up another slot |\n-|rate_based_choker |2 |increases. Configure the initial threshold |\n-| | |with _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b: |\n-| | |_\br_\ba_\bt_\be_\b__\bc_\bh_\bo_\bk_\be_\br_\b__\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd. |\n-| | |For more information, see _\br_\ba_\bt_\be_\b _\bb_\ba_\bs_\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|_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\bb_\bi_\bt_\bt_\by_\br_\ba_\bn_\bt_\b__\bc_\bh_\bo_\bk_\be_\br_\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 |\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\bse\bee\bed\bd_\b_c\bch\bho\bok\bki\bin\bng\bg_\b_a\bal\blg\bgo\bor\bri\bit\bth\bhm\bm_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\b _\b |\n-| | |which round-robins the peers that are unchoked when |\n-|round_robin |0 |seeding. This distributes the upload bandwidth uniformly|\n-| | |and fairly. It minimizes the ability for a peer to |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b _\be_\bv_\be_\br_\by_\bt_\bh_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\br_\be_\bd_\bi_\bs_\bt_\br_\bi_\bb_\bu_\bt_\bi_\bn_\bg_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |unchokes the peers we can send to the fastest. This |\n-|fastest_upload|1 |might be a bit more reliable in utilizing all available |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bp_\ba_\bc_\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 |\n-| | |prioritizes peers who have just started or are just |\n-| | |about to finish the download. The intention is to force |\n-|anti_leech |2 |peers in the middle of the download to trade with each |\n-| | |other. This does not just take into account the pieces a|\n-| | |peer is reporting having downloaded, but also the pieces|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bh_\ba_\bv_\be_\b _\bs_\be_\bn_\bt_\b _\bt_\bo_\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 |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm i\bio\bo_\b_b\bbu\buf\bff\bfe\ber\br_\b_m\bmo\bod\bde\be_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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-|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\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|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\bh_\be_\b__\bf_\bo_\br_\b__\ba_\bl_\bi_\bg_\bn_\be_\bd_\b__\bf_\bi_\bl_\be_\bs_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\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|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bw_\br_\bi_\bt_\be_\b__\bt_\bh_\br_\bo_\bu_\bg_\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|_\b3_\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* e\ben\bnu\bum\bm b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_m\bmi\bix\bxe\bed\bd_\b_a\bal\blg\bgo\bo_\b_t\bt *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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-|_\bp_\br_\be_\bf_\be_\br_\b__\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bs_\b _\bt_\bh_\be_\b _\bm_\bi_\bx_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bb_\ba_\bl_\ba_\bn_\bc_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|peer_proportional|1 |does not throttle uTP, throttles TCP to the same |\n-|_\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_\bo_\bp_\bo_\br_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\bp_\bu_\bt_\b _\ba_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bT_\bC_\bP_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\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 e\ben\bnc\bc_\b_p\bpo\bol\bli\bic\bcy\by *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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-| | |Only encrypted connections are allowed. Incoming |\n-|pe_forced |0 |connections that are not encrypted are closed and if the |\n-| | |encrypted outgoing connection fails, a non-encrypted retry|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\bi_\bl_\bl_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\bm_\ba_\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 |\n-| | |encrypted connections are enabled, but non-encrypted |\n-| | |connections are allowed. An incoming non-encrypted |\n-|pe_enabled |1 |connection will be accepted, and if an outgoing encrypted |\n-| | |connection fails, a non- encrypted connection will be |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\br_\bi_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\be_\b__\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b|_\b2_\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bn_\bo_\bn_\b-_\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ben\bnc\bc_\b_l\ble\bev\bve\bel\bl *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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 |\n-|_\bp_\be_\b__\bp_\bl_\ba_\bi_\bn_\bt_\be_\bx_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bo_\bn_\bl_\by_\b _\bp_\bl_\ba_\bi_\bn_\b _\bt_\be_\bx_\bt_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\bi_\bo_\bn|\n-|_\bp_\be_\b__\br_\bc_\b4_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bo_\bn_\bl_\by_\b _\bR_\bC_\b4_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\be_\b__\bb_\bo_\bt_\bh_\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bw_\b _\bb_\bo_\bt_\bh_\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* e\ben\bnu\bum\bm p\bpr\bro\box\bxy\by_\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/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\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|_\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 |\n-|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\bp_\br_\bo_\bx_\by_\b _\bs_\be_\br_\bv_\be_\br_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\ba_\bn_\bd_\b _\ba_\bl_\bl_\b _\bo_\bt_\bh_\be_\br_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\ba_\br_\be_\b _\bi_\bg_\bn_\bo_\br_\be_\bd_\b._\b _\b _\b _\b |\n-|socks4 |1 |The server is assumed to be a _\bS_\bO_\bC_\bK_\bS_\b4_\b _\bs_\be_\br_\bv_\be_\br that requires a |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\br_\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 |\n-| | |The server is assumed to be a SOCKS5 server (_\bR_\bF_\bC_\b _\b1_\b9_\b2_\b8) that |\n-|socks5 |2 |does not require any authentication. The username and |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd_\b _\ba_\br_\be_\b _\bi_\bg_\bn_\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 |\n-| | |The server is assumed to be a SOCKS5 server that supports |\n-|socks5_pw|3 |plain text username and password authentication (_\bR_\bF_\bC_\b _\b1_\b9_\b2_\b9). |\n-| | |The username and password specified may be sent to the proxy |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bi_\bt_\b _\br_\be_\bq_\bu_\bi_\br_\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 |\n-| | |The server is assumed to be an HTTP proxy. If the transport |\n-| | |used for the connection is non-HTTP, the server is assumed to|\n-|http |4 |support the _\bC_\bO_\bN_\bN_\bE_\bC_\bT method. i.e. for web seeds and HTTP |\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* 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-[_\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\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n-char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n-converts a setting integer (from the enums string_types, int_types or\n-bool_types) to a string, and vice versa.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-settings_pack d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs ();\n-returns a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk with every setting set to its default value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n-std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n-This is a utility function to produce a client ID fingerprint formatted to the\n-most common convention. The fingerprint can be set via the peer_fingerprint\n-setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-The name string should contain exactly two characters. These are the characters\n-unique to your client, used to identify it. Make sure not to clash with anybody\n-else. Here are some taken id's:\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n-|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n-|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-There's an informal directory of client id's _\bh_\be_\br_\be.\n-The major, minor, revision and tag parameters are used to identify the version\n-of your client.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n-The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n-array.\n-struct bitfield\n-{\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n- explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n- void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\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- void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n- int c\bco\bou\bun\bnt\bt () const noexcept;\n- int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n- int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (lt::bitfield const& rhs) const;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) *\b**\b**\b**\b**\b*\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n-explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n-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 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-*\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- h\bha\bas\bsh\bhe\ber\br (hasher const&);\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 (char const* data, int len);\n- hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- hasher& u\bup\bpd\bda\bat\bte\be (span data);\n- sha1_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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 (hasher const&);\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 (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 (char const* data, int len);\n-hasher& u\bup\bpd\bda\bat\bte\be (span data);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n+ 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-*\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+*\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 [_\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- 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+*\b**\b**\b**\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_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)\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()\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+queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n+Every torrent that is added is assigned a queue position exactly one greater\n+than the greatest queue position of all existing torrents. Torrents that are\n+being seeded have -1 as their queue position, since they're no longer in line\n+to be downloaded.\n+When a torrent is removed or turns into a seed, all torrents with greater queue\n+positions have their positions decreased to fill in the space in the sequence.\n+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-*\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+*\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* 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+*\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 [_\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+*\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-*\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+*\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**\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+*\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\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n+The piece availability is the number of peers that we are connected that has\n+advertised having a particular piece. This is the information that libtorrent\n+uses in order to prefer picking rare pieces.\n+post_piece_availability() will trigger a _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt to be posted.\n+piece_availability() fills the specified std::vector with the availability\n+for each piece in this torrent. libtorrent does not keep track of availability\n+for seeds, so if the torrent is seeding the availability for all pieces is\n+reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+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+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+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-*\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* 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+std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n+void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n+download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n+index must be in the range [0, number_of_files).\n+file_priority() queries or sets the priority of file index.\n+prioritize_files() takes a vector that has at as many elements as there are\n+files in the torrent. Each _\be_\bn_\bt_\br_\by is the priority of that file. The function\n+sets the priorities of all the pieces in the torrent based on the vector.\n+get_file_priorities() returns a vector with the priorities of all files.\n+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-*\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+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+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 [_\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+*\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-*\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+*\b**\b**\b**\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) 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)\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- 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+*\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- 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+*\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- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\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 [_\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+*\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 [_\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+*\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-*\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+*\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* 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+*\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* 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+*\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< (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- ec\n- the error that occurred\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- operation\n- A code from _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt enum, indicating what kind of operation failed.\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-*\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+*\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**\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+*\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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ query_last_seen_complete\n+ includes last_seen_complete.\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+ 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-*\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+ 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-*\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-|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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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- name\n- the name of the counter or gauge\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- 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+ 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-*\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+ 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-*\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+ 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* 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+*\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 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@@ -6323,15 +2109,15 @@\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::\n storage;\n file_index_t const index;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bol\bld\bd_\b_n\bna\bam\bme\be(\b()\b) n\bne\bew\bw_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\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 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@@ -6950,24 +2736,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* o\bol\bld\bd_\b_p\bpa\bat\bth\bh(\b()\b) s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-char const* 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@@ -8203,24 +3989,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- std::vector> n\bno\bod\bde\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::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\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+*\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 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@@ -8241,30 +4027,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+*\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 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@@ -8456,972 +4242,295 @@\n std::vector piece_info;\n std::vector block_data;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n piece_info\n info about pieces being downloaded for the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- block_data\n- storage for _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo pointers in _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo objects\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_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by_\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 when _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\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) is called\n-struct piece_availability_alert final : torrent_alert\n-{\n- std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n-\n- static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n- std::vector piece_availability;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece_availability\n- info about pieces being downloaded for the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\btr\bra\bac\bck\bke\ber\br_\b_l\bli\bis\bst\bt_\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 when _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b) is called\n-struct tracker_list_alert final : torrent_alert\n-{\n- std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n-\n- static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n- std::vector trackers;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackers\n- list of trackers and their status for the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-The alert class is the base class that specific messages are derived from.\n-_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n-struct alert\n-{\n- time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n- virtual int t\bty\byp\bpe\be () const noexcept = 0;\n- virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n- virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n- virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-\n- static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n- static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n- static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n- static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n- static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n- static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n- static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n- static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n- static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n- static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n- static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n- static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n- static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n- static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n- static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n- static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n-time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n-a timestamp is automatically created in the constructor\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual int t\bty\byp\bpe\be () const noexcept = 0;\n-returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n-against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n-_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n-cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n-e.g:\n-std::vector alerts;\n-ses.pop_alerts(&alerts);\n-for (alert* a : alerts) {\n- switch (a->type()) {\n-\n- case read_piece_alert::alert_type:\n- {\n- auto* p = static_cast(a);\n- if (p->ec) {\n- // read_piece failed\n- break;\n- }\n- // use p\n- break;\n- }\n- case file_renamed_alert::alert_type:\n- {\n- // etc...\n- }\n- }\n-}\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n-returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n-any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n-generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n-This is mainly intended for debug and development use. It is not suitable to\n-use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n-type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n-depending on the locale.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n-maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n-name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-template T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n-template T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n-When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n-to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n-Note\n-alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|unknown |0 |the error was unexpected and it is unknown which |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bc_\ba_\bu_\bs_\be_\bd_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|bittorrent |1 |this is used when the bittorrent logic determines |\n-|_\b _\b _\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 _\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\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 |\n-|_\bi_\bo_\bc_\bo_\bn_\bt_\br_\bo_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bi_\bo_\bc_\bo_\bn_\bt_\br_\bo_\bl_\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-|getpeername |3 |a call to getpeername() failed (querying the remote|\n-|_\b _\b _\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_\bP_\b _\bo_\bf_\b _\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|getname |4 |a call to getname failed (querying the local IP 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|_\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\ba_\bl_\bl_\bo_\bc_\b__\br_\be_\bc_\bv_\bb_\bu_\bf_\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\ba_\b _\br_\be_\bc_\be_\bi_\bv_\be_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b |\n-|_\ba_\bl_\bl_\bo_\bc_\b__\bs_\bn_\bd_\bb_\bu_\bf_\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\ba_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bf_\bi_\bl_\be_\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 _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\br_\be_\ba_\bd_\bi_\bn_\bg_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bf_\bi_\bl_\be_\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-|_\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\ba_\b _\bn_\bo_\bn_\b-_\br_\be_\ba_\bd_\b _\ba_\bn_\bd_\b _\bn_\bo_\bn_\b-_\bw_\br_\bi_\bt_\be_\b _\bf_\bi_\bl_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bw_\br_\bi_\bt_\be_\b _\bo_\bp_\be_\br_\ba_\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 |\n-|_\bs_\bo_\bc_\bk_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b _\b _\b _\b|_\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\br_\be_\ba_\bd_\b _\bo_\bp_\be_\br_\ba_\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 |\n-|_\bs_\bo_\bc_\bk_\b__\bo_\bp_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bo_\bp_\be_\bn_\b(_\b)_\b,_\b _\bt_\bo_\b _\bc_\br_\be_\ba_\bt_\be_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b |\n-|_\bs_\bo_\bc_\bk_\b__\bb_\bi_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bb_\bi_\bn_\bd_\b(_\b)_\b _\bo_\bn_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|available |14 |an attempt to query the number of bytes available |\n-|_\b _\b _\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 _\br_\be_\ba_\bd_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\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 |\n-|encryption |15 |a call related to bittorrent protocol encryption |\n-|_\b _\b _\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_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bs_\bl_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b _\b _\b _\b|_\be_\bs_\bt_\ba_\bb_\bl_\bi_\bs_\bh_\bi_\bn_\bg_\b _\ba_\bn_\b _\bS_\bS_\bL_\b _\bc_\bo_\bn_\bn_\be_\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 |\n-|get_interface |18 |a connection failed to satisfy the bind interface |\n-|_\b _\b _\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_\bt_\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 |\n-|_\bs_\bo_\bc_\bk_\b__\bl_\bi_\bs_\bt_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b9_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bl_\bi_\bs_\bt_\be_\bn_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n-|sock_bind_to_device|20 |a call to the ioctl to bind a socket to a specific |\n-|_\b _\b _\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_\be_\bt_\bw_\bo_\br_\bk_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bo_\br_\b _\ba_\bd_\ba_\bp_\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 |\n-|_\bs_\bo_\bc_\bk_\b__\ba_\bc_\bc_\be_\bp_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b1_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\ba_\bc_\bc_\be_\bp_\bt_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n-|_\bp_\ba_\br_\bs_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b|_\b2_\b2_\b _\b _\b _\b|_\bc_\bo_\bn_\bv_\be_\br_\bt_\b _\ba_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b |\n-|_\be_\bn_\bu_\bm_\b__\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b3_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bd_\be_\bv_\bi_\bc_\be_\bs_\b _\bo_\br_\b _\ba_\bd_\ba_\bp_\bt_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b4_\b _\b _\b _\b|_\bi_\bn_\bv_\bo_\bk_\bi_\bn_\bg_\b _\bs_\bt_\ba_\bt_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n-|_\bf_\bi_\bl_\be_\b__\bc_\bo_\bp_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b5_\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\ba_\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 |\n-|_\bf_\bi_\bl_\be_\b__\bf_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b|_\b2_\b6_\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bf_\bo_\br_\b _\ba_\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 |\n-|_\bf_\bi_\bl_\be_\b__\bh_\ba_\br_\bd_\b__\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b|_\b2_\b7_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\bi_\bn_\bg_\b _\ba_\b _\bh_\ba_\br_\bd_\b _\bl_\bi_\bn_\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 |\n-|_\bf_\bi_\bl_\be_\b__\br_\be_\bm_\bo_\bv_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b8_\b _\b _\b _\b|_\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\ba_\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 |\n-|_\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b9_\b _\b _\b _\b|_\br_\be_\bn_\ba_\bm_\bi_\bn_\bg_\b _\ba_\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 |\n-|_\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b0_\b _\b _\b _\b|_\bo_\bp_\be_\bn_\bi_\bn_\bg_\b _\ba_\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 |\n-|_\bm_\bk_\bd_\bi_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b1_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\bi_\bn_\bg_\b _\ba_\b _\bd_\bi_\br_\be_\bc_\bt_\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 _\b _\b _\b |\n-|_\bc_\bh_\be_\bc_\bk_\b__\br_\be_\bs_\bu_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b2_\b _\b _\b _\b|_\bc_\bh_\be_\bc_\bk_\b _\bf_\ba_\bs_\bt_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\ba_\bg_\ba_\bi_\bn_\bs_\bt_\b _\bf_\bi_\bl_\be_\bs_\b _\bo_\bn_\b _\bd_\bi_\bs_\bk_\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\bx_\bc_\be_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b3_\b _\b _\b _\b|_\ba_\bn_\b _\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b _\be_\bx_\bc_\be_\bp_\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 |\n-|_\ba_\bl_\bl_\bo_\bc_\b__\bc_\ba_\bc_\bh_\be_\b__\bp_\bi_\be_\bc_\be_\b _\b _\b|_\b3_\b4_\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bs_\bp_\ba_\bc_\be_\b _\bf_\bo_\br_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bc_\ba_\bc_\bh_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\bm_\bo_\bv_\be_\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\b _\bp_\ba_\br_\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 |\n-|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b|_\b3_\b6_\b _\b _\b _\b|_\br_\be_\ba_\bd_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bp_\ba_\br_\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 |\n-|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b|_\b3_\b7_\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b _\bt_\bo_\b _\ba_\b _\bp_\ba_\br_\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 |\n-|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b|_\b3_\b8_\b _\b _\b _\b|_\ba_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\by_\bm_\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b9_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\be_\b _\bo_\br_\b _\br_\be_\ba_\bd_\b _\ba_\b _\bs_\by_\bm_\bl_\bi_\bn_\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 |\n-|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b _\b _\b _\b|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bp_\be_\be_\br_\b _\bo_\br_\b _\bs_\be_\br_\bv_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\b__\bo_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b1_\b _\b _\b _\b|_\bs_\be_\bt_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bo_\bp_\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 |\n-|_\be_\bn_\bu_\bm_\b__\br_\bo_\bu_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b2_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\br_\bo_\bu_\bt_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|file_seek |43 |moving read/write position in a file, _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt_\b:_\b:|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b4_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bs_\by_\bn_\bc_\b _\bw_\ba_\bi_\bt_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bn_\b _\ba_\b _\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\bm_\bm_\ba_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bm_\bm_\ba_\bp_\b(_\b)_\b _\b(_\bo_\br_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b _\bc_\bo_\bu_\bn_\bt_\be_\br_\bp_\ba_\br_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bf_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b(_\b)_\b _\b(_\bo_\br_\b _\bS_\be_\bt_\bE_\bn_\bd_\bO_\bf_\bF_\bi_\bl_\be_\b(_\b)_\b _\bo_\bn_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b)_\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n- user_alert_id\n- user defined alerts should use IDs greater than this\n- num_alert_types\n- this constant represents \"max_alert_index\" + 1\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n- error\n- Enables alerts that report an error. This includes:\n- * tracker errors\n- * tracker warnings\n- * file errors\n- * resume data failures\n- * web seed errors\n- * .torrent files errors\n- * listen socket errors\n- * port mapping errors\n- peer\n- Enables alerts when peers send invalid requests, get banned or snubbed.\n- port_mapping\n- Enables alerts for port mapping events. For NAT-PMP and UPnP.\n- storage\n- Enables alerts for events related to the storage. File errors and\n- synchronization events for moving the storage, renaming files etc.\n- tracker\n- Enables all tracker events. Includes announcing to trackers, receiving\n- responses, warnings and errors.\n- connect\n- Low level alerts for when peers are connected and disconnected.\n- status\n- Enables alerts for when a torrent or the _\bs_\be_\bs_\bs_\bi_\bo_\bn changes state.\n- ip_block\n- Alerts when a peer is blocked by the ip blocker or port blocker.\n- performance_warning\n- Alerts when some limit is reached that might limit the download or upload\n- rate.\n- dht\n- Alerts on events in the DHT node. For incoming searches or bootstrapping\n- being done etc.\n- stats\n- If you enable these alerts, you will receive a stats_alert approximately\n- once every second, for every active torrent. These alerts contain all\n- statistics _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the interval since the lasts stats _\ba_\bl_\be_\br_\bt.\n- session_log\n- Enables debug logging alerts. These are available unless libtorrent was\n- built with logging disabled (TORRENT_DISABLE_LOGGING). The alerts being\n- posted are _\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and are _\bs_\be_\bs_\bs_\bi_\bo_\bn wide.\n- torrent_log\n- Enables debug logging alerts for torrents. These are available unless\n- libtorrent was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n- alerts being posted are _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and are torrent wide debug\n- events.\n- peer_log\n- Enables debug logging alerts for peers. These are available unless\n- libtorrent was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n- alerts being posted are _\bp_\be_\be_\br_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and low-level peer events and\n- messages.\n- incoming_request\n- enables the _\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\ba_\bl_\be_\br_\bt.\n- dht_log\n- enables _\bd_\bh_\bt_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt, debug logging for the DHT\n- dht_operation\n- enable events from pure dht operations not related to torrents\n- port_mapping_log\n- enables port mapping log events. This log is useful for debugging the\n- UPnP or NAT-PMP implementation\n- picker_log\n- enables verbose logging from the piece picker.\n- file_progress\n- alerts when files complete downloading\n- piece_progress\n- alerts when pieces complete downloading or fail hash check\n- upload\n- alerts when we upload blocks to other peers\n- block_progress\n- alerts on individual blocks being requested, downloading, finished,\n- rejected, time-out and cancelled. This is likely to post alerts at a high\n- rate.\n- all\n- The full bitmask, representing all available categories.\n- since the enum is signed, make sure this isn't interpreted as -1. For\n- instance, boost.python does that and fails when assigning it to an\n- unsigned parameter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n-holds a snapshot of the status of a torrent, as queried by _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:\n-_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b).\n-struct torrent_status\n-{\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n-\n- enum state_t\n- {\n- checking_files,\n- downloading_metadata,\n- downloading,\n- finished,\n- seeding,\n- unused_enum_for_backwards_compatibility_allocating,\n- checking_resume_data,\n- };\n-\n- torrent_handle handle;\n- error_code errc;\n- file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be = torrent_status::error_file_none;\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_n\bno\bon\bne\be {-1};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_s\bss\bsl\bl_\b_c\bct\btx\bx {-3};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_m\bme\bet\bta\bad\bda\bat\bta\ba {-4};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_e\bex\bxc\bce\bep\bpt\bti\bio\bon\bn {-5};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_p\bpa\bar\brt\btf\bfi\bil\ble\be {-6};\n- std::string save_path;\n- std::string name;\n- std::weak_ptr torrent_file;\n- time_duration n\bne\bex\bxt\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be = seconds{0};\n- std::string current_tracker;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_f\bfa\bai\bil\ble\bed\bd_\b_b\bby\byt\bte\bes\bs = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt_\b_b\bby\byt\bte\bes\bs = 0;\n- typed_bitfield pieces;\n- typed_bitfield verified_pieces;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bon\bne\be = 0;\n- std::int64_t t\bto\bot\bta\bal\bl = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd_\b_d\bdo\bon\bne\be = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd = 0;\n- std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n- storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n- float p\bpr\bro\bog\bgr\bre\bes\bss\bs = 0.f;\n- int p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_p\bpp\bpm\bm = 0;\n- queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn {};\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int u\bup\bpl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int u\bup\bpl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int n\bnu\bum\bm_\b_s\bse\bee\bed\bds\bs = 0;\n- int n\bnu\bum\bm_\b_p\bpe\bee\ber\brs\bs = 0;\n- int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int l\bli\bis\bst\bt_\b_s\bse\bee\bed\bds\bs = 0;\n- int l\bli\bis\bst\bt_\b_p\bpe\bee\ber\brs\bs = 0;\n- int c\bco\bon\bnn\bne\bec\bct\bt_\b_c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs = 0;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs = 0;\n- int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfu\bul\bll\bl_\b_c\bco\bop\bpi\bie\bes\bs = 0;\n- int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfr\bra\bac\bct\bti\bio\bon\bn = 0;\n- float d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_c\bco\bop\bpi\bie\bes\bs = 0.f;\n- int b\bbl\blo\boc\bck\bk_\b_s\bsi\biz\bze\be = 0;\n- int n\bnu\bum\bm_\b_u\bup\bpl\blo\boa\bad\bds\bs = 0;\n- int n\bnu\bum\bm_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = 0;\n- int u\bup\bpl\blo\boa\bad\bds\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n- int c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n- int u\bup\bp_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n- int d\bdo\bow\bwn\bn_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n- int s\bse\bee\bed\bd_\b_r\bra\ban\bnk\bk = 0;\n- state_t s\bst\bta\bat\bte\be = checking_resume_data;\n- bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be = false;\n- bool i\bis\bs_\b_s\bse\bee\bed\bdi\bin\bng\bg = false;\n- bool i\bis\bs_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd = false;\n- bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba = false;\n- bool h\bha\bas\bs_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg = false;\n- bool m\bmo\bov\bvi\bin\bng\bg_\b_s\bst\bto\bor\bra\bag\bge\be = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_t\btr\bra\bac\bck\bke\ber\brs\bs = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_l\bls\bsd\bd = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_d\bdh\bht\bt = false;\n- info_hash_t info_hashes;\n- time_point last_upload;\n- time_point last_download;\n- seconds active_duration;\n- seconds finished_duration;\n- seconds seeding_duration;\n- torrent_flags_t f\bfl\bla\bag\bgs\bs {};\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n-compares if the torrent status objects come from the same torrent. i.e. only\n-the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be field is compared.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\bte\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The torrent has not |\n-| | |started its download|\n-|checking_files |1 |yet, and is |\n-| | |currently checking |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b._\b _\b _\b _\b _\b |\n-| | |The torrent is |\n-| | |trying to download |\n-|downloading_metadata |2 |metadata from peers.|\n-| | |This implies the |\n-| | |ut_metadata |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bi_\bn_\b _\bu_\bs_\be_\b.|\n-| | |The torrent is being|\n-| | |downloaded. This is |\n-| | |the state most |\n-| | |torrents will be in |\n-|downloading |3 |most of the time. |\n-| | |The progress meter |\n-| | |will tell how much |\n-| | |of the files that |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\ba_\bs_\b _\bb_\be_\be_\bn_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b.|\n-| | |In this state the |\n-| | |torrent has finished|\n-| | |downloading but |\n-|finished |4 |still doesn't have |\n-| | |the entire torrent. |\n-| | |i.e. some pieces are|\n-| | |filtered and won't |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\be_\bt_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b._\b _\b _\b _\b _\b |\n-| | |In this state the |\n-|seeding |5 |torrent has finished|\n-| | |downloading and is a|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\bu_\br_\be_\b _\bs_\be_\be_\bd_\be_\br_\b._\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |If the torrent was |\n-| | |started in full |\n-| | |allocation mode, |\n-|unused_enum_for_backwards_compatibility_allocating|6 |this indicates that |\n-| | |the (disk) storage |\n-| | |for the torrent is |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The torrent is |\n-| | |currently checking |\n-| | |the fast resume data|\n-| | |and comparing it to |\n-| | |the files on disk. |\n-|checking_resume_data |7 |This is typically |\n-| | |completed in a |\n-| | |fraction of a |\n-| | |second, but if you |\n-| | |add a large number |\n-| | |of torrents at once,|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\by_\b _\bw_\bi_\bl_\bl_\b _\bq_\bu_\be_\bu_\be_\b _\bu_\bp_\b._\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- handle\n- a handle to the torrent whose status the object represents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- errc\n- may be set to an error code describing why the torrent was paused, in\n- case it was paused by an error. If the torrent is not paused or if it's\n- paused but not because of an error, this error_code is not set. if the\n- error is attributed specifically to a file, error_file is set to the\n- index of that file in the .torrent file.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file\n- if the torrent is stopped because of an disk I/O error, this field\n- contains the index of the file in the torrent that encountered the error.\n- If the error did not originate in a file in the torrent, there are a few\n- special values this can be set to: error_file_none, error_file_ssl_ctx,\n- error_file_exception, error_file_partfile or error_file_metadata;\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_none\n- special values for error_file to describe which file or component\n- encountered the error (errc). the error did not occur on a file\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_ssl_ctx\n- the error occurred setting up the SSL context\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_metadata\n- the error occurred while loading the metadata for the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_exception\n- there was a serious error reported in this torrent. The error code or a\n- torrent log _\ba_\bl_\be_\br_\bt may provide more information.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_partfile\n- the error occurred with the partfile\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_path\n- the path to the directory where this torrent's files are stored. It's\n- typically the path as was given to _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- when this torrent was started. This field is only included if the torrent\n- status is queried with torrent_handle::query_save_path.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- name\n- the name of the torrent. Typically this is derived from the .torrent\n- file. In case the torrent was started without metadata, and hasn't\n- completely received it yet, it returns the name given to it when added to\n- the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See session::add_torrent. This field is only included if the\n- torrent status is queried with torrent_handle::query_name.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- torrent_file\n- set to point to the torrent_info object for this torrent. It's only\n- included if the torrent status is queried with torrent_handle::\n- query_torrent_file.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- next_announce\n- the time until the torrent will announce itself to the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- current_tracker\n- the URL of the last working tracker. If no tracker request has been\n- successful yet, it's set to an empty string.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_download total_upload\n- the number of bytes downloaded and uploaded to all peers, accumulated,\n- t\bth\bhi\bis\bs s\bse\bes\bss\bsi\bio\bon\bn only. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n- paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n- reset to 0. If you want complete, persistent, stats, see all_time_upload\n- and all_time_download.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_payload_download total_payload_upload\n- counts the amount of bytes send and received this _\bs_\be_\bs_\bs_\bi_\bo_\bn, but only the\n- actual payload data (i.e the interesting data), these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs ignore any\n- protocol overhead. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n- paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n- reset to 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_failed_bytes\n- the number of bytes that has been downloaded and that has failed the\n- piece hash test. In other words, this is just how much crap that has been\n- downloaded since the torrent was last started. If a torrent is paused and\n- then restarted again, this counter will be reset.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_redundant_bytes\n- the number of bytes that has been downloaded even though that data\n- already was downloaded. The reason for this is that in some situations\n- the same data can be downloaded by mistake. When libtorrent sends\n- requests to a peer, and the peer doesn't send a response within a certain\n- timeout, libtorrent will re-request that block. Another situation when\n- libtorrent may re-request blocks is when the requests it sends out are\n- not replied in FIFO-order (it will re-request blocks that are skipped by\n- an out of order block). This is supposed to be as low as possible. This\n- only counts bytes since the torrent was last started. If a torrent is\n- paused and then restarted again, this counter will be reset.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pieces\n- a bitmask that represents which pieces we have (set to true) and the\n- pieces we don't have. It's a pointer and may be set to 0 if the torrent\n- isn't downloading or seeding.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_pieces\n- a bitmask representing which pieces has had their hash checked. This only\n- applies to torrents in s\bse\bee\bed\bd m\bmo\bod\bde\be. If the torrent is not in seed mode,\n- this bitmask may be empty.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_done\n- the total number of bytes of the file(s) that we have. All this does not\n- necessarily has to be downloaded during this _\bs_\be_\bs_\bs_\bi_\bo_\bn (that's\n- total_payload_download).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total\n- the total number of bytes to download for this torrent. This may be less\n- than the size of the torrent in case there are pad files. This number\n- only counts bytes that will actually be requested from peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_wanted_done\n- the number of bytes we have downloaded, only counting the pieces that we\n- actually want to download. i.e. excluding any pieces that we have but\n- have priority 0 (i.e. not wanted). Once a torrent becomes seed, any\n- piece- and file priorities are forgotten and all bytes are considered\n- \"wanted\".\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_wanted\n- The total number of bytes we want to download. This may be smaller than\n- the total torrent size in case any pieces are prioritized to 0, i.e. not\n- wanted. Once a torrent becomes seed, any piece- and file priorities are\n- forgotten and all bytes are considered \"wanted\".\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- all_time_upload all_time_download\n- are accumulated upload and download payload byte _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs. They are saved\n- in and restored from resume data to keep totals across sessions.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- added_time\n- the posix-time when this torrent was added. i.e. what time(nullptr)\n- returned at the time.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- completed_time\n- the posix-time when this torrent was finished. If the torrent is not yet\n- finished, this is 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_seen_complete\n- the time when we, or one of our peers, last saw a complete copy of this\n- torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- storage_mode\n- The allocation mode for the torrent. See _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt for the options.\n- For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress\n- a value in the range [0, 1], that represents the progress of the\n- torrent's current task. It may be checking files or downloading.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress_ppm\n- progress parts per million (progress * 1000000) when disabling floating\n- point operations, this is the only option to query progress\n- reflects the same value as progress, but instead in a range [0, 1000000]\n- (ppm = parts per million). When floating point operations are disabled,\n- this is the only alternative to the floating point value in progress.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- queue_position\n- the position this torrent has in the download queue. If the torrent is a\n- seed or finished, this is -1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_rate upload_rate\n- the total rates for all peers for this torrent. These will usually have\n- better precision than summing the rates from all peers. The rates are\n- given as the number of bytes per second.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_payload_rate upload_payload_rate\n- the total transfer rate of payload only, not counting protocol chatter.\n- This might be slightly smaller than the other rates, but if projected\n- over a long time (e.g. when calculating ETA:s) the difference may be\n- noticeable.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_seeds\n- the number of peers that are seeding that this client is currently\n- connected to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_peers\n- the number of peers this torrent currently is connected to. Peer\n- connections that are in the half-open state (is attempting to connect) or\n- are queued for later connection attempt do not count. Although they are\n- visible in the peer list when you call _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_complete num_incomplete\n- if the tracker sends scrape info in its announce reply, these fields will\n- be set to the total number of peers that have the whole file and the\n- total number of peers that are still downloading. set to -1 if the\n- tracker did not send any scrape data in its announce reply.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- list_seeds list_peers\n- the number of seeds in our peer list and the total number of peers\n- (including seeds). We are not necessarily connected to all the peers in\n- our peer list. This is the number of peers we know of in total, including\n- banned peers and peers that we have failed to connect to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connect_candidates\n- the number of peers in this torrent's peer list that is a candidate to be\n- connected to. i.e. It has fewer connect attempts than the max fail count,\n- it is not a seed if we are a seed, it is not banned etc. If this is 0, it\n- means we don't know of any more peers that we can try.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_pieces\n- the number of pieces that has been downloaded. It is equivalent to: std::\n- accumulate(pieces->begin(), pieces->end()). So you don't have to count\n- yourself. This can be used to see if anything has updated since last time\n- if you want to keep a graph of the pieces up to date.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_full_copies\n- the number of distributed copies of the torrent. Note that one copy may\n- be spread out among many peers. It tells how many copies there are\n- currently of the rarest piece(s) among the peers this client is connected\n- to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_fraction\n- tells the share of pieces that have more copies than the rarest piece(s).\n- Divide this number by 1000 to get the fraction.\n- For example, if distributed_full_copies is 2 and distributed_fraction is\n- 500, it means that the rarest pieces have only 2 copies among the peers\n- this torrent is connected to, and that 50% of all the pieces have more\n- than two copies.\n- If we are a seed, the piece picker is deallocated as an optimization, and\n- piece availability is no longer tracked. In this case the distributed\n- copies members are set to -1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_copies\n- the number of distributed copies of the file. note that one copy may be\n- spread out among many peers. This is a floating point representation of\n- the distributed copies.\n- the integer part tells how many copies\n- there are of the rarest piece(s)\n- the fractional part tells the fraction of pieces that\n- have more copies than the rarest piece(s).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- block_size\n- the size of a block, in bytes. A block is a sub piece, it is the number\n- of bytes that each piece request asks for and the number of bytes that\n- each bit in the partial_piece_info's bitset represents, see\n- _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b). This is typically 16 kB, but it may be smaller, if\n- the pieces are smaller.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_uploads\n- the number of unchoked peers in this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_connections\n- the number of peer connections this torrent has, including half-open\n- connections that hasn't completed the bittorrent handshake yet. This is\n- always >= num_peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- uploads_limit\n- the set limit of upload slots (unchoked peers) for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connections_limit\n- the set limit of number of connections for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- up_bandwidth_queue down_bandwidth_queue\n- the number of peers in this torrent that are waiting for more bandwidth\n- quota from the torrent rate limiter. This can determine if the rate you\n- get from this torrent is bound by the torrents limit or not. If there is\n- no limit set on this torrent, the peers might still be waiting for\n- bandwidth quota from the global limiter, but then they are counted in the\n- session_status object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- seed_rank\n- A rank of how important it is to seed the torrent, it is used to\n- determine which torrents to seed and which to queue. It is based on the\n- peer to seed ratio from the tracker scrape. For more information, see\n- _\bq_\bu_\be_\bu_\bi_\bn_\bg. Higher value means more important to seed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- state\n- the main state the torrent is in. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- need_save_resume\n- true if this torrent has unsaved changes to its download state and\n- statistics since the last resume data was saved.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- is_seeding\n- true if all pieces have been downloaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- is_finished\n- true if all pieces that have a priority > 0 are downloaded. There is only\n- a distinction between finished and seeding if some pieces or files have\n- been set to priority 0, i.e. are not downloaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- has_metadata\n- true if this torrent has metadata (either it was started from a .torrent\n- file or the metadata has been downloaded). The only scenario where this\n- can be false is when the torrent was started torrent-less (i.e. with just\n- an info-hash and tracker ip, a magnet link for instance).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- has_incoming\n- true if there has ever been an incoming connection attempt to this\n- torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- moving_storage\n- this is true if this torrent's storage is currently being moved from one\n- location to another. This may potentially be a long operation if a large\n- file ends up being copied from one drive to another.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- announcing_to_trackers announcing_to_lsd announcing_to_dht\n- these are set to true if this torrent is allowed to announce to the\n- respective peer source. Whether they are true or false is determined by\n- the queue logic/auto manager. Torrents that are not auto managed will\n- always be allowed to announce to all peer sources.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- info_hashes\n- the info-hash for this torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_upload last_download\n- the timestamps of the last time this torrent uploaded or downloaded\n- payload to any peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- active_duration finished_duration seeding_duration\n- these are cumulative _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs of for how long the torrent has been in\n- different states. active means not paused and added to _\bs_\be_\bs_\bs_\bi_\bo_\bn. Whether\n- it has found any peers or not is not relevant. finished means all\n- selected files/pieces were downloaded and available to other peers (this\n- is always a subset of active time). seeding means all files/pieces were\n- downloaded and available to peers. Being available to peers does not\n- imply there are other peers asking for the payload.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- reflects several of the torrent's flags. For more information, see\n- torrent_handle::flags().\n-Bencoding is a common representation in bittorrent used for dictionary, list,\n-_\bi_\bn_\bt and string hierarchies. It's used to encode .torrent files and some\n-messages in the network protocol. libtorrent also uses it to store settings,\n-resume data and other _\bs_\be_\bs_\bs_\bi_\bo_\bn state.\n-Strings in bencoded structures do not necessarily represent text. Strings are\n-raw byte buffers of a certain length. If a string is meant to be interpreted as\n-text, it is required to be UTF-8 encoded. See _\bB_\bE_\bP_\b _\b3.\n-The function for decoding bencoded data _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b), returning a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n-This function builds a tree that points back into the original buffer. The\n-returned _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will not be valid once the buffer it was parsed out of is\n-discarded.\n-It's possible to construct an _\be_\bn_\bt_\br_\by from a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, if a structure needs\n-to be altered and re-encoded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer or a\n-string.\n-class entry\n-{\n- data_type t\bty\byp\bpe\be () const;\n- e\ben\bnt\btr\bry\by (dictionary_type);\n- e\ben\bnt\btr\bry\by (span);\n- e\ben\bnt\btr\bry\by (integer_type);\n- e\ben\bnt\btr\bry\by (list_type);\n- e\ben\bnt\btr\bry\by (preformatted_type);\n- e\ben\bnt\btr\bry\by (U v);\n- e\ben\bnt\btr\bry\by (data_type t);\n- e\ben\bnt\btr\bry\by (bdecode_node const& n);\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry 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= (bdecode_node 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= (integer_type) &;\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= (preformatted_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n- list_type& l\bli\bis\bst\bt ();\n- dictionary_type const& d\bdi\bic\bct\bt () 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- 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- 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- string_type& s\bst\btr\bri\bin\bng\bg ();\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- enum data_type\n- {\n- int_t,\n- string_t,\n- list_t,\n- dictionary_t,\n- undefined_t,\n- preformatted_t,\n- };\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 (dictionary_type);\n-e\ben\bnt\btr\bry\by (span);\n-e\ben\bnt\btr\bry\by (integer_type);\n-e\ben\bnt\btr\bry\by (list_type);\n-e\ben\bnt\btr\bry\by (preformatted_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= (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= (bdecode_node 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= (integer_type) &;\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= (preformatted_type) &;\n-copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) d\bdi\bic\bct\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-list_type& l\bli\bis\bst\bt ();\n-dictionary_type const& d\bdi\bic\bct\bt () 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-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-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-string_type& s\bst\btr\bri\bin\bng\bg ();\n-The integer(), string(), list() and dict() functions are accessors that return\n-the respective type. If the entry object isn't of the type you request, the\n-accessor will throw system_error. You can ask an entry for its type through the\n-type() function.\n-If you want to create an entry you give it the type you want it to have in its\n-constructor, and then use one of the non-const accessors to get a reference\n-which you then can assign the value you want it to have.\n-The typical code to get info from a torrent file will then look like this:\n-entry torrent_file;\n-// ...\n+ block_data\n+ storage for _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo pointers in _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo objects\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_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by_\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 when _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\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) is called\n+struct piece_availability_alert final : torrent_alert\n+{\n+ std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n \n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find(\"announce\");\n-if (i != dict.end())\n+ static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n+ std::vector piece_availability;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece_availability\n+ info about pieces being downloaded for the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\btr\bra\bac\bck\bke\ber\br_\b_l\bli\bis\bst\bt_\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 when _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b) is called\n+struct tracker_list_alert final : torrent_alert\n {\n- std::string tracker_url = i->second.string();\n- std::cout << tracker_url << \"\\n\";\n-}\n-The following code is equivalent, but a little bit shorter:\n-entry torrent_file;\n-// ...\n+ std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n \n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key(\"announce\"))\n+ static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n+ std::vector trackers;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ trackers\n+ list of trackers and their status for the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n+The alert class is the base class that specific messages are derived from.\n+_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n+pointers returned by libtorrent are short lived (the details are described\n+under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n+struct alert\n {\n- std::string tracker_url = i->string();\n- std::cout << tracker_url << \"\\n\";\n+ time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+ virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+ virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+ virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+ virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+\n+ static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n+ static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n+ static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n+ static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n+ static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n+ static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n+ static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n+ static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n+ static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n+ static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n+ static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n+ static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n+ static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n+ static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n+ static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n+ static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n+time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+a timestamp is automatically created in the constructor\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n+against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n+_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n+cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n+e.g:\n+std::vector alerts;\n+ses.pop_alerts(&alerts);\n+for (alert* a : alerts) {\n+ switch (a->type()) {\n+\n+ case read_piece_alert::alert_type:\n+ {\n+ auto* p = static_cast(a);\n+ if (p->ec) {\n+ // read_piece failed\n+ break;\n+ }\n+ // use p\n+ break;\n+ }\n+ case file_renamed_alert::alert_type:\n+ {\n+ // etc...\n+ }\n+ }\n }\n-To make it easier to extract information from a torrent file, the class\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo exists.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (entry& e);\n-swaps the content of t\bth\bhi\bis\bs with e.\n+*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n+any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n-entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n-All of these functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they\n-will throw system_error.\n-The non-const versions of the operator[] will return a reference to either the\n-existing element at the given key or, if there is no element with the given\n-key, a reference to a newly inserted element at that key.\n-The const version of operator[] will only return a reference to an existing\n-element at the given key. If the key is not found, it will throw system_error.\n+*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n+This is mainly intended for debug and development use. It is not suitable to\n+use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n+type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n+depending on the locale.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_k\bke\bey\by(\b()\b) *\b**\b**\b**\b**\b*\n-entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n-entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n-These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n-throw system_error.\n-They will look for an element at the given key in the dictionary, if the\n-element cannot be found, they will return nullptr. If an element with the given\n-key is found, the return a pointer to it.\n+*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n-returns a pretty-printed string representation of the bencoded structure, with\n-JSON-style syntax\n+*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n+maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n+name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm d\bda\bat\bta\ba_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b__\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bd_\be_\bf_\bi_\bn_\be_\bd_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b__\bt_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n+template T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n+template T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n+When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n+to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n+Note\n+alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b<(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-inline std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, const entry& e);\n-prints the bencoded structure to the ostream as a JSON-style structure.\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|unknown |0 |the error was unexpected and it is unknown which |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bc_\ba_\bu_\bs_\be_\bd_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|bittorrent |1 |this is used when the bittorrent logic determines |\n+|_\b _\b _\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 _\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\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 |\n+|_\bi_\bo_\bc_\bo_\bn_\bt_\br_\bo_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bi_\bo_\bc_\bo_\bn_\bt_\br_\bo_\bl_\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+|getpeername |3 |a call to getpeername() failed (querying the remote|\n+|_\b _\b _\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_\bP_\b _\bo_\bf_\b _\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|getname |4 |a call to getname failed (querying the local IP 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|_\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bl_\bl_\bo_\bc_\b__\br_\be_\bc_\bv_\bb_\bu_\bf_\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\ba_\b _\br_\be_\bc_\be_\bi_\bv_\be_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b |\n+|_\ba_\bl_\bl_\bo_\bc_\b__\bs_\bn_\bd_\bb_\bu_\bf_\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\ba_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bf_\bi_\bl_\be_\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 _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\br_\be_\ba_\bd_\bi_\bn_\bg_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bf_\bi_\bl_\be_\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+|_\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\ba_\b _\bn_\bo_\bn_\b-_\br_\be_\ba_\bd_\b _\ba_\bn_\bd_\b _\bn_\bo_\bn_\b-_\bw_\br_\bi_\bt_\be_\b _\bf_\bi_\bl_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bw_\br_\bi_\bt_\be_\b _\bo_\bp_\be_\br_\ba_\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 |\n+|_\bs_\bo_\bc_\bk_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b _\b _\b _\b|_\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\br_\be_\ba_\bd_\b _\bo_\bp_\be_\br_\ba_\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 |\n+|_\bs_\bo_\bc_\bk_\b__\bo_\bp_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bo_\bp_\be_\bn_\b(_\b)_\b,_\b _\bt_\bo_\b _\bc_\br_\be_\ba_\bt_\be_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b |\n+|_\bs_\bo_\bc_\bk_\b__\bb_\bi_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bb_\bi_\bn_\bd_\b(_\b)_\b _\bo_\bn_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|available |14 |an attempt to query the number of bytes available |\n+|_\b _\b _\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 _\br_\be_\ba_\bd_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\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 |\n+|encryption |15 |a call related to bittorrent protocol encryption |\n+|_\b _\b _\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_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\ba_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bs_\bl_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b _\b _\b _\b|_\be_\bs_\bt_\ba_\bb_\bl_\bi_\bs_\bh_\bi_\bn_\bg_\b _\ba_\bn_\b _\bS_\bS_\bL_\b _\bc_\bo_\bn_\bn_\be_\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 |\n+|get_interface |18 |a connection failed to satisfy the bind interface |\n+|_\b _\b _\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_\bt_\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 |\n+|_\bs_\bo_\bc_\bk_\b__\bl_\bi_\bs_\bt_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b9_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bl_\bi_\bs_\bt_\be_\bn_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n+|sock_bind_to_device|20 |a call to the ioctl to bind a socket to a specific |\n+|_\b _\b _\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_\be_\bt_\bw_\bo_\br_\bk_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bo_\br_\b _\ba_\bd_\ba_\bp_\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 |\n+|_\bs_\bo_\bc_\bk_\b__\ba_\bc_\bc_\be_\bp_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b1_\b _\b _\b _\b|_\ba_\b _\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\ba_\bc_\bc_\be_\bp_\bt_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n+|_\bp_\ba_\br_\bs_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b|_\b2_\b2_\b _\b _\b _\b|_\bc_\bo_\bn_\bv_\be_\br_\bt_\b _\ba_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b |\n+|_\be_\bn_\bu_\bm_\b__\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b3_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bd_\be_\bv_\bi_\bc_\be_\bs_\b _\bo_\br_\b _\ba_\bd_\ba_\bp_\bt_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b4_\b _\b _\b _\b|_\bi_\bn_\bv_\bo_\bk_\bi_\bn_\bg_\b _\bs_\bt_\ba_\bt_\b(_\b)_\b _\bo_\bn_\b _\ba_\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 |\n+|_\bf_\bi_\bl_\be_\b__\bc_\bo_\bp_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b5_\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\ba_\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 |\n+|_\bf_\bi_\bl_\be_\b__\bf_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b|_\b2_\b6_\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bf_\bo_\br_\b _\ba_\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 |\n+|_\bf_\bi_\bl_\be_\b__\bh_\ba_\br_\bd_\b__\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b|_\b2_\b7_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\bi_\bn_\bg_\b _\ba_\b _\bh_\ba_\br_\bd_\b _\bl_\bi_\bn_\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 |\n+|_\bf_\bi_\bl_\be_\b__\br_\be_\bm_\bo_\bv_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b8_\b _\b _\b _\b|_\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\ba_\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 |\n+|_\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b9_\b _\b _\b _\b|_\br_\be_\bn_\ba_\bm_\bi_\bn_\bg_\b _\ba_\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 |\n+|_\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b0_\b _\b _\b _\b|_\bo_\bp_\be_\bn_\bi_\bn_\bg_\b _\ba_\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 |\n+|_\bm_\bk_\bd_\bi_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b1_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\bi_\bn_\bg_\b _\ba_\b _\bd_\bi_\br_\be_\bc_\bt_\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 _\b _\b _\b |\n+|_\bc_\bh_\be_\bc_\bk_\b__\br_\be_\bs_\bu_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b2_\b _\b _\b _\b|_\bc_\bh_\be_\bc_\bk_\b _\bf_\ba_\bs_\bt_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\ba_\bg_\ba_\bi_\bn_\bs_\bt_\b _\bf_\bi_\bl_\be_\bs_\b _\bo_\bn_\b _\bd_\bi_\bs_\bk_\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\bx_\bc_\be_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b3_\b _\b _\b _\b|_\ba_\bn_\b _\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b _\be_\bx_\bc_\be_\bp_\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 |\n+|_\ba_\bl_\bl_\bo_\bc_\b__\bc_\ba_\bc_\bh_\be_\b__\bp_\bi_\be_\bc_\be_\b _\b _\b|_\b3_\b4_\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bs_\bp_\ba_\bc_\be_\b _\bf_\bo_\br_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bc_\ba_\bc_\bh_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\bm_\bo_\bv_\be_\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\b _\bp_\ba_\br_\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 |\n+|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\br_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b|_\b3_\b6_\b _\b _\b _\b|_\br_\be_\ba_\bd_\b _\bf_\br_\bo_\bm_\b _\ba_\b _\bp_\ba_\br_\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 |\n+|_\bp_\ba_\br_\bt_\bf_\bi_\bl_\be_\b__\bw_\br_\bi_\bt_\be_\b _\b _\b _\b _\b _\b|_\b3_\b7_\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b _\bt_\bo_\b _\ba_\b _\bp_\ba_\br_\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 |\n+|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b|_\b3_\b8_\b _\b _\b _\b|_\ba_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\by_\bm_\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b9_\b _\b _\b _\b|_\bc_\br_\be_\ba_\bt_\be_\b _\bo_\br_\b _\br_\be_\ba_\bd_\b _\ba_\b _\bs_\by_\bm_\bl_\bi_\bn_\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 |\n+|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b _\b _\b _\b|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bp_\be_\be_\br_\b _\bo_\br_\b _\bs_\be_\br_\bv_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\b__\bo_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b1_\b _\b _\b _\b|_\bs_\be_\bt_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bo_\bp_\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 |\n+|_\be_\bn_\bu_\bm_\b__\br_\bo_\bu_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b2_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\br_\bo_\bu_\bt_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|file_seek |43 |moving read/write position in a file, _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt_\b:_\b:|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b4_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bs_\by_\bn_\bc_\b _\bw_\ba_\bi_\bt_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bn_\b _\ba_\b _\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\bm_\bm_\ba_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bm_\bm_\ba_\bp_\b(_\b)_\b _\b(_\bo_\br_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b _\bc_\bo_\bu_\bn_\bt_\be_\br_\bp_\ba_\br_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bf_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b(_\b)_\b _\b(_\bo_\br_\b _\bS_\be_\bt_\bE_\bn_\bd_\bO_\bf_\bF_\bi_\bl_\be_\b(_\b)_\b _\bo_\bn_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b)_\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbe\ben\bnc\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\be_\bn_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-template int b\bbe\ben\bnc\bco\bod\bde\be (OutIt out, const entry& e);\n-This function will encode data to bencoded form.\n-The _\be_\bn_\bt_\br_\by class is the internal representation of the bencoded data and it can\n-be used to retrieve information, an _\be_\bn_\bt_\br_\by can also be build by the program and\n-given to bencode() to encode it into the OutIt iterator.\n-OutIt is an _\bO_\bu_\bt_\bp_\bu_\bt_\bI_\bt_\be_\br_\ba_\bt_\bo_\br. It's a template and usually instantiated as\n-_\bo_\bs_\bt_\br_\be_\ba_\bm_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br or _\bb_\ba_\bc_\bk_\b__\bi_\bn_\bs_\be_\br_\bt_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br. This function assumes the value_type\n-of the iterator is a char. In order to encode _\be_\bn_\bt_\br_\by e into a buffer, do:\n-std::vector buf;\n-bencode(std::back_inserter(buf), e);\n+*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n+ user_alert_id\n+ user defined alerts should use IDs greater than this\n+ num_alert_types\n+ this constant represents \"max_alert_index\" + 1\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n+ error\n+ Enables alerts that report an error. This includes:\n+ * tracker errors\n+ * tracker warnings\n+ * file errors\n+ * resume data failures\n+ * web seed errors\n+ * .torrent files errors\n+ * listen socket errors\n+ * port mapping errors\n+ peer\n+ Enables alerts when peers send invalid requests, get banned or snubbed.\n+ port_mapping\n+ Enables alerts for port mapping events. For NAT-PMP and UPnP.\n+ storage\n+ Enables alerts for events related to the storage. File errors and\n+ synchronization events for moving the storage, renaming files etc.\n+ tracker\n+ Enables all tracker events. Includes announcing to trackers, receiving\n+ responses, warnings and errors.\n+ connect\n+ Low level alerts for when peers are connected and disconnected.\n+ status\n+ Enables alerts for when a torrent or the _\bs_\be_\bs_\bs_\bi_\bo_\bn changes state.\n+ ip_block\n+ Alerts when a peer is blocked by the ip blocker or port blocker.\n+ performance_warning\n+ Alerts when some limit is reached that might limit the download or upload\n+ rate.\n+ dht\n+ Alerts on events in the DHT node. For incoming searches or bootstrapping\n+ being done etc.\n+ stats\n+ If you enable these alerts, you will receive a stats_alert approximately\n+ once every second, for every active torrent. These alerts contain all\n+ statistics _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the interval since the lasts stats _\ba_\bl_\be_\br_\bt.\n+ session_log\n+ Enables debug logging alerts. These are available unless libtorrent was\n+ built with logging disabled (TORRENT_DISABLE_LOGGING). The alerts being\n+ posted are _\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and are _\bs_\be_\bs_\bs_\bi_\bo_\bn wide.\n+ torrent_log\n+ Enables debug logging alerts for torrents. These are available unless\n+ libtorrent was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n+ alerts being posted are _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and are torrent wide debug\n+ events.\n+ peer_log\n+ Enables debug logging alerts for peers. These are available unless\n+ libtorrent was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n+ alerts being posted are _\bp_\be_\be_\br_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt and low-level peer events and\n+ messages.\n+ incoming_request\n+ enables the _\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\ba_\bl_\be_\br_\bt.\n+ dht_log\n+ enables _\bd_\bh_\bt_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt, debug logging for the DHT\n+ dht_operation\n+ enable events from pure dht operations not related to torrents\n+ port_mapping_log\n+ enables port mapping log events. This log is useful for debugging the\n+ UPnP or NAT-PMP implementation\n+ picker_log\n+ enables verbose logging from the piece picker.\n+ file_progress\n+ alerts when files complete downloading\n+ piece_progress\n+ alerts when pieces complete downloading or fail hash check\n+ upload\n+ alerts when we upload blocks to other peers\n+ block_progress\n+ alerts on individual blocks being requested, downloading, finished,\n+ rejected, time-out and cancelled. This is likely to post alerts at a high\n+ rate.\n+ all\n+ The full bitmask, representing all available categories.\n+ since the enum is signed, make sure this isn't interpreted as -1. For\n+ instance, boost.python does that and fails when assigning it to an\n+ unsigned parameter.\n 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@@ -9625,16 +4734,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_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n virtual void t\bti\bic\bck\bk ();\n- virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n+ virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\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@@ -9664,17 +4773,17 @@\n through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n virtual void t\bti\bic\bck\bk ();\n This hook is called approximately once per second. It is a way of making it\n easy for plugins to do timed events, for sending messages or whatever.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+*\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 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@@ -9720,43 +4829,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 (piece_index_t);\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_a\bal\bll\bl ();\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_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_c\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_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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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_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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\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_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n+ virtual 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 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\bch\bho\bok\bke\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\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_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_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual void s\bse\ben\bnt\bt_\b_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_u\bun\bnc\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_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_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\bpi\bie\bec\bce\be (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n@@ -9792,48 +4901,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_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b)\n-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_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\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)\n-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) *\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 (piece_index_t);\n-virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b)\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()\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_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b)\n+o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n+virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_c\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_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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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_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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\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_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b)\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_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)\n s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\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_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_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_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\bpi\bie\bec\bce\be (peer_request const&);\n called after a choke message has been sent to the peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n called after piece data has been sent to the peer this can be used for stats\n book keeping\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -9912,62 +5021,73 @@\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 peer_id const& p\bpi\bid\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_c\bch\bho\bok\bke\bed\bd () const;\n bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n- bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n- void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ 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 const& r\bre\bem\bmo\bot\bte\be () const;\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n- bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () 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 const& r\bre\bem\bmo\bot\bte\be () const;\n bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n , disconnect_severity_t = peer_connection_interface::normal);\n- bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n+ bool 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- 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==\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_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+ void s\bsw\bwi\bit\btc\bch\bh_\b_s\bse\ben\bnd\bd_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bp_\be_\bx_\b._\bh_\bp_\bp\"\n+std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n+client_data_t);\n+constructor function for the ut_pex extension. The ut_pex extension allows\n+peers to gossip about their connections, allowing the swarm stay well connected\n+and peers aware of more peers in the swarm. This extension is enabled by\n+default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n const&, client_data_t);\n constructor function for the ut_metadata extension. The ut_metadata extension\n allows peers to request the .torrent file (or more specifically the info-\n dictionary of the .torrent file) from each other. This is the main building\n@@ -9982,372 +5102,1116 @@\n client_data_t);\n constructor function for the smart ban extension. The extension keeps track of\n the data peers have sent us for failing pieces and once the piece completes and\n passes the hash check bans the peers that turned out to have sent corrupt data.\n This function can either be passed in the add_torrent_params::extensions field,\n or via _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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* 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+*\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- ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n- ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n- ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter const&);\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter&&);\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n- 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+ void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+ void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n+ , peer_class_type_filter const& rhs);\n \n- enum access_flags\n+ enum socket_type_t\n {\n- blocked,\n+ tcp_socket,\n+ utp_socket,\n+ ssl_tcp_socket,\n+ ssl_utp_socket,\n+ i2p_socket,\n+ num_socket_types,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd(\b()\b) r\bre\bem\bmo\bov\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+add() and remove() adds and removes a peer class to be added to new peers based\n+on socket type.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) a\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+disallow() and allow() adds and removes a peer class to be removed from new\n+peers based on socket type.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n+takes a bitmask of peer classes and returns a new bitmask of peer classes after\n+the rules have been applied, based on the socket type argument (st).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|tcp_socket |0 |these match the socket types from socket_type.hpp|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bh_\bi_\bf_\bt_\be_\bd_\b _\bo_\bn_\be_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bs_\bl_\b__\bt_\bc_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bs_\bl_\b__\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\bs_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n+holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+calls.\n+struct peer_class_info\n+{\n+ bool ignore_unchoke_slots;\n+ int connection_limit_factor;\n+ std::string label;\n+ int upload_limit;\n+ int download_limit;\n+ int upload_priority;\n+ int download_priority;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ignore_unchoke_slots\n+ ignore_unchoke_slots determines whether peers should always unchoke a\n+ peer, regardless of the choking algorithm, or if it should honor the\n+ unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n+ peer classes a peer belongs to has this set to true, that peer will be\n+ unchoked at all times.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connection_limit_factor\n+ adjusts the connection limit (global and per torrent) that applies to\n+ this peer class. By default, local peers are allowed to exceed the normal\n+ connection limit for instance. This is specified as a percent factor. 100\n+ makes the peer class apply normally to the limit. 200 means as long as\n+ there are fewer connections than twice the limit, we accept this peer.\n+ This factor applies both to the global connection limit and the per-\n+ torrent limit. Note that if not used carefully one peer class can\n+ potentially completely starve out all other over time.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ label\n+ not used by libtorrent. It's intended as a potentially user-facing\n+ identifier of this peer class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_limit download_limit\n+ transfer rates limits for the whole peer class. They are specified in\n+ bytes per second and apply to the sum of all peers that are members of\n+ this class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_priority download_priority\n+ relative priorities used by the bandwidth allocator in the rate limiter.\n+ If no rate limits are in use, the priority is not used either. Priorities\n+ start at 1 (0 is not a valid priority) and may not exceed 255.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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 (char const* b, int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\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 (bitfield&& rhs) noexcept = default;\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 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 s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+ void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+ bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n+ bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n+ int s\bsi\biz\bze\be () const noexcept;\n+ int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n+ int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n+ bool e\bem\bmp\bpt\bty\by () const noexcept;\n+ char* d\bda\bat\bta\ba () noexcept;\n+ char const* d\bda\bat\bta\ba () const noexcept;\n+ void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n+ int c\bco\bou\bun\bnt\bt () const noexcept;\n+ int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n+ int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (lt::bitfield const& rhs) const;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) *\b**\b**\b**\b**\b*\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\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 (bitfield&& rhs) noexcept = default;\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* 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 s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+set bit at index to 0 (clear_bit) or 1 (set_bit).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n+returns true if all bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd are set\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bno\bon\bne\be_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n+returns true if no bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd is set\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int s\bsi\biz\bze\be () const noexcept;\n+returns the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in bits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n+returns the number of 32 bit words are needed to represent all bits in this\n+_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n+returns the number of bytes needed to represent all bits in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-bool e\bem\bmp\bpt\bty\by () const;\n-returns true if the filter does not contain any rules\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* 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+*\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* 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+*\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* 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+*\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* 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+*\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**\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+*\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- port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n- ~\b~p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n- p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\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 ();\n- port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\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+ h\bha\bas\bsh\bhe\ber\br ();\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+ h\bha\bas\bsh\bhe\ber\br (hasher const&);\n+ hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+ hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+ sha1_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\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+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+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* 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+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+append the following bytes to what is being hashed\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\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**\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+*\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- 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&&) noexcept;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\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- 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- int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () 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- 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- 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_i\bin\bnt\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- 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_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n- std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n- std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n- char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n- int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- 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+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\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+ 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 (char const* data, int len);\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+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* 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- none_t,\n- dict_t,\n- list_t,\n- string_t,\n- int_t,\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* 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+*\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\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-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&&) & = default;\n-For owning nodes, the copy will create a copy of the tree, but the underlying\n-buffer remains the same.\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* 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+*\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-*\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+ url\n+ The URL of the web seed\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+ 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-*\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-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+ 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-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\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) *\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-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-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+ 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* 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()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b)\n-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_s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\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-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-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_i\bin\bnt\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-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_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n-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+*\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-*\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+ 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-*\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_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) *\b**\b**\b**\b**\b*\n-std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n-char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n-int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-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+ 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-*\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+ 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-*\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+ 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* 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+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n+class torrent_info\n+{\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\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 (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+ 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 (std::string const& filename, error_code& ec);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\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 (span buffer, error_code& ec, from_span_t);\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 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+ void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+ std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+ std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n+ std::vector const& w\bwe\beb\bb_\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\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+ void 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::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 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+ char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n+ sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n+ bool i\bis\bs_\b_l\blo\boa\bad\bde\bed\bd () const;\n+ const std::string& n\bna\bam\bme\be () const;\n+ std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n+ const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n+ const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n+ std::vector> const& n\bno\bod\bde\bes\bs () const;\n+ void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair const& node);\n+ bool p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn (bdecode_node const& info, error_code& ec, int\n+max_pieces);\n+ bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n+ span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n+ span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n+ void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\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 (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+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 (std::string const& filename, error_code& ec);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\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 (span buffer, error_code& ec, from_span_t);\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* 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+*\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* 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+*\b**\b**\b**\b**\b* o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_storage const& 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**\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+*\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**\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+*\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**\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+*\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+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+void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+add_tracker() adds a tracker to the announce-list. The tier determines the\n+order in which the trackers are to be tried. The trackers() function will\n+return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n+string, which is the tracker url, and a tier index. The tier index is the high-\n+level priority. No matter which trackers that works or not, the ones with lower\n+tier will always be tried before the one with higher tier number. For more\n+information, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n+trackers() returns all entries from announce-list.\n+clear_trackers() removes all trackers from announce-list.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs(\b()\b) s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector 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* 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) 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 s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n+std::vector const& w\bwe\beb\bb_\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\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+void 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+web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n+a web_seed_entry and may refer to either a url seed or http seed.\n+add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n+set_web_seeds() replaces all web seeds with the ones specified in the seeds\n+vector.\n+The extern_auth argument can be used for other authorization schemes than basic\n+HTTP authorization. If set, it will override any username and password found in\n+the URL itself. The string will be sent as the HTTP authorization header's\n+value (without specifying \"Basic\").\n+The extra_headers argument defaults to an empty list, but can be used to insert\n+custom HTTP headers in the requests to a specific web seed.\n+See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+total_size() returns the total number of bytes the torrent-file represents.\n+Note that this is the number of pieces times the piece size (modulo the last\n+piece possibly being smaller). With pad files, the total size will be larger\n+than the sum of all (regular) file sizes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+piece_length() and num_pieces() returns the number of byte for each piece and\n+the total number of pieces, respectively. The difference between piece_size()\n+and piece_length() is that piece_size() takes the piece index as argument and\n+gives you the exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be smaller.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+returns the number of blocks there are in the typical piece. There may be fewer\n+in the last piece)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* 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\bv2\b2(\b()\b) v\bv1\b1(\b()\b) *\b**\b**\b**\b**\b*\n+bool v\bv1\b1 () const;\n+bool v\bv2\b2 () const;\n+returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n+torrents have both. These are shortcuts for info_hashes().has_v1() and\n+info_hashes().has_v2() calls.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n+If you need index-access to files you can use the num_files() along with the\n+file_path(), file_size()-family of functions to access files using indices.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+This function will map a piece index, a byte offset within that piece and a\n+size (in bytes) into the corresponding files with offsets where that data for\n+that piece is supposed to be stored. See _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int size)\n+const;\n+This function will map a range in a specific file into a range in the torrent.\n+The file_offset parameter is the offset in the file, given in bytes, where 0 is\n+the start of the file. See _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt.\n+The input range is assumed to be valid within the torrent. file_offset + size\n+is not allowed to be greater than the file size. file_index must refer to a\n+valid file, i.e. it cannot be >= num_files().\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n+Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n+Otherwise returns an empty string. The certificate is the public certificate in\n+x509 format.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+returns true if this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object has a torrent loaded. This is\n+primarily used to determine if a magnet link has had its metadata resolved yet\n+or not.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+bool p\bpr\bri\biv\bv () const;\n+returns true if this torrent is private. i.e., the client should not advertise\n+itself on the trackerless network (the Kademlia DHT) for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_i\bi2\b2p\bp(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n+returns true if this is an i2p torrent. This is determined by whether or not it\n+has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n+DHT and local peer discovery as well as talking to peers over anything other\n+than the i2p network.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+returns the piece size of file with index. This will be the same as\n+_\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+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+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+[_\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- 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+ 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- 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+ _\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+ ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n+ 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+\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* 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+~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n+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+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+Bencoding is a common representation in bittorrent used for dictionary, list,\n+_\bi_\bn_\bt and string hierarchies. It's used to encode .torrent files and some\n+messages in the network protocol. libtorrent also uses it to store settings,\n+resume data and other _\bs_\be_\bs_\bs_\bi_\bo_\bn state.\n+Strings in bencoded structures do not necessarily represent text. Strings are\n+raw byte buffers of a certain length. If a string is meant to be interpreted as\n+text, it is required to be UTF-8 encoded. See _\bB_\bE_\bP_\b _\b3.\n+The function for decoding bencoded data _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b), returning a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n+This function builds a tree that points back into the original buffer. The\n+returned _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will not be valid once the buffer it was parsed out of is\n+discarded.\n+It's possible to construct an _\be_\bn_\bt_\br_\by from a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, if a structure needs\n+to be altered and re-encoded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+The entry class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (std::map), an integer or a\n+string.\n+class entry\n+{\n+ data_type t\bty\byp\bpe\be () const;\n+ e\ben\bnt\btr\bry\by (dictionary_type);\n+ e\ben\bnt\btr\bry\by (preformatted_type);\n+ e\ben\bnt\btr\bry\by (list_type);\n+ e\ben\bnt\btr\bry\by (span);\n+ e\ben\bnt\btr\bry\by (integer_type);\n+ e\ben\bnt\btr\bry\by (U v);\n+ e\ben\bnt\btr\bry\by (data_type t);\n+ e\ben\bnt\btr\bry\by (bdecode_node const& n);\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (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= (entry const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\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+ string_type& s\bst\btr\bri\bin\bng\bg ();\n+ preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ 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+ 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+ enum data_type\n+ {\n+ int_t,\n+ string_t,\n+ list_t,\n+ dictionary_t,\n+ undefined_t,\n+ preformatted_t,\n+ };\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 (dictionary_type);\n+e\ben\bnt\btr\bry\by (preformatted_type);\n+e\ben\bnt\btr\bry\by (list_type);\n+e\ben\bnt\btr\bry\by (span);\n+e\ben\bnt\btr\bry\by (integer_type);\n+constructors directly from a specific type. The content of the argument is\n+copied into the newly constructed _\be_\bn_\bt_\br_\by\n+[_\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= (dictionary_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (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= (entry const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) l\bli\bis\bst\bt(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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+string_type& s\bst\btr\bri\bin\bng\bg ();\n+preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+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+The integer(), string(), list() and dict() functions are accessors that return\n+the respective type. If the entry object isn't of the type you request, the\n+accessor will throw system_error. You can ask an entry for its type through the\n+type() function.\n+If you want to create an entry you give it the type you want it to have in its\n+constructor, and then use one of the non-const accessors to get a reference\n+which you then can assign the value you want it to have.\n+The typical code to get info from a torrent file will then look like this:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find(\"announce\");\n+if (i != dict.end())\n+{\n+ std::string tracker_url = i->second.string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+The following code is equivalent, but a little bit shorter:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key(\"announce\"))\n+{\n+ std::string tracker_url = i->string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+To make it easier to extract information from a torrent file, the class\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo exists.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (entry& e);\n+swaps the content of t\bth\bhi\bis\bs with e.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n+entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n+All of these functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they\n+will throw system_error.\n+The non-const versions of the operator[] will return a reference to either the\n+existing element at the given key or, if there is no element with the given\n+key, a reference to a newly inserted element at that key.\n+The const version of operator[] will only return a reference to an existing\n+element at the given key. If the key is not found, it will throw system_error.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_k\bke\bey\by(\b()\b) *\b**\b**\b**\b**\b*\n+entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n+entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n+These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n+throw system_error.\n+They will look for an element at the given key in the dictionary, if the\n+element cannot be found, they will return nullptr. If an element with the given\n+key is found, the return a pointer to it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n+returns a pretty-printed string representation of the bencoded structure, with\n+JSON-style syntax\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm d\bda\bat\bta\ba_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b__\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bd_\be_\bf_\bi_\bn_\be_\bd_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b__\bt_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b<(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+inline std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, const entry& e);\n+prints the bencoded structure to the ostream as a JSON-style structure.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbe\ben\bnc\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\be_\bn_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+template int b\bbe\ben\bnc\bco\bod\bde\be (OutIt out, const entry& e);\n+This function will encode data to bencoded form.\n+The _\be_\bn_\bt_\br_\by class is the internal representation of the bencoded data and it can\n+be used to retrieve information, an _\be_\bn_\bt_\br_\by can also be build by the program and\n+given to bencode() to encode it into the OutIt iterator.\n+OutIt is an _\bO_\bu_\bt_\bp_\bu_\bt_\bI_\bt_\be_\br_\ba_\bt_\bo_\br. It's a template and usually instantiated as\n+_\bo_\bs_\bt_\br_\be_\ba_\bm_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br or _\bb_\ba_\bc_\bk_\b__\bi_\bn_\bs_\be_\br_\bt_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br. This function assumes the value_type\n+of the iterator is a char. In order to encode _\be_\bn_\bt_\br_\by e into a buffer, do:\n+std::vector buf;\n+bencode(std::back_inserter(buf), e);\n+[_\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@@ -10376,69 +6240,69 @@\n {\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t\n file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void 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+ void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n std::string const& n\bna\bam\bme\be () const;\n void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n- 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- bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n- std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n \"\") const;\n- std::string s\bsy\bym\bml\bli\bin\bnk\bk (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 char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+ string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+ std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\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- 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+ 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+ bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (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_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\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_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@@ -10466,28 +6330,28 @@\n is known up-front.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n 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@@ -10556,17 +6420,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@@ -10577,15 +6441,15 @@\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+*\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@@ -10604,41 +6468,41 @@\n returns the number of blocks in the specified piece, for v2 torrents.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n returns the number of blocks there are in the typical piece. There may be fewer\n in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\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_o\bof\bff\bfs\bse\bet\bt(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b)\n-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) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\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-bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n-std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+*\b**\b**\b**\b**\b* m\bmt\bti\bim\bme\be(\b()\b) h\bha\bas\bsh\bh(\b()\b) r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b)\n+f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n const;\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (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 char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\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+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+bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (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@@ -10651,26 +6515,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_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-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+*\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_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+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 Returns the number of pieces or blocks the file atindexspans, under the\n assumption that the file is aligned to the start of a piece. This is only\n meaningful for v2 torrents, where files are guaranteed such alignment. These\n numbers are used to size and navigate the merkle hash tree for each file.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n 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@@ -10687,15 +6551,15 @@\n returns a bitmask of flags from file_flags_t that apply to file at index.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n returns true if the file at the specified index has been renamed to have an\n absolute path, i.e. is not anchored in the save path of the torrent.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_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+*\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 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@@ -10726,35 +6590,54 @@\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\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+*\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+a parameter pack used to construct the storage for a torrent, used in\n+_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+struct storage_params\n+{\n+ s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs (file_storage const& f, file_storage const* mf\n+ , std::string const& sp, storage_mode_t const sm\n+ , aux::vector const& prio\n+ , sha1_hash const& ih);\n+\n+ file_storage const& files;\n+ file_storage const* m\bma\bap\bpp\bpe\bed\bd_\b_f\bfi\bil\ble\bes\bs = nullptr;\n+ std::string const& path;\n+ storage_mode_t m\bmo\bod\bde\be {storage_mode_sparse};\n+ aux::vector const& priorities;\n+ sha1_hash info_hash;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n-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+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* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n this is a simple posix disk I/O back-end, used for systems that don't have a 64\n bit virtual address space or don't support memory mapped files. It's\n implemented using portable C file functions and is single-threaded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n creates a disk io object that discards all data written to it, and only returns\n zero-buffers when read from. May be useful for testing and benchmarking.\n@@ -10806,152 +6689,2230 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bo_\bu_\br_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |don't move any source files, just forget |\n |reset_save_path |3 |about them and begin checking files at new |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b _\bp_\ba_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |reset_save_path_unchecked|4 |don't move any source files, just change save|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bt_\bh_\b _\ba_\bn_\bd_\b _\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\ba_\bn_\by_\b _\bc_\bh_\be_\bc_\bk_\bs_\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-struct announce_infohash\n+*\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- 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+ 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- message\n- if this tracker has returned an error or warning message that message is\n- stored here\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- last_error\n- if this tracker failed the last time it was contacted this error code\n- specifies what error occurred\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- 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+ ec\n+ the error that occurred\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+ 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- updating\n- true while we're waiting for a response from the tracker.\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- 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+*\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- complete_sent\n- set to true when we send a event=completed.\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* 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+*\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* 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* 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* 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* 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/_\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/_\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+|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+[_\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 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/_\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+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* 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- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt ();\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 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_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- _\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+ 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- local_endpoint\n- the local endpoint of the listen interface associated with this endpoint\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- 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+*\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- enabled\n- set to false to not announce from this endpoint\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd(\b()\b) a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n+virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n+ , char const* buf, std::shared_ptr o\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n+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**\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+*\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- announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n- explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n- 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- ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n+ ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n+ 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* 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* 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_s\bst\btr\br (int name, std::string val) = 0;\n+ virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n+ virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n+ virtual void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int 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* 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+ open the file for random access. This disables read-ahead logic\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* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n+started.\n+struct session_params\n+{\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n \n- enum tracker_source\n- {\n- source_torrent,\n- source_client,\n- source_magnet_link,\n- source_tex,\n- };\n+ settings_pack settings;\n+ std::vector> extensions;\n+ dht::dht_state dht_state;\n+ dht::dht_storage_constructor_type dht_storage_constructor;\n+ disk_io_constructor_type disk_io_constructor;\n+ std::map ext_state;\n+ libtorrent::ip_filter ip_filter;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+This constructor can be used to start with the default plugins (ut_metadata,\n+ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n+This constructor helps to configure the set of initial plugins to be added to\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's started.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ settings\n+ The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ extensions\n+ the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_state\n+ DHT node ID and node addresses to bootstrap the DHT with.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_storage_constructor\n+ function object to construct the storage object for DHT items.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ disk_io_constructor\n+ function object to create the disk I/O subsystem. Defaults to\n+ default_disk_io_constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ext_state\n+ this container can be used by extensions/plugins to store settings. It's\n+ primarily here to make it convenient to save and restore state across\n+ sessions, using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ip_filter\n+ the IP filter to use for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This restricts which peers are\n+ allowed to connect. As if passed to _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n+this class provides a non-owning handle to a _\bs_\be_\bs_\bs_\bi_\bo_\bn and a subset of the\n+interface of the _\bs_\be_\bs_\bs_\bi_\bo_\bn class. If the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is destructed any\n+handle to it will no longer be valid. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return false and any\n+operation on it will throw a system_error exception, with error code\n+invalid_session_handle.\n+struct session_handle\n+{\n+ bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+ session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags =\n+save_state_flags_t::all()) const;\n+ 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&& st);\n+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n+ std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\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&& 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+ 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+ 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::function(\n+ torrent_handle const&, client_data_t)> ext);\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n+ void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n+ ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n+ 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+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n+ ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n+ peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n+ void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n+ peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+ void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n+ 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 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 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- std::string url;\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+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+[_\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+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 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&& 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 overload that does not take an error_code throws an exception on error and\n+is not available when building without exception support. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n+returned by _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) can be used to retrieve information about the\n+torrent's progress, its peers etc. It is also used to abort a torrent.\n+If the torrent you are trying to add already exists in the _\bs_\be_\bs_\bs_\bi_\bo_\bn (is either\n+queued for checking, being checked or downloading) add_torrent() will throw\n+system_error which derives from std::exception unless duplicate_is_error is set\n+to false. In that case, _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will return the handle to the existing\n+torrent.\n+The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs class has a flags field. It can be used to control what\n+state the new torrent will be added in. Common flags to want to control are\n+torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n+link that will just download the metadata, but no payload, set the\n+torrent_flags::upload_mode flag.\n+Special consideration has to be taken when adding hybrid torrents (i.e.\n+torrents that are BitTorrent v2 torrents that are backwards compatible with\n+v1). For more details, see _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) r\bre\bes\bsu\bum\bme\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+Pausing the _\bs_\be_\bs_\bs_\bi_\bo_\bn has the same effect as pausing every torrent in it, except\n+that torrents will not be resumed by the auto-manage mechanism. Resuming will\n+restore the torrents to their previous paused state. i.e. the _\bs_\be_\bs_\bs_\bi_\bo_\bn pause\n+state is separate from the torrent pause state. A torrent is inactive if it is\n+paused or if the _\bs_\be_\bs_\bs_\bi_\bo_\bn is paused.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n+is_dht_running() returns true if the DHT support has been started and false\n+otherwise.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n+set_dht_storage set a dht custom storage constructor function to be used\n+internally when the dht is created.\n+Since the dht storage is a critical component for the dht behavior, this\n+function will only be effective the next time the dht is started. If you never\n+touch this feature, a default map-memory based storage is used.\n+If you want to make sure the dht is initially created with your custom storage,\n+create a _\bs_\be_\bs_\bs_\bi_\bo_\bn with the setting settings_pack::enable_dht to false, set your\n+constructor function and call apply_settings with settings_pack::enable_dht to\n+true.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n+add_dht_node takes a host name and port pair. That endpoint will be pinged, and\n+if a valid DHT reply is received, the node will be added to the routing table.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n+query the DHT for an immutable item at the target hash. the result is posted as\n+a _\bd_\bh_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::string salt = std::string());\n+query the DHT for a mutable item under the public key key. this is an ed25519\n+key. salt is optional and may be left as an empty string if no salt is to be\n+used. if the item is found in the DHT, a _\bd_\bh_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt is posted.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n+store the given bencoded data as an immutable item in the DHT. the returned\n+hash is the key that is to be used to look the item up again. It's just the\n+SHA-1 hash of the bencoded form of the structure.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::function&\n+ , std::int64_t&, std::string const&)> cb\n+ , std::string salt = std::string());\n+store a mutable item. The key is the public key the blob is to be stored under.\n+The optional salt argument is a string that is to be mixed in with the key when\n+determining where in the DHT the value is to be stored. The callback function\n+is called from within the libtorrent network thread once we've found where to\n+store the blob, possibly with the current value stored under the key. The\n+values passed to the callback functions are:\n+ entry& value\n+ the current value stored under the key (may be empty). Also expected to\n+ be set to the value to be stored by the function.\n+ std::array& signature\n+ the signature authenticating the current value. This may be zeros if\n+ there is currently no value stored. The function is expected to fill in\n+ this buffer with the signature of the new value to store. To generate the\n+ signature, you may want to use the sign_mutable_item function.\n+ std::int64_t& seq\n+ current sequence number. May be zero if there is no current value. The\n+ function is expected to set this to the new sequence number of the value\n+ that is to be stored. Sequence numbers must be monotonically increasing.\n+ Attempting to overwrite a value with a lower or equal sequence number\n+ will fail, even if the signature is correct.\n+ std::string const& salt\n+ this is the salt that was used for this put call.\n+Since the callback function cb is called from within libtorrent, it is critical\n+to not perform any blocking operations. Ideally not even locking a mutex. Pass\n+any data required for this function along with the function object's context\n+and make the function entirely self-contained. The only reason data blob's\n+value is computed via a function instead of just passing in the new value is to\n+avoid race conditions. If you want to u\bup\bpd\bda\bat\bte\be the value in the DHT, you must\n+first retrieve it, then modify it, then write it back. The way the DHT works,\n+it is natural to always do a lookup before storing and calling the callback in\n+between is convenient.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_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).\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* 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+[_\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) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+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* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n+ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n+Sets the peer class filter for this _\bs_\be_\bs_\bs_\bi_\bo_\bn. All new peer connections will take\n+this into account and be added to the peer classes specified by this filter,\n+based on the peer's IP address.\n+The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n+represents a peer class. The least significant bit represents class 0, the next\n+bit class 1 and so on.\n+For more info, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n+For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n+their own peer class, apply the following filter:\n+ip_filter f = ses.get_peer_class_filter();\n+peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n+f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n+ , 1 << static_cast(my_class));\n+ses.set_peer_class_filter(f);\n+This setting only applies to new connections, it won't affect existing peer\n+connections.\n+This function is limited to only peer class 0-31, since there are only 32 bits\n+in the IP range mapping. Only the set bits matter; no peer class will be\n+removed from a peer as a result of this call, peer classes are only added.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_filter are 32 bits.\n+The get_peer_class_filter() function returns the current filter.\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n+peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n+assignments to peers based on what kind of socket it is.\n+It does not only support assigning peer classes, it also supports removing peer\n+classes based on socket type.\n+The order of these rules being applied are:\n+ 1. peer-class IP filter\n+ 2. peer-class type filter, removing classes\n+ 3. peer-class type filter, adding classes\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n+Creates a new peer class (see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs) with the given name. The returned\n+integer is the new peer class identifier. Peer classes may have the same name,\n+so each invocation of this function creates a new class and returns a unique\n+identifier.\n+Identifiers are assigned from low numbers to higher. So if you plan on using\n+certain peer classes in a call to _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b), make sure to create\n+those early on, to get low identifiers.\n+For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n+This call dereferences the reference count of the specified peer class. When\n+creating a peer class it's automatically referenced by 1. If you want to\n+recycle a peer class, you may call this function. You may only call this\n+function o\bon\bnc\bce\be per peer class you create. Calling it more than once for the same\n+class will lead to memory corruption.\n+Since peer classes are reference counted, this function will not remove the\n+peer class if it's still assigned to torrents or peers. It will however remove\n+it once the last peer and torrent drops their references to it.\n+There is no need to call this function for custom peer classes. All peer\n+classes will be properly destructed when the _\bs_\be_\bs_\bs_\bi_\bo_\bn object destructs.\n+For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+These functions queries information from a peer class and updates the\n+configuration of a peer class, respectively.\n+cid must refer to an existing peer class. If it does not, the return value of\n+get_peer_class() is undefined.\n+set_peer_class() sets all the information in the _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo object in the\n+specified peer class. There is no option to only update a single property.\n+A peer or torrent belonging to more than one class, the highest priority among\n+any of its classes is the one that is taken into account.\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n+remove_torrent() will close all peer connections associated with the torrent\n+and tell the tracker that we've stopped participating in the swarm. This\n+operation cannot fail. When it completes, you will receive a\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n+_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, but will remove the torrent from the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+synchronously. Calling _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) immediately afterward with\n+the same torrent will succeed. Note that this creates a new handle which is not\n+equal to the removed one.\n+The optional second argument options can be used to delete all the files\n+downloaded by this torrent. To do so, pass in the value session_handle::\n+delete_files. Once the torrent is deleted, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted.\n+The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be remains valid for some time after _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n+called. It will become invalid only after all libtorrent tasks (such as I/\n+O tasks) release their references to the torrent. Until this happens,\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return true, and other calls such as\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) will succeed. Because of this, and because\n+_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, the following sequence usually succeeds (does\n+not throw system_error): .. code:: c++\n+ session.remove_handle(handle); handle.save_resume_data();\n+Note that when a queued or downloading torrent is removed, its position in the\n+download queue is vacated and every subsequent torrent in the queue has their\n+queue positions updated. This can potentially cause a large state_update to be\n+posted. When removing all torrents, it is advised to remove them from the back\n+of the queue, to minimize the shifting.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+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 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* 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) w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n+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* 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+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n+reopen_map_ports);\n+Instructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn to reopen all listen and outgoing sockets.\n+It's useful in the case your platform doesn't support the built in IP notifier\n+mechanism, or if you have a better more reliable way to detect changes in the\n+IP routing table.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n+This function is intended only for use by plugins. This type does not have a\n+stable API and should be relied on as little as possible.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_settings\n+ saves settings (i.e. the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_dht_state\n+ saves dht state such as nodes and node-id, possibly accelerating joining\n+ the DHT if provided at next _\bs_\be_\bs_\bs_\bi_\bo_\bn startup.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_extension_state\n+ load or save state from plugins\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_ip_filter\n+ load or save the IP filter set on the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ global_peer_class_id tcp_peer_class_id local_peer_class_id\n+ built-in peer classes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ delete_files\n+ delete the files belonging to the torrent from disk. including the part-\n+ file, if there is one\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ delete_partfile\n+ delete just the part-file associated with this torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ paused\n+ when set, the _\bs_\be_\bs_\bs_\bi_\bo_\bn will start paused. Call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bs_\bu_\bm_\be_\b(_\b) to\n+ start\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ udp tcp\n+ protocols used by _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ reopen_map_ports\n+ This option indicates if the ports are mapped using natpmp and upnp. If\n+ mapping was already made, they are deleted and added again. This only\n+ works if natpmp and/or upnp are configured to be enable.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+this is a holder for the internal _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object. Once the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n+the completion of the shutdown. The lifetime of this object may outlive\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n+down.\n+struct session_proxy\n+{\n+ session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+ session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn holds all state that spans multiple torrents. Among other things it\n+runs the network loop and manages all torrents. Once it's created, the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+object will spawn the main thread that will do all the work. The main thread\n+will be idle as long it doesn't have any torrents to participate in.\n+You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session_handle::\n+apply_settings() member function. To change one or more configuration options,\n+create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n+it in to session::apply_settings().\n+see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n+struct session : session_handle\n+{\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn ();\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n+ session_proxy a\bab\bbo\bor\brt\bt ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params 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&& 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+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n+Overload of the constructor that takes an external io_context to run the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n+multiple sessions on a single io_context, or low resource systems where\n+additional threads are expensive and sharing an io_context with other events is\n+fine.\n+Warning\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n+io_context::run() call m\bmu\bus\bst\bt have returned before it's safe to destruct the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn. Which means you M\bMU\bUS\bST\bT call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b:_\b:_\ba_\bb_\bo_\br_\bt_\b(_\b) and save the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+first, then destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn object, then sync with the io_context, then\n+destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n+The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n+shut down. If some trackers are down, they will time out. All this before the\n+destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n+(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n+can take a few second for it to finish. The timeout can be set with\n+_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+session_proxy a\bab\bbo\bor\brt\bt ();\n+In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+object will block while the trackers are contacted. If you keep one\n+session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n+block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n+then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n+from the session destructor call until the session_proxy destructor call. The\n+session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n+closed down, no operations are allowed on it). The only valid operation is\n+calling the destructor:\n+struct session_proxy {};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n+*\b**\b**\b**\b**\b**\b*\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 (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+session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+These functions serialize and de-serialize a session_params object to and from\n+bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+using the state from a previous one (or by programmatically configure the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n+certain aspects of the session's state. The _buf suffix indicates the function\n+operates on buffer rather than the bencoded structure. The torrents in a\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n+separately.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n+struct counters\n+{\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n+ counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n+ std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+ std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+ void 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 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+[_\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- 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+ 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* 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-explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\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-~\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+ 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* 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+ 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- url\n- tracker URL as it appeared in the torrent file\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 current &trackerid= argument passed to the tracker. this is optional\n- and is normally empty (in which case no trackerid is sent).\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- endpoints\n- each local listen socket (endpoint) will announce to the tracker. This\n- list contains state per endpoint.\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- tier\n- the tier this tracker belongs to\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- 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+*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+ explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n+ explicit operator T\bT () const;\n+ T* g\bge\bet\bt () const;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+ operator v\bvo\boi\bid\bd*\b* () const = delete;\n+\n+ template ::value>::type>\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- source\n- a bitmask specifying which sources we got this tracker from.\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- verified\n- set to true the first time we receive a valid response from this tracker.\n+*\b**\b**\b**\b**\b* c\bco\bon\bns\bst\bt*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) *\b**\b**\b**\b**\b*\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+operator v\bvo\boi\bid\bd*\b* () const = delete;\n+we don't allow type-unsafe operations\n 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@@ -10988,17 +8949,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 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@@ -11016,32 +8977,32 @@\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const;\n index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+ void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n \n static constexpr create_flags_t m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn_\b_t\bti\bim\bme\be = 2_bit;\n static constexpr create_flags_t s\bsy\bym\bml\bli\bin\bnk\bks\bs = 3_bit;\n static constexpr create_flags_t v\bv2\b2_\b_o\bon\bnl\bly\by = 5_bit;\n static constexpr create_flags_t v\bv1\b1_\b_o\bon\bnl\bly\by = 6_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs = 7_bit;\n static constexpr create_flags_t n\bno\bo_\b_a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs = 8_bit;\n 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.\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 for the torrent to be created. Set this up first, before passing it to the\n@@ -11156,15 +9117,15 @@\n makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n valid certificate signed by this root certificate. For SSL torrents, all peers\n are connecting over SSL connections. For more information, see the section on\n _\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n The string is not the path to the cert, it's the actual content of the\n certificate.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n 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@@ -11184,24 +9145,24 @@\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_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n Add similar torrents (by info-hash) or collections of similar torrents. Similar\n torrents are expected to share some files with this torrent. Torrents sharing a\n collection name with this torrent are also expected to share files with this\n torrent. A torrent may have more than one collection and more than one similar\n torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n modification_time\n@@ -11269,1122 +9230,3161 @@\n directories are traversed.\n The \"..\" directory is never traversed.\n The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n constructor.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n+error_code& ec);\n+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 inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n , settings_interface const& settings\n , std::function const& f);\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings, disk_io_constructor_type disk_io\n , std::function const& f, error_code& ec);\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n , std::function const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n-error_code& ec);\n inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n , 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 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\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* 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- 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- };\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+ 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+ 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- unsigned bytes_progress:15;\n- unsigned block_size:15;\n- unsigned state:2;\n- unsigned num_peers:14;\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* 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-[_\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* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+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- bytes_progress\n- the number of bytes that have been received for this block\n+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs(\b()\b) *\b**\b**\b**\b**\b*\n+bool h\bha\bas\bs (protocol_version v) const;\n+bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+returns true if the corresponding info hash is present in this object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- block_size\n- the total number of bytes in this block.\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- 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* g\bge\bet\bt_\b_b\bbe\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n+returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n+info-hash\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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* 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\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**\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- 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+ 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- 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- 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- finished\n- the number of blocks that are in the finished state\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- writing\n- the number of blocks that are in the writing state\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- requested\n- the number of blocks that are in the requested state\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- 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+ 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* 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**\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- 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 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- std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n- void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n- void 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- 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 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 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 a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry 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 a\bad\bdd\bd_\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 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 u\bun\bns\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 () 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_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_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_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 (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- download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n- void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority)\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- 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 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 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- 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- 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- 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- 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+ sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\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+ std::string client;\n+ typed_bitfield pieces;\n+ std::int64_t total_download;\n+ std::int64_t total_upload;\n+ time_duration last_request;\n+ time_duration last_active;\n+ time_duration download_queue_time;\n+ static constexpr peer_flags_t i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg = 0_bit;\n+ static constexpr peer_flags_t c\bch\bho\bok\bke\bed\bd = 1_bit;\n+ static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd = 2_bit;\n+ static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_c\bch\bho\bok\bke\bed\bd = 3_bit;\n+ static constexpr peer_flags_t s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs = 4_bit;\n+ static constexpr peer_flags_t o\bou\but\btg\bgo\boi\bin\bng\bg_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n+ static constexpr peer_flags_t l\blo\boc\bca\bal\bl_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n+ static constexpr peer_flags_t h\bha\ban\bnd\bds\bsh\bha\bak\bke\be = 6_bit;\n+ static constexpr peer_flags_t c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg = 7_bit;\n+ static constexpr peer_flags_t o\bon\bn_\b_p\bpa\bar\bro\bol\ble\be = 9_bit;\n+ static constexpr peer_flags_t s\bse\bee\bed\bd = 10_bit;\n+ static constexpr peer_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be = 11_bit;\n+ static constexpr peer_flags_t s\bsn\bnu\bub\bbb\bbe\bed\bd = 12_bit;\n+ static constexpr peer_flags_t u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by = 13_bit;\n+ static constexpr peer_flags_t e\ben\bnd\bdg\bga\bam\bme\be_\b_m\bmo\bod\bde\be = 14_bit;\n+ static constexpr peer_flags_t h\bho\bol\ble\bep\bpu\bun\bnc\bch\bhe\bed\bd = 15_bit;\n+ static constexpr peer_flags_t i\bi2\b2p\bp_\b_s\bso\boc\bck\bke\bet\bt = 16_bit;\n+ static constexpr peer_flags_t u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt = 17_bit;\n+ static constexpr peer_flags_t s\bss\bsl\bl_\b_s\bso\boc\bck\bke\bet\bt = 18_bit;\n+ static constexpr peer_flags_t r\brc\bc4\b4_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 19_bit;\n+ static constexpr peer_flags_t p\bpl\bla\bai\bin\bnt\bte\bex\bxt\bt_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 20_bit;\n+ peer_flags_t flags;\n+ static constexpr peer_source_flags_t t\btr\bra\bac\bck\bke\ber\br = 0_bit;\n+ static constexpr peer_source_flags_t d\bdh\bht\bt = 1_bit;\n+ static constexpr peer_source_flags_t p\bpe\bex\bx = 2_bit;\n+ static constexpr peer_source_flags_t l\bls\bsd\bd = 3_bit;\n+ static constexpr peer_source_flags_t r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba = 4_bit;\n+ static constexpr peer_source_flags_t i\bin\bnc\bco\bom\bmi\bin\bng\bg = 5_bit;\n+ peer_source_flags_t source;\n+ int up_speed;\n+ int down_speed;\n+ int payload_up_speed;\n+ int payload_down_speed;\n+ peer_id pid;\n+ int queue_bytes;\n+ int request_timeout;\n+ int send_buffer_size;\n+ int used_send_buffer;\n+ int receive_buffer_size;\n+ int used_receive_buffer;\n+ int receive_buffer_watermark;\n+ int num_hashfails;\n+ int download_queue_length;\n+ int timed_out_requests;\n+ int busy_requests;\n+ int requests_in_buffer;\n+ int target_dl_queue_length;\n+ int upload_queue_length;\n+ int failcount;\n+ piece_index_t downloading_piece_index;\n+ int downloading_block_index;\n+ int downloading_progress;\n+ int downloading_total;\n+ static constexpr connection_type_t s\bst\bta\ban\bnd\bda\bar\brd\bd_\b_b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt = 0_bit;\n+ static constexpr connection_type_t w\bwe\beb\bb_\b_s\bse\bee\bed\bd = 1_bit;\n+ static constexpr connection_type_t h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd = 2_bit;\n+ connection_type_t connection_type;\n+ int pending_disk_bytes;\n+ int pending_disk_read_bytes;\n+ int send_quota;\n+ int receive_quota;\n+ int rtt;\n+ int num_pieces;\n+ int download_rate_peak;\n+ int upload_rate_peak;\n+ float progress;\n+ int progress_ppm;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt ip;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_i\bid\bdl\ble\be = 0_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_l\bli\bim\bmi\bit\bt = 1_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_n\bne\bet\btw\bwo\bor\brk\bk = 2_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_d\bdi\bis\bsk\bk = 4_bit;\n+ bandwidth_state_flags_t read_state;\n+ bandwidth_state_flags_t write_state;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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* i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n+If this peer is an i2p peer, this function returns the destination address of\n+the peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ client\n+ A human readable string describing the software at the other end of the\n+ connection. In some cases this information is not available, then it will\n+ contain a string that may give away something about which software is\n+ running in the other end. In the case of a web seed, the server type and\n+ version will be a part of this string. This is UTF-8 encoded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ pieces\n+ a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, with one bit per piece in the torrent. Each bit tells you if\n+ the peer has that piece (if it's set to 1) or if the peer miss that piece\n+ (set to 0).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ total_download total_upload\n+ the total number of bytes downloaded from and uploaded to this peer.\n+ These numbers do not include the protocol chatter, but only the payload\n+ data.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ last_request last_active\n+ the time since we last sent a request to this peer and since any transfer\n+ occurred with this peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ download_queue_time\n+ the time until all blocks in the request queue will be downloaded\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n-void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-post_download_queue() triggers a download_queue_alert to be posted.\n-get_download_queue() is a synchronous call and returns a vector with\n-information about pieces that are partially downloaded or not downloaded but\n-partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n-vector.\n+ interesting\n+ w\bwe\be are interested in pieces from this peer.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n-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-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+ choked\n+ w\bwe\be have choked this peer.\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-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 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-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+ remote_interested\n+ the peer is interested in u\bus\bs\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ remote_choked\n+ the peer has choked u\bus\bs.\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+ supports_extensions\n+ means that this peer supports the _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\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) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\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 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 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+ outgoing_connection\n+ The connection was initiated by us, the peer has a listen port open, and\n+ that port is the same as in the address of this peer. If this flag is not\n+ set, this peer connection was opened by this peer connecting to us.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n-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-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+ local_connection\n+ deprecated synonym for outgoing_connection\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 r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n-std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n-void a\bad\bdd\bd_\b_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+ handshake\n+ The connection is opened, and waiting for the handshake. Until the\n+ handshake is done, the peer cannot be identified.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ connecting\n+ The connection is in a half-open state (i.e. it is being connected).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ on_parole\n+ The peer has participated in a piece that failed the hash check, and is\n+ now \"on parole\", which means we're only requesting whole pieces from this\n+ peer until it either fails that piece or proves that it doesn't send bad\n+ data.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ seed\n+ This peer is a seed (it has all the pieces).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bsu\bum\bme\be () const;\n-void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n-pause(), and resume() will disconnect all peers and reconnect all peers\n-respectively. When a torrent is paused, it will however remember all share\n-ratios to all peers and remember all potential (not connected) peers. Torrents\n-may be paused automatically if there is a file error (e.g. disk full) or\n-something similar. See _\bf_\bi_\bl_\be_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt.\n-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+ optimistic_unchoke\n+ This peer is subject to an optimistic unchoke. It has been unchoked for a\n+ while to see if it might unchoke us in return an earn an upload/unchoke\n+ slot. If it doesn't within some period of time, it will be choked and\n+ another peer will be optimistically unchoked.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) 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 u\bun\bns\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-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+ snubbed\n+ This peer has recently failed to send a block within the request timeout\n+ from when the request was sent. We're currently picking one block at a\n+ time from this peer.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ upload_only\n+ This peer has either explicitly (with an extension) or implicitly (by\n+ becoming a seed) told us that it will not downloading anything more,\n+ regardless of which pieces we have.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ endgame_mode\n+ This means the last time this peer picket a piece, it could not pick as\n+ many as it wanted because there were not enough free ones. i.e. all\n+ pieces this peer has were already requested from other peers.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+ holepunched\n+ This flag is set if the peer was in holepunch mode when the connection\n+ succeeded. This typically only happens if both peers are behind a NAT and\n+ the peers connect via the NAT holepunch mechanism.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ i2p_socket\n+ indicates that this socket is running on top of the I2P transport.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ utp_socket\n+ indicates that this socket is a uTP socket\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ssl_socket\n+ indicates that this socket is running on top of an SSL (TLS) channel\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ rc4_encrypted\n+ this connection is obfuscated with RC4\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ plaintext_encrypted\n+ the handshake of this connection was obfuscated with a Diffie-Hellman\n+ exchange\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flags\n+ tells you in which state the peer is in. It is set to any combination of\n+ the peer_flags_t flags above.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ tracker\n+ The peer was received from the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht\n+ The peer was received from the kademlia DHT.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pex\n+ The peer was received from the peer exchange extension.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ lsd\n+ The peer was received from the local service discovery (The peer is on\n+ the local network).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ resume_data\n+ The peer was added from the fast resume data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ incoming\n+ we received an incoming connection from this peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ source\n+ a combination of flags describing from which sources this peer was\n+ received. A combination of the peer_source_flags_t above.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ up_speed down_speed\n+ the current upload and download speed we have to and from this peer\n+ (including any protocol messages). updated about once per second\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ payload_up_speed payload_down_speed\n+ The transfer rates of payload data only updated about once per second\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pid\n+ the peer's id as used in the bittorrent protocol. This id can be used to\n+ extract 'fingerprints' from the peer. Sometimes it can tell you which\n+ client the peer is using. See identify_client()_\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ queue_bytes\n+ the number of bytes we have requested from this peer, but not yet\n+ received.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ request_timeout\n+ the number of seconds until the current front piece request will time\n+ out. This timeout can be adjusted through settings_pack::request_timeout.\n+ -1 means that there is not outstanding request.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ send_buffer_size used_send_buffer\n+ the number of bytes allocated and used for the peer's send buffer,\n+ respectively.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ receive_buffer_size used_receive_buffer receive_buffer_watermark\n+ the number of bytes allocated and used as receive buffer, respectively.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_hashfails\n+ the number of pieces this peer has participated in sending us that turned\n+ out to fail the hash check.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_queue_length\n+ this is the number of requests we have sent to this peer that we haven't\n+ got a response for yet\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ timed_out_requests\n+ the number of block requests that have timed out, and are still in the\n+ download queue\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ busy_requests\n+ the number of busy requests in the download queue. A busy request is a\n+ request for a block we've also requested from a different peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ requests_in_buffer\n+ the number of requests messages that are currently in the send buffer\n+ waiting to be sent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ target_dl_queue_length\n+ the number of requests that is tried to be maintained (this is typically\n+ a function of download speed)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_queue_length\n+ the number of piece-requests we have received from this peer that we\n+ haven't answered with a piece yet.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ failcount\n+ the number of times this peer has \"failed\". i.e. failed to connect or\n+ disconnected us. The failcount is decremented when we see this peer in a\n+ tracker response or peer exchange message.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ downloading_piece_index downloading_block_index downloading_progress\n+ downloading_total\n+ You can know which piece, and which part of that piece, that is currently\n+ being downloaded from a specific peer by looking at these four members.\n+ downloading_piece_index is the index of the piece that is currently being\n+ downloaded. This may be set to -1 if there's currently no piece\n+ downloading from this peer. If it is >= 0, the other three members are\n+ valid. downloading_block_index is the index of the block (or sub-piece)\n+ that is being downloaded. downloading_progress is the number of bytes of\n+ this block we have received from the peer, and downloading_total is the\n+ total number of bytes in this block.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ standard_bittorrent\n+ Regular bittorrent connection\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ web_seed\n+ HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b9 protocol\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ http_seed\n+ HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b7 protocol\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connection_type\n+ the kind of connection this peer uses. See connection_type_t.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pending_disk_bytes\n+ the number of bytes this peer has pending in the disk-io thread.\n+ Downloaded and waiting to be written to disk. This is what is capped by\n+ settings_pack::max_queued_disk_bytes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pending_disk_read_bytes\n+ number of outstanding bytes to read from disk\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ send_quota receive_quota\n+ the number of bytes this peer has been assigned to be allowed to send and\n+ receive until it has to request more quota from the bandwidth manager.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ rtt\n+ an estimated round trip time to this peer, in milliseconds. It is\n+ estimated by timing the TCP connect(). It may be 0 for incoming\n+ connections.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_pieces\n+ the number of pieces this peer has.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_rate_peak upload_rate_peak\n+ the highest download and upload rates seen on this connection. They are\n+ given in bytes per second. This number is reset to 0 on reconnect.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress\n+ the progress of the peer in the range [0, 1]. This is always 0 when\n+ floating point operations are disabled, instead use progress_ppm.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress_ppm\n+ indicates the download progress of the peer in the range [0, 1000000]\n+ (parts per million).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ip\n+ the IP-address to this peer. The type is an asio endpoint. For more info,\n+ see the _\ba_\bs_\bi_\bo documentation. This field is not valid for i2p peers.\n+ Instead use the _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b) function.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ local_endpoint\n+ the IP and port pair the socket is bound to locally. i.e. the IP address\n+ of the interface it's going out over. This may be useful for multi-homed\n+ clients with multiple interfaces to the internet. This field is not valid\n+ for i2p peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_idle\n+ The peer is not waiting for any external events to send or receive data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_limit\n+ The peer is waiting for the rate limiter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_network\n+ The peer has quota and is currently waiting for a network read or write\n+ operation to complete. This is the state all peers are in if there are no\n+ bandwidth limits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_disk\n+ The peer is waiting for the disk I/O thread to catch up writing buffers\n+ to disk before downloading more.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ read_state write_state\n+ bitmasks indicating what state this peer is in with regards to sending\n+ and receiving data. The states are defined as independent flags of type\n+ bandwidth_state_flags_t, in this class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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- // the handle was invalid, ignore this one and move to the next\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-while (outstanding_resume_data > 0)\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* 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+Generates a magnet URI from the specified torrent.\n+Several fields from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs objects are recorded in the magnet\n+link. In order to not include them, they have to be cleared before calling\n+_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b). These fields are used:\n+ ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n+ name, peers.\n+Depending on what the use case for the resulting magnet link is, clearing peers\n+and dht_nodes is probably a good idea if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs came from a\n+running torrent. Those lists may be long and be ephemeral.\n+If none of the info_hashes or ti fields are set, there is not info-hash\n+available, and a magnet link cannot be created. In this case _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+returns an empty string.\n+The recommended way to generate a magnet link from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is to call\n+_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), which will post a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt containing an\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This can then be passed to _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b).\n+The overload that takes a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be will make blocking calls to query\n+information about the torrent. If the torrent handle is invalid, an empty\n+string is returned.\n+For more information about magnet links, see _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n+add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n+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+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\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* 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_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_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, 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* 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* 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 e\bev\bve\ben\bnt\bt_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\ba_\br_\bt_\be_\bd_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\bu_\bs_\be_\bd_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_t\btr\bra\ban\bns\bsp\bpo\bor\brt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\ba_\bt_\bp_\bm_\bp_\b|_\b0_\b _\b _\b _\b _\b|_\bn_\ba_\bt_\bp_\bm_\bp_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bN_\bA_\bT_\b-_\bP_\bM_\bP_\b _\bo_\br_\b _\bP_\bC_\bP|\n+|_\bu_\bp_\bn_\bp_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_p\bpr\bro\bot\bto\boc\bco\bol\bl *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\bn_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bc_\bp_\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bd_\bp_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n+|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm 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* 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* 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* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n+ seed_mode\n+ If seed_mode is set, libtorrent will assume that all files are present\n+ for this torrent and that they all match the hashes in the torrent file.\n+ Each time a peer requests to download a block, the piece is verified\n+ against the hash, unless it has been verified already. If a hash fails,\n+ the torrent will automatically leave the seed mode and recheck all the\n+ files. The use case for this mode is if a torrent is created and seeded,\n+ or if the user already know that the files are complete, this is a way to\n+ avoid the initial file checks, and significantly reduce the startup time.\n+ Setting seed_mode on a torrent without metadata (a .torrent file) is a\n+ no-op and will be ignored.\n+ It is not possible to s\bse\bet\bt the seed_mode flag on a torrent after it has\n+ been added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. It is possible to c\bcl\ble\bea\bar\br it though.\n+ upload_mode\n+ If upload_mode is set, the torrent will be initialized in upload-mode,\n+ which means it will not make any piece requests. This state is typically\n+ entered on disk I/O errors, and if the torrent is also auto managed, it\n+ will be taken out of this state periodically (see settings_pack::\n+ optimistic_disk_retry).\n+ This mode can be used to avoid race conditions when adjusting priorities\n+ of pieces before allowing the torrent to start downloading.\n+ If the torrent is auto-managed (auto_managed), the torrent will\n+ eventually be taken out of upload-mode, regardless of how it got there.\n+ If it's important to manually control when the torrent leaves upload\n+ mode, don't make it auto managed.\n+ share_mode\n+ determines if the torrent should be added in s\bsh\bha\bar\bre\be m\bmo\bod\bde\be or not. Share\n+ mode indicates that we are not interested in downloading the torrent, but\n+ merely want to improve our share ratio (i.e. increase it). A torrent\n+ started in share mode will do its best to never download more than it\n+ uploads to the swarm. If the swarm does not have enough demand for upload\n+ capacity, the torrent will not download anything. This mode is intended\n+ to be safe to add any number of torrents to, without manual screening,\n+ without the risk of downloading more than is uploaded.\n+ A torrent in share mode sets the priority to all pieces to 0, except for\n+ the pieces that are downloaded, when pieces are decided to be downloaded.\n+ This affects the progress bar, which might be set to \"100% finished\" most\n+ of the time. Do not change file or piece priorities for torrents in share\n+ mode, it will make it not work.\n+ The share mode has one setting, the share ratio target, see\n+ settings_pack::share_mode_target for more info.\n+ apply_ip_filter\n+ determines if the IP filter should apply to this torrent or not. By\n+ default all torrents are subject to filtering by the IP filter (i.e. this\n+ flag is set by default). This is useful if certain torrents needs to be\n+ exempt for some reason, being an auto-update torrent for instance.\n+ paused\n+ specifies whether or not the torrent is paused. i.e. it won't connect to\n+ the tracker or any of the peers until it's resumed. Note that a paused\n+ torrent that also has the auto_managed flag set can be started at any\n+ time by libtorrent's queuing logic. See _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ auto_managed\n+ If the torrent is auto-managed (auto_managed), the torrent may be resumed\n+ at any point, regardless of how it paused. If it's important to manually\n+ control when the torrent is paused and resumed, don't make it auto\n+ managed.\n+ If auto_managed is set, the torrent will be queued, started and seeded\n+ automatically by libtorrent. When this is set, the torrent should also be\n+ started as paused. The default queue order is the order the torrents were\n+ added. They are all downloaded in that order. For more details, see\n+ _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ duplicate_is_error\n+ used in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs to indicate that it's an error to attempt to\n+ add a torrent that's already in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. If it's not considered an\n+ error, a handle to the existing torrent is returned. This flag is not\n+ saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it is only meant for adding torrents.\n+ update_subscribe\n+ on by default and means that this torrent will be part of state updates\n+ when calling _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b). This flag is not saved by\n+ _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n+ super_seeding\n+ sets the torrent into super seeding/initial seeding mode. If the torrent\n+ is not a seed, this flag has no effect.\n+ sequential_download\n+ sets the sequential download state for the torrent. In this mode the\n+ piece picker will pick pieces with low index numbers before pieces with\n+ high indices. The actual pieces that are picked depend on other factors\n+ still, such as which pieces a peer has and whether it is in parole mode\n+ or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n+ media. For that, see _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) instead.\n+ stop_when_ready\n+ When this flag is set, the torrent will f\bfo\bor\brc\bce\be s\bst\bto\bop\bp whenever it\n+ transitions from a non-data-transferring state into a data-transferring\n+ state (referred to as being ready to download or seed). This is useful\n+ for torrents that should not start downloading or seeding yet, but want\n+ to be made ready to do so. A torrent may need to have its files checked\n+ for instance, so it needs to be started and possibly queued for checking\n+ (auto-managed and started) but as soon as it's done, it should be\n+ stopped.\n+ F\bFo\bor\brc\bce\be s\bst\bto\bop\bpp\bpe\bed\bd means auto-managed is set to false and it's paused. As if\n+ the auto_manages flag is cleared and the paused flag is set on the\n+ torrent.\n+ Note that the torrent may transition into a downloading state while\n+ setting this flag, and since the logic is edge triggered you may miss the\n+ edge. To avoid this race, if the torrent already is in a downloading\n+ state when this call is made, it will trigger the stop-when-ready\n+ immediately.\n+ When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n+ transitions between downloading and non-downloading states will not be\n+ affected, until this flag is set again.\n+ The behavior is more robust when setting this flag as part of adding the\n+ torrent. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n+ The stop-when-ready flag fixes the inherent race condition of waiting for\n+ the _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt and then call _\bp_\ba_\bu_\bs_\be_\b(_\b). The download/seeding will\n+ most likely start in between posting the _\ba_\bl_\be_\br_\bt and receiving the call to\n+ pause.\n+ A downloading state is one where peers are being connected. Which means\n+ just downloading the metadata via the ut_metadata extension counts as a\n+ downloading state. In order to stop a torrent once the metadata has been\n+ downloaded, instead set all file priorities to dont_download\n+ override_trackers\n+ when this flag is set, the tracker list in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n+ override any trackers from the torrent file. If the flag is not set, the\n+ trackers from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of\n+ trackers used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n+ there are trackers present in the resume data file. This effectively\n+ makes the trackers saved in the resume data take precedence over the\n+ original trackers. This includes if there's an empty list of trackers, to\n+ support the case where they were explicitly removed in the previous\n+ _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ override_web_seeds\n+ If this flag is set, the web seeds from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n+ will override any web seeds in the torrent file. If it's not set, web\n+ seeds in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of web\n+ seeds used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n+ there are web seeds present in the resume data file. This effectively\n+ makes the web seeds saved in the resume data take precedence over the\n+ original ones. This includes if there's an empty list of web seeds, to\n+ support the case where they were explicitly removed in the previous\n+ _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ need_save_resume\n+ if this flag is set (which it is by default) the torrent will be\n+ considered needing to save its resume data immediately, in the category\n+ if_metadata_changed. See resume_data_flags_t and _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) for\n+ details.\n+ This flag is cleared by a successful call to _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) This flag\n+ is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it represents an ephemeral\n+ state of a running torrent.\n+ disable_dht\n+ set this flag to disable DHT for this torrent. This lets you have the DHT\n+ enabled for the whole client, and still have specific torrents not\n+ participating in it. i.e. not announcing to the DHT nor picking up peers\n+ from it.\n+ disable_lsd\n+ set this flag to disable local service discovery for this torrent.\n+ disable_pex\n+ set this flag to disable peer exchange for this torrent.\n+ no_verify_files\n+ if this flag is set, the resume data will be assumed to be correct\n+ without validating it against any files on disk. This may be used when\n+ restoring a _\bs_\be_\bs_\bs_\bi_\bo_\bn by loading resume data from disk. It will save time\n+ and also delay any hard disk errors until files are actually needed. If\n+ the resume data cannot be trusted, or if a torrent is added for the first\n+ time to some save path that may already have some of the files, this flag\n+ should not be set.\n+ default_dont_download\n+ default all file priorities to dont_download. This is useful for adding\n+ magnet links where the number of files is unknown, but the\n+ file_priorities is still set for some files. Any file not covered by the\n+ file_priorities list will be set to normal download priority, unless this\n+ flag is set, in which case they will be set to 0 (dont_download).\n+ i2p_torrent\n+ this flag makes the torrent be considered an \"i2p torrent\" for purposes\n+ of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n+ is disabled, i2p torrents won't add normal peers to its peer list. Note\n+ that non i2p torrents may still allow i2p peers (on the off-chance that a\n+ tracker return them and the _\bs_\be_\bs_\bs_\bi_\bo_\bn is configured with a SAM connection).\n+ This flag is set automatically when adding a torrent that has at least\n+ one tracker whose hostname ends with .i2p. It's also set by\n+ _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n+ all\n+ all torrent flags combined. Can conveniently be used when creating masks\n+ for flags\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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+[_\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 () 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+*\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_t\bto\bop\bp(\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_u\bup\bp(\b()\b)\n-q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) *\b**\b**\b**\b**\b*\n-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_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_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-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) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (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()\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+ 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\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+ 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* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n-void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n-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-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+ 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* 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) f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\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) d\bdo\bow\bwn\bnl\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) 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+ 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* 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-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* s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n-int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n-set_max_connections() sets the maximum number of connection this torrent will\n-open. If all connections are used up, incoming connections may be refused or\n-poor connections may be closed. This must be at least 2. The default is\n-unlimited number of connections. If -1 is given to the function, it means\n-unlimited. There is also a global limit of the number of connections, set by\n-connections_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-max_connections() returns the current settings.\n+ 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-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+ 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()\b) o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br<\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.\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+ num_connections\n+ the number of peer connections this torrent has, including half-open\n+ connections that hasn't completed the bittorrent handshake yet. This is\n+ always >= num_peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ uploads_limit\n+ the set limit of upload slots (unchoked peers) for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connections_limit\n+ the set limit of number of connections for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ up_bandwidth_queue down_bandwidth_queue\n+ the number of peers in this torrent that are waiting for more bandwidth\n+ quota from the torrent rate limiter. This can determine if the rate you\n+ get from this torrent is bound by the torrents limit or not. If there is\n+ no limit set on this torrent, the peers might still be waiting for\n+ bandwidth quota from the global limiter, but then they are counted in the\n+ session_status object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ seed_rank\n+ A rank of how important it is to seed the torrent, it is used to\n+ determine which torrents to seed and which to queue. It is based on the\n+ peer to seed ratio from the tracker scrape. For more information, see\n+ _\bq_\bu_\be_\bu_\bi_\bn_\bg. Higher value means more important to seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ state\n+ the main state the torrent is in. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ need_save_resume\n+ true if this torrent has unsaved changes to its download state and\n+ statistics since the last resume data was saved.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ is_seeding\n+ true if all pieces have been downloaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ is_finished\n+ true if all pieces that have a priority > 0 are downloaded. There is only\n+ a distinction between finished and seeding if some pieces or files have\n+ been set to priority 0, i.e. are not downloaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ has_metadata\n+ true if this torrent has metadata (either it was started from a .torrent\n+ file or the metadata has been downloaded). The only scenario where this\n+ can be false is when the torrent was started torrent-less (i.e. with just\n+ an info-hash and tracker ip, a magnet link for instance).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ has_incoming\n+ true if there has ever been an incoming connection attempt to this\n+ torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ moving_storage\n+ this is true if this torrent's storage is currently being moved from one\n+ location to another. This may potentially be a long operation if a large\n+ file ends up being copied from one drive to another.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ announcing_to_trackers announcing_to_lsd announcing_to_dht\n+ these are set to true if this torrent is allowed to announce to the\n+ respective peer source. Whether they are true or false is determined by\n+ the queue logic/auto manager. Torrents that are not auto managed will\n+ always be allowed to announce to all peer sources.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ info_hashes\n+ the info-hash for this torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_upload last_download\n+ the timestamps of the last time this torrent uploaded or downloaded\n+ payload to any peer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ active_duration finished_duration seeding_duration\n+ these are cumulative _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs of for how long the torrent has been in\n+ different states. active means not paused and added to _\bs_\be_\bs_\bs_\bi_\bo_\bn. Whether\n+ it has found any peers or not is not relevant. finished means all\n+ selected files/pieces were downloaded and available to other peers (this\n+ is always a subset of active time). seeding means all files/pieces were\n+ downloaded and available to peers. Being available to peers does not\n+ imply there are other peers asking for the payload.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flags\n+ reflects several of the torrent's flags. For more information, see\n+ torrent_handle::flags().\n+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* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk *\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 settings_pack struct, contains the names of all settings as enum values.\n+These values are passed in to the set_str(), set_int(), set_bool() functions,\n+to specify the setting to change.\n+The settings_pack only stores values for settings that have been explicitly set\n+on this object. However, it can still be queried for settings that have not\n+been set and returns the default value for those settings.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b |\n+|_\bu_\bs_\be_\br_\b__\ba_\bg_\be_\bn_\bt_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/|\n+this is the client identification to the tracker. The recommended format of\n+this string is: \"client-name/client-version libtorrent/libtorrent-version\".\n+This name will not only be used when making HTTP requests, but also when\n+sending extended headers to peers that support that extension. It may not\n+contain r or 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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bp_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bn_\bu_\bl_\bl_\bp_\bt_\br|\n+announce_ip is the ip address passed along to trackers as the &ip= parameter.\n+If left as the default, that parameter is omitted.\n+Note\n+This setting is only meant for very special cases where a seed is running on\n+the same host as the tracker, and the tracker accepts the IP parameter (which\n+normal trackers don't). Do not set this option unless you also control the\n+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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b__\bc_\bl_\bi_\be_\bn_\bt_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bn_\bu_\bl_\bl_\bp_\bt_\br|\n+this is the client name and version identifier sent to peers in the handshake\n+message. If this is an empty string, the user_agent is used instead. This\n+string must be a UTF-8 encoded unicode string.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n+This controls which IP address outgoing TCP peer connections are bound to, in\n+addition to controlling whether such connections are also bound to a specific\n+network interface/adapter (b\bbi\bin\bnd\bd-\b-t\bto\bo-\b-d\bde\bev\bvi\bic\bce\be).\n+This string is a comma-separated list of IP addresses and interface names. An\n+empty string will not bind TCP sockets to a device, and let the network stack\n+assign the local address.\n+A list of names will be used to bind outgoing TCP sockets in a round-robin\n+fashion. An IP address will simply be used tobind()the socket. An interface\n+name will attempt to bind the socket to that interface. If that fails, or is\n+unsupported, one of the IP addresses configured for that interface is used\n+tobind()the socket to. If the interface or adapter doesn't exist, the outgoing\n+peer connection will fail with an error message suggesting the device cannot be\n+found. Adapter names on Unix systems are of the form \"eth0\", \"eth1\", \"tun0\",\n+etc. This may be useful for clients that are multi-homed. Binding an outgoing\n+connection to a local IP does not necessarily make the connection via the\n+associated NIC/Adapter.\n+When outgoing interfaces are specified, incoming connections or packets sent to\n+a local interface or IP that's n\bno\bot\bt in this list will be rejected with a\n+_\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt with invalid_local_interface as the reason.\n+Note that these are just interface/adapter names or IP addresses. There are no\n+ports specified in this list. IPv6 addresses without port should be specified\n+without enclosing [, ].\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b0_\b._\b0_\b._\b0_\b._\b0_\b:_\b6_\b8_\b8_\b1_\b,_\b[_\b:_\b:_\b]_\b:_\b6_\b8_\b8_\b1|\n+a comma-separated list of (IP or device name, port) pairs. These are the listen\n+ports that will be opened for accepting incoming uTP and TCP peer connections.\n+These are also used for o\bou\but\btg\bgo\boi\bin\bng\bg uTP and UDP tracker connections and DHT nodes.\n+It is possible to listen on multiple interfaces and multiple ports. Binding to\n+port 0 will make the operating system pick the port.\n+Note\n+There are reasons to stick to the same port across sessions, which would mean\n+only using port 0 on the first start, and recording the port that was picked\n+for subsequent startups. Trackers, the DHT and other peers will remember the\n+port they see you use and hand that port out to other peers trying to connect\n+to you, as well as trying to connect to you themselves.\n+A port that has an \"s\" suffix will accept SSL peer connections. (note that SSL\n+sockets are only available in builds with SSL support)\n+A port that has an \"l\" suffix will be considered a local network. i.e. it's\n+assumed to only be able to reach hosts in the same local network as the IP\n+address (based on the netmask associated with the IP, queried from the\n+operating system).\n+if binding fails, the _\bl_\bi_\bs_\bt_\be_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted. Once a socket binding\n+succeeds (if it does), the _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bu_\bc_\bc_\be_\be_\bd_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted. There may be\n+multiple failures before a success.\n+If a device name that does not exist is configured, no listen socket will be\n+opened for that interface. If this is the only interface configured, it will be\n+as if no listen ports are configured.\n+If no listen ports are configured (e.g. listen_interfaces is an empty string),\n+networking will be disabled. No DHT will start, no outgoing uTP or tracker\n+connections will be made. No incoming TCP or uTP connections will be accepted.\n+(outgoing TCP connections will still be possible, depending on _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n+_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs).\n+For example: [::1]:8888 - will only accept connections on the IPv6 loopback\n+address on port 8888.\n+eth0:4444,eth1:4444 - will accept connections on port 4444 on any IP address\n+bound to device eth0 or eth1.\n+[::]:0s - will accept SSL connections on a port chosen by the OS. And not\n+accept non-SSL connections at all.\n+0.0.0.0:6881,[::]:6881 - binds to all interfaces on port 6881.\n+10.0.1.13:6881l - binds to the local IP address, port 6881, but only allow\n+talking to peers on the same local network. The netmask is queried from the\n+operating system. Interfaces marked l are not announced to trackers, unless the\n+tracker is also on the same local network.\n+Windows OS network adapter device name must be specified with GUID. It can be\n+obtained from \"netsh lan show interfaces\" command output. GUID must be\n+uppercased string embraced in curly brackets. {E4F0B674-0DFC-48BB-98A5-\n+2AA730BDB6D6}:7777 - will accept connections on port 7777 on adapter with this\n+GUID.\n+For more information, see the _\bM_\bu_\bl_\bt_\bi_\b-_\bh_\bo_\bm_\be_\bd_\b _\bh_\bo_\bs_\bt_\bs section.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n+when using a proxy, this is the hostname where the proxy is running see\n+proxy_type. Note that when using a proxy, the _\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\n+setting is overridden and only a single interface is created, just to contact\n+the proxy. This means a proxy cannot be combined with SSL torrents or multiple\n+listen interfaces. This proxy listen interface will not accept incoming TCP\n+connections, will not map ports with any gateway and will not enable local\n+service discovery. All traffic is supposed to be channeled through the proxy.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n+|_\bp_\br_\bo_\bx_\by_\b__\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n+when using a proxy, these are the credentials (if any) to use when connecting\n+to it. see proxy_type\n+ _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\b2_\bp_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b |\n+sets the _\bi_\b2_\bp SAM bridge to connect to. set the port with the i2p_port setting.\n+Unless this is set, i2p torrents are not supported. This setting is separate\n+from the other proxy settings since i2p torrents and their peers are\n+orthogonal. You can have i2p peers as well as regular peers via a proxy.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b |\n+|_\bp_\be_\be_\br_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\b-_\bL_\bT_\b2_\b0_\bA_\b0_\b-|\n+this is the fingerprint for the client. It will be used as the prefix to the\n+peer_id. If this is 20 bytes (or longer) it will be truncated to 20 bytes and\n+used as the entire peer-id\n+There is a utility function, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b) that can be used to\n+generate a standard client peer ID fingerprint prefix.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b _\b _\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bh_\bt_\b__\bb_\bo_\bo_\bt_\bs_\bt_\br_\ba_\bp_\b__\bn_\bo_\bd_\be_\bs_\b|_\bs_\bt_\br_\bi_\bn_\bg_\b|_\bd_\bh_\bt_\b._\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bo_\br_\bg_\b:_\b2_\b5_\b4_\b0_\b1|\n+This is a comma-separated list of IP port-pairs. They will be added to the DHT\n+node (if it's enabled) as back-up nodes in case we don't know of any.\n+Changing these after the DHT has been started may not have any effect until the\n+DHT is restarted.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\bl_\bo_\bw_\b__\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bp_\be_\br_\b__\bi_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+determines if connections from the same IP address as existing connections\n+should be rejected or not. Rejecting multiple connections from the same IP\n+address will prevent abusive behavior by peers. The logic for determining\n+whether connections are to the same peer is more complicated with this enabled,\n+and more likely to fail in some edge cases. It is not recommended to enable\n+this feature.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\be_\bn_\bd_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bh_\ba_\bv_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+send_redundant_have controls if have messages will be sent to peers that\n+already have the piece. This is typically not necessary, but it might be\n+necessary for collecting statistics in some cases.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bs_\be_\b__\bd_\bh_\bt_\b__\ba_\bs_\b__\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+use_dht_as_fallback determines how the DHT is used. If this is true, the DHT\n+will only be used for torrents where all trackers in its tracker list has\n+failed. Either by an explicit error message or a time out. If this is false,\n+the DHT is used regardless of if the trackers fail or 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bp_\bn_\bp_\b__\bi_\bg_\bn_\bo_\br_\be_\b__\bn_\bo_\bn_\br_\bo_\bu_\bt_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+upnp_ignore_nonrouters indicates whether or not the UPnP implementation should\n+ignore any broadcast response from a device whose address is not on our subnet.\n+i.e. it's a way to not talk to other people's routers by mistake.\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bs_\be_\b__\bp_\ba_\br_\bo_\bl_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+use_parole_mode specifies if parole mode should be used. Parole mode means that\n+peers that participate in pieces that fail the hash check are put in a mode\n+where they are only allowed to download whole pieces. If the whole piece a peer\n+in parole mode fails the hash check, it is banned. If a peer participates in a\n+piece that passes the hash check, it is taken out of parole mode.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bp_\br_\be_\bf_\be_\br_\b__\bs_\be_\be_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+if true, prefer seeding torrents when determining which torrents to give active\n+slots to. If false, give preference to downloading torrents\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bo_\bn_\bt_\b__\bc_\bo_\bu_\bn_\bt_\b__\bs_\bl_\bo_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if dont_count_slow_torrents is true, torrents without any payload transfers are\n+not subject to the active_seeds and active_downloads limits. This is intended\n+to make it more likely to utilize all available bandwidth, and avoid having\n+torrents that don't transfer anything block the active slots.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bl_\bo_\bs_\be_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+close_redundant_connections specifies whether libtorrent should close\n+connections where both ends have no utility in keeping the connection open. For\n+instance if both ends have completed their downloads, there's no point in\n+keeping it open.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+If prioritize_partial_pieces is true, partial pieces are picked before pieces\n+that are more rare. If false, rare pieces are always prioritized, unless the\n+number of partial pieces is growing out of proportion.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b__\bi_\bp_\b__\bo_\bv_\be_\br_\bh_\be_\ba_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if set to true, the estimated TCP/IP overhead is drained from the rate\n+limiters, to avoid exceeding the limits with the total traffic\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bt_\bo_\b__\ba_\bl_\bl_\b__\bt_\bi_\be_\br_\bs_\b _\b _\b _\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bt_\bo_\b__\ba_\bl_\bl_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+announce_to_all_trackers controls how multi tracker torrents are treated. If\n+this is set to true, all trackers in the same tier are announced to in\n+parallel. If all trackers in tier 0 fails, all trackers in tier 1 are announced\n+as well. If it's set to false, the behavior is as defined by the multi tracker\n+specification.\n+announce_to_all_tiers also controls how multi tracker torrents are treated.\n+When this is set to true, one tracker from each tier is announced to. This is\n+the uTorrent behavior. To be compliant with the Multi-tracker specification,\n+set it to false.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\be_\bf_\be_\br_\b__\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+prefer_udp_trackers: true means that trackers may be rearranged in a way that\n+udp trackers are always tried before http trackers for the same hostname.\n+Setting this to false means that the tracker's tier is respected and there's no\n+preference of one protocol over another.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bh_\ba_\bs_\bh_\b__\bc_\bh_\be_\bc_\bk_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set to true, all data downloaded from peers will be assumed to be correct,\n+and not tested to match the hashes in the torrent this is only useful for\n+simulation and testing purposes (typically combined with disabled_storage)\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\bl_\bo_\bw_\b__\bi_\b2_\bp_\b__\bm_\bi_\bx_\be_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+if this is true, i2p torrents are allowed to also get peers from other sources\n+than the tracker, and connect to regular IPs, not providing any anonymization.\n+This may be useful if the user is not interested in the anonymization of i2p,\n+but still wants to be able to connect to i2p peers.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bn_\bo_\b__\ba_\bt_\bi_\bm_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+no_atime_storage this is a Linux-only option and passes in the O_NOATIME to\n+open() when opening files. This may lead to some disk performance improvements.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bs_\bt_\ba_\br_\bt_\bs_\b__\bq_\bu_\be_\bu_\be_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+incoming_starts_queued_torrents. If a torrent has been paused by the auto\n+managed feature in libtorrent, i.e. the torrent is paused and auto managed,\n+this feature affects whether or not it is automatically started on an incoming\n+connection. The main reason to queue torrents, is not to make them unavailable,\n+but to save on the overhead of announcing to the trackers, the DHT and to avoid\n+spreading one's unchoke slots too thin. If a peer managed to find us, even\n+though we're no in the torrent anymore, this setting can make us start the\n+torrent and serve it.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bp_\bo_\br_\bt_\b__\bt_\br_\bu_\be_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set to true, the downloaded counter sent to trackers will include the\n+actual number of payload bytes downloaded including redundant bytes. If set to\n+false, it will not include any redundancy bytes\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bt_\br_\bi_\bc_\bt_\b__\be_\bn_\bd_\b__\bg_\ba_\bm_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+strict_end_game_mode controls when a block may be requested twice. If this is\n+true, a block may only be requested twice when there's at least one request to\n+every piece that's left to download in the torrent. This may slow down progress\n+on some pieces sometimes, but it may also avoid downloading a lot of redundant\n+bytes. If this is false, libtorrent attempts to use each peer connection to its\n+max, by always requesting something, even if it means requesting something that\n+has been requested from another peer already.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bu_\bt_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bu_\bt_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bt_\bc_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bt_\bc_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+Enables incoming and outgoing, TCP and uTP peer connections. false is disabled\n+and true is enabled. When outgoing connections are disabled, libtorrent will\n+simply not make outgoing peer connections with the specific transport protocol.\n+Disabled incoming peer connections will simply be rejected. These options only\n+apply to peer connections, not tracker- or any other kinds of connections.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bn_\bo_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b__\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+no_recheck_incomplete_resume determines if the storage should check the whole\n+files when resume data is incomplete or missing or whether it should simply\n+assume we don't have any of the data. If false, any existing files will be\n+checked. By setting this setting to true, the files won't be checked, but will\n+go straight to download mode.\n+ _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bn_\bo_\bn_\by_\bm_\bo_\bu_\bs_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+anonymous_mode: When set to true, the client tries to hide its identity to a\n+certain degree.\n+ * A generic user-agent will be used for trackers (except for private\n+ torrents).\n+ * Your local IPv4 and IPv6 address won't be sent as query string parameters\n+ to private trackers.\n+ * If announce_ip is configured, it will not be sent to trackers\n+ * The client version will not be sent to peers in the extension handshake.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bp_\bo_\br_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+specifies whether downloads from web seeds is reported to the tracker or not.\n+Turning it off also excludes web seed traffic from other stats and download\n+rate reporting via the libtorrent API.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\be_\be_\bd_\bi_\bn_\bg_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+seeding_outgoing_connections determines if seeding (and finished) torrents\n+should attempt to make outgoing connections or not. It may be set to false in\n+very specific applications where the cost of making outgoing connections is\n+high, and there are no or small benefits of doing so. For instance, if no nodes\n+are behind a firewall or a NAT, seeds don't need to make outgoing connections.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bn_\bo_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\br_\bi_\bv_\bi_\bl_\be_\bg_\be_\bd_\b__\bp_\bo_\br_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when this is true, libtorrent will not attempt to make outgoing connections to\n+peers whose port is < 1024. This is a safety precaution to avoid being part of\n+a DDoS attack\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bm_\bo_\bo_\bt_\bh_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+smooth_connects means the number of connection attempts per second may be\n+limited to below the connection_speed, in case we're close to bump up against\n+the limit of number of connections. The intention of this setting is to more\n+evenly distribute our connection attempts over time, instead of attempting to\n+connect in batches, and timing them out in batches.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\bw_\ba_\by_\bs_\b__\bs_\be_\bn_\bd_\b__\bu_\bs_\be_\br_\b__\ba_\bg_\be_\bn_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+always send user-agent in every web seed request. If false, only the first\n+request per http connection will include the user agent\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bp_\bp_\bl_\by_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b__\bt_\bo_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+apply_ip_filter_to_trackers determines whether the IP filter applies to\n+trackers as well as peers. If this is set to false, trackers are exempt from\n+the IP filter (if there is one). If no IP filter is set, this setting is\n+irrelevant.\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bb_\ba_\bn_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+when true, web seeds sending bad data will be banned\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b__\bs_\bh_\ba_\br_\be_\b__\bm_\bo_\bd_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if false, prevents libtorrent to advertise share-mode support\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bp_\bo_\br_\bt_\b__\br_\be_\bd_\bu_\bn_\bd_\ba_\bn_\bt_\b__\bb_\by_\bt_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if this is true, the number of redundant bytes is sent to the 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\by_\bs_\bt_\be_\bm_\b__\bp_\bo_\br_\bt_\b__\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if this is true, libtorrent will fall back to listening on a port chosen by the\n+operating system (i.e. binding to port 0). If a failure is preferred, set this\n+to false.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+when this is true, and incoming encrypted connections are enabled,\n+&supportcrypt=1 is included in http tracker announces\n+ _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bu_\bp_\bn_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+Starts and stops the UPnP service. When started, the listen port and the DHT\n+port are attempted to be forwarded on local UPnP router devices.\n+The upnp object returned by start_upnp() can be used to add and remove\n+arbitrary port mappings. Mapping status is returned through the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\ba_\bl_\be_\br_\bt\n+and the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt. The object will be valid until stop_upnp() is\n+called. See _\bu_\bp_\bn_\bp_\b _\ba_\bn_\bd_\b _\bn_\ba_\bt_\b _\bp_\bm_\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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bn_\ba_\bt_\bp_\bm_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+Starts and stops the NAT-PMP service. When started, the listen port and the DHT\n+port are attempted to be forwarded on the router through NAT-PMP.\n+The natpmp object returned by start_natpmp() can be used to add and remove\n+arbitrary port mappings. Mapping status is returned through the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\ba_\bl_\be_\br_\bt\n+and the _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt. The object will be valid until stop_natpmp() is\n+called. See _\bu_\bp_\bn_\bp_\b _\ba_\bn_\bd_\b _\bn_\ba_\bt_\b _\bp_\bm_\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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bl_\bs_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+Starts and stops Local Service Discovery. This service will broadcast the info-\n+hashes of all the non-private torrents on the local network to look for peers\n+on the same swarm within multicast reach.\n+ _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bd_\bh_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+starts the dht node and makes the trackerless service available to torrents.\n+ _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\be_\bf_\be_\br_\b__\br_\bc_\b4_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+if the allowed encryption level is both, setting this to true will prefer RC4\n+if both methods are offered, plain text otherwise\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if true, hostname lookups are done via the configured proxy (if any). This is\n+only supported by SOCKS5 and HTTP.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if true, peer connections are made (and accepted) over the configured proxy, if\n+any. Web seeds as well as regular bittorrent peer connections are considered\n+\"peer connections\". Anything transporting actual torrent payload (trackers and\n+DHT traffic are not considered peer connections).\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bu_\bt_\bo_\b__\bs_\be_\bq_\bu_\be_\bn_\bt_\bi_\ba_\bl_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if this setting is true, torrents with a very high availability of pieces (and\n+seeds) are downloaded sequentially. This is more efficient for the disk I/O.\n+With many seeds, the download order is unlikely to matter anyway\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+if true, tracker connections are made over the configured proxy, if any.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+Starts and stops the internal IP table route changes notifier.\n+The current implementation supports multiple platforms, and it is recommended\n+to have it enable, but you may want to disable it if it's supported but\n+unreliable, or if you have a better way to detect the changes. In the later\n+case, you should manually call session_handle::reopen_network_sockets to ensure\n+network changes are taken in consideration.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bp_\br_\be_\bf_\be_\br_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+when this is true, nodes whose IDs are derived from their source IP according\n+to _\bB_\bE_\bP_\b _\b4_\b2 are preferred in the routing table.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bi_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+determines if the routing table entries should restrict entries to one per IP.\n+This defaults to true, which helps mitigate some attacks on the DHT. It\n+prevents adding multiple nodes with IPs with a very close CIDR distance.\n+when set, nodes whose IP address that's in the same /24 (or /64 for IPv6) range\n+in the same routing table bucket. This is an attempt to mitigate node ID\n+spoofing attacks also restrict any IP to only have a single _\be_\bn_\bt_\br_\by in the whole\n+routing table\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\br_\be_\bs_\bt_\br_\bi_\bc_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\bi_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+determines if DHT searches should prevent adding nodes with IPs with very close\n+CIDR distance. This also defaults to true and helps mitigate certain attacks on\n+the DHT.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\be_\bx_\bt_\be_\bn_\bd_\be_\bd_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+makes the first buckets in the DHT routing table fit 128, 64, 32 and 16 nodes\n+respectively, as opposed to the standard size of 8. All other buckets have size\n+8 still.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\ba_\bg_\bg_\br_\be_\bs_\bs_\bi_\bv_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+slightly changes the lookup behavior in terms of how many outstanding requests\n+we keep. Instead of having branch factor be a hard limit, we always keep b\bbr\bra\ban\bnc\bch\bh\n+f\bfa\bac\bct\bto\bor\br outstanding requests to the closest nodes. i.e. every time we get\n+results back with closer nodes, we query them right away. It lowers the lookup\n+times at the cost of more outstanding queries.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bp_\br_\bi_\bv_\ba_\bc_\by_\b__\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set, perform lookups in a way that is slightly more expensive, but which\n+minimizes the amount of information leaked about you.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\be_\bn_\bf_\bo_\br_\bc_\be_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set, node's whose IDs that are not correctly generated based on its\n+external IP are ignored. When a query arrives from such node, an error message\n+is returned with a message saying \"invalid node ID\".\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bi_\bg_\bn_\bo_\br_\be_\b__\bd_\ba_\br_\bk_\b__\bi_\bn_\bt_\be_\br_\bn_\be_\bt_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+ignore DHT messages from parts of the internet we wouldn't expect to see any\n+traffic from\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\br_\be_\ba_\bd_\b__\bo_\bn_\bl_\by_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set, the other nodes won't keep this node in their routing tables, it's\n+meant for low-power and/or ephemeral devices that cannot support the DHT, it is\n+also useful for mobile devices which are sensitive to network traffic and\n+battery life. this node no longer responds to 'query' messages, and will place\n+a 'ro' key (value = 1) in the top-level message dictionary of outgoing query\n+messages.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\bi_\be_\bc_\be_\b__\be_\bx_\bt_\be_\bn_\bt_\b__\ba_\bf_\bf_\bi_\bn_\bi_\bt_\by_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when this is true, create an affinity for downloading 4 MiB extents of adjacent\n+pieces. This is an attempt to achieve better disk I/O throughput by downloading\n+larger extents of bytes, for torrents with small piece 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\b__\bh_\bt_\bt_\bp_\bs_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+when set to true, the certificate of HTTPS trackers and HTTPS web seeds will be\n+validated against the system's certificate store (as defined by OpenSSL). If\n+the system does not have a certificate store, this option may have to be\n+disabled in order to get trackers and web seeds to work).\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bs_\br_\bf_\b__\bm_\bi_\bt_\bi_\bg_\ba_\bt_\bi_\bo_\bn_\b|_\bb_\bo_\bo_\bl_\b|_\bt_\br_\bu_\be_\b _\b _\b |\n+when enabled, tracker and web seed requests are subject to certain\n+restrictions.\n+An HTTP(s) tracker requests to localhost (loopback) must have the request path\n+start with \"/announce\". This is the conventional bittorrent tracker request.\n+Any other HTTP(S) tracker request to loopback will be rejected. This applies to\n+trackers that redirect to loopback as well.\n+Web seeds that end up on the client's local network (i.e. in a private IP\n+address range) may not include query string arguments. This applies to web\n+seeds redirecting to the local network as well.\n+Web seeds on global IPs (i.e. not local network) may not redirect to a local\n+network 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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\bl_\bo_\bw_\b__\bi_\bd_\bn_\ba_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when disabled, any tracker or web seed with an IDNA hostname (internationalized\n+domain name) is ignored. This is a security precaution to avoid various unicode\n+encoding attacks that might happen at the application level.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bs_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bv_\ba_\bl_\bi_\bd_\b__\bd_\ba_\bt_\ba_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+when set to true, enables the attempt to use SetFileValidData() to pre-allocate\n+disk space. This system call will only work when running with Administrator\n+privileges on Windows, and so this setting is only relevant in that scenario.\n+Using SetFileValidData() poses a security risk, as it may reveal previously\n+deleted information from the disk.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bu_\bd_\bp_\b__\bs_\be_\bn_\bd_\b__\bl_\bo_\bc_\ba_\bl_\b__\be_\bp_\b|_\bb_\bo_\bo_\bl_\b|_\bf_\ba_\bl_\bs_\be_\b _\b |\n+When using a SOCKS5 proxy, UDP traffic is routed through the proxy by sending a\n+UDP ASSOCIATE command. If this option is true, the UDP ASSOCIATE command will\n+include the IP address and listen port to the local UDP socket. This indicates\n+to the proxy which source endpoint to expect our packets from. The benefit is\n+that incoming packets can be forwarded correctly, before any outgoing packets\n+are sent. The risk is that if there's a NAT between the client and the proxy,\n+the IP address specified in the protocol may not be valid from the proxy's\n+point of view.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bo_\bn_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+tracker_completion_timeout is the number of seconds the tracker connection will\n+wait from when it sent the request until it considers the tracker to have\n+timed-out.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+tracker_receive_timeout is the number of seconds to wait to receive any data\n+from the tracker. If no data is received for this number of seconds, the\n+tracker will be considered as having timed out. If a tracker is down, this is\n+the kind of timeout that will occur.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bt_\bo_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+stop_tracker_timeout is the number of seconds to wait when sending a stopped\n+message before considering a tracker to have timed out. This is usually\n+shorter, to make the client quit faster. If the value is set to 0, the\n+connections to trackers with the stopped event are suppressed.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b |\n+|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b*_\b1_\b0_\b2_\b4|\n+this is the maximum number of bytes in a tracker response. If a response size\n+passes this number of bytes it will be rejected and the connection will be\n+closed. On gzipped responses this size is measured on the uncompressed data.\n+So, if you get 20 bytes of gzip response that'll expand to 2 megabytes, it will\n+be interrupted before the entire response has been uncompressed (assuming the\n+limit is lower than 2 MiB).\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\bi_\be_\bc_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+the number of seconds from a request is sent until it times out if no piece\n+response is returned.\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n+the number of seconds one block (16 kiB) is expected to be received within. If\n+it's not, the block is requested from a different 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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b__\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+the length of the request queue given in the number of seconds it should take\n+for the other end to send all the pieces. i.e. the actual number of requests\n+depends on the download rate and this number.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bi_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n+the number of outstanding block requests a peer is allowed to queue up in the\n+client. If a peer sends more requests than this (before the first one has been\n+sent) the last request will be dropped. the higher this is, the faster upload\n+speeds the client can get to a single 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bo_\bu_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bq_\bu_\be_\bu_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n+max_out_request_queue is the maximum number of outstanding requests to send to\n+a peer. This limit takes precedence over request_queue_time. i.e. no matter the\n+download speed, the number of outstanding requests will never exceed this\n+limit.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bw_\bh_\bo_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+if a whole piece can be downloaded in this number of seconds, or less, the\n+peer_connection will prefer to request whole pieces at a time from this peer.\n+The benefit of this is to better utilize disk caches by doing localized\n+accesses and also to make it easier to identify bad peers if a piece fails the\n+hash check.\n+ _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\be_\be_\br_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b2_\b0_\b _\b _\b _\b |\n+peer_timeout is the number of seconds the peer connection should wait (for any\n+activity on the peer connection) before closing it due to time out. 120 seconds\n+is specified in the protocol specification. After half the time out, a keep\n+alive message is sent.\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+same as peer_timeout, but only applies to url-seeds. this is usually set lower,\n+because web servers are expected to be more reliable.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bp_\bi_\bp_\be_\bl_\bi_\bn_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+controls the pipelining size of url and http seeds. i.e. the number of HTTP\n+request to keep outstanding before waiting for the first one to complete. It's\n+common for web servers to limit this to a relatively low number, like 5\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bw_\ba_\bi_\bt_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+number of seconds until a new retry of a url-seed takes place. Default retry\n+value for http-seeds that don't provide a valid retry-after header.\n+ _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bf_\bi_\bl_\be_\b__\bp_\bo_\bo_\bl_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b0_\b _\b _\b _\b _\b |\n+sets the upper limit on the total number of files this _\bs_\be_\bs_\bs_\bi_\bo_\bn will keep open.\n+The reason why files are left open at all is that some anti virus software\n+hooks on every file close, and scans the file for viruses. deferring the\n+closing of the files will be the difference between a usable system and a\n+completely hogged down system. Most operating systems also has a limit on the\n+total number of file descriptors a process may have open.\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bf_\ba_\bi_\bl_\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+max_failcount is the maximum times we try to connect to a peer before stop\n+connecting again. If a peer succeeds, the failure counter is reset. If a peer\n+is retrieved from a peer source (other than DHT) the failcount is decremented\n+by one, allowing another try.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\bi_\bn_\b__\br_\be_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n+the number of seconds to wait to reconnect to a peer. this time is multiplied\n+with the failcount.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b _\b _\b _\b |\n+peer_connect_timeout the number of seconds to wait after a connection attempt\n+is initiated to a peer until it is considered as having timed out. This setting\n+is especially important in case the number of half-open connections are\n+limited, since stale half-open connection may delay the connection of other\n+peers considerably.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bs_\bp_\be_\be_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+connection_speed is the number of connection attempts that are made per second.\n+If a number < 0 is specified, it will default to 200 connections per second. If\n+0 is specified, it means don't make outgoing connections at 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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\bi_\bt_\by_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b0_\b _\b _\b _\b |\n+if a peer is uninteresting and uninterested for longer than this number of\n+seconds, it will be disconnected.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b _\b _\b _\b |\n+unchoke_interval is the number of seconds between chokes/unchokes. On this\n+interval, peers are re-evaluated for being choked/unchoked. This is defined as\n+30 seconds in the protocol, and it should be significantly longer than what it\n+takes for TCP to ramp up to it's max rate.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+optimistic_unchoke_interval is the number of seconds between each o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc\n+unchoke. On this timer, the currently optimistically unchoked peer will change.\n+ _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bn_\bu_\bm_\b__\bw_\ba_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n+num_want is the number of peers we want from each tracker request. It defines\n+what is sent as the &num_want= parameter to the 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bp_\bi_\bc_\bk_\be_\br_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b _\b _\b _\b _\b _\b |\n+initial_picker_threshold specifies the number of pieces we need before we\n+switch to rarest first picking. The first initial_picker_threshold pieces in\n+any torrent are picked at random , the following pieces are picked in rarest\n+first order.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b__\bs_\be_\bt_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+the number of allowed pieces to send to peers that supports the fast extensions\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n+|_\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bn_\bo_\b__\bp_\bi_\be_\bc_\be_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs|\n+suggest_mode controls whether or not libtorrent will send out suggest messages\n+to create a bias of its peers to request certain pieces. The modes are:\n+ * no_piece_suggestions which will not send out suggest messages.\n+ * suggest_read_cache which will send out suggest messages for the most\n+ recent pieces that are in the read cache.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b |\n+|_\bm_\ba_\bx_\b__\bq_\bu_\be_\bu_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bb_\by_\bt_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n+max_queued_disk_bytes is the maximum number of bytes, to be written to disk,\n+that can wait in the disk I/O thread queue. This queue is only for waiting for\n+the disk I/O thread to receive the job and either write it to disk or insert it\n+in the write cache. When this limit is reached, the peer connections will stop\n+reading data from their sockets, until the disk thread catches up. Setting this\n+too low will severely limit your download rate.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+the number of seconds to wait for a handshake response from a peer. If no\n+response is received within this time, the peer is disconnected.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b |\n+|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bl_\bo_\bw_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b*_\b _\b1_\b0_\b2_\b4_\b |\n+|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b*_\b _\b1_\b0_\b2_\b4|\n+|_\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b__\bf_\ba_\bc_\bt_\bo_\br_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b _\b _\b _\b |\n+send_buffer_low_watermark the minimum send buffer target size (send buffer\n+includes bytes pending being read from disk). For good and snappy seeding\n+performance, set this fairly high, to at least fit a few blocks. This is\n+essentially the initial window size which will determine how fast we can ramp\n+up the send rate\n+if the send buffer has fewer bytes than send_buffer_watermark, we'll read\n+another 16 kiB block onto it. If set too small, upload rate capacity will\n+suffer. If set too high, memory will be wasted. The actual watermark may be\n+lower than this in case the upload rate is low, this is the upper limit.\n+the current upload rate to a peer is multiplied by this factor to get the send\n+buffer watermark. The factor is specified as a percentage. i.e. 50 -> 0.5 This\n+product is clamped to the send_buffer_watermark setting to not exceed the max.\n+For high speed upload, this should be set to a greater value than 100. For high\n+capacity connections, setting this higher can improve upload performance and\n+disk throughput. Setting it too high may waste RAM and create a bias towards\n+read jobs over write jobs.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n+|_\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bf_\bi_\bx_\be_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b__\bc_\bh_\bo_\bk_\be_\br|\n+|_\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\br_\bo_\bu_\bn_\bd_\b__\br_\bo_\bb_\bi_\bn_\b _\b _\b _\b _\b _\b _\b |\n+choking_algorithm specifies which algorithm to use to determine how many peers\n+to unchoke. The unchoking algorithm for downloading torrents is always \"tit-\n+for-tat\", i.e. the peers we download the fastest from are unchoked.\n+The options for choking algorithms are defined in the _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt enum.\n+seed_choking_algorithm controls the seeding unchoke behavior. i.e. How we\n+select which peers to unchoke for seeding torrents. Since a seeding torrent\n+isn't downloading anything, the tit-for-tat mechanism cannot be used. The\n+available options are defined in the _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt enum.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\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_\bi_\bs_\bk_\b__\bi_\bo_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bD_\bI_\bS_\bK_\b__\bW_\bR_\bI_\bT_\bE_\b__\bM_\bO_\bD_\bE_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\br_\be_\ba_\bd_\b__\bm_\bo_\bd_\be_\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\bh_\be|\n+determines how files are opened when they're in read only mode versus read and\n+write mode. The options are:\n+ enable_os_cache\n+ Files are opened normally, with the OS caching reads and writes.\n+ disable_os_cache\n+ This opens all files in no-cache mode. This corresponds to the OS not\n+ letting blocks for the files linger in the cache. This makes sense in\n+ order to avoid the bittorrent client to potentially evict all other\n+ processes' cache by simply handling high throughput and large files. If\n+ libtorrent's read cache is disabled, enabling this may reduce\n+ performance.\n+ write_through\n+ flush pieces to disk as they complete validation.\n+One reason to disable caching is that it may help the operating system from\n+growing its file cache indefinitely.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\bo_\bu_\bt_\bg_\bo_\bi_\bn_\bg_\b__\bp_\bo_\br_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+this is the first port to use for binding outgoing connections to. This is\n+useful for users that have routers that allow QoS settings based on local port.\n+when binding outgoing connections to specific ports, num_outgoing_ports is the\n+size of the range. It should be more than a few\n+Warning\n+setting outgoing ports will limit the ability to keep multiple connections to\n+the same client, even for different torrents. It is not recommended to change\n+this setting. Its main purpose is to use as an escape hatch for cheap routers\n+with QoS capability but can only classify flows based on port numbers.\n+It is a range instead of a single port because of the problems with failing to\n+reconnect to peers if a previous socket to that peer and port is in TIME_WAIT\n+state.\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 _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\be_\be_\br_\b__\bd_\bs_\bc_\bp_\b|_\bi_\bn_\bt_\b _\b|_\b0_\bx_\b0_\b4_\b _\b _\b |\n+peer_dscp determines the DSCP field in the IP header of every packet sent to\n+peers (including web seeds). 0x0 means no marking, 0x04 represents Lower\n+Effort. For more details see _\bR_\bF_\bC_\b _\b8_\b6_\b2_\b2.\n+peer_tos is the backwards compatible name for this setting.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bs_\be_\be_\bd_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bh_\bt_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b8_\b8_\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b0_\b0_\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bl_\bs_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bv_\be_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n+for auto managed torrents, these are the limits they are subject to. If there\n+are too many torrents some of the auto managed ones will be paused until some\n+slots free up. active_downloads and active_seeds controls how many active\n+seeding and downloading torrents the queuing mechanism allows. The target\n+number of active torrents is min(active_downloads + active_seeds,\n+active_limit). active_downloads and active_seeds are upper limits on the number\n+of downloading torrents and seeding torrents respectively. Setting the value to\n+-1 means unlimited.\n+For example if there are 10 seeding torrents and 10 downloading torrents, and\n+active_downloads is 4 and active_seeds is 4, there will be 4 seeds active and 4\n+downloading torrents. If the settings are active_downloads = 2 and active_seeds\n+= 4, then there will be 2 downloading torrents and 4 seeding torrents active.\n+Torrents that are not auto managed are not counted against these limits.\n+active_checking is the limit of number of simultaneous checking torrents.\n+active_limit is a hard limit on the number of active (auto managed) torrents.\n+This limit also applies to slow torrents.\n+active_dht_limit is the max number of torrents to announce to the DHT.\n+active_tracker_limit is the max number of torrents to announce to their\n+trackers.\n+active_lsd_limit is the max number of torrents to announce to the local network\n+over the local service discovery protocol.\n+You can have more torrents a\bac\bct\bti\biv\bve\be, even though they are not announced to the\n+DHT, lsd or their tracker. If some peer knows about you for any reason and\n+tries to connect, it will still be accepted, unless the torrent is paused,\n+which means it won't accept any connections.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+auto_manage_interval is the number of seconds between the torrent queue is\n+updated, and rotated.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b |\n+|_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b4_\b _\b*_\b _\b6_\b0_\b _\b*_\b _\b6_\b0|\n+this is the limit on the time a torrent has been an active seed (specified in\n+seconds) before it is considered having met the seed limit criteria. See\n+_\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bu_\bt_\bo_\b__\bs_\bc_\br_\ba_\bp_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b8_\b0_\b0_\b _\b _\b |\n+|_\ba_\bu_\bt_\bo_\b__\bs_\bc_\br_\ba_\bp_\be_\b__\bm_\bi_\bn_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b _\b _\b _\b |\n+auto_scrape_interval is the number of seconds between scrapes of queued\n+torrents (auto managed and paused torrents). Auto managed torrents that are\n+paused, are scraped regularly in order to keep track of their downloader/seed\n+ratio. This ratio is used to determine which torrents to seed and which to\n+pause.\n+auto_scrape_min_interval is the minimum number of seconds between any automatic\n+scrape (regardless of torrent). In case there are a large number of paused auto\n+managed torrents, this puts a limit on how often a scrape request is sent.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n+|_\bm_\ba_\bx_\b__\bp_\ba_\bu_\bs_\be_\bd_\b__\bp_\be_\be_\br_\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b0_\b _\b _\b |\n+max_peerlist_size is the maximum number of peers in the list of known peers.\n+These peers are not necessarily connected, so this number should be much\n+greater than the maximum number of connected peers. Peers are evicted from the\n+cache when the list grows passed 90% of this limit, and once the size hits the\n+limit, peers are no longer added to the list. If this limit is set to 0, there\n+is no limit on how many peers we'll keep in the peer list.\n+max_paused_peerlist_size is the max peer list size used for torrents that are\n+paused. This can be used to save memory for paused torrents, since it's not as\n+important for them to keep a large peer list.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\bi_\bn_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n+this is the minimum allowed announce interval for a tracker. This is specified\n+in seconds and is used as a sanity check on what is returned from a tracker. It\n+mitigates hammering mis-configured trackers.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bs_\bt_\ba_\br_\bt_\bu_\bp_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n+this is the number of seconds a torrent is considered active after it was\n+started, regardless of upload and download speed. This is so that newly started\n+torrents are not considered inactive until they have a fair chance to start\n+downloading.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\be_\be_\bd_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b__\bq_\bu_\bo_\bt_\ba_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+seeding_piece_quota is the number of pieces to send to a peer, when seeding,\n+before rotating in another peer to the unchoke set.\n+ _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\br_\be_\bj_\be_\bc_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n+max_rejects is the number of piece requests we will reject in a row while a\n+peer is choked before the peer is considered abusive and is disconnected.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bc_\bv_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+|_\bs_\be_\bn_\bd_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+specifies the buffer sizes set on peer sockets. 0 means the OS default (i.e.\n+don't change the buffer sizes). The socket buffer sizes are changed using\n+setsockopt() with SOL_SOCKET/SO_RCVBUF and SO_SNDBUFFER.\n+Note that uTP peers share a single UDP socket buffer for each of the\n+listen_interfaces, along with DHT and UDP tracker traffic. If the buffer size\n+is too small for the combined traffic through the socket, packets may be\n+dropped.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bm_\ba_\bx_\b__\bp_\be_\be_\br_\b__\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n+the max number of bytes a single peer connection's receive buffer is allowed to\n+grow 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bd_\bi_\bs_\bk_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b*_\b _\b6_\b0|\n+optimistic_disk_retry is the number of seconds from a disk write errors occur\n+on a torrent until libtorrent will take it out of the upload mode, to test if\n+the error condition has been fixed.\n+libtorrent will only do this automatically for auto managed torrents.\n+You can explicitly take a torrent out of upload only mode using set_upload_mode\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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b _\b _\b _\b _\b |\n+max_suggest_pieces is the max number of suggested piece indices received from a\n+peer that's remembered. If a peer floods suggest messages, this limit prevents\n+libtorrent from using too much RAM.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bl_\bo_\bc_\ba_\bl_\b__\bs_\be_\br_\bv_\bi_\bc_\be_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n+local_service_announce_interval is the time between local network announces for\n+a torrent. This interval is specified in seconds.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b5_\b _\b*_\b _\b6_\b0|\n+dht_announce_interval is the number of seconds between announcing torrents to\n+the distributed hash table (DHT).\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bt_\bo_\bk_\be_\bn_\b__\be_\bx_\bp_\bi_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b6_\b0_\b _\b _\b _\b _\b |\n+udp_tracker_token_expiry is the number of seconds libtorrent will keep UDP\n+tracker connection tokens around for. This is specified to be 60 seconds. The\n+higher this value is, the fewer packets have to be sent to the UDP tracker. In\n+order for higher values to work, the tracker needs to be configured to match\n+the expiration time for tokens.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bn_\bu_\bm_\b__\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+num_optimistic_unchoke_slots is the number of optimistic unchoke slots to use.\n+Having a higher number of optimistic unchoke slots mean you will find the good\n+peers faster but with the trade-off to use up more bandwidth. 0 means\n+automatic, where libtorrent opens up 20% of your allowed upload slots as\n+optimistic unchoke slots.\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bp_\be_\bx_\b__\bp_\be_\be_\br_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n+the max number of peers we accept from pex messages from a single peer. this\n+limits the number of concurrent peers any of our peers claims to be connected\n+to. If they claim to be connected to more than this, we'll ignore any peer that\n+exceeds this limit\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bt_\bi_\bc_\bk_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n+tick_interval specifies the number of milliseconds between internal ticks. This\n+is the frequency with which bandwidth quota is distributed to peers. It should\n+not be more than one second (i.e. 1000 ms). Setting this to a low value (around\n+100) means higher resolution bandwidth quota distribution, setting it to a\n+higher value saves CPU cycles.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bh_\ba_\br_\be_\b__\bm_\bo_\bd_\be_\b__\bt_\ba_\br_\bg_\be_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+share_mode_target specifies the target share ratio for share mode torrents. If\n+set to 3, we'll try to upload 3 times as much as we download. Setting this very\n+high, will make it very conservative and you might end up not downloading\n+anything ever (and not affecting your share ratio). It does not make any sense\n+to set this any lower than 2. For instance, if only 3 peers need to download\n+the rarest piece, it's impossible to download a single piece and upload it more\n+than 3 times. If the share_mode_target is set to more than 3, nothing is\n+downloaded.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bp_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+|_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+upload_rate_limit and download_rate_limit sets the session-global limits of\n+upload and download rate limits, in bytes per second. By default peers on the\n+local network are not rate limited.\n+A value of 0 means unlimited.\n+For fine grained control over rate limits, including making them apply to local\n+peers, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\br_\ba_\bt_\be_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b8_\b0_\b0_\b0_\b _\b _\b |\n+the number of bytes per second (on average) the DHT is allowed to send. If the\n+incoming requests causes to many bytes to be sent in responses, incoming\n+requests will be dropped until the quota has been replenished.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b8_\b _\b _\b _\b _\b _\b |\n+unchoke_slots_limit is the max number of unchoked peers in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. The\n+number of unchoke slots may be ignored depending on what choking_algorithm is\n+set to. Setting this limit to -1 means unlimited, i.e. all peers will always be\n+unchoked.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n+connections_limit sets a global limit on the number of connections opened. The\n+number of connections is set to a hard minimum of at least two per torrent, so\n+if you set a too low connections limit, and open too many torrents, the limit\n+will not be met.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b__\bs_\bl_\ba_\bc_\bk_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+connections_slack is the number of incoming connections exceeding the\n+connection limit to accept in order to potentially replace existing ones.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bt_\bp_\b__\bt_\ba_\br_\bg_\be_\bt_\b__\bd_\be_\bl_\ba_\by_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bg_\ba_\bi_\bn_\b__\bf_\ba_\bc_\bt_\bo_\br_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bm_\bi_\bn_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bs_\by_\bn_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bf_\bi_\bn_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bn_\bu_\bm_\b__\br_\be_\bs_\be_\bn_\bd_\bs_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b0_\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bl_\bo_\bs_\bs_\b__\bm_\bu_\bl_\bt_\bi_\bp_\bl_\bi_\be_\br_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n+utp_target_delay is the target delay for uTP sockets in milliseconds. A high\n+value will make uTP connections more aggressive and cause longer queues in the\n+upload bottleneck. It cannot be too low, since the noise in the measurements\n+would cause it to send too slow. utp_gain_factor is the number of bytes the uTP\n+congestion window can increase at the most in one RTT. If this is set too high,\n+the congestion controller reacts too hard to noise and will not be stable, if\n+it's set too low, it will react slow to congestion and not back off as fast.\n+utp_min_timeout is the shortest allowed uTP socket timeout, specified in\n+milliseconds. The timeout depends on the RTT of the connection, but is never\n+smaller than this value. A connection times out when every packet in a window\n+is lost, or when a packet is lost twice in a row (i.e. the resent packet is\n+lost as well).\n+The shorter the timeout is, the faster the connection will recover from this\n+situation, assuming the RTT is low enough. utp_syn_resends is the number of SYN\n+packets that are sent (and timed out) before giving up and closing the socket.\n+utp_num_resends is the number of times a packet is sent (and lost or timed out)\n+before giving up and closing the connection. utp_connect_timeout is the number\n+of milliseconds of timeout for the initial SYN packet for uTP connections. For\n+each timed out packet (in a row), the timeout is doubled. utp_loss_multiplier\n+controls how the congestion window is changed when a packet loss is\n+experienced. It's specified as a percentage multiplier for cwnd. Do not change\n+this value unless you know what you're doing. Never set it higher than 100.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n+|_\bm_\bi_\bx_\be_\bd_\b__\bm_\bo_\bd_\be_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\be_\br_\b__\bp_\br_\bo_\bp_\bo_\br_\bt_\bi_\bo_\bn_\ba_\bl|\n+The mixed_mode_algorithm determines how to treat TCP connections when there are\n+uTP connections. Since uTP is designed to yield to TCP, there's an inherent\n+problem when using swarms that have both TCP and uTP connections. If nothing is\n+done, uTP connections would often be starved out for bandwidth by the TCP\n+connections. This mode is prefer_tcp. The peer_proportional mode simply looks\n+at the current throughput and rate limits all TCP connections to their\n+proportional share based on how many of the connections are TCP. This works\n+best if uTP connections are not rate limited by the global rate limiter (which\n+they aren't by default).\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bl_\bi_\bs_\bt_\be_\bn_\b__\bq_\bu_\be_\bu_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+listen_queue_size is the value passed in to listen() for the listen socket. It\n+is the number of outstanding incoming connections to queue up while we're not\n+actively waiting for a connection to be accepted. 5 should be sufficient for\n+any normal client. If this is a high performance server which expects to\n+receive a lot of connections, or used in a simulator or test, it might make\n+sense to raise this number. It will not take affect until the listen_interfaces\n+settings is updated.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bb_\bo_\bo_\bs_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b _\b _\b _\b _\b |\n+torrent_connect_boost is the number of peers to try to connect to immediately\n+when the first tracker response is received for a torrent. This is a boost to\n+given to new torrents to accelerate them starting up. The normal connect\n+scheduler is run once every second, this allows peers to be connected\n+immediately instead of waiting for the _\bs_\be_\bs_\bs_\bi_\bo_\bn tick to trigger connections.\n+This may not be set higher than 255.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\be_\br_\bt_\b__\bq_\bu_\be_\bu_\be_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n+alert_queue_size is the maximum number of alerts queued up internally. If\n+alerts are not popped, the queue will eventually fill up to this level. Once\n+the _\ba_\bl_\be_\br_\bt queue is full, additional alerts will be dropped, and not delivered\n+to the client. Once the client drains the queue, new alerts may be delivered\n+again. In order to know that alerts have been dropped, see session_handle::\n+dropped_alerts().\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bm_\ba_\bx_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4_\b0|\n+max_metadata_size is the maximum allowed size (in bytes) to be received by the\n+metadata extension, i.e. magnet links.\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bh_\ba_\bs_\bh_\bi_\bn_\bg_\b__\bt_\bh_\br_\be_\ba_\bd_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b _\b _\b _\b _\b _\b |\n+hashing_threads is the number of disk I/O threads to use for piece hash\n+verification. These threads are i\bin\bn a\bad\bdd\bdi\bit\bti\bio\bon\bn to the regular disk I/O threads\n+specified by _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\ba_\bi_\bo_\b__\bt_\bh_\br_\be_\ba_\bd_\bs. These threads are only used for full\n+checking of torrents. The hash checking done while downloading are done by the\n+regular disk I/O threads. The _\bh_\ba_\bs_\bh_\be_\br threads do not only compute hashes, but\n+also perform the read from disk. On storage optimal for sequential access, such\n+as hard drives, this setting should be set to 1, which is also the default.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bm_\be_\bm_\b__\bu_\bs_\ba_\bg_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b6_\b _\b _\b _\b |\n+the number of blocks to keep outstanding at any given time when checking\n+torrents. Higher numbers give faster re-checks but uses more memory. Specified\n+in number of 16 kiB blocks\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\be_\bd_\bi_\bc_\bt_\bi_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+if set to > 0, pieces will be announced to other peers before they are fully\n+downloaded (and before they are hash checked). The intention is to gain 1.5\n+potential round trip times per downloaded piece. When non-zero, this indicates\n+how many milliseconds in advance pieces should be announced, before they are\n+expected to be completed.\n+ _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bi_\bo_\b__\bt_\bh_\br_\be_\ba_\bd_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+for some aio back-ends, aio_threads specifies the number of io-threads to use.\n+ _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bb_\ba_\bc_\bk_\bo_\bf_\bf_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b0_\b _\b _\b _\b |\n+tracker_backoff determines how aggressively to back off from retrying failing\n+trackers. This value determines x\bx in the following formula, determining the\n+number of seconds to wait until the next retry:\n+ delay = 5 + 5 * x / 100 * fails^2\n+This setting may be useful to make libtorrent more or less aggressive in\n+hitting trackers.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\bh_\ba_\br_\be_\b__\br_\ba_\bt_\bi_\bo_\b__\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b _\b _\b _\b |\n+|_\bs_\be_\be_\bd_\b__\bt_\bi_\bm_\be_\b__\br_\ba_\bt_\bi_\bo_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b7_\b0_\b0_\b _\b _\b _\b |\n+when a seeding torrent reaches either the share ratio (bytes up / bytes down)\n+or the seed time ratio (seconds as seed / seconds as downloader) or the seed\n+time limit (seconds as seed) it is considered done, and it will leave room for\n+other torrents. These are specified as percentages. Torrents that are\n+considered done will still be allowed to be seeded, they just won't have\n+priority anymore. For more, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b4_\b _\b _\b _\b _\b _\b |\n+|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b__\bc_\bu_\bt_\bo_\bf_\bf_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b9_\b0_\b _\b _\b _\b _\b |\n+|_\bp_\be_\be_\br_\b__\bt_\bu_\br_\bn_\bo_\bv_\be_\br_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b0_\b0_\b _\b _\b _\b |\n+peer_turnover is the percentage of peers to disconnect every turnover\n+peer_turnover_interval (if we're at the peer limit), this is specified in\n+percent when we are connected to more than limit * peer_turnover_cutoff peers\n+disconnect peer_turnover fraction of the peers. It is specified in percent\n+peer_turnover_interval is the interval (in seconds) between optimistic\n+disconnects if the disconnects happen and how many peers are disconnected is\n+controlled by peer_turnover and peer_turnover_cutoff\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bs_\be_\be_\bd_\b__\be_\bv_\be_\br_\by_\b__\bn_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+this setting controls the priority of downloading torrents over seeding or\n+finished torrents when it comes to making peer connections. Peer connections\n+are throttled by the connection_speed and the half-open connection limit. This\n+makes peer connections a limited resource. Torrents that still have pieces to\n+download are prioritized by default, to avoid having many seeding torrents use\n+most of the connection attempts and only give one peer every now and then to\n+the downloading torrent. libtorrent will loop over the downloading torrents to\n+connect a peer each, and every n:th connection attempt, a finished torrent is\n+picked to be allowed to connect to a peer. This setting controls 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b |\n+|_\bm_\ba_\bx_\b__\bh_\bt_\bt_\bp_\b__\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bs_\bi_\bz_\be_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b*_\b1_\b0_\b2_\b4_\b*_\b2_\b0_\b4|\n+the max number of bytes to allow an HTTP response to be when announcing to\n+trackers or downloading .torrent files via the url provided in\n+add_torrent_params.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\br_\be_\bt_\br_\by_\b__\bp_\bo_\br_\bt_\b__\bb_\bi_\bn_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b _\b _\b _\b _\b |\n+if binding to a specific port fails, should the port be incremented by one and\n+tried again? This setting specifies how many times to retry a failed port bind\n+ _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk_\b|_\bi_\bn_\bt_\b _\b|_\bi_\bn_\bt_\b _\b _\b _\b |\n+a bitmask combining flags from _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt defining which kinds of alerts\n+to receive\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bo_\bu_\bt_\b__\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\be_\bn_\ba_\bb_\bl_\be_\bd|\n+|_\bi_\bn_\b__\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by_\b _\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\be_\bn_\ba_\bb_\bl_\be_\bd|\n+control the settings for incoming and outgoing connections respectively. see\n+_\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by enum for the available options. Keep in mind that protocol\n+encryption degrades performance in several respects:\n+ 1. It prevents \"zero copy\" disk buffers being sent to peers, since each peer\n+ needs to mutate the data (i.e. encrypt it) the data must be copied per\n+ peer connection rather than sending the same buffer to multiple peers.\n+ 2. The encryption itself requires more CPU than plain bittorrent protocol.\n+ The highest cost is the Diffie Hellman exchange on connection setup.\n+ 3. The encryption handshake adds several round-trips to the connection\n+ setup, and delays transferring 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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bp_\be_\b__\bb_\bo_\bt_\bh|\n+determines the encryption level of the connections. This setting will adjust\n+which encryption scheme is offered to the other peer, as well as which\n+encryption scheme is selected by the client. See _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl enum for options.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\be_\b__\bd_\bo_\bw_\bn_\b__\br_\ba_\bt_\be_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b4_\b8_\b _\b _\b |\n+|_\bi_\bn_\ba_\bc_\bt_\bi_\bv_\be_\b__\bu_\bp_\b__\br_\ba_\bt_\be_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b4_\b8_\b _\b _\b |\n+the download and upload rate limits for a torrent to be considered active by\n+the queuing mechanism. A torrent whose download rate is less than\n+inactive_down_rate and whose upload rate is less than inactive_up_rate for\n+auto_manage_startup seconds, is considered inactive, and another queued torrent\n+may be started. This logic is disabled if dont_count_slow_torrents is false.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bn_\bo_\bn_\be|\n+proxy to use. see _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bp_\br_\bo_\bx_\by_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+the port of the proxy server\n+ _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\b2_\bp_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+sets the _\bi_\b2_\bp SAM bridge port to connect to. set the hostname with the\n+i2p_hostname setting.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\br_\bl_\bs_\be_\be_\bd_\b__\bm_\ba_\bx_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bb_\by_\bt_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b _\b*_\b _\b1_\b0_\b2_\b4_\b _\b*_\b _\b1_\b0_\b2_\b4|\n+The maximum request range of an url seed in bytes. This value defines the\n+largest possible sequential web seed request. Lower values are possible but\n+will be ignored if they are lower then piece size. This value should be related\n+to your download speed to prevent libtorrent from creating too many expensive\n+http requests per second. You can select a value as high as you want but keep\n+in mind that libtorrent can't create parallel requests if the first request did\n+already select the whole file. If you combine bittorrent seeds with web seeds\n+and pick strategies like rarest first you may find your web seed requests split\n+into smaller parts because we don't download already picked pieces twice.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b__\br_\be_\bt_\br_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b8_\b0_\b0_\b _\b _\b |\n+time to wait until a new retry of a web seed name lookup\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bl_\bo_\bs_\be_\b__\bf_\bi_\bl_\be_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\bC_\bL_\bO_\bS_\bE_\b__\bF_\bI_\bL_\bE_\b__\bI_\bN_\bT_\bE_\bR_\bV_\bA_\bL|\n+the number of seconds between closing the file opened the longest ago. 0 means\n+to disable the feature. The purpose of this is to periodically close files to\n+trigger the operating system flushing disk cache. Specifically it has been\n+observed to be required on windows to not have the disk cache grow\n+indefinitely. This defaults to 240 seconds on windows, and disabled on other\n+systems.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bt_\bp_\b__\bc_\bw_\bn_\bd_\b__\br_\be_\bd_\bu_\bc_\be_\b__\bt_\bi_\bm_\be_\br_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n+When uTP experiences packet loss, it will reduce the congestion window, and not\n+reduce it again for this many milliseconds, even if experiencing another lost\n+packet.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+the max number of web seeds to have connected per torrent at any given time.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b__\bc_\ba_\bc_\bh_\be_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b2_\b0_\b0_\b _\b _\b |\n+the number of seconds before the internal host name resolver considers a cache\n+value timed out, negative values are interpreted as zero.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bs_\be_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\be_\bn_\bt_\b__\bl_\bo_\bw_\b__\bw_\ba_\bt_\be_\br_\bm_\ba_\br_\bk_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b6_\b3_\b8_\b4_\b _\b |\n+specify the not-sent low watermark for socket send buffers. This corresponds to\n+the, Linux-specific, TCP_NOTSENT_LOWAT TCP socket option.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\br_\ba_\bt_\be_\b__\bc_\bh_\bo_\bk_\be_\br_\b__\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b2_\b4_\b _\b _\b |\n+the rate based choker compares the upload rate to peers against a threshold\n+that increases proportionally by its size for every peer it visits, visiting\n+peers in decreasing upload rate. The number of upload slots is determined by\n+the number of peers whose upload rate exceeds the threshold. This option sets\n+the start value for this threshold. A higher value leads to fewer unchoke\n+slots, a lower value leads to 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 \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bu_\bp_\bn_\bp_\b__\bl_\be_\ba_\bs_\be_\b__\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b6_\b0_\b0_\b _\b _\b |\n+The expiration time of UPnP port-mappings, specified in seconds. 0 means\n+permanent lease. Some routers do not support expiration times on port-maps (nor\n+correctly returning an error indicating lack of support). In those cases, set\n+this to 0. Otherwise, don't set it any lower than 5 minutes.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\ba_\bx_\b__\bc_\bo_\bn_\bc_\bu_\br_\br_\be_\bn_\bt_\b__\bh_\bt_\bt_\bp_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b _\b _\b _\b _\b |\n+limits the number of concurrent HTTP tracker announces. Once the limit is hit,\n+tracker requests are queued and issued when an outstanding announce completes.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bs_\b__\br_\be_\bp_\bl_\by_\b|_\bi_\bn_\bt_\b _\b|_\b1_\b0_\b0_\b _\b _\b _\b |\n+the maximum number of peers to send in a reply to get_peers\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\bb_\br_\ba_\bn_\bc_\bh_\bi_\bn_\bg_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+the number of concurrent search request the node will send when announcing and\n+refreshing the routing table. This parameter is called alpha in the kademlia\n+paper\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bf_\ba_\bi_\bl_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+the maximum number of failed tries to contact a node before it is removed from\n+the routing table. If there are known working nodes that are ready to replace a\n+failing node, it will be replaced immediately, this limit is only used to clear\n+out nodes that don't have any node that can replace them.\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b0_\b0_\b _\b _\b |\n+the total number of torrents to track from the DHT. This is simply an upper\n+limit to make sure malicious DHT nodes cannot make us allocate an unbounded\n+amount of memory.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bd_\bh_\bt_\b__\bi_\bt_\be_\bm_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b7_\b0_\b0_\b _\b _\b _\b |\n+max number of items the DHT will store\n+ _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bp_\be_\be_\br_\bs_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b0_\b0_\b _\b _\b _\b |\n+the max number of peers to store per torrent (for the DHT)\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\be_\ba_\br_\bc_\bh_\b__\br_\be_\bp_\bl_\by_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+the max number of torrents to return in a torrent search query to the DHT\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b*_\b _\b6_\b0_\b |\n+the number of seconds a DHT node is banned if it exceeds the rate limit. The\n+rate limit is averaged over 10 seconds to allow for bursts above the limit.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\ba_\bt_\be_\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b5_\b _\b _\b _\b _\b _\b |\n+the max number of packets per second a DHT node is allowed to send without\n+getting banned.\n+ _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bi_\bt_\be_\bm_\b__\bl_\bi_\bf_\be_\bt_\bi_\bm_\be_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+the number of seconds a immutable/mutable item will be expired. default is 0,\n+means never expires.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bi_\bn_\bt_\be_\br_\bv_\ba_\bl_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b1_\b6_\b0_\b0_\b _\b |\n+the info-hashes sample recomputation interval (in seconds). The node will\n+precompute a subset of the tracked info-hashes and return that instead of\n+calculating it upon each request. The permissible range is between 0 and 21600\n+seconds (inclusive).\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bd_\bh_\bt_\b__\bm_\ba_\bx_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b0_\b _\b _\b _\b _\b |\n+the maximum number of elements in the sampled subset of info-hashes. If this\n+number is too big, expect the DHT storage implementations to clamp it in order\n+to allow UDP packets go through\n+ _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt_\b |\n+|_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\bx_\b2_\b0_\b0_\b0_\b0_\b0|\n+max_piece_count is the maximum allowed number of pieces in metadata received\n+via magnet links. Loading large torrents (with more pieces than the default\n+limit) may also require passing in a higher limit to _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b), if those are used.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bt_\bo_\bk_\be_\bn_\b__\bl_\bi_\bm_\bi_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b2_\b5_\b0_\b0_\b0_\b0_\b0|\n+when receiving metadata (torrent file) from peers, this is the max number of\n+bencoded tokens we're willing to parse. This limit is meant to prevent DoS\n+attacks on peers. For very large torrents, this limit may have to be raised.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\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 |\n+|_\bd_\bi_\bs_\bk_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b|_\bi_\bn_\bt_\b _\b|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt_\b:_\b:_\ba_\bu_\bt_\bo_\b__\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be|\n+controls whether disk writes will be made through a memory mapped file or via\n+normal write calls. This only affects the mmap_disk_io. When saving to a non-\n+local drive (network share, NFS or NAS) using memory mapped files is most\n+likely inferior. When writing to a local SSD (especially in DAX mode) using\n+memory mapped files likely gives the best performance. The values for this\n+setting are specified as _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\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 _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bm_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b__\bc_\bu_\bt_\bo_\bf_\bf_\b|_\bi_\bn_\bt_\b _\b|_\b4_\b0_\b _\b _\b _\b _\b |\n+when using mmap_disk_io, files smaller than this number of blocks will not be\n+memory mapped, but will use normal pread/pwrite operations. This file size\n+limit is specified in 16 kiB blocks.\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\bt\bt_\by\by_\bp\bp_\be\be_\b|_\bd\bd_\be\be_\bf\bf_\ba\ba_\bu\bu_\bl\bl_\bt\bt|\n+|_\bi_\b2_\bp_\b__\bi_\bn_\bb_\bo_\bu_\bn_\bd_\b__\bq_\bu_\ba_\bn_\bt_\bi_\bt_\by_\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\bo_\bu_\bt_\bb_\bo_\bu_\bn_\bd_\b__\bq_\bu_\ba_\bn_\bt_\bi_\bt_\by_\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\bi_\bn_\bb_\bo_\bu_\bn_\bd_\b__\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\bo_\bu_\bt_\bb_\bo_\bu_\bn_\bd_\b__\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b|_\bi_\bn_\bt_\b _\b|_\b3_\b _\b _\b _\b _\b _\b |\n+Configures the SAM _\bs_\be_\bs_\bs_\bi_\bo_\bn quantity of I2P inbound and outbound tunnels\n+[1..16]. number of hops for I2P inbound and outbound tunnels [0..7] Changing\n+these will not trigger a reconnect to the SAM bridge, they will take effect the\n+next time the SAM connection is re-established (by restarting or changing\n+i2p_hostname or i2p_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+ bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n+ void c\bcl\ble\bea\bar\br ();\n+ void c\bcl\ble\bea\bar\br (int name);\n+ int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n+ std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n+ bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+ 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+ type_mask,\n+ index_mask,\n+ };\n+\n+ enum mmap_write_mode_t\n+ {\n+ always_pwrite,\n+ always_mmap_write,\n+ auto_mmap_write,\n+ };\n+\n+ enum suggest_mode_t\n+ {\n+ no_piece_suggestions,\n+ suggest_read_cache,\n+ };\n+\n+ enum choking_algorithm_t\n+ {\n+ fixed_slots_choker,\n+ rate_based_choker,\n+ deprecated_bittyrant_choker,\n+ };\n+\n+ enum seed_choking_algorithm_t\n+ {\n+ round_robin,\n+ fastest_upload,\n+ anti_leech,\n+ };\n+\n+ enum io_buffer_mode_t\n+ {\n+ enable_os_cache,\n+ deprecated_disable_os_cache_for_aligned_files,\n+ disable_os_cache,\n+ write_through,\n+ };\n+\n+ enum bandwidth_mixed_algo_t\n+ {\n+ prefer_tcp,\n+ peer_proportional,\n+ };\n+\n+ enum enc_policy\n+ {\n+ pe_forced,\n+ pe_enabled,\n+ pe_disabled,\n+ };\n+\n+ enum enc_level\n+ {\n+ pe_plaintext,\n+ pe_rc4,\n+ pe_both,\n+ };\n+\n+ enum proxy_type_t\n+ {\n+ none,\n+ socks4,\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_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n+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+pack. name can be any enumeration value from string_types, int_types or\n+bool_types.\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+clear the settings pack from all settings\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n+void c\bcl\ble\bea\bar\br (int name);\n+clear a specific setting from the pack\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n+std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n+bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|\n+|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bt_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b _\b _\b _\b|_\b1_\b6_\b3_\b8_\b4_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bb_\bo_\bo_\bl_\b__\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\b _\b _\b|_\b3_\b2_\b7_\b6_\b8_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\by_\bp_\be_\b__\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b9_\b1_\b5_\b2_\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bd_\be_\bx_\b__\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b3_\b8_\b3_\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* e\ben\bnu\bum\bm m\bmm\bma\bap\bp_\b_w\bwr\bri\bit\bte\be_\b_m\bmo\bod\bde\be_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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 |\n+|always_pwrite |0 |disable writing to disk via mmap, always use normal |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b _\bc_\ba_\bl_\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 |\n+|always_mmap_write|1 |prefer using memory mapped files for disk writes (at|\n+|_\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_\ba_\bs_\bt_\b _\bf_\bo_\br_\b _\bl_\ba_\br_\bg_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b _\bm_\bi_\bg_\bh_\bt_\b _\bm_\ba_\bk_\be_\b _\bs_\be_\bn_\bs_\be_\b)_\b _\b _\b _\b |\n+| | |determine whether to use pwrite or memory mapped |\n+|auto_mmap_write |2 |files for disk writes depending on the kind 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|_\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bb_\be_\bh_\bi_\bn_\bd_\b _\bt_\bh_\be_\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 |\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\bsu\bug\bgg\bge\bes\bst\bt_\b_m\bmo\bod\bde\be_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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__\bp_\bi_\be_\bc_\be_\b__\bs_\bu_\bg_\bg_\be_\bs_\bt_\bi_\bo_\bn_\bs_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\br_\be_\ba_\bd_\b__\bc_\ba_\bc_\bh_\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* e\ben\bnu\bum\bm c\bch\bho\bok\bki\bin\bng\bg_\b_a\bal\blg\bgo\bor\bri\bit\bth\bhm\bm_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 the traditional choker with a fixed|\n+|fixed_slots_choker |0 |number of unchoke slots (as specified 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|_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b__\bl_\bi_\bm_\bi_\bt_\b)_\b._\b _\b _\b _\b _\b _\b _\b |\n+| | |This opens up unchoke slots based on the |\n+| | |upload rate achieved to peers. The more |\n+| | |slots that are opened, the marginal upload |\n+| | |rate required to open up another slot |\n+|rate_based_choker |2 |increases. Configure the initial threshold |\n+| | |with _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b: |\n+| | |_\br_\ba_\bt_\be_\b__\bc_\bh_\bo_\bk_\be_\br_\b__\bi_\bn_\bi_\bt_\bi_\ba_\bl_\b__\bt_\bh_\br_\be_\bs_\bh_\bo_\bl_\bd. |\n+| | |For more information, see _\br_\ba_\bt_\be_\b _\bb_\ba_\bs_\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|_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\bb_\bi_\bt_\bt_\by_\br_\ba_\bn_\bt_\b__\bc_\bh_\bo_\bk_\be_\br_\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 |\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\bse\bee\bed\bd_\b_c\bch\bho\bok\bki\bin\bng\bg_\b_a\bal\blg\bgo\bor\bri\bit\bth\bhm\bm_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\b _\b |\n+| | |which round-robins the peers that are unchoked when |\n+|round_robin |0 |seeding. This distributes the upload bandwidth uniformly|\n+| | |and fairly. It minimizes the ability for a peer to |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b _\be_\bv_\be_\br_\by_\bt_\bh_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\br_\be_\bd_\bi_\bs_\bt_\br_\bi_\bb_\bu_\bt_\bi_\bn_\bg_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |unchokes the peers we can send to the fastest. This |\n+|fastest_upload|1 |might be a bit more reliable in utilizing all available |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bp_\ba_\bc_\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 |\n+| | |prioritizes peers who have just started or are just |\n+| | |about to finish the download. The intention is to force |\n+|anti_leech |2 |peers in the middle of the download to trade with each |\n+| | |other. This does not just take into account the pieces a|\n+| | |peer is reporting having downloaded, but also the pieces|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bh_\ba_\bv_\be_\b _\bs_\be_\bn_\bt_\b _\bt_\bo_\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 |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm i\bio\bo_\b_b\bbu\buf\bff\bfe\ber\br_\b_m\bmo\bod\bde\be_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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+|_\be_\bn_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\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|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\bh_\be_\b__\bf_\bo_\br_\b__\ba_\bl_\bi_\bg_\bn_\be_\bd_\b__\bf_\bi_\bl_\be_\bs_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bo_\bs_\b__\bc_\ba_\bc_\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|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bw_\br_\bi_\bt_\be_\b__\bt_\bh_\br_\bo_\bu_\bg_\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|_\b3_\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* e\ben\bnu\bum\bm b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_m\bmi\bix\bxe\bed\bd_\b_a\bal\blg\bgo\bo_\b_t\bt *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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+|_\bp_\br_\be_\bf_\be_\br_\b__\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bs_\b _\bt_\bh_\be_\b _\bm_\bi_\bx_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bb_\ba_\bl_\ba_\bn_\bc_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|peer_proportional|1 |does not throttle uTP, throttles TCP to the same |\n+|_\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_\bo_\bp_\bo_\br_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\bp_\bu_\bt_\b _\ba_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bT_\bC_\bP_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\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 e\ben\bnc\bc_\b_p\bpo\bol\bli\bic\bcy\by *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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+| | |Only encrypted connections are allowed. Incoming |\n+|pe_forced |0 |connections that are not encrypted are closed and if the |\n+| | |encrypted outgoing connection fails, a non-encrypted retry|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\bi_\bl_\bl_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\bm_\ba_\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 |\n+| | |encrypted connections are enabled, but non-encrypted |\n+| | |connections are allowed. An incoming non-encrypted |\n+|pe_enabled |1 |connection will be accepted, and if an outgoing encrypted |\n+| | |connection fails, a non- encrypted connection will be |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\br_\bi_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\be_\b__\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b|_\b2_\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bn_\bo_\bn_\b-_\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ben\bnc\bc_\b_l\ble\bev\bve\bel\bl *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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 |\n+|_\bp_\be_\b__\bp_\bl_\ba_\bi_\bn_\bt_\be_\bx_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bo_\bn_\bl_\by_\b _\bp_\bl_\ba_\bi_\bn_\b _\bt_\be_\bx_\bt_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\bi_\bo_\bn|\n+|_\bp_\be_\b__\br_\bc_\b4_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bo_\bn_\bl_\by_\b _\bR_\bC_\b4_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\be_\b__\bb_\bo_\bt_\bh_\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bw_\b _\bb_\bo_\bt_\bh_\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* e\ben\bnu\bum\bm p\bpr\bro\box\bxy\by_\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/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\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|_\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 |\n+|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\bp_\br_\bo_\bx_\by_\b _\bs_\be_\br_\bv_\be_\br_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\ba_\bn_\bd_\b _\ba_\bl_\bl_\b _\bo_\bt_\bh_\be_\br_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\ba_\br_\be_\b _\bi_\bg_\bn_\bo_\br_\be_\bd_\b._\b _\b _\b _\b |\n+|socks4 |1 |The server is assumed to be a _\bS_\bO_\bC_\bK_\bS_\b4_\b _\bs_\be_\br_\bv_\be_\br that requires a |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\br_\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 |\n+| | |The server is assumed to be a SOCKS5 server (_\bR_\bF_\bC_\b _\b1_\b9_\b2_\b8) that |\n+|socks5 |2 |does not require any authentication. The username and |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd_\b _\ba_\br_\be_\b _\bi_\bg_\bn_\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 |\n+| | |The server is assumed to be a SOCKS5 server that supports |\n+|socks5_pw|3 |plain text username and password authentication (_\bR_\bF_\bC_\b _\b1_\b9_\b2_\b9). |\n+| | |The username and password specified may be sent to the proxy |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bi_\bt_\b _\br_\be_\bq_\bu_\bi_\br_\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 |\n+| | |The server is assumed to be an HTTP proxy. If the transport |\n+| | |used for the connection is non-HTTP, the server is assumed to|\n+|http |4 |support the _\bC_\bO_\bN_\bN_\bE_\bC_\bT method. i.e. for web seeds and HTTP |\n+| | |trackers, a plain proxy will suffice. The proxy is assumed to|\n+| | |not require authorization. The username and password will not|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\b _\bu_\bs_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The server is assumed to be an HTTP proxy that requires user |\n+|http_pw |5 |authorization. The username and password will be sent to the |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n+std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n+ , int major, int minor = 0, int revision = 0, int tag = 0);\n+This is a utility function to produce a client ID fingerprint formatted to the\n+most common convention. The fingerprint can be set via the peer_fingerprint\n+setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n+The name string should contain exactly two characters. These are the characters\n+unique to your client, used to identify it. Make sure not to clash with anybody\n+else. Here are some taken id's:\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n+|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n+|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+There's an informal directory of client id's _\bh_\be_\br_\be.\n+The major, minor, revision and tag parameters are used to identify the version\n+of your client.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+settings_pack 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* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n+int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n+char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n+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* 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 ();\n+ i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n+ ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+ ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter 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+ 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+ 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+ 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 ();\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+ 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* 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@@ -12570,62 +12570,62 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n nodes\n the bootstrap nodes saved from the buckets node\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n nodes6\n the bootstrap nodes saved from the IPv6 buckets node\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ settings_interface const& settings);\n+constructor for the default DHT storage. The DHT storage is responsible for\n+maintaining peers and mutable and immutable items announced and stored/put to\n+the DHT node.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bh_\bp_\bp\"\n signature s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm (\n span v\n , span salt\n , sequence_number seq\n , public_key const& pk\n , secret_key const& sk);\n given a byte range v and an optional byte range salt, a sequence number, public\n key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function\n produces a signature which is written into a 64 byte buffer pointed to by sig.\n The caller is responsible for allocating the destination buffer that's passed\n in as the sig argument. Typically it would be allocated on the stack.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- settings_interface const& settings);\n-constructor for the default DHT storage. The DHT storage is responsible for\n-maintaining peers and mutable and immutable items announced and stored/put to\n-the DHT node.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n seed\n announce to DHT as a seed\n implied_port\n announce to DHT with the implied-port flag set. This tells the network to\n use your source UDP port as your listen port, rather than the one\n specified in the message. This may improve the chances of traversing NATs\n when using uTP.\n ssl_torrent\n Specify the port number for the SSL listen socket in the DHT announce.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\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+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n this function turns the resume data in an add_torrent_params object into a\n bencoded structure\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n flags);\n+entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n , write_torrent_flags_t flags);\n-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@@ -12634,17 +12634,17 @@\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 (bdecode_node const& rd\n , error_code& ec, int piece_limit = 0x200000);\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n , int piece_limit = 0x200000);\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n- , error_code& ec, load_torrent_limits const& cfg = {});\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (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 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@@ -12697,18 +12697,18 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\be_\bd_\b2_\b5_\b5_\b1_\b9_\b._\bh_\bp_\bp\"\n bool e\bed\bd2\b25\b55\b51\b19\b9_\b_v\bve\ber\bri\bif\bfy\by (signature const& sig\n , span msg, public_key const& pk);\n Verifies the signature on the given message using pk\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\bed\bd2\b25\b55\b51\b19\b9_\b_a\bad\bdd\bd_\b_s\bsc\bca\bal\bla\bar\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\be_\bd_\b2_\b5_\b5_\b1_\b9_\b._\bh_\bp_\bp\"\n-secret_key e\bed\bd2\b25\b55\b51\b19\b9_\b_a\bad\bdd\bd_\b_s\bsc\bca\bal\bla\bar\br (secret_key const& sk\n- , std::array const& scalar);\n public_key e\bed\bd2\b25\b55\b51\b19\b9_\b_a\bad\bdd\bd_\b_s\bsc\bca\bal\bla\bar\br (public_key const& pk\n , std::array const& scalar);\n+secret_key e\bed\bd2\b25\b55\b51\b19\b9_\b_a\bad\bdd\bd_\b_s\bsc\bca\bal\bla\bar\br (secret_key const& sk\n+ , std::array const& scalar);\n Adds a scalar to the given key pair where scalar is a 32 byte buffer (possibly\n generated withed25519_create_seed), generating a new key pair.\n You can calculate the public key sum without knowing the private key and vice\n versa by passing in null for the key you don't know. This is useful when a\n third party (an authoritative server for example) needs to enforce randomness\n on a key pair while only knowing the public key of the other side.\n Warning: the last bit of the scalar is ignored - if comparing scalars make sure\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "unified_diff": "@@ -459,15 +459,174 @@\n \tauto o = rpc.allocate_observer<null_observer>(std::move(algo), source, node_id());\n #if TORRENT_USE_ASSERTS\n \to->m_in_constructor = false;\n #endif\n \to->flags |= observer::flag_queried;\n \trpc.invoke(req, source, o);\n \n-relevance 3../src/web_peer_connection.cpp:199this should be an optional, piece index -1 should not be allowed

    this should be an optional, piece index -1 should\n+relevance 3../src/peer_connection.cpp:3119instead 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:3119

    \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+#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+
    \t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+
    \t\tif (!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<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+\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+\t\tif (m_outstanding_writing_bytes == 0\n+
    relevance 3../src/peer_connection.cpp:4027once 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:4027

    \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<torrent> t = m_torrent.lock();\n+\t\tTORRENT_ASSERT(t);\n+\n+\t\tif (m_disconnecting) return;\n+\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\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+\t\t\t{\n+
    relevance 3../src/peer_connection.cpp:4713new_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:4713

    \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+
    \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\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<torrent> 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+#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 not be allowed

    ../src/web_peer_connection.cpp:199

    \n \t\t\tauto const range = aux::file_piece_range_inclusive(fs, i);\n \t\t\tfor (piece_index_t k = std::get<0>(range); k < std::get<1>(range); ++k)\n \t\t\t\thave.clear_bit(k);\n \t\t}\n \t\tt->set_seed(peer_info_struct(), false);\n \t\tif (have.none_set())\n@@ -511,15 +670,15 @@\n #endif\n \n \t\t// prevent the peer from trying to send anything more\n \t\tm_send_buffer.clear();\n \n \t\t// when the web server closed our write-end of the socket (i.e. its\n \t\t// read-end), if it's an HTTP 1.0 server. we will stop sending more\n-
    relevance 3../src/web_peer_connection.cpp:419do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?

    do we really need a special case here? wouldn't the multi-file\n+relevance 3../src/web_peer_connection.cpp:419do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?

    do we really need a special case here? wouldn't the multi-file\n case handle single file torrents correctly too?

    ../src/web_peer_connection.cpp:419

    \t\tsize -= pr.length;\n \t}\n \n #ifndef TORRENT_DISABLE_LOGGING\n \tpeer_log(peer_log_alert::outgoing_message, \"REQUESTING\", \"(piece: %d start: %d) - (piece: %d end: %d)\"\n \t\t, static_cast<int>(r.piece), r.start\n \t\t, static_cast<int>(pr.piece), pr.start + pr.length);\n@@ -563,15 +722,15 @@\n \t{\n \t\tstd::vector<file_slice> files = info.orig_files().map_block(req.piece, req.start\n \t\t\t, req.length);\n \n \t\tfor (auto const &f : files)\n \t\t{\n \t\t\tfile_request_t file_req;\n-
    relevance 3../src/web_peer_connection.cpp:504file_index_t should not allow negative values

    file_index_t should not allow negative values

    ../src/web_peer_connection.cpp:504

    \t\t\t\t\t// with the correct slashes. Don't encode it again\n+
    relevance 3../src/web_peer_connection.cpp:504file_index_t should not allow negative values

    file_index_t should not allow negative values

    ../src/web_peer_connection.cpp:504

    \t\t\t\t\t// with the correct slashes. Don't encode it again\n \t\t\t\t\trequest += m_path;\n \t\t\t\t}\n \n \t\t\t\trequest += escape_file_path(info.orig_files(), f.file_index);\n \t\t\t}\n \t\t\trequest += \" HTTP/1.1\\r\\n\";\n \t\t\tadd_headers(request, m_settings, using_proxy);\n@@ -614,15 +773,15 @@\n \t{\n \t\tstd::string const& server_version = p.header(\"server\");\n \t\tif (!server_version.empty())\n \t\t\treturn server_version;\n \t\treturn host;\n \t}\n \n-
    relevance 3../src/web_peer_connection.cpp:695this could be made more efficient for the case when we use an HTTP proxy. Then we wouldn't need to add new web seeds to the torrent, we could just make the redirect table contain full URLs.

    this could be made more efficient for the case when we use an\n+relevance 3../src/web_peer_connection.cpp:695this could be made more efficient for the case when we use an HTTP proxy. Then we wouldn't need to add new web seeds to the torrent, we could just make the redirect table contain full URLs.

    this could be made more efficient for the case when we use an\n HTTP proxy. Then we wouldn't need to add new web seeds to the torrent,\n we could just make the redirect table contain full URLs.

    ../src/web_peer_connection.cpp:695

    \tbool const single_file_request = !m_path.empty()\n \t\t&& m_path[m_path.size() - 1] != '/';\n \n \t// when SSRF mitigation is enabled, a web seed on the internet (is_global())\n \t// is not allowed to redirect to a server on the local network, so we set\n \t// the no_local_ips flag\n@@ -667,15 +826,338 @@\n \t\tweb->have_files.resize(t->torrent_file().num_files(), false);\n \n \t\t// the new web seed we're adding only has this file for now\n \t\t// we may add more files later\n \t\tweb->redirects[file_index] = redirect_path;\n \t\tif (web->have_files.get_bit(file_index) == false)\n \t\t{\n-
    relevance 3../src/session_impl.cpp:1142closing the udp sockets here means that the uTP connections cannot be closed gracefully

    closing the udp sockets here means that\n+relevance 3../src/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:418we 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:418

    \t\t// --- V2 HASHES ---\n+\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2())\n+\t\t{\n+\t\t\tif (!p.merkle_trees.empty())\n+\t\t\t\tload_merkle_trees(\n+\t\t\t\t\tstd::move(p.merkle_trees)\n+\t\t\t\t\t, std::move(p.merkle_tree_mask)\n+\t\t\t\t\t, std::move(p.verified_leaf_hashes));\n+\n+\t\t\t// we really don't want to store extra copies of the trees\n+\t\t\tTORRENT_ASSERT(p.merkle_trees.empty());\n+\t\t}\n+\n+\t\tif (valid_metadata())\n+\t\t{\n+\t\t\tinc_stats_counter(counters::num_total_pieces_added\n+\t\t\t\t, m_torrent_file->num_pieces());\n+\t\t}\n+\n+
    \t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n+
    \t}\n+\n+\tvoid torrent::load_merkle_trees(\n+\t\taux::vector<std::vector<sha256_hash>, file_index_t> trees_import\n+\t\t, aux::vector<std::vector<bool>, file_index_t> mask\n+\t\t, aux::vector<std::vector<bool>, file_index_t> verified)\n+\t{\n+\t\tauto const& fs = m_torrent_file->orig_files();\n+\n+\t\tstd::vector<bool> const empty_verified;\n+\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i)\n+\t\t{\n+\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (i >= trees_import.end_index()) break;\n+\t\t\tstd::vector<bool> const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i];\n+\t\t\tif (i < mask.end_index() && !mask[i].empty())\n+\t\t\t{\n+\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false);\n+\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask);\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tvoid torrent::inc_stats_counter(int c, int value)\n+
    relevance 3../src/torrent.cpp:714assert there are no outstanding async operations on this torrent

    assert there are no outstanding async operations on this\n+torrent

    ../src/torrent.cpp:714

    #endif\n+\n+\t\tif (!m_ses.dht()) return false;\n+\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false;\n+\t\tif (!m_announce_to_dht) return false;\n+\t\tif (m_paused) return false;\n+\n+\t\t// don't announce private torrents\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false;\n+\t\tif (m_trackers.empty()) return true;\n+\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true;\n+\n+\t\treturn std::none_of(m_trackers.begin(), m_trackers.end()\n+\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); });\n+\t}\n+\n+#endif\n+\n+\ttorrent::~torrent()\n+\t{\n+
    \n+
    #if TORRENT_USE_ASSERTS\n+\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n+\t\t{\n+\t\t\tif (!m_links[i].in_list()) continue;\n+\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n+\t\t}\n+#endif\n+\n+\t\t// The invariant can't be maintained here, since the torrent\n+\t\t// is being destructed, all weak references to it have been\n+\t\t// reset, which means that all its peers already have an\n+\t\t// invalidated torrent pointer (so it cannot be verified to be correct)\n+\n+\t\t// i.e. the invariant can only be maintained if all connections have\n+\t\t// been closed by the time the torrent is destructed. And they are\n+\t\t// supposed to be closed. So we can still do the invariant check.\n+\n+\t\t// however, the torrent object may be destructed from the main\n+\t\t// thread when shutting down, if the disk cache has references to it.\n+\t\t// this means that the invariant check that this is called from the\n+\t\t// network thread cannot be maintained\n+\n+\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0});\n+\t\tTORRENT_ASSERT(m_connections.empty());\n+\t\t// just in case, make sure the session accounting is kept right\n+\t\tfor (auto p : m_connections)\n+\t\t\tm_ses.close_connection(p);\n+\t}\n+\n+\tvoid torrent::read_piece(piece_index_t const piece)\n+
    relevance 3../src/torrent.cpp:1326there'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:1326

    \t\tpiece_picker& m_picker;\n+\t\tpiece_index_t m_piece;\n+\t};\n+\n+\tvoid torrent::add_piece_async(piece_index_t const piece\n+\t\t, std::vector<char> data, add_piece_flags_t const flags)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\t// make sure the piece index is correct\n+\t\tif (piece >= torrent_file().end_piece())\n+\t\t\treturn;\n+\n+\t\t// make sure the piece size is correct\n+\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece)))\n+\t\t\treturn;\n+\n+\t\tadd_piece(piece, data.data(), flags);\n+\t}\n+\n+
    \tvoid torrent::add_piece(piece_index_t const piece, char const* data\n+
    \t\t, add_piece_flags_t const flags)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\t// make sure the piece index is correct\n+\t\tif (piece >= torrent_file().end_piece())\n+\t\t\treturn;\n+\n+\t\tint const piece_size = m_torrent_file->piece_size(piece);\n+\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size();\n+\n+\t\tif (m_deleted) return;\n+\n+\t\t// avoid crash trying to access the picker when there is none\n+\t\tif (m_have_all && !has_picker()) return;\n+\n+\t\t// we don't support clobbering the piece picker while checking the\n+\t\t// files. We may end up having the same piece multiple times\n+\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files\n+\t\t\t&& state() != torrent_status::checking_resume_data);\n+\t\tif (state() == torrent_status::checking_files\n+\t\t\t|| state() == torrent_status::checking_resume_data)\n+\t\t\treturn;\n+\n+\t\tneed_picker();\n+\n+\t\tif (picker().have_piece(piece)\n+\t\t\t&& !(flags & torrent_handle::overwrite_existing))\n+\t\t\treturn;\n+\n+
    relevance 3../src/torrent.cpp:3951this could probably be pulled out into a free function

    this could probably be pulled out into a free function

    ../src/torrent.cpp:3951

    \tstd::int64_t calc_bytes(file_storage const& fs, piece_count const& pc)\n+\t{\n+\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true));\n+\n+\t\t// if we have 0 pieces, we can't have any pad blocks either\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0));\n+\n+\t\t// if we have all pieces, we must also have the last one\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false));\n+\n+\t\t// every block should not be a pad block\n+\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length());\n+\n+\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length()\n+\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0)\n+\t\t\t- std::int64_t(pc.pad_bytes);\n+\t}\n+\n+\t// fills in total_wanted, total_wanted_done and total_done\n+
    \tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n+
    \t{\n+\t\tINVARIANT_CHECK;\n+\n+\t\tst.total_done = 0;\n+\t\tst.total_wanted_done = 0;\n+\t\tst.total_wanted = m_size_on_disk;\n+\n+\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size());\n+\t\tTORRENT_ASSERT(st.total_wanted >= 0);\n+\n+\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0);\n+\t\tif (!valid_metadata()) return;\n+\n+\t\tif (m_seed_mode || is_seed())\n+\t\t{\n+\t\t\t// once we're a seed and remove the piece picker, we stop tracking\n+\t\t\t// piece- and file priority. We consider everything as being\n+\t\t\t// \"wanted\"\n+\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes;\n+\t\t\tst.total_wanted_done = m_size_on_disk;\n+\t\t\tst.total_wanted = m_size_on_disk;\n+\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done);\n+\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted);\n+\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size());\n+\t\t\treturn;\n+\t\t}\n+\t\telse if (!has_picker())\n+\t\t{\n+\t\t\tst.total_done = 0;\n+\t\t\tst.total_wanted_done = 0;\n+
    relevance 3../src/torrent.cpp:4886should this alert have an error code in it?

    should this alert have an error code in it?

    ../src/torrent.cpp:4886

    \t\ton_remove_peers();\n+\t\tTORRENT_ASSERT(m_connections.empty());\n+\n+\t\t// post a message to the main thread to destruct\n+\t\t// the torrent object from there\n+\t\tif (m_storage)\n+\t\t{\n+\t\t\ttry {\n+\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage\n+\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this()));\n+\t\t\t}\n+\t\t\tcatch (std::exception const& e)\n+\t\t\t{\n+\t\t\t\tTORRENT_UNUSED(e);\n+\t\t\t\tm_storage.reset();\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n+#endif\n+\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n+\t\t\t\t// good idea to post it here, even though we failed\n+
    \t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+
    \t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\t}\n+\t\t\tm_ses.deferred_submit_jobs();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n+\t\t\t\t, info_hash(), get_userdata());\n+\t\t}\n+\n+
    relevance 3../src/torrent.cpp:4956this 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:4956

    \t}\n+\n+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+\tvoid torrent::set_super_seeding(bool const on)\n+\t{\n+\t\tif (on == m_super_seeding) return;\n+\n+\t\tm_super_seeding = on;\n+\t\tset_need_save_resume(torrent_handle::if_state_changed);\n+\t\tstate_updated();\n+\n+\t\tif (m_super_seeding) return;\n+\n+\t\t// disable super seeding for all peers\n+\t\tfor (auto pc : *this)\n+\t\t{\n+\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1));\n+\t\t}\n+\t}\n+\n+
    \tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n+
    \t{\n+\t\t// return a piece with low availability that is not in\n+\t\t// the bitfield and that is not currently being super\n+\t\t// seeded by any peer\n+\t\tTORRENT_ASSERT(m_super_seeding);\n+\n+\t\t// do a linear search from the first piece\n+\t\tint min_availability = 9999;\n+\t\tstd::vector<piece_index_t> avail_vec;\n+\t\tfor (auto const i : m_torrent_file->piece_range())\n+\t\t{\n+\t\t\tif (bits[i]) continue;\n+\n+\t\t\tint availability = 0;\n+\t\t\tfor (auto pc : *this)\n+\t\t\t{\n+\t\t\t\tif (pc->super_seeded_piece(i))\n+\t\t\t\t{\n+\t\t\t\t\t// avoid super-seeding the same piece to more than one\n+\t\t\t\t\t// peer if we can avoid it. Do this by artificially\n+\t\t\t\t\t// increase the availability\n+\t\t\t\t\tavailability = 999;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\tif (pc->has_piece(i)) ++availability;\n+\t\t\t}\n+\t\t\tif (availability > min_availability) continue;\n+\t\t\tif (availability == min_availability)\n+\t\t\t{\n+\t\t\t\tavail_vec.push_back(i);\n+
    relevance 3../src/session_impl.cpp:1142closing the udp sockets here means that the uTP connections cannot be closed gracefully

    closing the udp sockets here means that\n the uTP connections cannot be closed gracefully

    ../src/session_impl.cpp:1142

    #ifndef TORRENT_DISABLE_LOGGING\n \t\tsession_log(\" aborting all connections (%d)\", int(m_connections.size()));\n #endif\n \t\t// abort all connections\n \t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n \t\t{\n \t\t\tpeer_connection* p = (*i).get();\n@@ -719,15 +1201,15 @@\n \n \t\t// it's OK to detach the threads here. The disk_io_thread\n \t\t// has an internal counter and won't release the network\n \t\t// thread until they're all dead (via m_work).\n \t\tm_disk_thread->abort(false);\n \n \t\t// now it's OK for the network thread to exit\n-
    relevance 3../src/session_impl.cpp:1636the logic in this if-block should be factored out into a separate function. At least most of it

    the logic in this if-block should be factored out into a\n+relevance 3../src/session_impl.cpp:1636the 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:1636

    \t\t\t\t, (lep.flags & listen_socket_t::local_network) ? \"local-network \" : \"\"\n \t\t\t\t, (lep.flags & listen_socket_t::accept_incoming) ? \"accept-incoming \" : \"no-incoming \"\n \t\t\t\t, (lep.flags & listen_socket_t::was_expanded) ? \"expanded-ip \" : \"\"\n \t\t\t\t, (lep.flags & listen_socket_t::proxy) ? \"proxy \" : \"\");\n \t\t}\n #endif\n \n@@ -771,15 +1253,15 @@\n \t\t\t\terror_code err;\n \t\t\t\tret->sock->set_option(exclusive_address_use(true), err);\n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\t\tif (err && should_log())\n \t\t\t\t{\n \t\t\t\t\tsession_log(\"failed enable exclusive address use on listen socket: %s\"\n \t\t\t\t\t\t, err.message().c_str());\n-
    relevance 3../src/session_impl.cpp:2604it would be neat if the utp socket manager would handle ICMP errors too

    it would be neat if the utp socket manager would\n+relevance 3../src/session_impl.cpp:2604it 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:2604

    \n \t\tstd::shared_ptr<session_udp_socket> s = socket.lock();\n \t\tif (!s) return;\n \n \t\tstruct utp_socket_manager& mgr =\n #ifdef TORRENT_SSL_PEERS\n \t\t\tssl == transport::ssl ? m_ssl_utp_socket_manager :\n@@ -823,15 +1305,15 @@\n \t\t\t\t\t// if it wasn't a uTP packet, try the other users of the UDP\n \t\t\t\t\t// socket\n \t\t\t\t\tbool handled = false;\n #ifndef TORRENT_DISABLE_DHT\n \t\t\t\t\tauto listen_socket = ls.lock();\n \t\t\t\t\tif (m_dht && buf.size() > 20\n \t\t\t\t\t\t&& buf.front() == 'd'\n-
    relevance 3../src/session_impl.cpp:4153it would probably make sense to have a separate list of peers that are eligible for optimistic unchoke, similar to the torrents perhaps this could even iterate over the pool allocators of torrent_peer objects. It could probably be done in a single pass and collect the n best candidates. maybe just a queue of peers would make even more sense, just pick the next peer in the queue for unchoking. It would be O(1).

    it would probably make sense to have a separate list of peers\n+relevance 3../src/session_impl.cpp:4153it 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:4153

    \t}\n \n@@ -865,15 +1347,15 @@\n \t\t\t{\n \t\t\t\tprev_opt_unchoke.push_back(pi);\n \t\t\t}\n \n \t\t\ttorrent const* t = p->associated_torrent().lock().get();\n \t\t\tif (!t) continue;\n \n-
    relevance 3../src/session_impl.cpp:4176peers should know whether their torrent is paused or not, instead of having to ask it over and over again

    peers should know whether their torrent is paused or not,\n+relevance 3../src/session_impl.cpp:4176peers 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:4176

    \t\t// collect the currently optimistically unchoked peers here, so we can\n \t\t// choke them when we've found new optimistic unchoke candidates.\n \t\tstd::vector<torrent_peer*> prev_opt_unchoke;\n \n \t\tfor (auto& i : m_connections)\n \t\t{\n \t\t\tpeer_connection* const p = i.get();\n@@ -917,15 +1399,15 @@\n \t\tstd::partial_sort(opt_unchoke.begin()\n \t\t\t, opt_unchoke.begin() + num_opt_unchoke\n \t\t\t, opt_unchoke.end()\n #ifndef TORRENT_DISABLE_EXTENSIONS\n \t\t\t, last_optimistic_unchoke_cmp(m_ses_extensions[plugins_optimistic_unchoke_idx])\n #else\n \t\t\t, last_optimistic_unchoke_cmp()\n-
    relevance 3../src/session_impl.cpp:4422there should be a pre-calculated list of all peers eligible for unchoking

    there should be a pre-calculated list of all peers eligible for\n+relevance 3../src/session_impl.cpp:4422there 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:4422

    \t}\n \n \tvoid session_impl::recalculate_unchoke_slots()\n \t{\n \t\tTORRENT_ASSERT(is_single_thread());\n \n \t\ttime_point const now = aux::time_now();\n@@ -969,15 +1451,15 @@\n \t\t\t\t\tp->reset_choke_counters();\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tif (pi && pi->optimistically_unchoked)\n \t\t\t\t{\n \t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1);\n \t\t\t\t\tpi->optimistically_unchoked = false;\n-
    relevance 3../src/session_impl.cpp:6134use public_key here instead of std::array

    use public_key here instead of std::array

    ../src/session_impl.cpp:6134

    \n+
    relevance 3../src/session_impl.cpp:6134use public_key here instead of std::array

    use public_key here instead of std::array

    ../src/session_impl.cpp:6134

    \n \tvoid session_impl::dht_get_immutable_item(sha1_hash const& target)\n \t{\n \t\tif (!m_dht) return;\n \t\tm_dht->get_item(target, std::bind(&session_impl::get_immutable_callback\n \t\t\t, this, target, _1));\n \t}\n \n@@ -1020,465 +1502,15 @@\n \t\t\t\talerts.emplace_alert<dht_put_alert>(pk.bytes, sig.bytes\n \t\t\t\t\t, std::move(salt), seq.value, num);\n \t\t\t}\n \t\t}\n \n \t\tvoid put_mutable_callback(dht::item& i\n \t\t\t, std::function<void(entry&, std::array<char, 64>&\n-
    relevance 3../src/torrent.cpp:418we 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:418

    \t\t// --- V2 HASHES ---\n-\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2())\n-\t\t{\n-\t\t\tif (!p.merkle_trees.empty())\n-\t\t\t\tload_merkle_trees(\n-\t\t\t\t\tstd::move(p.merkle_trees)\n-\t\t\t\t\t, std::move(p.merkle_tree_mask)\n-\t\t\t\t\t, std::move(p.verified_leaf_hashes));\n-\n-\t\t\t// we really don't want to store extra copies of the trees\n-\t\t\tTORRENT_ASSERT(p.merkle_trees.empty());\n-\t\t}\n-\n-\t\tif (valid_metadata())\n-\t\t{\n-\t\t\tinc_stats_counter(counters::num_total_pieces_added\n-\t\t\t\t, m_torrent_file->num_pieces());\n-\t\t}\n-\n-
    \t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n-
    \t}\n-\n-\tvoid torrent::load_merkle_trees(\n-\t\taux::vector<std::vector<sha256_hash>, file_index_t> trees_import\n-\t\t, aux::vector<std::vector<bool>, file_index_t> mask\n-\t\t, aux::vector<std::vector<bool>, file_index_t> verified)\n-\t{\n-\t\tauto const& fs = m_torrent_file->orig_files();\n-\n-\t\tstd::vector<bool> const empty_verified;\n-\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i)\n-\t\t{\n-\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0)\n-\t\t\t\tcontinue;\n-\n-\t\t\tif (i >= trees_import.end_index()) break;\n-\t\t\tstd::vector<bool> const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i];\n-\t\t\tif (i < mask.end_index() && !mask[i].empty())\n-\t\t\t{\n-\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false);\n-\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask);\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask);\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tvoid torrent::inc_stats_counter(int c, int value)\n-
    relevance 3../src/torrent.cpp:714assert there are no outstanding async operations on this torrent

    assert there are no outstanding async operations on this\n-torrent

    ../src/torrent.cpp:714

    #endif\n-\n-\t\tif (!m_ses.dht()) return false;\n-\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false;\n-\t\tif (!m_announce_to_dht) return false;\n-\t\tif (m_paused) return false;\n-\n-\t\t// don't announce private torrents\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false;\n-\t\tif (m_trackers.empty()) return true;\n-\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true;\n-\n-\t\treturn std::none_of(m_trackers.begin(), m_trackers.end()\n-\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); });\n-\t}\n-\n-#endif\n-\n-\ttorrent::~torrent()\n-\t{\n-
    \n-
    #if TORRENT_USE_ASSERTS\n-\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n-\t\t{\n-\t\t\tif (!m_links[i].in_list()) continue;\n-\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n-\t\t}\n-#endif\n-\n-\t\t// The invariant can't be maintained here, since the torrent\n-\t\t// is being destructed, all weak references to it have been\n-\t\t// reset, which means that all its peers already have an\n-\t\t// invalidated torrent pointer (so it cannot be verified to be correct)\n-\n-\t\t// i.e. the invariant can only be maintained if all connections have\n-\t\t// been closed by the time the torrent is destructed. And they are\n-\t\t// supposed to be closed. So we can still do the invariant check.\n-\n-\t\t// however, the torrent object may be destructed from the main\n-\t\t// thread when shutting down, if the disk cache has references to it.\n-\t\t// this means that the invariant check that this is called from the\n-\t\t// network thread cannot be maintained\n-\n-\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0});\n-\t\tTORRENT_ASSERT(m_connections.empty());\n-\t\t// just in case, make sure the session accounting is kept right\n-\t\tfor (auto p : m_connections)\n-\t\t\tm_ses.close_connection(p);\n-\t}\n-\n-\tvoid torrent::read_piece(piece_index_t const piece)\n-
    relevance 3../src/torrent.cpp:1326there'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:1326

    \t\tpiece_picker& m_picker;\n-\t\tpiece_index_t m_piece;\n-\t};\n-\n-\tvoid torrent::add_piece_async(piece_index_t const piece\n-\t\t, std::vector<char> data, add_piece_flags_t const flags)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\t// make sure the piece index is correct\n-\t\tif (piece >= torrent_file().end_piece())\n-\t\t\treturn;\n-\n-\t\t// make sure the piece size is correct\n-\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece)))\n-\t\t\treturn;\n-\n-\t\tadd_piece(piece, data.data(), flags);\n-\t}\n-\n-
    \tvoid torrent::add_piece(piece_index_t const piece, char const* data\n-
    \t\t, add_piece_flags_t const flags)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\t// make sure the piece index is correct\n-\t\tif (piece >= torrent_file().end_piece())\n-\t\t\treturn;\n-\n-\t\tint const piece_size = m_torrent_file->piece_size(piece);\n-\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size();\n-\n-\t\tif (m_deleted) return;\n-\n-\t\t// avoid crash trying to access the picker when there is none\n-\t\tif (m_have_all && !has_picker()) return;\n-\n-\t\t// we don't support clobbering the piece picker while checking the\n-\t\t// files. We may end up having the same piece multiple times\n-\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files\n-\t\t\t&& state() != torrent_status::checking_resume_data);\n-\t\tif (state() == torrent_status::checking_files\n-\t\t\t|| state() == torrent_status::checking_resume_data)\n-\t\t\treturn;\n-\n-\t\tneed_picker();\n-\n-\t\tif (picker().have_piece(piece)\n-\t\t\t&& !(flags & torrent_handle::overwrite_existing))\n-\t\t\treturn;\n-\n-
    relevance 3../src/torrent.cpp:3951this could probably be pulled out into a free function

    this could probably be pulled out into a free function

    ../src/torrent.cpp:3951

    \tstd::int64_t calc_bytes(file_storage const& fs, piece_count const& pc)\n-\t{\n-\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true));\n-\n-\t\t// if we have 0 pieces, we can't have any pad blocks either\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0));\n-\n-\t\t// if we have all pieces, we must also have the last one\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false));\n-\n-\t\t// every block should not be a pad block\n-\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length());\n-\n-\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length()\n-\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0)\n-\t\t\t- std::int64_t(pc.pad_bytes);\n-\t}\n-\n-\t// fills in total_wanted, total_wanted_done and total_done\n-
    \tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n-
    \t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tst.total_done = 0;\n-\t\tst.total_wanted_done = 0;\n-\t\tst.total_wanted = m_size_on_disk;\n-\n-\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size());\n-\t\tTORRENT_ASSERT(st.total_wanted >= 0);\n-\n-\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0);\n-\t\tif (!valid_metadata()) return;\n-\n-\t\tif (m_seed_mode || is_seed())\n-\t\t{\n-\t\t\t// once we're a seed and remove the piece picker, we stop tracking\n-\t\t\t// piece- and file priority. We consider everything as being\n-\t\t\t// \"wanted\"\n-\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes;\n-\t\t\tst.total_wanted_done = m_size_on_disk;\n-\t\t\tst.total_wanted = m_size_on_disk;\n-\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done);\n-\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted);\n-\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size());\n-\t\t\treturn;\n-\t\t}\n-\t\telse if (!has_picker())\n-\t\t{\n-\t\t\tst.total_done = 0;\n-\t\t\tst.total_wanted_done = 0;\n-
    relevance 3../src/torrent.cpp:4886should this alert have an error code in it?

    should this alert have an error code in it?

    ../src/torrent.cpp:4886

    \t\ton_remove_peers();\n-\t\tTORRENT_ASSERT(m_connections.empty());\n-\n-\t\t// post a message to the main thread to destruct\n-\t\t// the torrent object from there\n-\t\tif (m_storage)\n-\t\t{\n-\t\t\ttry {\n-\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage\n-\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this()));\n-\t\t\t}\n-\t\t\tcatch (std::exception const& e)\n-\t\t\t{\n-\t\t\t\tTORRENT_UNUSED(e);\n-\t\t\t\tm_storage.reset();\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n-#endif\n-\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n-\t\t\t\t// good idea to post it here, even though we failed\n-
    \t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-
    \t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\t}\n-\t\t\tm_ses.deferred_submit_jobs();\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n-\t\t\t\t, info_hash(), get_userdata());\n-\t\t}\n-\n-
    relevance 3../src/torrent.cpp:4956this 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:4956

    \t}\n-\n-#ifndef TORRENT_DISABLE_SUPERSEEDING\n-\tvoid torrent::set_super_seeding(bool const on)\n-\t{\n-\t\tif (on == m_super_seeding) return;\n-\n-\t\tm_super_seeding = on;\n-\t\tset_need_save_resume(torrent_handle::if_state_changed);\n-\t\tstate_updated();\n-\n-\t\tif (m_super_seeding) return;\n-\n-\t\t// disable super seeding for all peers\n-\t\tfor (auto pc : *this)\n-\t\t{\n-\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1));\n-\t\t}\n-\t}\n-\n-
    \tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n-
    \t{\n-\t\t// return a piece with low availability that is not in\n-\t\t// the bitfield and that is not currently being super\n-\t\t// seeded by any peer\n-\t\tTORRENT_ASSERT(m_super_seeding);\n-\n-\t\t// do a linear search from the first piece\n-\t\tint min_availability = 9999;\n-\t\tstd::vector<piece_index_t> avail_vec;\n-\t\tfor (auto const i : m_torrent_file->piece_range())\n-\t\t{\n-\t\t\tif (bits[i]) continue;\n-\n-\t\t\tint availability = 0;\n-\t\t\tfor (auto pc : *this)\n-\t\t\t{\n-\t\t\t\tif (pc->super_seeded_piece(i))\n-\t\t\t\t{\n-\t\t\t\t\t// avoid super-seeding the same piece to more than one\n-\t\t\t\t\t// peer if we can avoid it. Do this by artificially\n-\t\t\t\t\t// increase the availability\n-\t\t\t\t\tavailability = 999;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\tif (pc->has_piece(i)) ++availability;\n-\t\t\t}\n-\t\t\tif (availability > min_availability) continue;\n-\t\t\tif (availability == min_availability)\n-\t\t\t{\n-\t\t\t\tavail_vec.push_back(i);\n-
    relevance 3../src/peer_connection.cpp:3119instead 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:3119

    \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-#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-
    \t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-
    \t\tif (!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<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-\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-\t\tif (m_outstanding_writing_bytes == 0\n-
    relevance 3../src/peer_connection.cpp:4027once 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:4027

    \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<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\n-\t\tif (m_disconnecting) return;\n-\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\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-\t\t\t{\n-
    relevance 3../src/peer_connection.cpp:4713new_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:4713

    \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-
    \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\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<torrent> 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-#ifndef TORRENT_DISABLE_LOGGING\n-
    relevance 3../src/session_handle.cpp:672expose the sequence_number, public_key, secret_key and signature types to the client

    expose the sequence_number, public_key, secret_key and signature\n+relevance 3../src/session_handle.cpp:672expose 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:672

    \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@@ -1522,46 +1554,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 #else\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/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,165 @@\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.hpp:1438factor 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_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+\t\t// ``add_tracker()`` will look if the specified tracker is already in the\n+\t\t// set. If it is, it doesn't do anything. If it's not in the current set\n+\t\t// of trackers, it will insert it in the tier specified in the\n+\t\t// announce_entry.\n+\t\t//\n+\t\t// The updated set of trackers will be saved in the resume data, and when\n+\t\t// a torrent is started with resume data, the trackers from the resume\n+\t\t// data will replace the original ones.\n+\t\tstd::vector<announce_entry> trackers() const;\n+\t\tvoid replace_trackers(std::vector<announce_entry> const&) const;\n+\t\tvoid add_tracker(announce_entry const&) const;\n+\t\tvoid post_trackers() const;\n+\n+
    \n+
    \t\t// ``add_url_seed()`` adds another url to the torrent's list of url\n+\t\t// seeds. If the given url already exists in that list, the call has no\n+\t\t// effect. The torrent will connect to the server and try to download\n+\t\t// pieces from it, unless it's paused, queued, checking or seeding.\n+\t\t// ``remove_url_seed()`` removes the given url if it exists already.\n+\t\t// ``url_seeds()`` return a set of the url seeds currently in this\n+\t\t// torrent. Note that URLs that fails may be removed automatically from\n+\t\t// the list.\n+\t\t//\n+\t\t// See http-seeding_ for more information.\n+\t\tvoid add_url_seed(std::string const& url) const;\n+\t\tvoid remove_url_seed(std::string const& url) const;\n+\t\tstd::set<std::string> url_seeds() const;\n+\n+\t\t// These functions are identical as the ``*_url_seed()`` variants, but\n+\t\t// they operate on `BEP 17`_ web seeds instead of `BEP 19`_.\n+\t\t//\n+\t\t// See http-seeding_ for more information.\n+\t\tvoid add_http_seed(std::string const& url) const;\n+\t\tvoid remove_http_seed(std::string const& url) const;\n+\t\tstd::set<std::string> http_seeds() const;\n+\n+\t\t// add the specified extension to this torrent. The ``ext`` argument is\n+\t\t// a function that will be called from within libtorrent's context\n+\t\t// passing in the internal torrent object and the specified userdata\n+\t\t// pointer. The function is expected to return a shared pointer to\n+\t\t// a torrent_plugin instance.\n+\t\tvoid add_extension(\n+\t\t\tstd::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext\n+\t\t\t, client_data_t userdata = client_data_t{});\n+
    relevance 3../include/libtorrent/web_peer_connection.hpp:119if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and release_disk_receive_buffer

    if we make this be a disk_buffer_holder instead\n+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+\t\t}\n+\n+\t\tint last_payload_downloaded() const\n+\t\t{ return m_stat[download_payload].counter(); }\n+\t\tint last_payload_uploaded() const\n+\t\t{ return m_stat[upload_payload].counter(); }\n+\t\tint last_protocol_downloaded() const\n+\t\t{ return m_stat[download_protocol].counter(); }\n+\t\tint last_protocol_uploaded() const\n+\t\t{ return m_stat[upload_protocol].counter(); }\n+\n+\t\t// these are the channels we keep stats for\n+\t\tenum\n+\t\t{\n+
    \t\t\tupload_payload,\n+
    \t\t\tupload_protocol,\n+\t\t\tdownload_payload,\n+\t\t\tdownload_protocol,\n+\t\t\tupload_ip_protocol,\n+\t\t\tdownload_ip_protocol,\n+\t\t\tnum_channels\n+\t\t};\n+\n+\t\tvoid clear()\n+\t\t{\n+\t\t\tfor (int i = 0; i < num_channels; ++i)\n+\t\t\t\tm_stat[i].clear();\n+\t\t}\n+\n+\t\tstat_channel const& operator[](int i) const\n+\t\t{\n+\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels);\n+\t\t\treturn m_stat[i];\n+\t\t}\n+\n+\tprivate:\n+\n+\t\tstat_channel m_stat[num_channels];\n+\t};\n+\n+}\n+\n+#endif // TORRENT_STAT_HPP_INCLUDED\n+
    relevance 3../include/libtorrent/torrent.hpp:1438factor 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:1438

    #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@@ -1657,15 +1807,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:1498factor 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:1498factor 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:1498

    \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@@ -1709,65 +1859,15 @@\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/stat.hpp:257everything but payload counters and rates could probably be removed from here

    everything but payload counters and rates could probably be\n-removed from here

    ../include/libtorrent/stat.hpp:257

    \t\t// peer_connection is opened and have some previous\n-\t\t// transfers from earlier connections.\n-\t\tvoid add_stat(std::int64_t downloaded, std::int64_t uploaded)\n-\t\t{\n-\t\t\tm_stat[download_payload].offset(downloaded);\n-\t\t\tm_stat[upload_payload].offset(uploaded);\n-\t\t}\n-\n-\t\tint last_payload_downloaded() const\n-\t\t{ return m_stat[download_payload].counter(); }\n-\t\tint last_payload_uploaded() const\n-\t\t{ return m_stat[upload_payload].counter(); }\n-\t\tint last_protocol_downloaded() const\n-\t\t{ return m_stat[download_protocol].counter(); }\n-\t\tint last_protocol_uploaded() const\n-\t\t{ return m_stat[upload_protocol].counter(); }\n-\n-\t\t// these are the channels we keep stats for\n-\t\tenum\n-\t\t{\n-
    \t\t\tupload_payload,\n-
    \t\t\tupload_protocol,\n-\t\t\tdownload_payload,\n-\t\t\tdownload_protocol,\n-\t\t\tupload_ip_protocol,\n-\t\t\tdownload_ip_protocol,\n-\t\t\tnum_channels\n-\t\t};\n-\n-\t\tvoid clear()\n-\t\t{\n-\t\t\tfor (int i = 0; i < num_channels; ++i)\n-\t\t\t\tm_stat[i].clear();\n-\t\t}\n-\n-\t\tstat_channel const& operator[](int i) const\n-\t\t{\n-\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels);\n-\t\t\treturn m_stat[i];\n-\t\t}\n-\n-\tprivate:\n-\n-\t\tstat_channel m_stat[num_channels];\n-\t};\n-\n-}\n-\n-#endif // TORRENT_STAT_HPP_INCLUDED\n-
    relevance 3../include/libtorrent/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@@ -1810,15 +1910,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+
    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@@ -1861,114 +1961,14 @@\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_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-\t\t// ``add_tracker()`` will look if the specified tracker is already in the\n-\t\t// set. If it is, it doesn't do anything. If it's not in the current set\n-\t\t// of trackers, it will insert it in the tier specified in the\n-\t\t// announce_entry.\n-\t\t//\n-\t\t// The updated set of trackers will be saved in the resume data, and when\n-\t\t// a torrent is started with resume data, the trackers from the resume\n-\t\t// data will replace the original ones.\n-\t\tstd::vector<announce_entry> trackers() const;\n-\t\tvoid replace_trackers(std::vector<announce_entry> const&) const;\n-\t\tvoid add_tracker(announce_entry const&) const;\n-\t\tvoid post_trackers() const;\n-\n-
    \n-
    \t\t// ``add_url_seed()`` adds another url to the torrent's list of url\n-\t\t// seeds. If the given url already exists in that list, the call has no\n-\t\t// effect. The torrent will connect to the server and try to download\n-\t\t// pieces from it, unless it's paused, queued, checking or seeding.\n-\t\t// ``remove_url_seed()`` removes the given url if it exists already.\n-\t\t// ``url_seeds()`` return a set of the url seeds currently in this\n-\t\t// torrent. Note that URLs that fails may be removed automatically from\n-\t\t// the list.\n-\t\t//\n-\t\t// See http-seeding_ for more information.\n-\t\tvoid add_url_seed(std::string const& url) const;\n-\t\tvoid remove_url_seed(std::string const& url) const;\n-\t\tstd::set<std::string> url_seeds() const;\n-\n-\t\t// These functions are identical as the ``*_url_seed()`` variants, but\n-\t\t// they operate on `BEP 17`_ web seeds instead of `BEP 19`_.\n-\t\t//\n-\t\t// See http-seeding_ for more information.\n-\t\tvoid add_http_seed(std::string const& url) const;\n-\t\tvoid remove_http_seed(std::string const& url) const;\n-\t\tstd::set<std::string> http_seeds() const;\n-\n-\t\t// add the specified extension to this torrent. The ``ext`` argument is\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/kademlia/routing_table.hpp:153to improve memory locality and scanning performance, turn the routing table into a single vector with boundaries for the nodes instead. Perhaps replacement nodes should be in a separate vector.

    to improve memory locality and scanning performance, turn the\n routing table into a single vector with boundaries for the nodes instead.\n Perhaps replacement nodes should be in a separate vector.

    ../include/libtorrent/kademlia/routing_table.hpp:153

    // * Nodes are not marked as being stale, they keep a counter\n // \tthat tells how many times in a row they have failed. When\n // \ta new node is to be inserted, the node that has failed\n // \tthe most times is replaced. If none of the nodes in the\n // \tbucket has failed, then it is put in the replacement\n@@ -2066,15 +2066,66 @@\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_dht.cpp:1642test num_global_nodes

    test num_global_nodes

    ../test/test_dht.cpp:1642

    relevance 2../test/test_dht.cpp:1643test need_refresh

    test need_refresh

    ../test/test_dht.cpp:1643

    \n+
    relevance 2../test/test_storage.cpp:639split this test up into smaller parts

    split this test up into smaller parts

    ../test/test_storage.cpp:639

    \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 \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@@ -2117,15 +2168,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@@ -2168,119 +2219,230 @@\n \tbool ret = verify_message(ent, msg_desc, msg_keys, error_string);\n \tTEST_CHECK(ret);\n \tTEST_CHECK(msg_keys[0]);\n \tif (msg_keys[0]) TEST_EQUAL(msg_keys[0].string_value(), \"test\");\n \tTEST_CHECK(msg_keys[1]);\n \tTEST_CHECK(msg_keys[2]);\n \tif (msg_keys[2]) TEST_EQUAL(msg_keys[2].string_value(), \"test2\");\n-
    relevance 2../test/test_storage.cpp:639split this test up into smaller parts

    split this test up into smaller parts

    ../test/test_storage.cpp:639

    \tio->submit_jobs();\n-\tios.restart();\n-\trun_until(ios, done);\n+
    relevance 2../test/test_piece_picker.cpp:2825test 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:2825

    relevance 2../src/peer_connection.cpp:2548this 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:2548

    \t\t\t}\n+#endif\n \n-\tTEST_EQUAL(oversized, bool(flags & test_oversized));\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-\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+\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->has_piece_passed(r.piece), peer_interested, false);\n+\t\t\t}\n \n-\tio->abort(true);\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-
    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+\t\t\treturn;\n+\t\t}\n \n-\tstd::shared_ptr<torrent_info> info;\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-\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+\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-\tdelete_dirs(\"temp_storage\");\n+\t\tif (m_choked && fast_idx == -1)\n+\t\t{\n+
    relevance 2../src/peer_connection.cpp:3293since 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:3293

    \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-\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+\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r);\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:2825test 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:2825

    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+\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-\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+\t\t\tif (m_requests.empty())\n+\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1);\n \n-\tstd::string dht_immutable_item_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\"\n-\t\t\t, aux::to_hex(target).c_str()\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n+\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-
    \tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n-
    \t\t, std::array<char, 32> const& k\n-\t\t, std::array<char, 64> const& sig\n-\t\t, std::int64_t sequence\n-\t\t, string_view s\n-\t\t, entry i\n-\t\t, bool a)\n-\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a)\n-\t{}\n+\t// -----------------------------\n+\t// --------- DHT PORT ----------\n+\t// -----------------------------\n \n-\tstd::string dht_mutable_item_alert::message() const\n+\tvoid peer_connection::incoming_dht_port(int const listen_port)\n \t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\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\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n-\t\t\t, aux::to_hex(key).c_str()\n-\t\t\t, salt.c_str()\n-\t\t\t, seq\n-\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n+\t\tTORRENT_UNUSED(listen_port);\n #endif\n \t}\n \n-\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n)\n-\t\t: target(t)\n-\t\t, public_key()\n-\t\t, signature()\n-\t\t, salt()\n-
    relevance 2../src/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// -----------------------------\n+\t// --------- HAVE ALL ----------\n+\t// -----------------------------\n+\n+\tvoid peer_connection::incoming_have_all()\n+\t{\n+relevance 2../src/peer_connection.cpp:4958use 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:4958

    \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/instantiate_connection.cpp:44peer_connection and tracker_connection should probably be flags

    peer_connection and tracker_connection should probably be flags

    ../src/instantiate_connection.cpp:44

    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n+*/\n+\n+#include \"libtorrent/socket.hpp\"\n+#include \"libtorrent/aux_/socket_type.hpp\"\n+#include \"libtorrent/aux_/utp_socket_manager.hpp\"\n+#include \"libtorrent/aux_/instantiate_connection.hpp\"\n+#include \"libtorrent/aux_/utp_stream.hpp\"\n+#include \"libtorrent/ssl_stream.hpp\"\n+\n+namespace libtorrent { namespace aux {\n+\n+
    \taux::socket_type instantiate_connection(io_context& ios\n+
    \t\t, aux::proxy_settings const& ps\n+\t\t, void* ssl_context\n+\t\t, utp_socket_manager* sm\n+\t\t, bool peer_connection\n+\t\t, bool tracker_connection)\n+\t{\n+#if !TORRENT_USE_SSL\n+\t\tTORRENT_UNUSED(ssl_context);\n+#endif\n+\n+\t\tif (sm)\n+\t\t{\n+#if TORRENT_USE_SSL\n+\t\t\tif (ssl_context)\n+\t\t\t{\n+\t\t\t\tssl_stream<utp_stream> s(ios, *static_cast<ssl::context*>(ssl_context));\n+\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer()));\n+\t\t\t\treturn socket_type(std::move(s));\n+\t\t\t}\n+\t\t\telse\n+#endif\n+\t\t\t{\n+\t\t\t\tutp_stream s(ios);\n+\t\t\t\ts.set_impl(sm->new_utp_socket(&s));\n+\t\t\t\treturn socket_type(std::move(s));\n+\t\t\t}\n+\t\t}\n+#if TORRENT_USE_I2P\n+\t\telse if (ps.type == settings_pack::i2p_proxy)\n+\t\t{\n+
    relevance 2../src/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@@ -2326,168 +2488,328 @@\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/instantiate_connection.cpp:44peer_connection and tracker_connection should probably be flags

    peer_connection and tracker_connection should probably be flags

    ../src/instantiate_connection.cpp:44

    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#include \"libtorrent/socket.hpp\"\n-#include \"libtorrent/aux_/socket_type.hpp\"\n-#include \"libtorrent/aux_/utp_socket_manager.hpp\"\n-#include \"libtorrent/aux_/instantiate_connection.hpp\"\n-#include \"libtorrent/aux_/utp_stream.hpp\"\n-#include \"libtorrent/ssl_stream.hpp\"\n-\n-namespace libtorrent { namespace aux {\n+
    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-
    \taux::socket_type instantiate_connection(io_context& ios\n-
    \t\t, aux::proxy_settings const& ps\n-\t\t, void* ssl_context\n-\t\t, utp_socket_manager* sm\n-\t\t, bool peer_connection\n-\t\t, bool tracker_connection)\n-\t{\n-#if !TORRENT_USE_SSL\n-\t\tTORRENT_UNUSED(ssl_context);\n+\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 (sm)\n+\t\tif (ret == 0)\n \t\t{\n-#if TORRENT_USE_SSL\n-\t\t\tif (ssl_context)\n-\t\t\t{\n-\t\t\t\tssl_stream<utp_stream> s(ios, *static_cast<ssl::context*>(ssl_context));\n-\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer()));\n-\t\t\t\treturn socket_type(std::move(s));\n-\t\t\t}\n-\t\t\telse\n-#endif\n-\t\t\t{\n-\t\t\t\tutp_stream s(ios);\n-\t\t\t\ts.set_impl(sm->new_utp_socket(&s));\n-\t\t\t\treturn socket_type(std::move(s));\n-\t\t\t}\n+\t\t\tec.clear();\n+\t\t\treturn;\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/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+\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\treturn false;\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\tstd::shared_ptr<udp_tracker_connection> const p = i->second;\n-\t\t// on_receive() may remove the tracker connection from the list\n-\t\treturn p->on_receive(ep, buf);\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-\tvoid tracker_manager::incoming_error(error_code const&\n-\t\t, udp::endpoint const&)\n+\tbool is_directory(std::string const& f, error_code& ec)\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    \t}\n-
    \n-\tbool tracker_manager::incoming_packet(string_view const hostname\n-\t\t, span<char const> const buf)\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 \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\t// ignore packets smaller than 8 bytes\n-\t\tif (buf.size() < 16) return false;\n+\t\tbdecode_node ret;\n+\t\tec.clear();\n \n-\t\t// the first word is the action, if it's not [0, 3]\n-\t\t// it's not a valid udp tracker response\n-\t\tspan<const char> ptr = buf;\n-\t\tstd::uint32_t const action = aux::read_uint32(ptr);\n-\t\tif (action > 3) return false;\n+\t\tif (buffer.size() > bdecode_token::max_offset)\n+\t\t{\n+\t\t\tif (error_pos) *error_pos = 0;\n+\t\t\tec = bdecode_errors::limit_exceeded;\n+\t\t\treturn ret;\n+\t\t}\n \n-\t\tstd::uint32_t const transaction = aux::read_uint32(ptr);\n-\t\tauto const i = m_udp_conns.find(transaction);\n+\t\t// this is the stack of bdecode_token indices, into m_tokens.\n+\t\t// sp is the stack pointer, as index into the array, stack\n+\t\tint sp = 0;\n+\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit);\n \n-\t\tif (i == m_udp_conns.end())\n+
    \t\tchar const* start = buffer.data();\n+
    \t\tchar const* end = start + buffer.size();\n+\t\tchar const* const orig_start = start;\n+\n+\t\tif (start == end)\n+\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\n+\t\twhile (start <= end)\n \t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t// now, this may not have been meant to be a tracker response,\n-\t\t\t// but chances are pretty good, so it's probably worth logging\n-\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \"\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+\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\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/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\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/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-\tbool need_encoding(char const* str, int const len)\n+\tvoid alert_manager::maybe_notify(alert* a)\n \t{\n-\t\tfor (int i = 0; i < len; ++i)\n+\t\tif (m_alerts[m_generation].size() == 1)\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\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\treturn false;\n \t}\n \n-\tvoid convert_path_to_posix(std::string& path)\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\n \t{\n-\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n+\t\tm_ses_extensions.push_back(ext);\n \t}\n+#endif\n \n-
    \tstd::string read_until(char const*& str, char const delim, char const* end)\n-
    \t{\n-\t\tTORRENT_ASSERT(str <= end);\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/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 \n-\t\tstd::string ret;\n-\t\twhile (str != end && *str != delim)\n+\t\t\t\t// if we ended up copying the file, don't do anything during\n+\t\t\t\t// roll-back\n+\t\t\t\tif (copied_files[file_index]) continue;\n+\n+\t\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(file_index));\n+\t\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(file_index));\n+\n+\t\t\t\t// ignore errors when rolling back\n+\t\t\t\tstorage_error ignore;\n+\t\t\t\tmove_file(new_path, old_path, ignore);\n+\t\t\t}\n+\n+\t\t\treturn { status_t::fatal_disk_error, save_path };\n+\t\t}\n+\n+
    \n+
    \t\tstd::set<std::string> subdirs;\n+\t\tfor (auto const i : f.file_range())\n \t\t{\n-\t\t\tret += *str;\n-\t\t\t++str;\n+\t\t\t// files moved out to absolute paths are not moved\n+\t\t\tif (f.file_absolute_path(i)) continue;\n+\n+\t\t\tif (has_parent_path(f.file_path(i)))\n+\t\t\t\tsubdirs.insert(parent_path(f.file_path(i)));\n+\n+\t\t\t// if we ended up renaming the file instead of moving it, there's no\n+\t\t\t// need to delete the source.\n+\t\t\tif (copied_files[i] == false) continue;\n+\n+\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n+\n+\t\t\t// we may still have some files in old save_path\n+\t\t\t// eg. if (flags == dont_replace && exists(new_path))\n+\t\t\t// ignore errors when removing\n+\t\t\terror_code ignore;\n+\t\t\tremove(old_path, ignore);\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+\t\tfor (std::string const& s : subdirs)\n+\t\t{\n+\t\t\terror_code err;\n+\t\t\tstd::string subdir = combine_path(save_path, s);\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\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+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-\t\tstd::string msg;\n-\t\tstd::string escaped_path { escape_path(path) };\n-\t\t// reserve enough space so further append will\n-\t\t// only copy values to existing location\n-
    relevance 2../src/http_tracker_connection.cpp:479returning a bool here is redundant. Instead this function should return the peer_entry

    returning a bool here is redundant. Instead this function should\n+\t\t\t\t\tif (err)\n+\t\t\t\t\t{\n+\t\t\t\t\t\tec.file(idx);\n+\t\t\t\t\t\tec.operation = operation_t::mkdir;\n+\t\t\t\t\t\treturn false;\n+\t\t\t\t\t}\n+\n+\t\t\t\t\thard_link(s, file_path, err);\n+\t\t\t\t}\n+\n+\t\t\t\t// if the file already exists, that's not an error\n+\t\t\t\tif (err == boost::system::errc::file_exists)\n+\t\t\t\t\tcontinue;\n+\n+
    \t\t\t\tif (err)\n+
    \t\t\t\t{\n+\t\t\t\t\tec.ec = err;\n+\t\t\t\t\tec.file(idx);\n+\t\t\t\t\tec.operation = operation_t::file_hard_link;\n+\t\t\t\t\treturn false;\n+\t\t\t\t}\n+\t\t\t\tadded_files = true;\n+\t\t\t\tstat.set_dirty(idx);\n+\t\t\t}\n+\t\t}\n+#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n+\n+\t\tbool const seed = (rd.have_pieces.size() >= fs.num_pieces()\n+\t\t\t&& rd.have_pieces.all_set())\n+\t\t\t|| (rd.flags & torrent_flags::seed_mode);\n+\n+\t\tif (seed)\n+\t\t{\n+\t\t\tfor (file_index_t const file_index : fs.file_range())\n+\t\t\t{\n+\t\t\t\tif (fs.pad_file_at(file_index)) continue;\n+\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+\t\t\t\t\tcontinue;\n+\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/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@@ -2531,309 +2853,169 @@\n \t\t\treturn false;\n \t\t}\n \t\tret.hostname = i.string_value().to_string();\n \n \t\t// extract port\n \t\ti = info.dict_find_int(\"port\");\n \t\tif (!i)\n-
    relevance 2../src/session_impl.cpp:599is there a reason not to move all of this into init()? and just post it to the io_context?

    is there a reason not to move all of this into init()? and just\n-post it to the io_context?

    ../src/session_impl.cpp:599

    \ttry\n-#endif\n-\t{\n-\t\t(this->*f)(std::forward<Args>(a)...);\n-\t}\n-#ifndef BOOST_NO_EXCEPTIONS\n-\tcatch (system_error const& e) {\n-\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+
    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-\t\t// apply all m_settings to this session\n-\t\trun_all_updates(*this);\n-\t\treopen_listen_sockets(false);\n+\tstd::mutex udp_tracker_connection::m_cache_mutex;\n \n-#if TORRENT_USE_INVARIANT_CHECKS\n-\t\tcheck_invariant();\n-#endif\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-#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+\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\tentry& e = *eptr;\n-\t\t// make it a dict\n-\t\te.dict();\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 (flags & session::save_settings)\n+\t\tif (ec)\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\ttracker_connection::fail(ec, operation_t::parse_address);\n+\t\t\treturn;\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+\t\taux::session_settings const& settings = m_man.settings();\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+\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n \n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\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\text->save_state(*eptr);\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-
    relevance 2../src/session_impl.cpp:3880make 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:3880

    \t\tif (!m_dht_torrents.empty())\n+\t\telse\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+\t\t\tusing namespace std::placeholders;\n+\t\t\tADD_OUTSTANDING_ASYNC(\"udp_tracker_connection::name_lookup\");\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-\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+\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-\tvoid session_impl::on_lsd_announce(error_code const& e)\n+\tstd::string dht_immutable_item_alert::message() const\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:5513this 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:5513

    #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+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tchar msg[1050];\n+\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\"\n+\t\t\t, aux::to_hex(target).c_str()\n+\t\t\t, item.to_string().c_str());\n+\t\treturn msg;\n #endif\n \t}\n \n-\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+
    \tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n+
    \t\t, std::array<char, 32> const& k\n+\t\t, std::array<char, 64> const& sig\n+\t\t, std::int64_t sequence\n+\t\t, string_view s\n+\t\t, entry i\n+\t\t, bool a)\n+\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a)\n+\t{}\n \n-\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const\n+\tstd::string dht_mutable_item_alert::message() 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 (!(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:5553this 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:5553

    \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+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\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+\t\tchar msg[1050];\n+\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n+\t\t\t, aux::to_hex(key).c_str()\n+\t\t\t, salt.c_str()\n+\t\t\t, seq\n+\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n+\t\t\t, item.to_string().c_str());\n+\t\treturn msg;\n #endif\n \t}\n \n-
    \tstd::uint16_t session_impl::ssl_listen_port() const\n-
    \t{\n-\t\treturn ssl_listen_port(nullptr);\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/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-\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const\n+\tbool need_encoding(char const* str, int const len)\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\tfor (int i = 0; i < len; ++i)\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\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0)\n+\t\t\t\treturn true;\n+\t\t\t++str;\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:6388this 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:6388

    \t\treturn upload_rate_limit(m_local_peer_class);\n-\t}\n-\n-\tint session_impl::local_download_rate_limit() const\n-\t{\n-\t\treturn download_rate_limit(m_local_peer_class);\n-\t}\n-\n-\tint session_impl::upload_rate_limit_depr() const\n-\t{\n-\t\treturn upload_rate_limit(m_global_class);\n+\t\treturn false;\n \t}\n \n-\tint session_impl::download_rate_limit_depr() const\n+\tvoid convert_path_to_posix(std::string& path)\n \t{\n-\t\treturn download_rate_limit(m_global_class);\n+\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n \t}\n-#endif // DEPRECATE\n \n-\n-
    \tvoid session_impl::update_peer_dscp()\n+
    \tstd::string read_until(char const*& str, char const delim, char const* end)\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\tTORRENT_ASSERT(str <= end);\n+\n+\t\tstd::string ret;\n+\t\twhile (str != end && *str != delim)\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+\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-#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+\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\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+\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-#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/torrent.cpp:503post alert

    post alert

    ../src/torrent.cpp:503

    \t\tif (m_current_gauge_state != no_gauge_state)\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/torrent.cpp:503post alert

    post alert

    ../src/torrent.cpp:503

    \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@@ -2876,15 +3058,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:1842add 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:1842add 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:1842

    \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@@ -2928,15 +3110,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:4473use chrono type for time duration

    use chrono type for time duration

    ../src/torrent.cpp:4473

    \t\t\tif (trust_points > 8) trust_points = 8;\n+
    relevance 2../src/torrent.cpp:4473use chrono type for time duration

    use chrono type for time duration

    ../src/torrent.cpp:4473

    \t\t\tif (trust_points > 8) trust_points = 8;\n \t\t\tp->trust_points = trust_points;\n \t\t\tif (p->connection)\n \t\t\t{\n \t\t\t\tauto* peer = static_cast<peer_connection*>(p->connection);\n \t\t\t\tTORRENT_ASSERT(peer->m_in_use == 1337);\n \t\t\t\tpeer->received_valid_data(index);\n \t\t\t}\n@@ -2979,15 +3161,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:4900abort 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:4900abort 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:4900

    \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@@ -3031,15 +3213,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:8008if 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:8008if 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:8008

    \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@@ -3084,117 +3266,309 @@\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/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// 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\ttracker_connection::fail(ec, operation_t::parse_address);\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\taux::session_settings const& settings = m_man.settings();\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\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\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-\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+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\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\text->save_state(*eptr);\n \t\t}\n-\t\telse\n+
    relevance 2../src/session_impl.cpp:3880make 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:3880

    \t\tif (!m_dht_torrents.empty())\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/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+\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-\tbdecode_node bdecode(span<char const> buffer\n-\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit)\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\tbdecode_node ret;\n-\t\tec.clear();\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 (buffer.size() > bdecode_token::max_offset)\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:5513this 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:5513

    #ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (!node_list.empty() && nodes.empty())\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\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// 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+\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\tchar const* start = buffer.data();\n-
    \t\tchar const* end = start + buffer.size();\n-\t\tchar const* const orig_start = start;\n+
    \tstd::uint16_t session_impl::listen_port() const\n+
    \t{\n+\t\treturn listen_port(nullptr);\n+\t}\n \n-\t\tif (start == end)\n-\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\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\twhile (start <= end)\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 (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\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:5553this 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:5553

    \t\t\t\treturn 0;\n \n-\t\t\tif (sp >= depth_limit)\n-\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\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+#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-\t\t\t// look for a new token\n-\t\t\tchar const t = *start;\n+
    \tstd::uint16_t session_impl::ssl_listen_port() const\n+
    \t{\n+\t\treturn ssl_listen_port(nullptr);\n+\t}\n \n-\t\t\tint const current_frame = sp;\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\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\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\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:6388this 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:6388

    \t\treturn upload_rate_limit(m_local_peer_class);\n+\t}\n+\n+\tint session_impl::local_download_rate_limit() const\n+\t{\n+\t\treturn download_rate_limit(m_local_peer_class);\n+\t}\n+\n+\tint session_impl::upload_rate_limit_depr() const\n+\t{\n+\t\treturn upload_rate_limit(m_global_class);\n+\t}\n+\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+\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\tif (stack[current_frame - 1].state == 0)\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\t// the current parent is a dict and we are parsing a key.\n-
    relevance 2../src/piece_picker.cpp:2003make the 2048 limit configurable

    make the 2048 limit configurable

    ../src/piece_picker.cpp:2003

    \t// indicating which path thought the picker we took to arrive at the\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/piece_picker.cpp:2003make the 2048 limit configurable

    make the 2048 limit configurable

    ../src/piece_picker.cpp:2003

    \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@@ -3237,15 +3611,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:2600the 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:2600the 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:2600

    \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@@ -3289,15 +3663,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:3485it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_passed 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:3485it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_passed 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_passed\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:3485

    \t\tauto const state = m_piece_map[piece].download_queue();\n \t\tif (state == piece_pos::piece_open) return;\n \t\tauto const i = find_dl_piece(state, piece);\n \t\tif (i == m_downloads[state].end()) return;\n@@ -3344,15 +3718,66 @@\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+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+\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+\t\treturn p->on_receive(ep, buf);\n+\t}\n+\n+\tvoid tracker_manager::incoming_error(error_code const&\n+\t\t, udp::endpoint const&)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    \t}\n+
    \n+\tbool tracker_manager::incoming_packet(string_view const hostname\n+\t\t, span<char const> const buf)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\t// ignore packets smaller than 8 bytes\n+\t\tif (buf.size() < 16) return false;\n+\n+\t\t// the first word is the action, if it's not [0, 3]\n+\t\t// it's not a valid udp tracker response\n+\t\tspan<const char> ptr = buf;\n+\t\tstd::uint32_t const action = aux::read_uint32(ptr);\n+\t\tif (action > 3) return false;\n+\n+\t\tstd::uint32_t const transaction = aux::read_uint32(ptr);\n+\t\tauto const i = m_udp_conns.find(transaction);\n+\n+\t\tif (i == m_udp_conns.end())\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t// now, this may not have been meant to be a tracker response,\n+\t\t\t// but chances are pretty good, so it's probably worth logging\n+\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \"\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/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@@ -3397,440 +3822,66 @@\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/path.cpp:429test this on a FAT volume to see what error we get!

    test this on a FAT volume to see what error we get!

    ../src/path.cpp:429

    \t\t\t// it's possible CreateHardLink will copy the file internally too,\n-\t\t\t// if the filesystem does not support it.\n-\t\t\tec.assign(GetLastError(), system_category());\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// fall back to making a copy\n-#endif\n-#else\n-\t\t// assume posix's link() function exists\n-\t\tint ret = ::link(n_exist.c_str(), n_link.c_str());\n-\n-\t\tif (ret == 0)\n-\t\t{\n-\t\t\tec.clear();\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// most errors are passed through, except for the ones that indicate that\n-\t\t// hard links are not supported and require a copy.\n-
    \t\tif (errno != EMLINK\n-
    \t\t\t&& errno != EXDEV\n-#ifdef TORRENT_BEOS\n-\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link\n-\t\t\t&& errno != EPERM\n-#endif\n-\t\t\t)\n-\t\t{\n-\t\t\t// some error happened, report up to the caller\n-\t\t\tec.assign(errno, system_category());\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// fall back to making a copy\n-\n-#endif\n-\n-\t\t// if we get here, we should copy the file\n-\t\tstorage_error se;\n-\t\taux::copy_file(file, link, se);\n-\t\tec = se.ec;\n-\t}\n-\n-\tbool is_directory(std::string const& f, error_code& ec)\n-\t{\n-\t\tec.clear();\n-\t\terror_code e;\n-\t\tfile_status s;\n-\t\tstat_file(f, &s, e);\n-\t\tif (!e && s.mode & file_status::directory) return true;\n-\t\tec = e;\n-
    relevance 2../src/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-\n-\t\t\t\t// if we ended up copying the file, don't do anything during\n-\t\t\t\t// roll-back\n-\t\t\t\tif (copied_files[file_index]) continue;\n-\n-\t\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(file_index));\n-\t\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(file_index));\n-\n-\t\t\t\t// ignore errors when rolling back\n-\t\t\t\tstorage_error ignore;\n-\t\t\t\tmove_file(new_path, old_path, ignore);\n-\t\t\t}\n-\n-\t\t\treturn { status_t::fatal_disk_error, save_path };\n-\t\t}\n-\n-
    \n-
    \t\tstd::set<std::string> subdirs;\n-\t\tfor (auto const i : f.file_range())\n-\t\t{\n-\t\t\t// files moved out to absolute paths are not moved\n-\t\t\tif (f.file_absolute_path(i)) continue;\n-\n-\t\t\tif (has_parent_path(f.file_path(i)))\n-\t\t\t\tsubdirs.insert(parent_path(f.file_path(i)));\n-\n-\t\t\t// if we ended up renaming the file instead of moving it, there's no\n-\t\t\t// need to delete the source.\n-\t\t\tif (copied_files[i] == false) continue;\n-\n-\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n-\n-\t\t\t// we may still have some files in old save_path\n-\t\t\t// eg. if (flags == dont_replace && exists(new_path))\n-\t\t\t// ignore errors when removing\n-\t\t\terror_code ignore;\n-\t\t\tremove(old_path, ignore);\n-\t\t}\n-\n-\t\tfor (std::string const& s : subdirs)\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-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-\t\t\t\t\tif (err)\n-\t\t\t\t\t{\n-\t\t\t\t\t\tec.file(idx);\n-\t\t\t\t\t\tec.operation = operation_t::mkdir;\n-\t\t\t\t\t\treturn false;\n-\t\t\t\t\t}\n-\n-\t\t\t\t\thard_link(s, file_path, err);\n-\t\t\t\t}\n-\n-\t\t\t\t// if the file already exists, that's not an error\n-\t\t\t\tif (err == boost::system::errc::file_exists)\n-\t\t\t\t\tcontinue;\n-\n-
    \t\t\t\tif (err)\n-
    \t\t\t\t{\n-\t\t\t\t\tec.ec = err;\n-\t\t\t\t\tec.file(idx);\n-\t\t\t\t\tec.operation = operation_t::file_hard_link;\n-\t\t\t\t\treturn false;\n-\t\t\t\t}\n-\t\t\t\tadded_files = true;\n-\t\t\t\tstat.set_dirty(idx);\n-\t\t\t}\n-\t\t}\n-#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n-\n-\t\tbool const seed = (rd.have_pieces.size() >= fs.num_pieces()\n-\t\t\t&& rd.have_pieces.all_set())\n-\t\t\t|| (rd.flags & torrent_flags::seed_mode);\n-\n-\t\tif (seed)\n-\t\t{\n-\t\t\tfor (file_index_t const file_index : fs.file_range())\n-\t\t\t{\n-\t\t\t\tif (fs.pad_file_at(file_index)) continue;\n-\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-\t\t\t\t\tcontinue;\n-\n-
    relevance 2../src/peer_connection.cpp:2548this 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:2548

    \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->has_piece_passed(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:3293since 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:3293

    \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+
    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-\tvoid peer_connection::incoming_have_all()\n+\t// internal\n+\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n \t{\n-
    relevance 2../src/peer_connection.cpp:4958use 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:4958

    \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/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/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\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-\tvoid alert_manager::maybe_notify(alert* a)\n+\t// this is a group. It contains a set of group members\n+\tstruct torrent_entry\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+\t\tstd::string name;\n+\t\tstd::vector<peer_entry> peers4;\n+\t\tstd::vector<peer_entry> peers6;\n+\t};\n \n-\tvoid alert_manager::set_notify_function(std::function<void()> const& fun)\n+
    \tconstexpr time_duration announce_interval = minutes(30);\n+
    \n+\tstruct dht_immutable_item\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+\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-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\n+\tstruct dht_mutable_item : dht_immutable_item\n \t{\n-\t\tm_ses_extensions.push_back(ext);\n-\t}\n-#endif\n+\t\tsignature sig{};\n+\t\tsequence_number seq{};\n+\t\tpublic_key key{};\n+\t\tstd::string salt;\n+\t};\n \n-\tvoid alert_manager::get_all(std::vector<alert*>& alerts)\n+\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n \t{\n-\t\tstd::lock_guard<std::recursive_mutex> lock(m_mutex);\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,66 @@\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/proxy_base.hpp:298use the resolver interface that has a built-in cache

    use the resolver interface that has a built-in cache

    ../include/libtorrent/proxy_base.hpp:298

    protected:\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/proxy_base.hpp:298use the resolver interface that has a built-in cache

    use the resolver interface that has a built-in cache

    ../include/libtorrent/proxy_base.hpp:298

    protected:\n \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 const& e, Handler&& h)\n \t{\n \t\tif (!e) return false;\n@@ -4106,15 +4157,15 @@\n \t{ return boost::asio::get_associated_allocator(m_underlying_handler); }\n \n \texecutor_type get_executor() const noexcept\n \t{\n \t\treturn boost::asio::get_associated_executor(m_underlying_handler);\n \t}\n \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+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@@ -4158,118 +4209,15 @@\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/piece_picker.hpp:647having 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:647

    \t\t\t\telse if (state() == piece_full)\n-\t\t\t\t\t\tstate(piece_full_reverse);\n-\t\t\t}\n-\n-\t\t\t// the number of peers that has this piece\n-\t\t\t// (availability)\n-\t\t\tstd::uint32_t peer_count : 26;\n-\n-\t\t\t// one of the download_queue_t values. This indicates whether this piece\n-\t\t\t// is currently being downloaded or not, and what state it's in if\n-\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks\n-\t\t\t// requested from them are separated out into separate lists to make\n-\t\t\t// lookups quicker. The main oddity is that whether a downloading piece\n-\t\t\t// has only been requested from peers that are reverse, that's\n-\t\t\t// recorded as piece_downloading_reverse, which really means the same\n-\t\t\t// as piece_downloading, it just saves space to also indicate that it\n-\t\t\t// has a bit lower priority. The reverse bit is only relevant if the\n-\t\t\t// state is piece_downloading.\n-\t\t\tstd::uint32_t download_state : 3;\n-\n-
    \n-
    \t\t\t// is 0 if the piece is filtered (not to be downloaded)\n-\t\t\t// 1 is low priority\n-\t\t\t// 2 is low priority\n-\t\t\t// 3 is mid priority\n-\t\t\t// 4 is default priority\n-\t\t\t// 5 is mid priority\n-\t\t\t// 6 is high priority\n-\t\t\t// 7 is high priority\n-\t\t\tstd::uint32_t piece_priority : 3;\n-\n-\t\t\t// index in to the piece_info vector\n-\t\t\tprio_index_t index;\n-\n-#ifdef TORRENT_DEBUG_REFCOUNTS\n-\t\t\t// all the peers that have this piece\n-\t\t\tstd::set<const torrent_peer*> have_peers;\n-#endif\n-\n-\t\t\t// index is set to this to indicate that we have the\n-\t\t\t// piece. There is no entry for the piece in the\n-\t\t\t// buckets if this is the case.\n-\t\t\tstatic constexpr prio_index_t we_have_index{-1};\n-\n-\t\t\t// the priority value that means the piece is filtered\n-\t\t\tstatic constexpr std::uint32_t filter_priority = 0;\n-\n-\t\t\t// the max number the peer count can hold\n-\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff;\n-\n-\t\t\tbool have() const { return index == we_have_index; }\n-
    relevance 2../include/libtorrent/socks5_stream.hpp:153add async_connect() that takes a hostname and port as well

    add async_connect() that takes a hostname and port as well

    ../include/libtorrent/socks5_stream.hpp:153

    \t\tTORRENT_ASSERT(!aux::is_ip_address(host));\n-\t\tm_dst_name = host;\n-\t\tif (m_dst_name.size() > 255)\n-\t\t\tm_dst_name.resize(255);\n-\t}\n-\n-\tvoid close(error_code& ec)\n-\t{\n-\t\tm_dst_name.clear();\n-\t\tproxy_base::close(ec);\n-\t}\n-\n-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid close()\n-\t{\n-\t\tm_dst_name.clear();\n-\t\tproxy_base::close();\n-\t}\n-#endif\n-\n-
    \ttemplate <class Handler>\n-
    \tvoid async_connect(endpoint_type const& endpoint, Handler handler)\n-\t{\n-\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine,\n-\t\t// and using a hostname is fine on SOCKS version 5.\n-\t\tTORRENT_ASSERT(endpoint.address() != address()\n-\t\t\t|| (!m_dst_name.empty() && m_version == 5));\n-\n-\t\tm_remote_endpoint = endpoint;\n-\n-\t\t// the connect is split up in the following steps:\n-\t\t// 1. resolve name of proxy server\n-\t\t// 2. connect to proxy server\n-\t\t// 3. if version == 5:\n-\t\t// 3.1 send SOCKS5 authentication method message\n-\t\t// 3.2 read SOCKS5 authentication response\n-\t\t// 3.3 send username+password\n-\t\t// 4. send SOCKS command message\n-\n-\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\");\n-\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator(\n-\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) {\n-\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn));\n-\t\t\t}, std::move(handler)));\n-\t}\n-\n-private:\n-\n-\ttemplate <typename Handler>\n-\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n-\t\t, Handler h)\n-
    relevance 2../include/libtorrent/peer_connection.hpp:996this should really be a circular buffer

    this should really be a circular buffer

    ../include/libtorrent/peer_connection.hpp:996

    \t\t// it just serves as a queue to remember what we've sent, to avoid\n+
    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@@ -4310,15 +4258,15 @@\n \n \t\ttemplate <typename Fun, typename... Args>\n \t\tvoid wrap(Fun f, Args&&... a);\n \n \t\t// statistics about upload and download speeds\n \t\t// and total amount of uploads and downloads for\n \t\t// this peer\n-
    relevance 2../include/libtorrent/peer_connection.hpp:1086rename this target queue size

    rename this target queue size

    ../include/libtorrent/peer_connection.hpp:1086

    \t\t// this is the piece that is available to this peer. Only\n+
    relevance 2../include/libtorrent/peer_connection.hpp:1086rename this target queue size

    rename this target queue size

    ../include/libtorrent/peer_connection.hpp:1086

    \t\t// this is the piece that is available to this peer. Only\n \t\t// these two pieces can be downloaded from us by this peer.\n \t\t// This will remain the current piece for this peer until\n \t\t// another peer sends us a have message for this piece\n \t\tstd::array<piece_index_t, 2> m_superseed_piece = {{piece_index_t(-1), piece_index_t(-1)}};\n #endif\n \n \t\t// the number of bytes send to the disk-io\n@@ -4361,66 +4309,67 @@\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/aux_/chained_buffer.hpp:60this type should probably be renamed to send_buffer

    this type should probably be renamed to send_buffer

    ../include/libtorrent/aux_/chained_buffer.hpp:60

    #include \"libtorrent/aux_/buffer.hpp\"\n+
    relevance 2../include/libtorrent/piece_picker.hpp:647having 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:647

    \t\t\t\telse if (state() == piece_full)\n+\t\t\t\t\t\tstate(piece_full_reverse);\n+\t\t\t}\n \n-#include <deque>\n-#include <vector>\n+\t\t\t// the number of peers that has this piece\n+\t\t\t// (availability)\n+\t\t\tstd::uint32_t peer_count : 26;\n \n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <boost/asio/buffer.hpp>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+\t\t\t// one of the download_queue_t values. This indicates whether this piece\n+\t\t\t// is currently being downloaded or not, and what state it's in if\n+\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks\n+\t\t\t// requested from them are separated out into separate lists to make\n+\t\t\t// lookups quicker. The main oddity is that whether a downloading piece\n+\t\t\t// has only been requested from peers that are reverse, that's\n+\t\t\t// recorded as piece_downloading_reverse, which really means the same\n+\t\t\t// as piece_downloading, it just saves space to also indicate that it\n+\t\t\t// has a bit lower priority. The reverse bit is only relevant if the\n+\t\t\t// state is piece_downloading.\n+\t\t\tstd::uint32_t download_state : 3;\n \n-#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+
    \n+
    \t\t\t// is 0 if the piece is filtered (not to be downloaded)\n+\t\t\t// 1 is low priority\n+\t\t\t// 2 is low priority\n+\t\t\t// 3 is mid priority\n+\t\t\t// 4 is default priority\n+\t\t\t// 5 is mid priority\n+\t\t\t// 6 is high priority\n+\t\t\t// 7 is high priority\n+\t\t\tstd::uint32_t piece_priority : 3;\n \n-namespace libtorrent {\n-namespace aux {\n+\t\t\t// index in to the piece_info vector\n+\t\t\tprio_index_t index;\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{\n-\t\t\tthread_started();\n-#if TORRENT_USE_ASSERTS\n-\t\t\tm_destructed = false;\n+#ifdef TORRENT_DEBUG_REFCOUNTS\n+\t\t\t// all the peers that have this piece\n+\t\t\tstd::set<const torrent_peer*> have_peers;\n #endif\n-\t\t}\n \n-\tprivate:\n+\t\t\t// index is set to this to indicate that we have the\n+\t\t\t// piece. There is no entry for the piece in the\n+\t\t\t// buckets if this is the case.\n+\t\t\tstatic constexpr prio_index_t we_have_index{-1};\n \n-\t\t// 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\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\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 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\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/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@@ -4440,15 +4389,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@@ -4493,67 +4442,66 @@\n \t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0;\n \t\tvirtual void remove_torrent_impl(std::shared_ptr<torrent> tptr, remove_flags_t options) = 0;\n \n \t\t// port filter\n \t\tvirtual port_filter const& get_port_filter() const = 0;\n \t\tvirtual void ban_ip(address addr) = 0;\n \n-
    relevance 1../src/session_impl.cpp:5705report 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:5705

    \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+
    relevance 2../include/libtorrent/aux_/chained_buffer.hpp:60this type should probably be renamed to send_buffer

    this type should probably be renamed to send_buffer

    ../include/libtorrent/aux_/chained_buffer.hpp:60

    #include \"libtorrent/aux_/buffer.hpp\"\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+#include <deque>\n+#include <vector>\n \n-\t\tif (!listen_socket) return;\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/asio/buffer.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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+#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 \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+namespace libtorrent {\n+namespace aux {\n \n-\t\tif (!ec && m_alerts.should_post<portmap_alert>())\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\tm_alerts.emplace_alert<portmap_alert>(mapping, port\n-\t\t\t\t, transport, proto, listen_socket->local_endpoint.address());\n+\t\t\tthread_started();\n+#if TORRENT_USE_ASSERTS\n+\t\t\tm_destructed = false;\n+#endif\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+\tprivate:\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+\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\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:1125make 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\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:1125make 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:1125

    \n \t\t// notify the user of the error\n \t\tif (alerts().should_post<file_error_alert>())\n \t\t\talerts().emplace_alert<file_error_alert>(error.ec\n@@ -4600,15 +4548,15 @@\n \t\tpause();\n \t}\n \n \tvoid torrent::on_piece_fail_sync(piece_index_t const piece, piece_block) try\n \t{\n \t\tif (m_abort) return;\n \n-
    relevance 1../src/torrent.cpp:8371should 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:8371should 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:8371

    \n \t\tset_state(torrent_status::finished);\n \t\tset_queue_position(no_pos);\n \n \t\tm_became_finished = aux::time_now32();\n \n@@ -4653,14 +4601,66 @@\n \t\t\t// we need to keep the object alive during this operation\n \t\t\tm_ses.disk_thread().async_release_files(m_storage\n \t\t\t\t, std::bind(&torrent::on_cache_flushed, shared_from_this(), false));\n \t\t\tm_ses.deferred_submit_jobs();\n \t\t}\n \n \t\t// this torrent just completed downloads, which means it will fall\n+
    relevance 1../src/session_impl.cpp:5705report 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:5705

    \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,18 +4679,17 @@\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_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_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@@ -4733,212 +4732,196 @@\n \tentry::list_type l;\n \tl.push_back(entry(\"http://foo.com/bar1\"));\n \tl.push_back(entry(\"http://foo.com/bar1\"));\n \tl.push_back(entry(\"http://foo.com/bar2\"));\n \tentry const e(l);\n \tentry torrent;\n \ttorrent[\"url-list\"] = e;\n-
    relevance 0../test/test_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_timestamp_history.cpp:54test the case where we have > 120 samples (and have the base delay actually be updated)

    test the case where we have > 120 samples (and have the base delay actually be updated)

    ../test/test_timestamp_history.cpp:54

    relevance 0../test/test_timestamp_history.cpp:55test the case where a sample is lower than the history entry but not lower than the base

    test the case where a sample is lower than the history entry but not lower than the base

    ../test/test_timestamp_history.cpp:55

    #include \"libtorrent/aux_/timestamp_history.hpp\"\n+
    relevance 0../test/test_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-TORRENT_TEST(timestamp_history)\n-{\n-\tusing namespace lt;\n+using 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+
    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-\t// test that wrapping of the timestamp is properly handled\n-\th.add_sample(0xfffffff3, false);\n-\tTEST_EQUAL(h.base(), 0xfffffff3);\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-
    }\n-
    \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-\t\t{\n-\t\t\tTEST_CHECK(!t.has_node(i));\n-\t\t}\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-namespace {\n-void test_roundtrip(aux::merkle_tree const& t\n-\t, int const block_count\n-\t, int const blocks_per_piece)\n+TORRENT_TEST(parse_peers4)\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+\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_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_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-\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+\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa};\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+\tbits_out = filter.to_string();\n+\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0);\n }\n \n-TORRENT_TEST(roundtrip_empty_tree)\n+} // anonymous namespace\n+\n+TORRENT_TEST(bloom_filter)\n {\n-\taux::merkle_tree t(num_blocks, 1, f[0].data());\n-\ttest_roundtrip(t, num_blocks, 1);\n-}\n+\ttest_set_and_get();\n+\ttest_set_bits();\n+\ttest_count_zeroes();\n+\ttest_to_from_string();\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+
    relevance 0../test/test_transfer.cpp:166these settings_pack tests belong in their own test

    these settings_pack tests belong in their own test

    ../test/test_transfer.cpp:166

    \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// 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+\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-\tauto const& res = *result;\n-\tTEST_EQUAL(res.passed.size(), 0);\n-\tTEST_EQUAL(res.failed.size(), 0);\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-\tfor (int i = 127; i < 127 + 4; ++i)\n-\t\tTEST_CHECK(t[i] == f[i]);\n+\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n \n-\tTEST_CHECK(t.verified_leafs() == none_set(num_blocks));\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-
    \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_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+\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-\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+\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-\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+\tses2.apply_settings(pack);\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+\ttorrent_handle tor1;\n+\ttorrent_handle tor2;\n+\n+\tcreate_directory(\"tmp1_transfer\", ec);\n+\tstd::ofstream file(\"tmp1_transfer/temporary\");\n+\tstd::shared_ptr<torrent_info> t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false);\n+\tfile.close();\n+\n+\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n+\n+\tadd_torrent_params params;\n+\tparams.storage_mode = storage_mode;\n+\tparams.flags &= ~torrent_flags::paused;\n+\tparams.flags &= ~torrent_flags::auto_managed;\n+\n+\twait_for_listen(ses1, \"ses1\");\n+\twait_for_listen(ses2, \"ses2\");\n+
    relevance 0../test/test_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\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\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\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#ifndef TORRENT_DISABLE_LOGGING\n+\t\tbool should_log_portmap(portmap_transport) const override\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\treturn true;\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+\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-\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+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::printf(\"failed to write bittorrent handshake: %s\\n\"\n-\t\t\t, ec.message().c_str());\n-\t\treturn false;\n+\t\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\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+\tstd::vector<ip_interface> const ifs = enum_net_interfaces(ios, ec);\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\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\n \t}\n-\n-\tif (memcmp(buf, \"\\x13\" \"BitTorrent protocol\", 20) != 0)\n+\tint idx = 0;\n+\tfor (auto const& face : ifs)\n \t{\n-\t\tstd::printf(\"invalid bittorrent handshake\\n\");\n-\t\treturn false;\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+\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_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_fast_extension.cpp:1135test sending invalid requests (out of bound piece index, offsets and sizes)

    test sending invalid requests (out of bound piece index, offsets and\n+sizes)

    ../test/test_fast_extension.cpp:1135

    relevance 0../test/test_dht.cpp:472check to make sure the \"best\" items are stored

    check to make sure the \"best\" items are stored

    ../test/test_dht.cpp:472

    \t\t\t, msg_args().target(items[j].target));\n \n \t\tkey_desc_t const desc[] =\n \t\t{\n \t\t\t{ \"r\", bdecode_node::dict_t, 0, key_desc_t::parse_children },\n \t\t\t\t{ \"v\", bdecode_node::dict_t, 0, 0},\n \t\t\t\t{ \"id\", bdecode_node::string_t, 20, key_desc_t::last_child},\n \t\t\t{ \"y\", bdecode_node::string_t, 1, 0},\n@@ -4981,15 +4964,15 @@\n }\n \n void put_mutable_item_data_cb(dht::item& i)\n {\n \tif (!i.empty())\n \t\tg_got_items.push_back(i);\n \n-
    relevance 0../test/test_dht.cpp:3223this won't work because the second node isn't pinged so it wont be added to the routing table

    this won't work because the second node isn't pinged so it wont\n+

    relevance 0../test/test_dht.cpp:3223this won't work because the second node isn't pinged so it wont be added to the routing table

    this won't work because the second node isn't pinged so it wont\n be added to the routing table

    ../test/test_dht.cpp:3223

    \tbool ret = verify_message(request, get_item_desc_ro, parsed, error_string);\n \n \tTEST_CHECK(ret);\n \tTEST_EQUAL(parsed[3].int_value(), 1);\n \n \t// should have one node now, which is 4.4.4.4:1234\n \tTEST_EQUAL(std::get<0>(node.size()), 1);\n@@ -5028,15 +5011,15 @@\n }\n \n #ifndef TORRENT_DISABLE_LOGGING\n // these tests rely on logging being enabled\n \n TORRENT_TEST(invalid_error_msg)\n {\n-
    relevance 0../test/test_dht.cpp:4081test obfuscated_get_peers

    test obfuscated_get_peers

    ../test/test_dht.cpp:4081

    \t\tTEST_CHECK(sm.has_quota());\n+
    relevance 0../test/test_dht.cpp:4081test obfuscated_get_peers

    test obfuscated_get_peers

    ../test/test_dht.cpp:4081

    \t\tTEST_CHECK(sm.has_quota());\n \t});\n }\n \n TORRENT_TEST(rate_limit_accrue_limit)\n {\n \taux::session_settings sett;\n \tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits<int>::max());\n@@ -5057,15 +5040,15 @@\n TORRENT_TEST(dht)\n {\n \t// dummy dht test\n \tTEST_CHECK(true);\n }\n \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+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@@ -5079,15 +5062,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@@ -5101,15 +5084,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@@ -5152,15 +5135,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@@ -5205,15 +5188,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@@ -5258,15 +5241,214 @@\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_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_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+\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+
    \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+\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+\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+\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_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_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+\t{ \"test3_pad_files\", \"test2_pad_files\", 2},\n+\t{ \"test1_pad_files\", \"test2_pad_files\", 2},\n+\t{ \"test1_pad_files\", \"test3_pad_files\", 2},\n+\t{ \"test2_pad_files\", \"test3_pad_files\", 2},\n+\n+\t// one might expect this to work, but since the tail of the single file\n+\t// torrent is not padded, the last piece hash won't match\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+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+\t{ \"test1_pad_files\", \"test2_pad_files\", 2},\n+\t{ \"test1_pad_files\", \"test3_pad_files\", 2},\n+\t{ \"test2_pad_files\", \"test3_pad_files\", 2},\n+\n+\t// one might expect this to work, but since the tail of the single file\n+\t// torrent is not padded, the last piece hash won't match\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+
    \n+
    TORRENT_TEST(resolve_links)\n+{\n+\tstd::string path = combine_path(parent_path(current_working_directory())\n+\t\t, \"mutable_test_torrents\");\n+\n+\tfor (int i = 0; i < int(sizeof(test_torrents)/sizeof(test_torrents[0])); ++i)\n+\t{\n+\t\ttest_torrent_t const& e = test_torrents[i];\n+\n+\t\tstd::string p = combine_path(path, e.filename1) + \".torrent\";\n+\t\tstd::printf(\"loading %s\\n\", p.c_str());\n+\t\tstd::shared_ptr<torrent_info> ti1 = std::make_shared<torrent_info>(p);\n+\n+\t\tp = combine_path(path, e.filename2) + \".torrent\";\n+\t\tstd::printf(\"loading %s\\n\", p.c_str());\n+\t\tstd::shared_ptr<torrent_info> ti2 = std::make_shared<torrent_info>(p);\n+\n+\t\tstd::printf(\"resolving\\n\");\n+\t\tresolve_links l(ti1);\n+\t\tl.match(ti2, \".\");\n+\n+\t\taux::vector<resolve_links::link_t, file_index_t> const& links = l.get_links();\n+\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_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@@ -5311,18 +5493,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@@ -5360,823 +5542,240 @@\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_transfer.cpp:166these settings_pack tests belong in their own test

    these settings_pack tests belong in their own test

    ../test/test_transfer.cpp:166

    \t// to the time it will take to complete the test\n-\tpack.set_int(settings_pack::min_reconnect_time, 0);\n-\tpack.set_int(settings_pack::stop_tracker_timeout, 1);\n-\tpack.set_bool(settings_pack::announce_to_all_trackers, true);\n-\tpack.set_bool(settings_pack::announce_to_all_tiers, true);\n-\n-\t// make sure we announce to both http and udp trackers\n-\tpack.set_bool(settings_pack::prefer_udp_trackers, false);\n-\tpack.set_bool(settings_pack::enable_outgoing_utp, false);\n-\tpack.set_bool(settings_pack::enable_incoming_utp, false);\n-\tpack.set_bool(settings_pack::enable_lsd, false);\n-\tpack.set_bool(settings_pack::enable_natpmp, false);\n-\tpack.set_bool(settings_pack::enable_upnp, false);\n-\tpack.set_bool(settings_pack::enable_dht, false);\n+
    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-\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+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-\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n+\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data());\n+\tt2.load_sparse_tree(tree, mask, empty_verified);\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+\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-\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+\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-\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\tTEST_CHECK(t.compare_node(i, t2[i]));\n+\t\tTEST_CHECK(t2.compare_node(i, t[i]));\n+\t}\n+}\n+}\n \n-\tses2.apply_settings(pack);\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-\ttorrent_handle tor1;\n-\ttorrent_handle tor2;\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-\tcreate_directory(\"tmp1_transfer\", ec);\n-\tstd::ofstream file(\"tmp1_transfer/temporary\");\n-\tstd::shared_ptr<torrent_info> t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false);\n-\tfile.close();\n-\n-\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n-\n-\tadd_torrent_params params;\n-\tparams.storage_mode = storage_mode;\n-\tparams.flags &= ~torrent_flags::paused;\n-\tparams.flags &= ~torrent_flags::auto_managed;\n-\n-\twait_for_listen(ses1, \"ses1\");\n-\twait_for_listen(ses2, \"ses2\");\n-
    relevance 0../test/test_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-\t{ \"test3_pad_files\", \"test2_pad_files\", 2},\n-\t{ \"test1_pad_files\", \"test2_pad_files\", 2},\n-\t{ \"test1_pad_files\", \"test3_pad_files\", 2},\n-\t{ \"test2_pad_files\", \"test3_pad_files\", 2},\n-\n-\t// one might expect this to work, but since the tail of the single file\n-\t// torrent is not padded, the last piece hash won't match\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-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-\t{ \"test1_pad_files\", \"test2_pad_files\", 2},\n-\t{ \"test1_pad_files\", \"test3_pad_files\", 2},\n-\t{ \"test2_pad_files\", \"test3_pad_files\", 2},\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-\t// one might expect this to work, but since the tail of the single file\n-\t// torrent is not padded, the last piece hash won't match\n-\t{ \"test1_pad_files\", \"test1_single\", 0},\n+\tauto const& res = *result;\n+\tTEST_EQUAL(res.passed.size(), 0);\n+\tTEST_EQUAL(res.failed.size(), 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+\tfor (int i = 127; i < 127 + 4; ++i)\n+\t\tTEST_CHECK(t[i] == f[i]);\n \n-};\n+\tTEST_CHECK(t.verified_leafs() == none_set(num_blocks));\n+}\n \n 
    \n-
    TORRENT_TEST(resolve_links)\n-{\n-\tstd::string path = combine_path(parent_path(current_working_directory())\n-\t\t, \"mutable_test_torrents\");\n-\n-\tfor (int i = 0; i < int(sizeof(test_torrents)/sizeof(test_torrents[0])); ++i)\n-\t{\n-\t\ttest_torrent_t const& e = test_torrents[i];\n-\n-\t\tstd::string p = combine_path(path, e.filename1) + \".torrent\";\n-\t\tstd::printf(\"loading %s\\n\", p.c_str());\n-\t\tstd::shared_ptr<torrent_info> ti1 = std::make_shared<torrent_info>(p);\n-\n-\t\tp = combine_path(path, e.filename2) + \".torrent\";\n-\t\tstd::printf(\"loading %s\\n\", p.c_str());\n-\t\tstd::shared_ptr<torrent_info> ti2 = std::make_shared<torrent_info>(p);\n-\n-\t\tstd::printf(\"resolving\\n\");\n-\t\tresolve_links l(ti1);\n-\t\tl.match(ti2, \".\");\n-\n-\t\taux::vector<resolve_links::link_t, file_index_t> const& links = l.get_links();\n-\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+
    relevance 0../src/peer_connection.cpp:1091this should be the global download rate

    this should be the global download rate

    ../src/peer_connection.cpp:1091

    \n+\t\tint rate = 0;\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_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// 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\treturn true;\n+\t\t\trate = m_download_rate_peak;\n \t\t}\n-\n-\t\tvoid log_portmap(portmap_transport, char const* msg\n-\t\t\t, aux::listen_socket_handle const&) const override\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\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_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../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-\t\t, protocol_version v, string_view u, operation_t const operation\n-\t\t, error_code const& e\n-\t\t, string_view m)\n-\t\t: tracker_alert(alloc, h, ep, u)\n-\t\t, times_in_row(times)\n-\t\t, error(e)\n-\t\t, op(operation)\n-\t\t, m_msg_idx(alloc.copy_string(m))\n-#if TORRENT_ABI_VERSION == 1\n-\t\t, status_code(e && e.category() == http_category() ? e.value() : -1)\n-\t\t, msg(m)\n-#endif\n-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\tchar const* tracker_error_alert::failure_reason() const\n-\t{\n-\t\treturn m_alloc.get().ptr(m_msg_idx);\n-\t}\n-\n-\tstd::string tracker_error_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\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-\t\treturn ret;\n-#endif\n-\t}\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-#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-\t\treturn ret;\n-#endif\n-\t}\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-\t\t, msg(m)\n-#endif\n-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\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-\t\treturn {};\n-#else\n-\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message();\n-#endif\n-\t}\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-\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-\t\treturn {};\n-#else\n-\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message();\n-#endif\n-\t}\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-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\tstd::string scrape_reply_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\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-#endif\n-\t}\n-\n-\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h, tcp::endpoint const& ep\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-#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-#endif\n-\t}\n-\n-\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h, tcp::endpoint const& ep\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-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h, tcp::endpoint const& ep\n-\t\t, string_view u, string_view m)\n-\t\t: tracker_alert(alloc, h, ep, u)\n-\t\t, error(errors::tracker_failure)\n-\t\t, m_msg_idx(alloc.copy_string(m))\n-#if TORRENT_ABI_VERSION == 1\n-\t\t, msg(m)\n-#endif\n-\t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\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-#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-\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-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message();\n-#endif\n-\t}\n-\n-\ttracker_reply_alert::tracker_reply_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h, tcp::endpoint const& ep\n-\t\t, int np, protocol_version v, string_view u)\n-\t\t: tracker_alert(alloc, h, ep, u)\n-\t\t, num_peers(np)\n-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\tstd::string tracker_reply_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar ret[400];\n-\t\tstd::snprintf(ret, sizeof(ret), \"%s %s received peers: %d\"\n-\t\t\t, tracker_alert::message().c_str()\n-\t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\"\n-\t\t\t, num_peers);\n-\t\treturn ret;\n-#endif\n-\t}\n-\n-\tdht_reply_alert::dht_reply_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h\n-\t\t, int np)\n-\t\t: tracker_alert(alloc, h, {}, \"\")\n-\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-
    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-\t\tchar ret[400];\n-\t\tstd::snprintf(ret, sizeof(ret), \"%s received DHT peers: %d\"\n-\t\t\t, tracker_alert::message().c_str(), num_peers);\n-\t\treturn ret;\n-#endif\n-\t}\n-\n-\ttracker_announce_alert::tracker_announce_alert(aux::stack_allocator& alloc\n-\t\t, torrent_handle const& h, tcp::endpoint const& ep, string_view u\n-\t\t, protocol_version const v, event_t const e)\n-\t\t: tracker_alert(alloc, h, ep, u)\n-\t\t, event(e)\n-
    \t\t, version(v)\n-
    \t{\n-\t\tTORRENT_ASSERT(!u.empty());\n-\t}\n-\n-\tstd::string tracker_announce_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tstatic const char* const event_str[] = {\"none\", \"completed\", \"started\", \"stopped\", \"paused\"};\n-\t\treturn tracker_alert::message()\n-\t\t\t+ (version == protocol_version::V1 ? \" v1\" : \" v2\")\n-\t\t\t+ \" sending announce (\" + event_str[static_cast<int>(event)] + \")\";\n-#endif\n-\t}\n-\n-\thash_failed_alert::hash_failed_alert(\n-\t\taux::stack_allocator& alloc\n-\t\t, torrent_handle const& h\n-\t\t, piece_index_t index)\n-\t\t: torrent_alert(alloc, h)\n-\t\t, piece_index(index)\n-\t{\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/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+\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// first see if we need to resend any packets\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-
    \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\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n+
    \t\t}\n+\t\telse\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\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// 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/create_torrent.cpp:611this can be optimized

    this can be optimized

    ../src/create_torrent.cpp:611

    \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+\t\t// avoid division by zero\n+\t\tif (rate < 50) rate = 50;\n \n-\tvoid add_symlink_path(entry& e, std::string symlink_path)\n-\t{\n-\t\tentry& sympath_e = e[\"symlink path\"];\n+\t\t// average of current rate and peak\n+//\t\trate = (rate + m_download_rate_peak) / 2;\n \n-\t\tstd::string const link = lexically_relative(\"\", symlink_path);\n-\t\tfor (auto elems = lsplit_path(link); !elems.first.empty();\n-\t\t\telems = lsplit_path(elems.second))\n-\t\t\tsympath_e.list().emplace_back(elems.first);\n+\t\treturn milliseconds((m_outstanding_bytes + extra_bytes\n+\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\n \t}\n-}\n \n-\tstd::vector<char> create_torrent::generate_buf() const\n+\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n \t{\n-
    \t\tstd::vector<char> ret;\n-
    \t\tbencode(std::back_inserter(ret), generate());\n-\t\treturn ret;\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tm_statistics.add_stat(downloaded, uploaded);\n \t}\n \n-\tentry create_torrent::generate() const\n+\tsha1_hash peer_connection::associated_info_hash() const\n \t{\n-\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0)\n-\t\t\taux::throw_ex<system_error>(errors::torrent_missing_file_tree);\n-\n-\t\t// if all v2 hashes are set correctly, generate the v2 parts of the\n-\t\t// torrent\n-\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash);\n-\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash);\n-\n-\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent\n-\t\tif (!make_v1 && !make_v2)\n-\t\t\taux::throw_ex<system_error>(errors::invalid_hash_entry);\n-\n-\t\tTORRENT_ASSERT(m_files.piece_length() > 0);\n-\n-\t\tentry dict;\n-\n-\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first;\n-\n-\t\tif (!m_nodes.empty())\n+\t\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:3520sort the allowed fast set in priority order

    sort the allowed fast set in priority order

    ../src/peer_connection.cpp:3520

    \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->has_piece_passed(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\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-\n-\t\tauto file_iter = std::upper_bound(\n-\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset);\n-\n-\t\tTORRENT_ASSERT(file_iter != m_files.begin());\n-\t\t--file_iter;\n-\t\treturn file_index_t{int(file_iter - m_files.begin())};\n-\t}\n-\n-\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const\n-\t{\n-\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length()));\n-\t}\n-\n-\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const\n-\t{\n-
    \t\tfor (file_index_t const i : file_range())\n-
    \t\t{\n-\t\t\tif (root(i) == root_hash) return i;\n+\t\t\tt->peer_is_interesting(*this);\n \t\t}\n-\t\treturn file_index_t{-1};\n \t}\n \n-\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\n+\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n \t{\n-\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\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-#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+
    \t\treturn m_allowed_fast;\n+
    \t}\n \n-\tint file_storage::file_name_len(file_index_t const index) const\n+\tbool peer_connection::can_request_time_critical() 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+\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-\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+\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-\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n+\tbool peer_connection::make_time_critical(piece_block const& block)\n \t{\n-\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\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/choker.cpp:255make configurable

    make configurable

    ../src/choker.cpp:255

    \t\t\t// first reset the number of unchoke slots, because we'll calculate\n+\t\t\t// it purely based on the current state of our peers.\n+\t\t\tupload_slots = 0;\n \n-\t\t// 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\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\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\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-
    \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\tfor (auto const* p : peers)\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+\t\t\t\tint const rate = int(p->uploaded_in_last_round()\n+\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval));\n \n-\t\t// 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\t\t// always have at least 1 unchoke slot\n+\t\t\t\tif (rate < rate_threshold) break;\n \n-\t\t// re-compute offsets and insert pad files as necessary\n-\t\tstd::int64_t off = 0;\n+\t\t\t\t++upload_slots;\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\t\trate_threshold += 2048;\n+
    \t\t\t}\n+\t\t\t++upload_slots;\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+\t\t// sorts the peers that are eligible for unchoke by download rate and\n+\t\t// secondary by total upload. The reason for this is, if all torrents are\n+\t\t// being seeded, the download rate will be 0, and the peers we have sent\n+\t\t// the least to should be unchoked\n \n-\t\t// symbolic links that points to directories\n-\t\tstd::unordered_map<std::string, std::string> dir_links;\n+\t\t// we use partial sort here, because we only care about the top\n+\t\t// upload_slots peers.\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 slots = std::min(upload_slots, int(peers.size()));\n \n-\t\tfor (auto const i : file_range())\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\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+\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota);\n \n-\t\t\t\tif (is_complete(target))\n-\t\t\t\t{\n-
    relevance 0../src/merkle_tree.cpp:110in C++20, use std::identity

    in C++20, use std::identity

    ../src/merkle_tree.cpp:110

    \t\tallocate_full();\n+\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/merkle_tree.cpp:110in C++20, use std::identity

    in C++20, use std::identity

    ../src/merkle_tree.cpp:110

    \t\tallocate_full();\n \n \t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified);\n \n \t\tload_verified_bits(verified);\n \n \t\toptimize_storage();\n \t\toptimize_storage_piece_layer();\n@@ -6219,15 +5818,15 @@\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+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@@ -6271,15 +5870,15 @@\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+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@@ -6323,15 +5922,15 @@\n \n \t\t\t\t\t\t// now that this hash has been reported as failing, we\n \t\t\t\t\t\t// can clear it. This will prevent it from being\n \t\t\t\t\t\t// reported as failing again.\n \t\t\t\t\t\tm_tree[dst_idx].clear();\n \t\t\t\t\t}\n \t\t\t\t\telse if (dst_idx >= first_leaf)\n-
    relevance 0../src/merkle_tree.cpp:447instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up to the level below the root and then validates it.

    instead of overwriting the root and comparing it\n+relevance 0../src/merkle_tree.cpp:447instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up to the level below the root and then validates it.

    instead of overwriting the root and comparing it\n against hashes[], write a functions that *validates* a tree\n by just filling it up to the level below the root and then\n validates it.

    ../src/merkle_tree.cpp:447

    \t\t\t&& dest_start_idx < first_piece_idx + num_pieces())\n \t\t{\n \t\t\tint const blocks_in_piece = 1 << base;\n \n \t\t\t// it may now be possible to verify the hashes of previously received blocks\n@@ -6366,15 +5965,15 @@\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset);\n \t\t\t\t\t// record that these block hashes are correct!\n \t\t\t\t\tint const leafs_start = block_idx - block_layer_start();\n \t\t\t\t\tint const leafs_end = std::min(m_num_blocks, leafs_start + blocks_in_piece);\n-
    relevance 0../src/merkle_tree.cpp:471this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n+relevance 0../src/merkle_tree.cpp:471this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n to set a range of bits

    ../src/merkle_tree.cpp:471

    \t\t\t\tmerkle_fill_tree(m_tree, blocks_in_piece, block_idx);\n \t\t\t\tif (m_tree[piece] != hashes[i])\n \t\t\t\t{\n \t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx);\n \t\t\t\t\t// write back the correct hash\n \t\t\t\t\tm_tree[piece] = hashes[i];\n \t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece());\n@@ -6418,15 +6017,15 @@\n \t\tif (blocks_verified(block_index, 1))\n \t\t{\n \t\t\t// if this blocks's hash is already known, check the passed-in hash against it\n \t\t\tif (compare_node(block_tree_index, h))\n \t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1);\n \t\t\telse\n \t\t\t\treturn std::make_tuple(set_block_result::block_hash_failed, block_index, 1);\n-
    relevance 0../src/merkle_tree.cpp:514use structured binding in C++17

    use structured binding in C++17

    ../src/merkle_tree.cpp:514

    \t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n+
    relevance 0../src/merkle_tree.cpp:514use structured binding in C++17

    use structured binding in C++17

    ../src/merkle_tree.cpp:514

    \t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n \t\tauto const block_tree_index = first_leaf + block_index;\n \n \t\tif (blocks_verified(block_index, 1))\n \t\t{\n \t\t\t// if this blocks's hash is already known, check the passed-in hash against it\n \t\t\tif (compare_node(block_tree_index, h))\n \t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1);\n@@ -6462,15 +6061,15 @@\n \t\t\t// the whole piece failed the hash check. Clear all block hashes\n \t\t\t// in this piece and report a hash failure\n \t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start);\n \t\t\tm_tree[root_index] = root;\n \t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size);\n \t\t}\n \n-
    relevance 0../src/merkle_tree.cpp:539this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n+relevance 0../src/merkle_tree.cpp:539this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n to set a range of bits

    ../src/merkle_tree.cpp:539

    \t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks);\n \n \t\t// if the root node is unknown the hashes cannot be verified yet\n \t\tif (m_tree[root_index].is_all_zeros())\n \t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size);\n \n \t\t// save the root hash because merkle_fill_tree will overwrite it\n@@ -6514,97 +6113,304 @@\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/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+
    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-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+\t\tauto file_iter = std::upper_bound(\n+\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset);\n \n-#include <boost/multiprecision/integer.hpp>\n-#include <boost/multiprecision/cpp_int.hpp>\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-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const\n+\t{\n+\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length()));\n+\t}\n \n-#include \"libtorrent/random.hpp\"\n-#include \"libtorrent/aux_/alloca.hpp\"\n-#include \"libtorrent/pe_crypto.hpp\"\n-#include \"libtorrent/hasher.hpp\"\n+\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const\n+\t{\n+
    \t\tfor (file_index_t const i : file_range())\n+
    \t\t{\n+\t\t\tif (root(i) == root_hash) return i;\n+\t\t}\n+\t\treturn file_index_t{-1};\n+\t}\n \n-namespace libtorrent {\n+\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\n+\t{\n+\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\n+\t}\n \n-\tnamespace mp = boost::multiprecision;\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-\tnamespace {\n-
    \t\tkey_t const dh_prime\n-
    \t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\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::array<char, 96> export_key(key_t const& k)\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\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\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-
    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+\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n+\t{\n+\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n \n-namespace libtorrent {\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-\tnamespace mp = boost::multiprecision;\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-\tnamespace {\n-\t\tkey_t const dh_prime\n-\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\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-\tstd::array<char, 96> export_key(key_t const& k)\n+\tvoid file_storage::sanitize_symlinks()\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// 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\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// 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/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+\t\tauto& merkle_tree = m_merkle_trees[f];\n+\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f);\n+\t\tstd::int64_t const block_offset = static_cast<int>(piece) * std::int64_t(m_files.piece_length())\n+\t\t\t+ offset - m_files.file_offset(f);\n+\t\tint const block_index = aux::numeric_cast<int>(block_offset / default_block_size);\n+\n+\t\tif (h.is_all_zeros())\n+\t\t{\n+\t\t\tTORRENT_ASSERT_FAIL();\n+\t\t\treturn set_block_hash_result::block_hash_failed();\n \t\t}\n-\t\treturn ret;\n+\n+
    \t\taux::merkle_tree::set_block_result result;\n+
    \t\tint leafs_index;\n+\t\tint leafs_size;\n+\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h);\n+\n+\t\tif (result == aux::merkle_tree::set_block_result::unknown)\n+\t\t\treturn set_block_hash_result::unknown();\n+\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed)\n+\t\t\treturn set_block_hash_result::block_hash_failed();\n+\n+\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed)\n+\t\t\t? set_block_hash_result::result::piece_hash_failed\n+\t\t\t: set_block_hash_result::result::success;\n+\n+\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size;\n+\n+\t\treturn { status\n+\t\t\t, int(leafs_index - static_cast<int>(piece - file_first_piece) * blocks_per_piece)\n+\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) };\n \t}\n \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+\tvoid hash_picker::hashes_rejected(hash_request const& req)\n+\t{\n+\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n \n-\t// Set the prime P and the generator, generate local public key\n-\tdh_key_exchange::dh_key_exchange()\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_info.cpp:875this 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:875

    \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\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\tINVARIANT_CHECK;\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\tTORRENT_ASSERT(is_loaded());\n+\t\t// the new specified file storage must have the exact\n+\t\t// same size as the current file storage\n+\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size());\n \n-\t\t// 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/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\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/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+\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+}\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@@ -6647,15 +6453,332 @@\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/ip_notifier.cpp:41simulator support

    simulator support

    ../src/ip_notifier.cpp:41

          from this software without specific prior written permission.\n+
    relevance 0../src/http_seed_connection.cpp:441technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases

    technically, this isn't supposed to happen, but it seems to\n+sometimes. Some of the accounting is probably wrong in certain\n+cases

    ../src/http_seed_connection.cpp:441

    \t\t\t\t\t// cut out the chunk header from the receive buffer\n+\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX);\n+\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast<int>(m_chunk_pos + m_body_start));\n+\t\t\t\t\trecv_buffer = m_recv_buffer.get();\n+\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start);\n+\t\t\t\t\tm_chunk_pos += chunk_size;\n+\t\t\t\t\tif (chunk_size == 0)\n+\t\t\t\t\t{\n+\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1\n+\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == 'H'\n+\t\t\t\t\t\t\t|| (m_parser.chunked_encoding()\n+\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == '\\r'));\n+\t\t\t\t\t\tm_chunk_pos = -1;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tint payload = int(bytes_transferred);\n+\t\t\tif (payload > m_response_left) payload = int(m_response_left);\n+\t\t\tif (payload > front_request.length) payload = front_request.length;\n+
    \t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n+
    \t\t\treceived_bytes(payload, 0);\n+\t\t\tincoming_piece_fragment(payload);\n+\t\t\tm_response_left -= payload;\n+\n+\t\t\tif (m_parser.status_code() == 503)\n+\t\t\t{\n+\t\t\t\tif (!m_parser.finished()) return;\n+\n+\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str());\n+\t\t\t\tif (retry_time <= 0) retry_time = 60;\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time);\n+#endif\n+\n+\t\t\t\treceived_bytes(0, int(bytes_transferred));\n+\t\t\t\t// temporarily unavailable, retry later\n+\t\t\t\tt->retry_web_seed(this, seconds32(retry_time));\n+\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n+\t\t\t\treturn;\n+\t\t\t}\n+\n+\n+\t\t\t// we only received the header, no data\n+\t\t\tif (recv_buffer.empty()) break;\n+\n+\t\t\tif (recv_buffer.size() < front_request.length) break;\n+\n+\t\t\t// if the response is chunked, we need to receive the last\n+\t\t\t// terminating chunk and the tail headers before we can proceed\n+\t\t\tif (m_parser.chunked_encoding() && m_chunk_pos >= 0) break;\n+
    relevance 0../src/posix_part_file.cpp:337what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n+from this piece? does it matter? Since we won't actively erase the\n+data from disk, but it may be overwritten soon, it's probably not that\n+big of a deal

    ../src/posix_part_file.cpp:337

    \n+\t\t\tif (ec) return {};\n+\n+#ifdef TORRENT_WINDOWS\n+\t\t\tret = file_pointer(::_wfopen(convert_to_native_path_string(fn).c_str(), L\"wb+\"));\n+#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\tif (ec) return {};\n+\t\treturn ret;\n+\t}\n+\n+\tvoid posix_part_file::free_piece(piece_index_t const piece)\n+\t{\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+\t{\n+\t\tflush_metadata_impl(ec);\n+\t\tif (ec) return;\n+\n+\t\tif (!m_piece_map.empty())\n+\t\t{\n+\t\t\tstd::string old_path = combine_path(m_path, m_name);\n+\t\t\tstd::string new_path = combine_path(path, m_name);\n+\n+\t\t\trename(old_path, new_path, ec);\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\n+\t\t\tif (ec)\n+\t\t\t{\n+\t\t\t\tstorage_error se;\n+\t\t\t\taux::copy_file(old_path, new_path, se);\n+\t\t\t\tec = se.ec;\n+\t\t\t\tif (ec) return;\n+\t\t\t\tremove(old_path, ec);\n+\t\t\t}\n+\t\t}\n+\t\tm_path = path;\n+\t}\n+
    relevance 0../src/posix_part_file.cpp:425instead 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:425

    \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\tTORRENT_ASSERT(!ec);\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 posix_part_file::flush_metadata(error_code& ec)\n+\t{\n+\t\tflush_metadata_impl(ec);\n+\t}\n+\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+\t\t\t// part file, remove it\n+\t\t\tstd::string const p = combine_path(m_path, m_name);\n+\t\t\tremove(p, ec);\n+\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tauto f = open_file(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/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+
    \n+
    \tADD_OUTSTANDING_ASYNC(\"socks5::on_connected\");\n+\tm_socks5_sock.async_connect(m_proxy_addr\n+\t\t, std::bind(&socks5::on_connected, self(), _1));\n+\n+\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\");\n+\tm_timer.expires_after(seconds(10));\n+\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout\n+\t\t, self(), _1));\n+}\n+\n+void socks5::on_connect_timeout(error_code const& e)\n+{\n+\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\n+\n+\tif (e == boost::asio::error::operation_aborted) return;\n+\n+\tif (m_abort) return;\n+\n+\tif (m_alerts.should_post<socks5_alert>())\n+\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::connect, errors::timed_out);\n+\n+\terror_code ignore;\n+\tm_socks5_sock.close(ignore);\n+\n+\t++m_failures;\n+\tretry_connection();\n+}\n+\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+\t\t{\n+\t\t\t// files moved out to absolute paths are not moved\n+\t\t\tif (f.file_absolute_path(i)) continue;\n+\n+\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n+\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i));\n+\n+\t\t\terror_code ignore;\n+\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore))\n+\t\t\t{\n+\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n+
    \t\t\tmove_file(old_path, new_path, ec);\n+
    \n+\t\t\t// if the source file doesn't exist. That's not a problem\n+\t\t\t// we just ignore that file\n+\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.ec.clear();\n+\t\t\telse if (ec\n+\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument\n+\t\t\t\t&& ec.ec != boost::system::errc::permission_denied)\n+\t\t\t{\n+\t\t\t\t// moving the file failed\n+\t\t\t\t// on OSX, the error when trying to rename a file across different\n+\t\t\t\t// volumes is EXDEV, which will make it fall back to copying.\n+\t\t\t\tec.ec.clear();\n+\t\t\t\tcopy_file(old_path, new_path, ec);\n+\t\t\t\tif (!ec) copied_files[i] = true;\n+\t\t\t}\n+\n+\t\t\tif (ec)\n+\t\t\t{\n+\t\t\t\tec.file(i);\n+\t\t\t\tfile_index = i;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!ec && move_partfile)\n+\t\t{\n+\t\t\terror_code e;\n+\t\t\tmove_partfile(new_save_path, e);\n+\t\t\tif (e)\n+
    relevance 0../src/storage_utils.cpp:538it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic

    it would seem reasonable to, instead, set the have_pieces bits\n+for the pieces representing these files, and resume with the normal\n+logic

    ../src/storage_utils.cpp:538

    \t\t\t\t\tcontinue;\n+\n+\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs\n+\t\t\t\t\t, save_path, ec);\n+\t\t\t\tif (size < 0) return false;\n+\n+\t\t\t\tif (size < fs.file_size(file_index))\n+\t\t\t\t{\n+\t\t\t\t\tec.ec = errors::mismatching_file_size;\n+\t\t\t\t\tec.file(file_index);\n+\t\t\t\t\tec.operation = operation_t::check_resume;\n+\t\t\t\t\treturn false;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\treturn true;\n+\t\t}\n+\n+#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n+\t\t// always trigger a full recheck when we pull in files from other\n+\t\t// torrents, via hard links\n+
    \t\tif (added_files) return false;\n+
    #endif\n+\n+\t\t// parse have bitmask. Verify that the files we expect to have\n+\t\t// actually do exist\n+\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece());\n+\t\tfor (piece_index_t i(0); i < end_piece; ++i)\n+\t\t{\n+\t\t\tif (rd.have_pieces.get_bit(i) == false) continue;\n+\n+\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1);\n+\t\t\tTORRENT_ASSERT(!f.empty());\n+\n+\t\t\tfile_index_t const file_index = f[0].file_index;\n+\n+\t\t\t// files with priority zero may not have been saved to disk at their\n+\t\t\t// expected location, but is likely to be in a partfile. Just exempt it\n+\t\t\t// from checking\n+\t\t\tif (file_index < file_priority.end_index()\n+\t\t\t\t&& file_priority[file_index] == dont_download)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (fs.pad_file_at(file_index)) continue;\n+\n+\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0)\n+\t\t\t\treturn false;\n+\n+\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in\n+\t\t\t// this file. We're just sanity-checking whether the files exist\n+\t\t\t// or not.\n+\t\t\tpeer_request const pr = fs.map_file(file_index\n+
    relevance 0../src/ip_notifier.cpp:41simulator support

    simulator support

    ../src/ip_notifier.cpp:41

          from this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n@@ -6698,15 +6821,1057 @@\n #if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n \t!defined TORRENT_BUILD_SIMULATOR\n \n // common utilities for Mac and iOS\n template <typename T> void CFRefRetain(T h) { CFRetain(h); }\n template <typename T> void CFRefRelease(T h) { CFRelease(h); }\n \n-
    relevance 0../src/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+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/performance_counters.cpp:40move stats_counter_t out of counters

    move stats_counter_t out of counters

    ../src/performance_counters.cpp:40

    relevance 0../src/performance_counters.cpp:41should bittorrent keep-alive messages have a counter too?

    should bittorrent keep-alive messages have a counter too?

    ../src/performance_counters.cpp:41

    relevance 0../src/performance_counters.cpp:42It would be nice if this could be an internal type. default_disk_constructor depends on it now

    It would be nice if this could be an internal type. default_disk_constructor depends on it now

    ../src/performance_counters.cpp:42

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n+*/\n+\n+#include \"libtorrent/performance_counters.hpp\"\n+#include \"libtorrent/assert.hpp\"\n+#include <cstring> // for memset\n+\n+namespace libtorrent {\n+\n+
    \tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n+
    \t{\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (auto& counter : m_stats_counter)\n+\t\t\tcounter.store(0, std::memory_order_relaxed);\n+#else\n+\t\tm_stats_counter.fill(0);\n+#endif\n+\t}\n+\n+\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT\n+\t{\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n+\t\t\tm_stats_counter[i].store(\n+\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n+\t\t\t\t\t, std::memory_order_relaxed);\n+#else\n+\t\tstd::lock_guard<std::mutex> l(c.m_mutex);\n+\t\tm_stats_counter = c.m_stats_counter;\n+#endif\n+\t}\n+\n+\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT\n+\t{\n+\t\tif (&c == this) return *this;\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n+\t\t\tm_stats_counter[i].store(\n+\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n+\t\t\t\t\t, std::memory_order_relaxed);\n+
    relevance 0../src/disabled_disk_io.cpp:106it would be nice to return a valid hash of zeroes here

    it would be nice to return a valid hash of zeroes here

    ../src/disabled_disk_io.cpp:106

    \t\t});\n+\t}\n+\n+\tbool async_write(storage_index_t\n+\t\t, peer_request const& r\n+\t\t, char const*, std::shared_ptr<disk_observer>\n+\t\t, std::function<void(storage_error const&)> handler\n+\t\t, disk_job_flags_t) override\n+\t{\n+\t\tTORRENT_ASSERT(r.length <= default_block_size);\n+\t\tTORRENT_UNUSED(r);\n+\n+\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n+\t\treturn false;\n+\t}\n+\n+\tvoid async_hash(storage_index_t\n+\t\t, piece_index_t piece, span<sha256_hash>, disk_job_flags_t\n+\t\t, std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) override\n+\t{\n+
    \t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n+
    \t}\n+\n+\tvoid async_hash2(storage_index_t, piece_index_t piece, int\n+\t\t, disk_job_flags_t\n+\t\t, std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) override\n+\t{\n+\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); });\n+\t}\n+\n+\tvoid async_move_storage(storage_index_t\n+\t\t, std::string p, move_flags_t\n+\t\t, std::function<void(status_t, std::string const&, storage_error const&)> handler) override\n+\t{\n+\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable\n+\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); });\n+\t}\n+\n+\tvoid async_release_files(storage_index_t, std::function<void()> handler) override\n+\t{\n+\t\tpost(m_ios, [h = std::move(handler)] { h(); });\n+\t}\n+\n+\tvoid async_delete_files(storage_index_t\n+\t\t, remove_flags_t, std::function<void(storage_error const&)> handler) override\n+\t{\n+\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n+\t}\n+\n+\tvoid async_check_files(storage_index_t\n+\t\t, add_torrent_params const*\n+
    relevance 0../src/utp_socket_manager.cpp:204this should not be heap allocated, sockets should be movable

    this should not be heap allocated, sockets should be movable

    ../src/utp_socket_manager.cpp:204

    \n+//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str());\n+\n+\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp))\n+\t\t\treturn false;\n+\n+\t\t// if not found, see if it's a SYN packet, if it is,\n+\t\t// create a new utp_stream\n+\t\tif (ph->get_type() == ST_SYN)\n+\t\t{\n+\t\t\t// possible SYN flood. Just ignore\n+\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2)\n+\t\t\t\treturn false;\n+\n+\t\t\tTORRENT_ASSERT(m_new_connection == -1);\n+\t\t\t// create the new socket with this ID\n+\t\t\tm_new_connection = id;\n+\n+//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection);\n+\n+
    \t\t\taux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false));\n+
    \n+\t\t\tutp_stream* str = nullptr;\n+#ifdef TORRENT_SSL_PEERS\n+\t\t\tif (is_ssl(c))\n+\t\t\t\tstr = &boost::get<ssl_stream<utp_stream>>(c).next_layer();\n+\t\t\telse\n+#endif\n+\t\t\t\tstr = boost::get<utp_stream>(&c);\n+\n+\t\t\tTORRENT_ASSERT(str);\n+\t\t\tint const mtu = mtu_for_dest(ep.address());\n+\t\t\tstr->get_impl()->init_mtu(mtu);\n+\t\t\tstr->get_impl()->m_sock = std::move(socket);\n+\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time);\n+\t\t\tif (!ret) return false;\n+\t\t\tm_last_socket = str->get_impl();\n+\t\t\tm_cb(std::move(c));\n+\t\t\t// the connection most likely changed its connection ID here\n+\t\t\t// we need to move it to the correct ID\n+\t\t\treturn true;\n+\t\t}\n+\n+\t\tif (ph->get_type() == ST_RESET) return false;\n+\n+\t\t// #error send reset\n+\n+\t\treturn false;\n+\t}\n+\n+\tvoid utp_socket_manager::subscribe_writable(utp_socket_impl* s)\n+
    relevance 0../src/create_torrent.cpp:611this can be optimized

    this can be optimized

    ../src/create_torrent.cpp:611

    \t\tstd::string& attr = e[\"attr\"].string();\n+\t\tif (flags & file_storage::flag_pad_file) attr += 'p';\n+\t\tif (flags & file_storage::flag_hidden) attr += 'h';\n+\t\tif (flags & file_storage::flag_executable) attr += 'x';\n+\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l';\n+\t}\n+\n+\tvoid add_symlink_path(entry& e, std::string symlink_path)\n+\t{\n+\t\tentry& sympath_e = e[\"symlink path\"];\n+\n+\t\tstd::string const link = lexically_relative(\"\", symlink_path);\n+\t\tfor (auto elems = lsplit_path(link); !elems.first.empty();\n+\t\t\telems = lsplit_path(elems.second))\n+\t\t\tsympath_e.list().emplace_back(elems.first);\n+\t}\n+}\n+\n+\tstd::vector<char> create_torrent::generate_buf() const\n+\t{\n+
    \t\tstd::vector<char> ret;\n+
    \t\tbencode(std::back_inserter(ret), generate());\n+\t\treturn ret;\n+\t}\n+\n+\tentry create_torrent::generate() const\n+\t{\n+\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0)\n+\t\t\taux::throw_ex<system_error>(errors::torrent_missing_file_tree);\n+\n+\t\t// if all v2 hashes are set correctly, generate the v2 parts of the\n+\t\t// torrent\n+\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash);\n+\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash);\n+\n+\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent\n+\t\tif (!make_v1 && !make_v2)\n+\t\t\taux::throw_ex<system_error>(errors::invalid_hash_entry);\n+\n+\t\tTORRENT_ASSERT(m_files.piece_length() > 0);\n+\n+\t\tentry dict;\n+\n+\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first;\n+\n+\t\tif (!m_nodes.empty())\n+\t\t{\n+\t\t\tentry& nodes = dict[\"nodes\"];\n+\t\t\tentry::list_type& nodes_list = nodes.list();\n+\t\t\tfor (auto const& n : m_nodes)\n+\t\t\t{\n+
    relevance 0../src/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/cpuid.cpp:131enable when aarch64 is really tested

    enable when aarch64 is really tested

    ../src/cpuid.cpp:131

    \tbool supports_mmx() noexcept\n+\t{\n+#if TORRENT_HAS_SSE\n+\t\tstd::uint32_t cpui[4] = {0};\n+\t\tcpuid(cpui, 1);\n+\t\treturn (cpui[2] & (1 << 23)) != 0;\n+#else\n+\t\treturn false;\n+#endif\n+\t}\n+\n+\tbool supports_arm_neon() noexcept\n+\t{\n+#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV\n+#if defined __arm__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON);\n+\t\treturn (helper_getauxval(16) & (1 << 12));\n+#elif defined __aarch64__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD);\n+\t\t//return (getauxval(16) & (1 << 1));\n+
    \t\treturn false;\n+
    #endif\n+#else\n+\t\treturn false;\n+#endif\n+\t}\n+\n+\tbool supports_arm_crc32c() noexcept\n+\t{\n+#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV\n+#if defined TORRENT_FORCE_ARM_CRC32\n+\t\treturn true;\n+#elif defined __arm__\n+\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32);\n+\t\treturn (helper_getauxval(26) & (1 << 4));\n+#elif defined __aarch64__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32);\n+\t\treturn (helper_getauxval(16) & (1 << 7));\n+#endif\n+#else\n+\t\treturn false;\n+#endif\n+\t}\n+\n+} // anonymous namespace\n+\n+\tbool const sse42_support = supports_sse42();\n+\tbool const mmx_support = supports_mmx();\n+\tbool const arm_neon_support = supports_arm_neon();\n+\tbool const arm_crc32c_support = supports_arm_crc32c();\n+} }\n+
    relevance 0../src/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+\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/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/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+\t\t, protocol_version v, string_view u, operation_t const operation\n+\t\t, error_code const& e\n+\t\t, string_view m)\n+\t\t: tracker_alert(alloc, h, ep, u)\n+\t\t, times_in_row(times)\n+\t\t, error(e)\n+\t\t, op(operation)\n+\t\t, m_msg_idx(alloc.copy_string(m))\n+#if TORRENT_ABI_VERSION == 1\n+\t\t, status_code(e && e.category() == http_category() ? e.value() : -1)\n+\t\t, msg(m)\n+#endif\n+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\tchar const* tracker_error_alert::failure_reason() const\n+\t{\n+\t\treturn m_alloc.get().ptr(m_msg_idx);\n+\t}\n+\n+\tstd::string tracker_error_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\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+\t\treturn ret;\n+#endif\n+\t}\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+#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+\t\treturn ret;\n+#endif\n+\t}\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+\t\t, msg(m)\n+#endif\n+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\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+\t\treturn {};\n+#else\n+\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message();\n+#endif\n+\t}\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+\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+\t\treturn {};\n+#else\n+\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message();\n+#endif\n+\t}\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+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\tstd::string scrape_reply_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\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+#endif\n+\t}\n+\n+\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h, tcp::endpoint const& ep\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+#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+#endif\n+\t}\n+\n+\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h, tcp::endpoint const& ep\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+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h, tcp::endpoint const& ep\n+\t\t, string_view u, string_view m)\n+\t\t: tracker_alert(alloc, h, ep, u)\n+\t\t, error(errors::tracker_failure)\n+\t\t, m_msg_idx(alloc.copy_string(m))\n+#if TORRENT_ABI_VERSION == 1\n+\t\t, msg(m)\n+#endif\n+\t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\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+#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+\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+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message();\n+#endif\n+\t}\n+\n+\ttracker_reply_alert::tracker_reply_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h, tcp::endpoint const& ep\n+\t\t, int np, protocol_version v, string_view u)\n+\t\t: tracker_alert(alloc, h, ep, u)\n+\t\t, num_peers(np)\n+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\tstd::string tracker_reply_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tchar ret[400];\n+\t\tstd::snprintf(ret, sizeof(ret), \"%s %s received peers: %d\"\n+\t\t\t, tracker_alert::message().c_str()\n+\t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\"\n+\t\t\t, num_peers);\n+\t\treturn ret;\n+#endif\n+\t}\n+\n+\tdht_reply_alert::dht_reply_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h\n+\t\t, int np)\n+\t\t: tracker_alert(alloc, h, {}, \"\")\n+\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+
    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+\t\tchar ret[400];\n+\t\tstd::snprintf(ret, sizeof(ret), \"%s received DHT peers: %d\"\n+\t\t\t, tracker_alert::message().c_str(), num_peers);\n+\t\treturn ret;\n+#endif\n+\t}\n+\n+\ttracker_announce_alert::tracker_announce_alert(aux::stack_allocator& alloc\n+\t\t, torrent_handle const& h, tcp::endpoint const& ep, string_view u\n+\t\t, protocol_version const v, event_t const e)\n+\t\t: tracker_alert(alloc, h, ep, u)\n+\t\t, event(e)\n+
    \t\t, version(v)\n+
    \t{\n+\t\tTORRENT_ASSERT(!u.empty());\n+\t}\n+\n+\tstd::string tracker_announce_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tstatic const char* const event_str[] = {\"none\", \"completed\", \"started\", \"stopped\", \"paused\"};\n+\t\treturn tracker_alert::message()\n+\t\t\t+ (version == protocol_version::V1 ? \" v1\" : \" v2\")\n+\t\t\t+ \" sending announce (\" + event_str[static_cast<int>(event)] + \")\";\n+#endif\n+\t}\n+\n+\thash_failed_alert::hash_failed_alert(\n+\t\taux::stack_allocator& alloc\n+\t\t, torrent_handle const& h\n+\t\t, piece_index_t index)\n+\t\t: torrent_alert(alloc, h)\n+\t\t, piece_index(index)\n+\t{\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/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:589it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/settings_pack.cpp:589

    \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+\tsettings_pack default_settings()\n+\t{\n+\t\tsettings_pack ret;\n+
    \t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n+
    \t\t{\n+\t\t\tif (str_settings[i].default_value == nullptr) continue;\n+\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value);\n+\t\t}\n+\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/part_file.cpp:300what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n+from this piece? does it matter? Since we won't actively erase the\n+data from disk, but it may be overwritten soon, it's probably not that\n+big of a deal

    ../src/part_file.cpp:300

    \t\t\t\tcreate_directories(m_path, ec);\n+\t\t\t\tif (ec) return {};\n+\t\t\t\treturn aux::file_handle(fn, 0, mode);\n+\t\t\t}\n+\t\t\treturn {};\n+\t\t}\n+\t}\n+\tcatch (storage_error const& e)\n+\t{\n+\t\tec = e.ec;\n+\t\treturn {};\n+\t}\n+\n+\tvoid part_file::free_piece(piece_index_t const piece)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tauto const i = m_piece_map.find(piece);\n+\t\tif (i == m_piece_map.end()) return;\n+\n+
    \n+
    \t\tm_free_slots.push_back(i->second);\n+\t\tm_piece_map.erase(i);\n+\t\tm_dirty_metadata = true;\n+\t}\n+\n+\tvoid part_file::move_partfile(std::string const& path, error_code& ec)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tflush_metadata_impl(ec);\n+\t\tif (ec) return;\n+\n+\t\tif (!m_piece_map.empty())\n+\t\t{\n+\t\t\tstd::string old_path = combine_path(m_path, m_name);\n+\t\t\tstd::string new_path = combine_path(path, m_name);\n+\n+\t\t\trename(old_path, new_path, ec);\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\n+\t\t\tif (ec)\n+\t\t\t{\n+\t\t\t\tstorage_error se;\n+\t\t\t\taux::copy_file(old_path, new_path, se);\n+\t\t\t\tec = se.ec;\n+\t\t\t\tif (ec) return;\n+\t\t\t\tremove(old_path, ec);\n+\t\t\t}\n+\t\t}\n+
    relevance 0../src/part_file.cpp:412instead 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:412

    \t\t\t\t\t\tTORRENT_ASSERT(j->second == slot);\n+\t\t\t\t\t\tm_free_slots.push_back(j->second);\n+\t\t\t\t\t\tm_piece_map.erase(j);\n+\t\t\t\t\t\tm_dirty_metadata = true;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tfile_offset += block_to_copy;\n+\t\t\tpiece_offset = 0;\n+\t\t\tsize -= block_to_copy;\n+\t\t}\n+\t}\n+\n+\tvoid part_file::flush_metadata(error_code& ec)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tflush_metadata_impl(ec);\n+\t}\n+\n+
    \tvoid part_file::flush_metadata_impl(error_code& ec)\n+
    \t{\n+\t\t// do we need to flush the metadata?\n+\t\tif (m_dirty_metadata == false) return;\n+\n+\t\tif (m_piece_map.empty())\n+\t\t{\n+\t\t\t// if we don't have any pieces left in the\n+\t\t\t// part file, remove it\n+\t\t\tstd::string const p = combine_path(m_path, m_name);\n+\t\t\tremove(p, ec);\n+\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec);\n+\t\tif (ec) return;\n+\n+\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size));\n+\n+\t\tusing namespace libtorrent::aux;\n+\n+\t\tchar* ptr = header.data();\n+\t\twrite_uint32(m_max_pieces, ptr);\n+\t\twrite_uint32(m_piece_size, ptr);\n+\n+\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n+\t\t{\n+\t\t\tauto const i = m_piece_map.find(piece);\n+
    relevance 0../src/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@@ -6723,15 +7888,15 @@\n \tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n \t\t, \"should be nothrow move constructible\");\n \n \tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n \t\t, \"should be nothrow move constructible\");\n \n 
    \n-
    relevance 0../src/add_torrent_params.cpp:84it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be nothrow default constructible\");

    it would be nice if this was nothrow default constructible\n+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@@ -6758,47 +7923,246 @@\n \t{\n \t\treturn !atp.have_pieces.empty()\n \t\t\t|| (atp.flags & torrent_flags::seed_mode);\n \t}\n }\n \n }\n-
    relevance 0../src/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/load_torrent.cpp:121move the loading logic from torrent_info constructor into here

    move the loading logic from torrent_info constructor into here

    ../src/load_torrent.cpp:121

    \t\t\t\tmask.resize(std::size_t(full_size), false);\n+\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size)\n+\t\t\t\t\t, end = i + num_pieces; i < end; ++i)\n+\t\t\t\t{\n+\t\t\t\t\tmask[std::size_t(i)] = true;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tti->free_piece_layers();\n+\t\t}\n+\t\tatp.info_hashes = atp.ti->info_hashes();\n+\t}\n+}\n+\n+\tadd_torrent_params load_torrent_file(std::string const& filename)\n+\t{ return load_torrent_file(filename, load_torrent_limits{}); }\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer)\n+\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); }\n+\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file)\n+\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); }\n+\n+
    \tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n+
    \t{\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(filename, cfg);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\n \t{\n-\t\tif (m_thread && m_thread.use_count() == 1)\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(buffer, cfg, from_span);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n+\t{\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(torrent_file, cfg);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+}\n+\n+
    relevance 0../src/web_connection_base.cpp:72introduce a web-seed default class which has a low download priority

    introduce a web-seed default class which has a low download priority

    ../src/web_connection_base.cpp:72

    \t\t: peer_connection(pack)\n+\t\t, m_first_request(true)\n+\t\t, m_ssl(false)\n+\t\t, m_external_auth(web.auth)\n+\t\t, m_extra_headers(web.extra_headers)\n+\t\t, m_parser(http_parser::dont_parse_chunks)\n+\t\t, m_body_start(0)\n+\t{\n+\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo);\n+\t\t// when going through a proxy, we don't necessarily have an endpoint here,\n+\t\t// since the proxy might be resolving the hostname, not us\n+\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp);\n+\n+\t\tINVARIANT_CHECK;\n+\n+\t\tTORRENT_ASSERT(is_outgoing());\n+\n+\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\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+\n+#if TORRENT_USE_SSL\n+\t\tif (protocol == \"https\")\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\tm_ssl = true;\n+\t\t\tif (m_port == -1) m_port = 443;\n \t\t}\n+#endif\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-\tTORRENT_EXPORT std::unique_ptr<disk_interface> default_disk_io_constructor(\n-\t\tio_context& ios, settings_interface const& sett, counters& cnt)\n+\tint web_connection_base::timeout() const\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+\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/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-#else\n-\t\treturn posix_disk_io_constructor(ios, sett, cnt);\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\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast<std::size_t>(len));\n+#if defined __GNUC__ && __GNUC__ == 12\n+#pragma GCC diagnostic pop\n #endif\n+\t\t\tstd::memset(begin, 0, aux::numeric_cast<std::size_t>(96 - len));\n+\t\t}\n+\t\treturn ret;\n \t}\n \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+\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\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/ut_metadata.cpp:281we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

    we really need to increment the refcounter on the torrent\n+while this buffer is still in the peer's send buffer

    ../src/ut_metadata.cpp:281

    \t\t\t\tint const offset = piece * 16 * 1024;\n+\t\t\t\tmetadata = m_tp.metadata().data() + offset;\n+\t\t\t\tmetadata_piece_size = std::min(\n+\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024);\n+\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0);\n+\t\t\t\tTORRENT_ASSERT(offset >= 0);\n+\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size());\n+\t\t\t}\n+\n+\t\t\tchar msg[200];\n+\t\t\tchar* header = msg;\n+\t\t\tchar* p = &msg[6];\n+\t\t\tint const len = bencode(p, e);\n+\t\t\tint const total_size = 2 + len + metadata_piece_size;\n+\t\t\tnamespace io = aux;\n+\t\t\tio::write_uint32(total_size, header);\n+\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header);\n+\t\t\tio::write_uint8(m_message_index, header);\n+\n+\t\t\tm_pc.send_buffer({msg, len + 6});\n+
    \t\t\tif (metadata_piece_size)\n+
    \t\t\t{\n+\t\t\t\tm_pc.append_const_send_buffer(\n+\t\t\t\t\tspan<char>(const_cast<char*>(metadata), metadata_piece_size), metadata_piece_size);\n+\t\t\t}\n+\n+\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended);\n+\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata);\n+\t\t}\n+\n+\t\tbool on_extended(int const length\n+\t\t\t, int const extended_msg, span<char const> body) override\n+\t\t{\n+\t\t\tif (extended_msg != 2) return false;\n+\t\t\tif (m_message_index == 0) return false;\n+\n+\t\t\tif (length > 17 * 1024)\n+\t\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\"\n+\t\t\t\t\t, \"packet too big %d\", length);\n+#endif\n+\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error);\n+\t\t\t\treturn true;\n+\t\t\t}\n+\n+\t\t\tif (!m_pc.packet_finished()) return true;\n+\n+\t\t\terror_code ec;\n+\t\t\tbdecode_node msg = bdecode(body, ec);\n+\t\t\tif (msg.type() != bdecode_node::dict_t)\n+
    relevance 0../src/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 #if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n@@ -6842,15 +8206,15 @@\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+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@@ -6867,15 +8231,15 @@\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+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@@ -6919,274 +8283,498 @@\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/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+
    relevance 0../src/torrent.cpp:1941this 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:1941

    //\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\tINVARIANT_CHECK;\n+\t\tset_state(torrent_status::checking_resume_data);\n \n-\t\tTORRENT_ASSERT(is_outgoing());\n+\t\taux::vector<std::string, file_index_t> links;\n+#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n+\t\tif (!m_torrent_file->similar_torrents().empty()\n+\t\t\t|| !m_torrent_file->collections().empty())\n+\t\t{\n+\t\t\tresolve_links res(m_torrent_file);\n \n-\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\n+\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n+\t\t\t{\n+\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n+\t\t\t\tif (!t) continue;\n \n-\t\t// we only want left-over bandwidth\n-
    \n-
    \t\tstd::string protocol;\n-\t\terror_code ec;\n-\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path)\n-\t\t\t= parse_url_components(web.url, ec);\n-\t\tTORRENT_ASSERT(!ec);\n+\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+
    \t\t\t\tif (!t->is_seed()) continue;\n+
    \n+\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t}\n+\t\t\tfor (auto const& c : m_torrent_file->collections())\n+\t\t\t{\n+\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n \n-\t\tif (m_port == -1 && protocol == \"http\")\n-\t\t\tm_port = 80;\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:1954this 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:1954

    \t\t{\n+\t\t\tresolve_links res(m_torrent_file);\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\tfor (auto const& ih : m_torrent_file->similar_torrents())\n+\t\t\t{\n+\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n+\t\t\t\tif (!t) continue;\n+\n+\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+\t\t\t\tif (!t->is_seed()) continue;\n+\n+\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t}\n+\t\t\tfor (auto const& c : m_torrent_file->collections())\n+\t\t\t{\n+\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n+\n+\t\t\t\tfor (auto const& t : ts)\n+\t\t\t\t{\n+\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+
    \t\t\t\t\tif (!t->is_seed()) continue;\n+
    \n+\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tstd::vector<resolve_links::link_t> const& l = res.get_links();\n+\t\t\tif (!l.empty())\n+\t\t\t{\n+\t\t\t\tlinks.resize(m_torrent_file->files().num_files());\n+\t\t\t\tfor (auto const& i : l)\n+\t\t\t\t{\n+\t\t\t\t\tif (!i.ti) continue;\n+\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path\n+\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx));\n+\t\t\t\t}\n+\t\t\t}\n \t\t}\n+#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n+\n+#if TORRENT_USE_ASSERTS\n+\t\tTORRENT_ASSERT(m_outstanding_check_files == false);\n+\t\tm_outstanding_check_files = true;\n #endif\n \n-\t\tif (!m_basic_auth.empty())\n-\t\t\tm_basic_auth = base64encode(m_basic_auth);\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:2715this 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:2715

    \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\tm_server_string = m_host;\n-\t\taux::verify_encoding(m_server_string);\n-\t}\n+\t\tif (!m_announce_to_lsd) return;\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/performance_counters.cpp:40move stats_counter_t out of counters

    move stats_counter_t out of counters

    ../src/performance_counters.cpp:40

    relevance 0../src/performance_counters.cpp:41should bittorrent keep-alive messages have a counter too?

    should bittorrent keep-alive messages have a counter too?

    ../src/performance_counters.cpp:41

    relevance 0../src/performance_counters.cpp:42It would be nice if this could be an internal type. default_disk_constructor depends on it now

    It would be nice if this could be an internal type. default_disk_constructor depends on it now

    ../src/performance_counters.cpp:42

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n+\t\t// private torrents are never announced on LSD\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return;\n \n-*/\n+#if TORRENT_USE_I2P\n+\t\t// i2p torrents are also never announced on LSD\n+\t\t// unless we allow mixed swarms\n+\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed))\n+\t\t\treturn;\n+#endif\n \n-#include \"libtorrent/performance_counters.hpp\"\n-#include \"libtorrent/assert.hpp\"\n-#include <cstring> // for memset\n+\t\tif (is_paused()) return;\n \n-namespace libtorrent {\n+\t\tif (!m_ses.has_lsd()) return;\n \n-
    \tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n-
    \t{\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (auto& counter : m_stats_counter)\n-\t\t\tcounter.store(0, std::memory_order_relaxed);\n+
    #ifdef TORRENT_SSL_PEERS\n+
    \t\tint port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port();\n #else\n-\t\tm_stats_counter.fill(0);\n+\t\tint port = m_ses.listen_port();\n #endif\n+\n+\t\t// announce with the local discovery service\n+\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version)\n+\t\t{\n+\t\t\tm_ses.announce_lsd(ih, port);\n+\t\t});\n \t}\n \n-\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT\n+#ifndef TORRENT_DISABLE_DHT\n+\n+\tvoid torrent::dht_announce()\n \t{\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n-\t\t\tm_stats_counter[i].store(\n-\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n-\t\t\t\t\t, std::memory_order_relaxed);\n-#else\n-\t\tstd::lock_guard<std::mutex> l(c.m_mutex);\n-\t\tm_stats_counter = c.m_stats_counter;\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (!m_ses.dht())\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tdebug_log(\"DHT: no dht initialized\");\n+#endif\n+\t\t\treturn;\n+\t\t}\n+\t\tif (!should_announce_dht())\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+#if TORRENT_USE_I2P\n+
    relevance 0../src/torrent.cpp:3870add one peer per IP the hostname resolves to

    add one peer per IP the hostname resolves to

    ../src/torrent.cpp:3870

    \tcatch (...) { handle_exception(); }\n #endif\n-\t}\n \n-\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT\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\tif (&c == this) return *this;\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n-\t\t\tm_stats_counter[i].store(\n-\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n-\t\t\t\t\t, std::memory_order_relaxed);\n-
    relevance 0../src/torrent_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+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tINVARIANT_CHECK;\n+\n+\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\");\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (e && should_log())\n+\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str());\n #endif\n \n-\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const\n-\t{\n-\t\tasync_call(&torrent::set_file_priority, index, priority);\n-\t}\n+\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return;\n \n-\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const\n-\t{\n-\t\treturn sync_call_ret<download_priority_t>(dont_download, &torrent::file_priority, index);\n-\t}\n+
    \t\ttcp::endpoint host(host_list.front(), std::uint16_t(port));\n+
    \n+\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked)\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str());\n+\t\t\t}\n+#endif\n+\t\t\tif (m_ses.alerts().should_post<peer_blocked_alert>())\n+\t\t\t\tm_ses.alerts().emplace_alert<peer_blocked_alert>(get_handle()\n+\t\t\t\t\t, host, peer_blocked_alert::ip_filter);\n+\t\t\treturn;\n+\t\t}\n \n-
    \tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n-
    \t{\n-\t\tasync_call(&torrent::prioritize_files\n-\t\t\t, static_cast<aux::vector<download_priority_t, file_index_t> const&>(files));\n-\t}\n+\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0)))\n+\t\t{\n+\t\t\tstate_updated();\n \n-\tstd::vector<download_priority_t> torrent_handle::get_file_priorities() const\n-\t{\n-\t\taux::vector<download_priority_t, file_index_t> ret;\n-\t\tauto retp = &ret;\n-\t\tsync_call(&torrent::file_priorities, retp);\n-\t\treturn TORRENT_RVO(ret);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\"\n+\t\t\t\t\t, host.address().to_string().c_str()\n+\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1);\n+\t\t\t}\n+#endif\n+\t\t}\n+\t\tupdate_want_peers();\n \t}\n+
    relevance 0../src/torrent.cpp:4562only 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:4562

    \t\t{\n+\t\t\tstd::set<torrent_peer*> ret;\n+\t\t\tif (!blocks.empty() && !downloaders.empty())\n+\t\t\t{\n+\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]);\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin()));\n+\t\t\t}\n+\t\t\treturn ret;\n+\t\t}();\n \n-#if TORRENT_ABI_VERSION == 1\n+\t\t// if this piece wasn't downloaded from peers, we just found it on disk.\n+\t\t// In that case, we should just consider it as \"not-have\" and there's no\n+\t\t// need to try to get higher fidelity hashes (yet)\n+\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr);\n \n-// ============ start deprecation ===============\n+\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk)\n+\t\t{\n+
    \t\t\tverify_block_hashes(index);\n+
    \t\t}\n \n-\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n-\t{\n-\t\taux::vector<download_priority_t, file_index_t> file_prio;\n-\t\tfile_prio.reserve(files.size());\n-\t\tfor (auto const p : files) {\n-\t\t\tfile_prio.push_back(download_priority_t(static_cast<std::uint8_t>(p)));\n+\t\t// the below code is penalizing peers that sent use bad data.\n+\t\t// increase the total amount of failed bytes\n+\t\tif (!found_on_disk)\n+\t\t{\n+\t\t\tif (blocks.empty())\n+\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index));\n+\t\t\telse\n+\t\t\t\tadd_failed_bytes(static_cast<int>(blocks.size()) * default_block_size);\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\t\tfor (auto& ext : m_extensions)\n+\t\t\t{\n+\t\t\t\text->on_piece_failed(index);\n+\t\t\t}\n+#endif\n+\n+\t\t\t// did we receive this piece from a single peer?\n+\t\t\t// if we know exactly which blocks failed the hash, we can also be certain\n+\t\t\t// that all peers in the list sent us bad data\n+\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty();\n+\n+\t\t\tpenalize_peers(peers, index, known_bad_peer);\n \t\t}\n-\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/posix_part_file.cpp:337what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n-from this piece? does it matter? Since we won't actively erase the\n-data from disk, but it may be overwritten soon, it's probably not that\n-big of a deal

    ../src/posix_part_file.cpp:337

    \n-\t\t\tif (ec) return {};\n+\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:7501come 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:7501

    \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-#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+\t\t\t// don't make a TCP connection if it's disabled\n+\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp))\n+\t\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tif (should_log())\n+\t\t\t\t{\n+\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \"\n+\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str()\n+\t\t\t\t\t\t, peerinfo->supports_utp);\n+\t\t\t\t}\n #endif\n-\t\t\tif (ret.file() == nullptr)\n-\t\t\t\tec.assign(errno, generic_category());\n+\t\t\t\treturn false;\n+\t\t\t}\n \t\t}\n-\t\tif (ec) return {};\n-\t\treturn ret;\n-\t}\n \n-\tvoid posix_part_file::free_piece(piece_index_t const piece)\n-\t{\n-\t\tauto const i = m_piece_map.find(piece);\n-\t\tif (i == m_piece_map.end()) return;\n+
    \t\taux::socket_type s = [&] {\n+
    \n+#if TORRENT_USE_I2P\n+\t\tif (peerinfo->is_i2p_addr)\n+\t\t{\n+\t\t\t// It's not entirely obvious why this peer connection is not marked as\n+\t\t\t// one. The main feature of a peer connection is that whether or not we\n+\t\t\t// proxy it is configurable. When we use i2p, we want to always prox\n+\t\t\t// everything via i2p.\n \n-
    \n-
    \t\tm_free_slots.push_back(i->second);\n-\t\tm_piece_map.erase(i);\n-\t\tm_dirty_metadata = true;\n+\t\t\taux::proxy_settings proxy;\n+\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname);\n+\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port));\n+\t\t\tproxy.type = settings_pack::i2p_proxy;\n+\n+\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context()\n+\t\t\t\t, proxy, nullptr, nullptr, false, false);\n+\t\t\ti2p_stream& str = boost::get<i2p_stream>(ret);\n+\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint());\n+\t\t\tstr.set_destination(static_cast<i2p_peer*>(peerinfo)->dest());\n+\t\t\tstr.set_command(i2p_stream::cmd_connect);\n+\t\t\tstr.set_session_id(m_ses.i2p_session());\n+\t\t\treturn ret;\n+\t\t}\n+\t\telse\n+#endif\n+\t\t{\n+\t\t\tvoid* userdata = nullptr;\n+#ifdef TORRENT_SSL_PEERS\n+\t\t\tif (is_ssl_torrent())\n+\t\t\t{\n+
    relevance 0../src/torrent.cpp:9091perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9091

    \t\t// finished torrents may not change their queue positions, as it's set to\n+\t\t// -1\n+\t\tif ((m_abort || is_finished()) && p != no_pos) return;\n+\n+\t\tTORRENT_ASSERT((p == no_pos) == is_finished()\n+\t\t\t|| (!m_auto_managed && p == no_pos)\n+\t\t\t|| (m_abort && p == no_pos)\n+\t\t\t|| (!m_added && p == no_pos));\n+\t\tif (p == m_sequence_number) return;\n+\n+\t\tTORRENT_ASSERT(p >= no_pos);\n+\n+\t\tstate_updated();\n+\n+\t\tm_ses.set_queue_position(this, p);\n \t}\n \n-\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec)\n+\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n \t{\n-\t\tflush_metadata_impl(ec);\n-\t\tif (ec) return;\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n+
    \t\tif (int(m_max_uploads) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n+#endif\n \n-\t\tif (!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+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n+\t}\n \n-\t\t\trename(old_path, new_path, ec);\n-\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.clear();\n+\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:9108perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9108

    \n+\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (limit <= 0) limit = (1 << 24) - 1;\n+\t\tif (int(m_max_uploads) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n+#endif\n \n-\t\t\tif (ec)\n-\t\t\t{\n-\t\t\t\tstorage_error se;\n-\t\t\t\taux::copy_file(old_path, new_path, se);\n-\t\t\t\tec = se.ec;\n-\t\t\t\tif (ec) return;\n-\t\t\t\tremove(old_path, ec);\n-\t\t\t}\n-\t\t}\n-\t\tm_path = path;\n+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n \t}\n-
    relevance 0../src/posix_part_file.cpp:425instead 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:425

    \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\tTORRENT_ASSERT(!ec);\n-\t\t\t\tif (ec) return;\n+\tvoid torrent::set_max_connections(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n+
    \t\tif (int(m_max_connections) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_connections = aux::numeric_cast<std::uint32_t>(limit);\n+\t\tupdate_want_peers();\n \n-\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+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections);\n+#endif\n+\n+\t\tif (num_peers() > int(m_max_connections))\n+\t\t{\n+\t\t\tdisconnect_peers(num_peers() - m_max_connections\n+\t\t\t\t, errors::too_many_connections);\n \t\t}\n+\n+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n \t}\n \n-\tvoid posix_part_file::flush_metadata(error_code& ec)\n+\tvoid torrent::set_upload_limit(int const limit)\n \t{\n-\t\tflush_metadata_impl(ec);\n+\t\tset_limit_impl(limit, peer_connection::upload_channel);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tdebug_log(\"*** set-upload-limit: %d\", limit);\n+#endif\n \t}\n \n-
    \tvoid 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+\tvoid torrent::set_download_limit(int const limit)\n+\t{\n+
    relevance 0../src/torrent.cpp:11034instead 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:11034

    \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\tif (m_piece_map.empty())\n-\t\t{\n-\t\t\t// if we don't have any pieces left in the\n-\t\t\t// part file, remove it\n-\t\t\tstd::string const p = combine_path(m_path, m_name);\n-\t\t\tremove(p, ec);\n+\t\t\t// pick all blocks for this piece. the peers list is kept up to date\n+\t\t\t// and sorted. when we issue a request to a peer, its download queue\n+\t\t\t// time will increase and it may need to be bumped in the peers list,\n+\t\t\t// since it's ordered by download queue time\n+\t\t\tpick_time_critical_block(peers, ignore_peers\n+\t\t\t\t, peers_with_requests\n+\t\t\t\t, pi, &i, m_picker.get()\n+\t\t\t\t, blocks_in_piece, timed_out);\n \n-\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.clear();\n-\t\t\treturn;\n-\t\t}\n+\t\t\t// put back the peers we ignored into the peer list for the next piece\n+\t\t\tif (!ignore_peers.empty())\n+\t\t\t{\n+\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end());\n+\t\t\t\tignore_peers.clear();\n \n-\t\tauto f = open_file(open_mode::read_write, ec);\n-\t\tif (ec) return;\n+
    \t\t\t\tstd::sort(peers.begin(), peers.end()\n+
    \t\t\t\t\t, [] (peer_connection const* lhs, peer_connection const* rhs)\n+\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); });\n+\t\t\t}\n \n-\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size));\n+\t\t\t// if this peer's download time exceeds 2 seconds, we're done.\n+\t\t\t// We don't want to build unreasonably long request queues\n+\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000))\n+\t\t\t\tbreak;\n+\t\t}\n \n-\t\tusing namespace libtorrent::aux;\n+\t\t// commit all the time critical requests\n+\t\tfor (auto p : peers_with_requests)\n+\t\t{\n+\t\t\tp->send_block_requests();\n+\t\t}\n+\t}\n+#endif // TORRENT_DISABLE_STREAMING\n \n-\t\tchar* ptr = header.data();\n-\t\twrite_uint32(m_max_pieces, ptr);\n-\t\twrite_uint32(m_piece_size, ptr);\n+\tstd::set<std::string> torrent::web_seeds(web_seed_entry::type_t const type) const\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tstd::set<std::string> ret;\n+\t\tfor (auto const& s : m_web_seeds)\n+\t\t{\n+\t\t\tif (s.peer_info.banned) continue;\n+\t\t\tif (s.removed) continue;\n+\t\t\tif (s.type != type) continue;\n+\t\t\tret.insert(s.url);\n+\t\t}\n+\t\treturn ret;\n+
    relevance 0../src/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\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n+\t\tvoid crypto_random_bytes(span<char> buffer)\n \t\t{\n-\t\t\tauto const i = m_piece_map.find(piece);\n-
    relevance 0../src/session_impl.cpp:615come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store

    come up with some abstraction to do this for gnutls as well\n+#ifdef TORRENT_BUILD_SIMULATOR\n+\t\t\t// In the simulator we want deterministic random numbers\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#elif TORRENT_USE_CNG\n+\t\t\taux::cng_gen_random(buffer);\n+#elif TORRENT_USE_CRYPTOAPI\n+\t\t\t// windows\n+\t\t\taux::crypt_gen_random(buffer);\n+#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL\n+// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the\n+// openssl compatibility layer. This function API does not support\n+// an arbitrary buffer size (openssl does), it is limited by the\n+// constant RNG_MAX_BLOCK_LEN.\n+
    \n+
    \t\t\t// openssl\n+\t\t\tint r = RAND_bytes(reinterpret_cast<unsigned char*>(buffer.data())\n+\t\t\t\t, int(buffer.size()));\n+\t\t\tif (r != 1) aux::throw_ex<system_error>(errors::no_entropy);\n+#elif TORRENT_USE_GETRANDOM\n+\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast<std::size_t>(buffer.size()), 0);\n+\t\t\tif (r == ssize_t(buffer.size())) return;\n+\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex<system_error>(error_code(errno, generic_category()));\n+\t\t\tstatic dev_random dev;\n+\t\t\tdev.read(buffer);\n+#elif TORRENT_USE_DEV_RANDOM\n+\t\t\tstatic dev_random dev;\n+\t\t\tdev.read(buffer);\n+#else\n+\n+#if TORRENT_BROKEN_RANDOM_DEVICE\n+\t\t\t// even pseudo random numbers rely on being able to seed the random\n+\t\t\t// generator\n+#error \"no entropy source available\"\n+#else\n+#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#else\n+#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\"\n+#endif\n+#endif\n+\n+#endif\n+\t\t}\n+}\n+relevance 0../src/session_impl.cpp:615come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store

    come up with some abstraction to do this for gnutls as well\n load certificates from the windows system certificate store

    ../src/session_impl.cpp:615

    \t\tpause();\n \t}\n #endif\n \n \t// This function is called by the creating thread, not in the message loop's\n \t// io_context thread.\n \tvoid session_impl::start_session()\n@@ -7230,15 +8818,15 @@\n #endif\n #ifdef __APPLE__\n \t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec);\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str());\n \t\tec.clear();\n #endif\n-
    relevance 0../src/session_impl.cpp:1482it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/session_impl.cpp:1482

    \t\t\tbandwidth_channel* ch = &p->channel[peer_connection::download_channel];\n+
    relevance 0../src/session_impl.cpp:1482it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/session_impl.cpp:1482

    \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@@ -7281,15 +8869,15 @@\n \tbool get_setting_impl(Pack const& p, int name, bool*)\n \t{ return p.get_bool(name); }\n \n \ttemplate <typename Pack>\n \tstd::string get_setting_impl(Pack const& p, int name, std::string*)\n \t{ return p.get_str(name); }\n \n-
    relevance 0../src/session_impl.cpp:1996could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost identical, maybe the latter could be removed too

    could this function be merged with expand_unspecified_addresses?\n+relevance 0../src/session_impl.cpp:1996could 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:1996

    \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@@ -7334,15 +8922,15 @@\n \t\t\t\t// (which must be of the same family as the address we're\n \t\t\t\t// connecting to)\n \t\t\t\tif (iface.device != ipface.name) continue;\n \n \t\t\t\tbool const local = iface.local\n \t\t\t\t\t|| ipface.interface_address.is_loopback()\n \t\t\t\t\t|| is_link_local(ipface.interface_address);\n-
    relevance 0../src/session_impl.cpp:2304it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to disable a tracker, we set the version number that it was disabled at. This change would affect the ABI in 1.2, so should be done in 2.0 or later

    it would probably be better to do this by having a\n+relevance 0../src/session_impl.cpp:2304it 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:2304

    \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@@ -7389,15 +8977,15 @@\n \t\t\tif (ep != EndpointType())\n \t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device);\n \t\t}\n \t}\n \n \tvoid session_impl::remap_ports(remap_port_mask_t const mask\n \t\t, listen_socket_t& s)\n-
    relevance 0../src/session_impl.cpp:2864this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2864

    \t\t\t\t// handshaking\n+
    relevance 0../src/session_impl.cpp:2864this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2864

    \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@@ -7433,15 +9021,15 @@\n \n \tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n \t{\n \t\tTORRENT_ASSERT(is_ssl(s));\n \n \t\t// save the socket so we can cancel the handshake\n \n-
    relevance 0../src/session_impl.cpp:2889this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2889

    \t\t\t// after the handshake is done\n+
    relevance 0../src/session_impl.cpp:2889this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2889

    \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@@ -7484,15 +9072,15 @@\n \t\tif (iter == m_incoming_sockets.end()) return;\n \n \t\tsocket_type s(std::move(**iter));\n \t\tTORRENT_ASSERT(is_ssl(s));\n \t\tm_incoming_sockets.erase(iter);\n \n \t\terror_code e;\n-
    relevance 0../src/session_impl.cpp:3588have 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:3588

    \t\t// --------------------------------------------------------------\n+
    relevance 0../src/session_impl.cpp:3588have 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:3588

    \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@@ -7535,15 +9123,15 @@\n \n \t\t\t// if the call to second_tick caused the torrent\n \t\t\t// to no longer want to be ticked (i.e. it was\n \t\t\t// removed from the list) we need to back up the counter\n \t\t\t// to not miss the torrent after it\n \t\t\tif (!t.want_tick()) --i;\n \t\t}\n-
    relevance 0../src/session_impl.cpp:3621this should apply to all bandwidth channels

    this should apply to all bandwidth channels

    ../src/session_impl.cpp:3621

    #if TORRENT_DEBUG_STREAMING > 0\n+
    relevance 0../src/session_impl.cpp:3621this should apply to all bandwidth channels

    this should apply to all bandwidth channels

    ../src/session_impl.cpp:3621

    #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@@ -7586,15 +9174,15 @@\n #endif\n \n \t\tm_stat.second_tick(tick_interval_ms);\n \n \t\t// --------------------------------------------------------------\n \t\t// scrape paused torrents that are auto managed\n \t\t// (unless the session is paused)\n-
    relevance 0../src/session_impl.cpp:4312use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap this at max - 1, since we may add one below

    use a lower limit than m_settings.connections_limit\n+relevance 0../src/session_impl.cpp:4312use 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:4312

    \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@@ -7640,15 +9228,15 @@\n \n \t\t\tif (m_next_finished_connect_torrent >= int(want_peers_finished.size()))\n \t\t\t\tm_next_finished_connect_torrent = 0;\n \n \t\t\ttorrent* t = nullptr;\n \t\t\t// there are prioritized torrents. Pick one of those\n \t\t\twhile (!m_prio_torrents.empty())\n-
    relevance 0../src/session_impl.cpp:4457post a message to have this happen immediately instead of waiting for the next tick

    post a message to have this happen\n+relevance 0../src/session_impl.cpp:4457post 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:4457

    \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@@ -7692,15 +9280,15 @@\n \t\tif (should_log())\n \t\t{\n \t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \"\n \t\t\t\t\"eligible-peers: %d\"\n \t\t\t\t\" allowed-slots: %d ]\"\n \t\t\t\t, int(m_connections.size())\n \t\t\t\t, int(peers.size())\n-
    relevance 0../src/session_impl.cpp:4784it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have a fixed array of n entries rather than a vector, to further improve memory locality.

    it might be a nice feature here to limit the number of torrents\n+relevance 0../src/session_impl.cpp:4784it 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:4784

    \t\t\tt->status(&st, flags);\n \t\t}\n \t}\n@@ -7748,15 +9336,15 @@\n \t\t\tm_posted_stats_header = true;\n \t\t\tm_alerts.emplace_alert<session_stats_header_alert>();\n \t\t}\n \t\tm_disk_thread->update_stats_counters(m_stats_counters);\n \n #ifndef TORRENT_DISABLE_DHT\n \t\tif (m_dht)\n-
    relevance 0../src/session_impl.cpp:5159factor out this logic into a separate function for unit testing

    factor out this logic into a separate function for unit\n+relevance 0../src/session_impl.cpp:5159factor 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:5159

    \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@@ -7800,15 +9388,15 @@\n \n \t\t\t\tif (ls->flags & listen_socket_t::proxy\n \t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask))\n \t\t\t\t{\n \t\t\t\t\t// is this better than the previous match?\n \t\t\t\t\tmatch = ls;\n \t\t\t\t}\n-
    relevance 0../src/session_impl.cpp:5878refactor, move the storage to dht_tracker

    refactor, move the storage to dht_tracker

    ../src/session_impl.cpp:5878

    #ifndef TORRENT_DISABLE_LOGGING\n+
    relevance 0../src/session_impl.cpp:5878refactor, move the storage to dht_tracker

    refactor, move the storage to dht_tracker

    ../src/session_impl.cpp:5878

    #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@@ -7851,15 +9439,15 @@\n \t\tfor (auto const& n : m_dht_router_nodes)\n \t\t{\n \t\t\tm_dht->add_router_node(n);\n \t\t}\n \n \t\tfor (auto const& n : m_dht_nodes)\n \t\t{\n-
    relevance 0../src/session_impl.cpp:6265asserts that no outstanding async operations are still in flight

    asserts that no outstanding async operations are still in flight

    ../src/session_impl.cpp:6265

    \t\tif (!m_dht) return;\n+
    relevance 0../src/session_impl.cpp:6265asserts that no outstanding async operations are still in flight

    asserts that no outstanding async operations are still in flight

    ../src/session_impl.cpp:6265

    \t\tif (!m_dht) return;\n \t\tm_dht->direct_request(ep, e, std::bind(&on_direct_response, std::ref(m_alerts), userdata, _1));\n \t}\n \n #endif\n \n \tbool session_impl::is_listening() const\n \t{\n@@ -7902,903 +9490,15 @@\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/load_torrent.cpp:121move the loading logic from torrent_info constructor into here

    move the loading logic from torrent_info constructor into here

    ../src/load_torrent.cpp:121

    \t\t\t\tmask.resize(std::size_t(full_size), false);\n-\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size)\n-\t\t\t\t\t, end = i + num_pieces; i < end; ++i)\n-\t\t\t\t{\n-\t\t\t\t\tmask[std::size_t(i)] = true;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\tti->free_piece_layers();\n-\t\t}\n-\t\tatp.info_hashes = atp.ti->info_hashes();\n-\t}\n-}\n-\n-\tadd_torrent_params load_torrent_file(std::string const& filename)\n-\t{ return load_torrent_file(filename, load_torrent_limits{}); }\n-\tadd_torrent_params load_torrent_buffer(span<char const> buffer)\n-\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); }\n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file)\n-\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); }\n-\n-
    \tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n-
    \t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(filename, cfg);\n-\t\tupdate_atp(ret);\n-\t\treturn ret;\n-\t}\n-\n-\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\n-\t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(buffer, cfg, from_span);\n-\t\tupdate_atp(ret);\n-\t\treturn ret;\n-\t}\n-\n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n-\t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(torrent_file, cfg);\n-\t\tupdate_atp(ret);\n-\t\treturn ret;\n-\t}\n-\n-}\n-\n-
    relevance 0../src/cpuid.cpp:131enable when aarch64 is really tested

    enable when aarch64 is really tested

    ../src/cpuid.cpp:131

    \tbool supports_mmx() noexcept\n-\t{\n-#if TORRENT_HAS_SSE\n-\t\tstd::uint32_t cpui[4] = {0};\n-\t\tcpuid(cpui, 1);\n-\t\treturn (cpui[2] & (1 << 23)) != 0;\n-#else\n-\t\treturn false;\n-#endif\n-\t}\n-\n-\tbool supports_arm_neon() noexcept\n-\t{\n-#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV\n-#if defined __arm__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON);\n-\t\treturn (helper_getauxval(16) & (1 << 12));\n-#elif defined __aarch64__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD);\n-\t\t//return (getauxval(16) & (1 << 1));\n-
    \t\treturn false;\n-
    #endif\n-#else\n-\t\treturn false;\n-#endif\n-\t}\n-\n-\tbool supports_arm_crc32c() noexcept\n-\t{\n-#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV\n-#if defined TORRENT_FORCE_ARM_CRC32\n-\t\treturn true;\n-#elif defined __arm__\n-\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32);\n-\t\treturn (helper_getauxval(26) & (1 << 4));\n-#elif defined __aarch64__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32);\n-\t\treturn (helper_getauxval(16) & (1 << 7));\n-#endif\n-#else\n-\t\treturn false;\n-#endif\n-\t}\n-\n-} // anonymous namespace\n-\n-\tbool const sse42_support = supports_sse42();\n-\tbool const mmx_support = supports_mmx();\n-\tbool const arm_neon_support = supports_arm_neon();\n-\tbool const arm_crc32c_support = supports_arm_crc32c();\n-} }\n-
    relevance 0../src/torrent_info.cpp:875this 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:875

    \t\t\tstd::string ext = extension(filename);\n-\t\t\tint cnt = 0;\n-\t\t\tfor (;;)\n-\t\t\t{\n-\t\t\t\t++cnt;\n-\t\t\t\tchar new_ext[50];\n-\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str());\n-\t\t\t\tfilename = base + new_ext;\n-\n-\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc;\n-\t\t\t\tprocess_string_lowercase(crc, filename);\n-\t\t\t\tstd::uint32_t const new_hash = crc.checksum();\n-\t\t\t\tif (files.find(new_hash) == files.end())\n-\t\t\t\t{\n-\t\t\t\t\tfiles.insert({new_hash, {i, 0}});\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\t++num_collisions;\n-\t\t\t\tif (num_collisions > 100)\n-\t\t\t\t{\n-
    \t\t\t\t}\n-
    \t\t\t}\n-\n-\t\t\tcopy_on_write();\n-\t\t\tm_files.rename_file(i, filename);\n-\t\t}\n-\t}\n-\n-\tvoid torrent_info::remap_files(file_storage const& f)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tTORRENT_ASSERT(is_loaded());\n-\t\t// the new specified file storage must have the exact\n-\t\t// same size as the current file storage\n-\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size());\n-\n-\t\tif (m_files.total_size() != f.total_size()) return;\n-\t\tcopy_on_write();\n-\t\tm_files = f;\n-\t\tm_files.set_num_pieces(m_orig_files->num_pieces());\n-\t\tm_files.set_piece_length(m_orig_files->piece_length());\n-\t}\n-\n-#if TORRENT_ABI_VERSION == 1\n-\t// standard constructor that parses a torrent file\n-\ttorrent_info::torrent_info(entry const& torrent_file)\n-\t{\n-\t\tstd::vector<char> tmp;\n-\t\tstd::back_insert_iterator<std::vector<char>> out(tmp);\n-\t\tbencode(out, torrent_file);\n-
    relevance 0../src/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:589it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/settings_pack.cpp:589

    \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-\tsettings_pack default_settings()\n-\t{\n-\t\tsettings_pack ret;\n-
    \t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n-
    \t\t{\n-\t\t\tif (str_settings[i].default_value == nullptr) continue;\n-\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value);\n-\t\t}\n-\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/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-
    \n-
    \tADD_OUTSTANDING_ASYNC(\"socks5::on_connected\");\n-\tm_socks5_sock.async_connect(m_proxy_addr\n-\t\t, std::bind(&socks5::on_connected, self(), _1));\n-\n-\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\");\n-\tm_timer.expires_after(seconds(10));\n-\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout\n-\t\t, self(), _1));\n-}\n-\n-void socks5::on_connect_timeout(error_code const& e)\n-{\n-\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\n-\n-\tif (e == boost::asio::error::operation_aborted) return;\n-\n-\tif (m_abort) return;\n-\n-\tif (m_alerts.should_post<socks5_alert>())\n-\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::connect, errors::timed_out);\n-\n-\terror_code ignore;\n-\tm_socks5_sock.close(ignore);\n-\n-\t++m_failures;\n-\tretry_connection();\n-}\n-\n-void socks5::on_connected(error_code const& e)\n-{\n-
    relevance 0../src/torrent.cpp:1941this 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:1941

    //\t\t\t\tTORRENT_ASSERT(picker().have_piece(i));\n-\t\t\t\twe_have(i);\n-\t\t\t}\n-\t\t}\n-\n-\t\tset_state(torrent_status::checking_resume_data);\n-\n-\t\taux::vector<std::string, file_index_t> links;\n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\tif (!m_torrent_file->similar_torrents().empty()\n-\t\t\t|| !m_torrent_file->collections().empty())\n-\t\t{\n-\t\t\tresolve_links res(m_torrent_file);\n-\n-\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n-\t\t\t{\n-\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n-\t\t\t\tif (!t) continue;\n-\n-\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    \t\t\t\tif (!t->is_seed()) continue;\n-
    \n-\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t}\n-\t\t\tfor (auto const& c : m_torrent_file->collections())\n-\t\t\t{\n-\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n-\n-\t\t\t\tfor (auto const& t : ts)\n-\t\t\t\t{\n-\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    relevance 0../src/torrent.cpp:1954this 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:1954

    \t\t{\n-\t\t\tresolve_links res(m_torrent_file);\n-\n-\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n-\t\t\t{\n-\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n-\t\t\t\tif (!t) continue;\n-\n-\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-\t\t\t\tif (!t->is_seed()) continue;\n-\n-\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t}\n-\t\t\tfor (auto const& c : m_torrent_file->collections())\n-\t\t\t{\n-\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n-\n-\t\t\t\tfor (auto const& t : ts)\n-\t\t\t\t{\n-\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    \t\t\t\t\tif (!t->is_seed()) continue;\n-
    \n-\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tstd::vector<resolve_links::link_t> const& l = res.get_links();\n-\t\t\tif (!l.empty())\n-\t\t\t{\n-\t\t\t\tlinks.resize(m_torrent_file->files().num_files());\n-\t\t\t\tfor (auto const& i : l)\n-\t\t\t\t{\n-\t\t\t\t\tif (!i.ti) continue;\n-\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path\n-\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx));\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tTORRENT_ASSERT(m_outstanding_check_files == false);\n-\t\tm_outstanding_check_files = true;\n-#endif\n-\n-\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files))\n-\t\t{\n-\t\t\tm_ses.disk_thread().async_check_files(\n-\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr\n-\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error)\n-\t\t\t\t{ self->on_resume_data_checked(st, error); });\n-
    relevance 0../src/torrent.cpp:2715this 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:2715

    \t\t// not ready for peers. Except, if we don't have metadata,\n-\t\t// we need peers to download from\n-\t\tif (!m_files_checked && valid_metadata()) return;\n-\n-\t\tif (!m_announce_to_lsd) return;\n-\n-\t\t// private torrents are never announced on LSD\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return;\n-\n-#if TORRENT_USE_I2P\n-\t\t// i2p torrents are also never announced on LSD\n-\t\t// unless we allow mixed swarms\n-\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed))\n-\t\t\treturn;\n-#endif\n-\n-\t\tif (is_paused()) return;\n-\n-\t\tif (!m_ses.has_lsd()) return;\n-\n-
    #ifdef TORRENT_SSL_PEERS\n-
    \t\tint port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port();\n-#else\n-\t\tint port = m_ses.listen_port();\n-#endif\n-\n-\t\t// announce with the local discovery service\n-\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version)\n-\t\t{\n-\t\t\tm_ses.announce_lsd(ih, port);\n-\t\t});\n-\t}\n-\n-#ifndef TORRENT_DISABLE_DHT\n-\n-\tvoid torrent::dht_announce()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (!m_ses.dht())\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tdebug_log(\"DHT: no dht initialized\");\n-#endif\n-\t\t\treturn;\n-\t\t}\n-\t\tif (!should_announce_dht())\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-#if TORRENT_USE_I2P\n-
    relevance 0../src/torrent.cpp:3870add one peer per IP the hostname resolves to

    add one peer per IP the hostname resolves to

    ../src/torrent.cpp:3870

    \tcatch (...) { handle_exception(); }\n-#endif\n-\n-\tvoid torrent::on_peer_name_lookup(error_code const& e\n-\t\t, std::vector<address> const& host_list, int const port\n-\t\t, protocol_version const v) try\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tINVARIANT_CHECK;\n-\n-\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\");\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (e && should_log())\n-\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str());\n-#endif\n-\n-\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return;\n-\n-
    \t\ttcp::endpoint host(host_list.front(), std::uint16_t(port));\n-
    \n-\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked)\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str());\n-\t\t\t}\n-#endif\n-\t\t\tif (m_ses.alerts().should_post<peer_blocked_alert>())\n-\t\t\t\tm_ses.alerts().emplace_alert<peer_blocked_alert>(get_handle()\n-\t\t\t\t\t, host, peer_blocked_alert::ip_filter);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0)))\n-\t\t{\n-\t\t\tstate_updated();\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\"\n-\t\t\t\t\t, host.address().to_string().c_str()\n-\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1);\n-\t\t\t}\n-#endif\n-\t\t}\n-\t\tupdate_want_peers();\n-\t}\n-
    relevance 0../src/torrent.cpp:4562only 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:4562

    \t\t{\n-\t\t\tstd::set<torrent_peer*> ret;\n-\t\t\tif (!blocks.empty() && !downloaders.empty())\n-\t\t\t{\n-\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]);\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin()));\n-\t\t\t}\n-\t\t\treturn ret;\n-\t\t}();\n-\n-\t\t// if this piece wasn't downloaded from peers, we just found it on disk.\n-\t\t// In that case, we should just consider it as \"not-have\" and there's no\n-\t\t// need to try to get higher fidelity hashes (yet)\n-\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr);\n-\n-\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk)\n-\t\t{\n-
    \t\t\tverify_block_hashes(index);\n-
    \t\t}\n-\n-\t\t// the below code is penalizing peers that sent use bad data.\n-\t\t// increase the total amount of failed bytes\n-\t\tif (!found_on_disk)\n-\t\t{\n-\t\t\tif (blocks.empty())\n-\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index));\n-\t\t\telse\n-\t\t\t\tadd_failed_bytes(static_cast<int>(blocks.size()) * default_block_size);\n-\n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\t\tfor (auto& ext : m_extensions)\n-\t\t\t{\n-\t\t\t\text->on_piece_failed(index);\n-\t\t\t}\n-#endif\n-\n-\t\t\t// did we receive this piece from a single peer?\n-\t\t\t// if we know exactly which blocks failed the hash, we can also be certain\n-\t\t\t// that all peers in the list sent us bad data\n-\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty();\n-\n-\t\t\tpenalize_peers(peers, index, known_bad_peer);\n-\t\t}\n-\n-\t\t// If m_storage isn't set here, it means we're shutting down\n-\t\tif (m_storage)\n-\t\t{\n-\t\t\t// it doesn't make much sense to fail to hash a piece\n-
    relevance 0../src/torrent.cpp:7501come 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:7501

    \t\t\t\t\t|| peerinfo->confirmed_supports_utp))\n-\t\t\t{\n-\t\t\t\tsm = m_ses.utp_socket_manager();\n-\t\t\t}\n-\n-\t\t\t// don't make a TCP connection if it's disabled\n-\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp))\n-\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \"\n-\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str()\n-\t\t\t\t\t\t, peerinfo->supports_utp);\n-\t\t\t\t}\n-#endif\n-\t\t\t\treturn false;\n-\t\t\t}\n-\t\t}\n-\n-
    \t\taux::socket_type s = [&] {\n-
    \n-#if TORRENT_USE_I2P\n-\t\tif (peerinfo->is_i2p_addr)\n-\t\t{\n-\t\t\t// It's not entirely obvious why this peer connection is not marked as\n-\t\t\t// one. The main feature of a peer connection is that whether or not we\n-\t\t\t// proxy it is configurable. When we use i2p, we want to always prox\n-\t\t\t// everything via i2p.\n-\n-\t\t\taux::proxy_settings proxy;\n-\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname);\n-\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port));\n-\t\t\tproxy.type = settings_pack::i2p_proxy;\n-\n-\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context()\n-\t\t\t\t, proxy, nullptr, nullptr, false, false);\n-\t\t\ti2p_stream& str = boost::get<i2p_stream>(ret);\n-\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint());\n-\t\t\tstr.set_destination(static_cast<i2p_peer*>(peerinfo)->dest());\n-\t\t\tstr.set_command(i2p_stream::cmd_connect);\n-\t\t\tstr.set_session_id(m_ses.i2p_session());\n-\t\t\treturn ret;\n-\t\t}\n-\t\telse\n-#endif\n-\t\t{\n-\t\t\tvoid* userdata = nullptr;\n-#ifdef TORRENT_SSL_PEERS\n-\t\t\tif (is_ssl_torrent())\n-\t\t\t{\n-
    relevance 0../src/torrent.cpp:9091perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9091

    \t\t// finished torrents may not change their queue positions, as it's set to\n-\t\t// -1\n-\t\tif ((m_abort || is_finished()) && p != no_pos) return;\n-\n-\t\tTORRENT_ASSERT((p == no_pos) == is_finished()\n-\t\t\t|| (!m_auto_managed && p == no_pos)\n-\t\t\t|| (m_abort && p == no_pos)\n-\t\t\t|| (!m_added && p == no_pos));\n-\t\tif (p == m_sequence_number) return;\n-\n-\t\tTORRENT_ASSERT(p >= no_pos);\n-\n-\t\tstate_updated();\n-\n-\t\tm_ses.set_queue_position(this, p);\n-\t}\n-\n-\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n-
    \t\tif (int(m_max_uploads) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n-#endif\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n-\t}\n-\n-\tvoid torrent::set_max_connections(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    relevance 0../src/torrent.cpp:9108perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9108

    \n-\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (limit <= 0) limit = (1 << 24) - 1;\n-\t\tif (int(m_max_uploads) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n-#endif\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n-\t}\n-\n-\tvoid torrent::set_max_connections(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n-
    \t\tif (int(m_max_connections) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_connections = aux::numeric_cast<std::uint32_t>(limit);\n-\t\tupdate_want_peers();\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections);\n-#endif\n-\n-\t\tif (num_peers() > int(m_max_connections))\n-\t\t{\n-\t\t\tdisconnect_peers(num_peers() - m_max_connections\n-\t\t\t\t, errors::too_many_connections);\n-\t\t}\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n-\t}\n-\n-\tvoid torrent::set_upload_limit(int const limit)\n-\t{\n-\t\tset_limit_impl(limit, peer_connection::upload_channel);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tdebug_log(\"*** set-upload-limit: %d\", limit);\n-#endif\n-\t}\n-\n-\tvoid torrent::set_download_limit(int const limit)\n-\t{\n-
    relevance 0../src/torrent.cpp:11034instead 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:11034

    \t\t\t\tstd::printf(\"timed out [average-piece-time: %d ms ]\\n\"\n-\t\t\t\t\t, m_average_piece_time);\n-#endif\n-\t\t\t}\n-\n-\t\t\t// pick all blocks for this piece. the peers list is kept up to date\n-\t\t\t// and sorted. when we issue a request to a peer, its download queue\n-\t\t\t// time will increase and it may need to be bumped in the peers list,\n-\t\t\t// since it's ordered by download queue time\n-\t\t\tpick_time_critical_block(peers, ignore_peers\n-\t\t\t\t, peers_with_requests\n-\t\t\t\t, pi, &i, m_picker.get()\n-\t\t\t\t, blocks_in_piece, timed_out);\n-\n-\t\t\t// put back the peers we ignored into the peer list for the next piece\n-\t\t\tif (!ignore_peers.empty())\n-\t\t\t{\n-\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end());\n-\t\t\t\tignore_peers.clear();\n-\n-
    \t\t\t\tstd::sort(peers.begin(), peers.end()\n-
    \t\t\t\t\t, [] (peer_connection const* lhs, peer_connection const* rhs)\n-\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); });\n-\t\t\t}\n-\n-\t\t\t// if this peer's download time exceeds 2 seconds, we're done.\n-\t\t\t// We don't want to build unreasonably long request queues\n-\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000))\n-\t\t\t\tbreak;\n-\t\t}\n-\n-\t\t// commit all the time critical requests\n-\t\tfor (auto p : peers_with_requests)\n-\t\t{\n-\t\t\tp->send_block_requests();\n-\t\t}\n-\t}\n-#endif // TORRENT_DISABLE_STREAMING\n-\n-\tstd::set<std::string> torrent::web_seeds(web_seed_entry::type_t const type) const\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tstd::set<std::string> ret;\n-\t\tfor (auto const& s : m_web_seeds)\n-\t\t{\n-\t\t\tif (s.peer_info.banned) continue;\n-\t\t\tif (s.removed) continue;\n-\t\t\tif (s.type != type) continue;\n-\t\t\tret.insert(s.url);\n-\t\t}\n-\t\treturn ret;\n-
    relevance 0../src/random.cpp:141improve calling RAND_bytes multiple times, using fallback for now

    improve calling RAND_bytes multiple times, using fallback for now

    ../src/random.cpp:141

    #else\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#endif\n-\t\t}\n-\n-\t\tvoid crypto_random_bytes(span<char> buffer)\n-\t\t{\n-#ifdef TORRENT_BUILD_SIMULATOR\n-\t\t\t// In the simulator we want deterministic random numbers\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#elif TORRENT_USE_CNG\n-\t\t\taux::cng_gen_random(buffer);\n-#elif TORRENT_USE_CRYPTOAPI\n-\t\t\t// windows\n-\t\t\taux::crypt_gen_random(buffer);\n-#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL\n-// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the\n-// openssl compatibility layer. This function API does not support\n-// an arbitrary buffer size (openssl does), it is limited by the\n-// constant RNG_MAX_BLOCK_LEN.\n-
    \n-
    \t\t\t// openssl\n-\t\t\tint r = RAND_bytes(reinterpret_cast<unsigned char*>(buffer.data())\n-\t\t\t\t, int(buffer.size()));\n-\t\t\tif (r != 1) aux::throw_ex<system_error>(errors::no_entropy);\n-#elif TORRENT_USE_GETRANDOM\n-\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast<std::size_t>(buffer.size()), 0);\n-\t\t\tif (r == ssize_t(buffer.size())) return;\n-\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex<system_error>(error_code(errno, generic_category()));\n-\t\t\tstatic dev_random dev;\n-\t\t\tdev.read(buffer);\n-#elif TORRENT_USE_DEV_RANDOM\n-\t\t\tstatic dev_random dev;\n-\t\t\tdev.read(buffer);\n-#else\n-\n-#if TORRENT_BROKEN_RANDOM_DEVICE\n-\t\t\t// even pseudo random numbers rely on being able to seed the random\n-\t\t\t// generator\n-#error \"no entropy source available\"\n-#else\n-#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#else\n-#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\"\n-#endif\n-#endif\n-\n-#endif\n-\t\t}\n-}\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+
    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@@ -8841,15 +9541,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:2074this 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:2074this 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:2074

    \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@@ -8896,15 +9596,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:2218Is 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:2218Is 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:2218

    \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@@ -8948,15 +9648,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:2572when 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:2572when 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:2572

    \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@@ -8995,15 +9695,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:3150should 5 be configurable?

    should 5 be configurable?

    ../src/piece_picker.cpp:3150

    \t\tbool have_all = true;\n+
    relevance 0../src/piece_picker.cpp:3150should 5 be configurable?

    should 5 be configurable?

    ../src/piece_picker.cpp:3150

    \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@@ -9046,276 +9746,66 @@\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/storage_utils.cpp:230ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been copied. That would let us rollback with higher confidence.

    ideally, if we end up copying files because of a move across\n-volumes, the source should not be deleted until they've all been\n-copied. That would let us rollback with higher confidence.

    ../src/storage_utils.cpp:230

    \t\t// later\n-\t\taux::vector<bool, file_index_t> copied_files(std::size_t(f.num_files()), false);\n-\n-\t\t// track how far we got in case of an error\n-\t\tfile_index_t file_index{};\n-\t\tfor (auto const i : f.file_range())\n-\t\t{\n-\t\t\t// files moved out to absolute paths are not moved\n-\t\t\tif (f.file_absolute_path(i)) continue;\n-\n-\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n-\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i));\n-\n-\t\t\terror_code ignore;\n-\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore))\n-\t\t\t{\n-\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n-
    \t\t\tmove_file(old_path, new_path, ec);\n-
    \n-\t\t\t// if the source file doesn't exist. That's not a problem\n-\t\t\t// we just ignore that file\n-\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.ec.clear();\n-\t\t\telse if (ec\n-\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument\n-\t\t\t\t&& ec.ec != boost::system::errc::permission_denied)\n-\t\t\t{\n-\t\t\t\t// moving the file failed\n-\t\t\t\t// on OSX, the error when trying to rename a file across different\n-\t\t\t\t// volumes is EXDEV, which will make it fall back to copying.\n-\t\t\t\tec.ec.clear();\n-\t\t\t\tcopy_file(old_path, new_path, ec);\n-\t\t\t\tif (!ec) copied_files[i] = true;\n-\t\t\t}\n-\n-\t\t\tif (ec)\n-\t\t\t{\n-\t\t\t\tec.file(i);\n-\t\t\t\tfile_index = i;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\n-\t\tif (!ec && move_partfile)\n-\t\t{\n-\t\t\terror_code e;\n-\t\t\tmove_partfile(new_save_path, e);\n-\t\t\tif (e)\n-
    relevance 0../src/storage_utils.cpp:538it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic

    it would seem reasonable to, instead, set the have_pieces bits\n-for the pieces representing these files, and resume with the normal\n-logic

    ../src/storage_utils.cpp:538

    \t\t\t\t\tcontinue;\n-\n-\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs\n-\t\t\t\t\t, save_path, ec);\n-\t\t\t\tif (size < 0) return false;\n-\n-\t\t\t\tif (size < fs.file_size(file_index))\n-\t\t\t\t{\n-\t\t\t\t\tec.ec = errors::mismatching_file_size;\n-\t\t\t\t\tec.file(file_index);\n-\t\t\t\t\tec.operation = operation_t::check_resume;\n-\t\t\t\t\treturn false;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\treturn true;\n-\t\t}\n-\n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\t// always trigger a full recheck when we pull in files from other\n-\t\t// torrents, via hard links\n-
    \t\tif (added_files) return false;\n-
    #endif\n-\n-\t\t// parse have bitmask. Verify that the files we expect to have\n-\t\t// actually do exist\n-\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece());\n-\t\tfor (piece_index_t i(0); i < end_piece; ++i)\n-\t\t{\n-\t\t\tif (rd.have_pieces.get_bit(i) == false) continue;\n-\n-\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1);\n-\t\t\tTORRENT_ASSERT(!f.empty());\n-\n-\t\t\tfile_index_t const file_index = f[0].file_index;\n-\n-\t\t\t// files with priority zero may not have been saved to disk at their\n-\t\t\t// expected location, but is likely to be in a partfile. Just exempt it\n-\t\t\t// from checking\n-\t\t\tif (file_index < file_priority.end_index()\n-\t\t\t\t&& file_priority[file_index] == dont_download)\n-\t\t\t\tcontinue;\n-\n-\t\t\tif (fs.pad_file_at(file_index)) continue;\n-\n-\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0)\n-\t\t\t\treturn false;\n-\n-\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in\n-\t\t\t// this file. We're just sanity-checking whether the files exist\n-\t\t\t// or not.\n-\t\t\tpeer_request const pr = fs.map_file(file_index\n-
    relevance 0../src/peer_connection.cpp:1091this should be the global download rate

    this should be the global download rate

    ../src/peer_connection.cpp:1091

    \n-\t\tint rate = 0;\n-\n-\t\t// if we haven't received any data recently, the current download rate\n-\t\t// is not representative\n-\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0)\n-\t\t{\n-\t\t\trate = m_download_rate_peak;\n-\t\t}\n-\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5)\n-\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000)\n-\t\t{\n-\t\t\t// if we're have only been unchoked for a short period of time,\n-\t\t\t// we don't know what rate we can get from this peer. Instead of assuming\n-\t\t\t// the lowest possible rate, assume the average.\n-\n-\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]);\n-\t\t\t// avoid division by 0\n-\t\t\tif (peers_with_requests == 0) peers_with_requests = 1;\n-\n-
    \t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n-
    \t\t}\n-\t\telse\n-\t\t{\n-\t\t\t// current download rate in bytes per seconds\n-\t\t\trate = m_statistics.transfer_rate(stat::download_payload);\n-\t\t}\n-\n-\t\t// avoid division by zero\n-\t\tif (rate < 50) rate = 50;\n-\n-\t\t// average of current rate and peak\n-//\t\trate = (rate + m_download_rate_peak) / 2;\n+
    relevance 0../src/torrent_peer.cpp:181how do we deal with our external address changing?

    how do we deal with our external address changing?

    ../src/torrent_peer.cpp:181

    \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\treturn milliseconds((m_outstanding_bytes + extra_bytes\n-\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\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-\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n+#ifndef TORRENT_DISABLE_LOGGING\n+\tstd::string torrent_peer::to_string() const\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tm_statistics.add_stat(downloaded, uploaded);\n+\t\tTORRENT_ASSERT(in_use);\n+#if TORRENT_USE_I2P\n+\t\tif (is_i2p_addr) return dest().to_string();\n+#endif // TORRENT_USE_I2P\n+\t\treturn address().to_string();\n \t}\n+#endif\n \n-\tsha1_hash peer_connection::associated_info_hash() const\n+\tstd::int64_t torrent_peer::total_download() 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:3520sort the allowed fast set in priority order

    sort the allowed fast set in priority order

    ../src/peer_connection.cpp:3520

    \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->has_piece_passed(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\tTORRENT_ASSERT(in_use);\n+\t\tif (connection != nullptr)\n \t\t{\n-\t\t\tt->peer_is_interesting(*this);\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-\n-\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\n-
    \t\treturn m_allowed_fast;\n-
    \t}\n-\n-\tbool peer_connection::can_request_time_critical() const\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (has_peer_choked() || !is_interesting()) return false;\n-\t\tif (int(m_download_queue.size()) + int(m_request_queue.size())\n-\t\t\t> m_desired_queue_size * 2) return false;\n-\t\tif (on_parole()) return false;\n-\t\tif (m_disconnecting) return false;\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tif (t->upload_mode()) return false;\n-\n-\t\t// ignore snubbed peers, since they're not likely to return pieces in a\n-\t\t// timely manner anyway\n-\t\tif (m_snubbed) return false;\n-\t\treturn true;\n-\t}\n-\n-\tbool peer_connection::make_time_critical(piece_block const& block)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tauto const rit = std::find_if(m_request_queue.begin()\n-\t\t\t, m_request_queue.end(), aux::has_block(block));\n-\t\tif (rit == m_request_queue.end()) return false;\n-#if TORRENT_USE_ASSERTS\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tTORRENT_ASSERT(t->has_picker());\n-
    relevance 0../src/http_seed_connection.cpp:441technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases

    technically, this isn't supposed to happen, but it seems to\n-sometimes. Some of the accounting is probably wrong in certain\n-cases

    ../src/http_seed_connection.cpp:441

    \t\t\t\t\t// cut out the chunk header from the receive buffer\n-\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX);\n-\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast<int>(m_chunk_pos + m_body_start));\n-\t\t\t\t\trecv_buffer = m_recv_buffer.get();\n-\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start);\n-\t\t\t\t\tm_chunk_pos += chunk_size;\n-\t\t\t\t\tif (chunk_size == 0)\n-\t\t\t\t\t{\n-\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1\n-\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == 'H'\n-\t\t\t\t\t\t\t|| (m_parser.chunked_encoding()\n-\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == '\\r'));\n-\t\t\t\t\t\tm_chunk_pos = -1;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tint payload = int(bytes_transferred);\n-\t\t\tif (payload > m_response_left) payload = int(m_response_left);\n-\t\t\tif (payload > front_request.length) payload = front_request.length;\n-
    \t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n-
    \t\t\treceived_bytes(payload, 0);\n-\t\t\tincoming_piece_fragment(payload);\n-\t\t\tm_response_left -= payload;\n-\n-\t\t\tif (m_parser.status_code() == 503)\n-\t\t\t{\n-\t\t\t\tif (!m_parser.finished()) return;\n-\n-\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str());\n-\t\t\t\tif (retry_time <= 0) retry_time = 60;\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time);\n-#endif\n-\n-\t\t\t\treceived_bytes(0, int(bytes_transferred));\n-\t\t\t\t// temporarily unavailable, retry later\n-\t\t\t\tt->retry_web_seed(this, seconds32(retry_time));\n-\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n-\t\t\t\treturn;\n-\t\t\t}\n-\n-\n-\t\t\t// we only received the header, no data\n-\t\t\tif (recv_buffer.empty()) break;\n-\n-\t\t\tif (recv_buffer.size() < front_request.length) break;\n-\n-\t\t\t// if the response is chunked, we need to receive the last\n-\t\t\t// terminating chunk and the tail headers before we can proceed\n-\t\t\tif (m_parser.chunked_encoding() && m_chunk_pos >= 0) break;\n-
    relevance 0../src/session_handle.cpp:485in 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:485

    \t\tasync_add_torrent(add_torrent_params(params));\n+
    relevance 0../src/session_handle.cpp:485in 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:485

    \t\tasync_add_torrent(add_torrent_params(params));\n \t}\n \n \tvoid session_handle::async_add_torrent(add_torrent_params&& params)\n \t{\n \t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty());\n \n #if TORRENT_ABI_VERSION < 3\n@@ -9358,556 +9848,267 @@\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/part_file.cpp:300what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n-from this piece? does it matter? Since we won't actively erase the\n-data from disk, but it may be overwritten soon, it's probably not that\n-big of a deal

    ../src/part_file.cpp:300

    \t\t\t\tcreate_directories(m_path, ec);\n-\t\t\t\tif (ec) return {};\n-\t\t\t\treturn aux::file_handle(fn, 0, mode);\n-\t\t\t}\n-\t\t\treturn {};\n-\t\t}\n-\t}\n-\tcatch (storage_error const& e)\n-\t{\n-\t\tec = e.ec;\n-\t\treturn {};\n+
    relevance 0../src/torrent_handle.cpp:589support moving files into this call

    support moving files into this call

    ../src/torrent_handle.cpp:589

    \t\tauto retp = &prio;\n+\t\tsync_call(&torrent::piece_priorities, retp);\n+\t\tstd::vector<int> ret;\n+\t\tret.reserve(prio.size());\n+\t\tfor (auto p : prio)\n+\t\t\tret.push_back(int(static_cast<std::uint8_t>(p)));\n+\t\treturn ret;\n \t}\n+#endif\n \n-\tvoid part_file::free_piece(piece_index_t const piece)\n+\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const\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\tasync_call(&torrent::set_file_priority, index, priority);\n \t}\n \n-\tvoid part_file::move_partfile(std::string const& path, error_code& ec)\n+\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const\n \t{\n-\t\tstd::lock_guard<std::mutex> l(m_mutex);\n-\n-\t\tflush_metadata_impl(ec);\n-\t\tif (ec) return;\n-\n-\t\tif (!m_piece_map.empty())\n-\t\t{\n-\t\t\tstd::string old_path = combine_path(m_path, m_name);\n-\t\t\tstd::string new_path = combine_path(path, m_name);\n-\n-\t\t\trename(old_path, new_path, ec);\n-\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.clear();\n+\t\treturn sync_call_ret<download_priority_t>(dont_download, &torrent::file_priority, index);\n+\t}\n \n-\t\t\tif (ec)\n-\t\t\t{\n-\t\t\t\tstorage_error se;\n-\t\t\t\taux::copy_file(old_path, new_path, se);\n-\t\t\t\tec = se.ec;\n-\t\t\t\tif (ec) return;\n-\t\t\t\tremove(old_path, ec);\n-\t\t\t}\n-\t\t}\n-
    relevance 0../src/part_file.cpp:412instead 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:412

    \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+
    \tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n+
    \t{\n+\t\tasync_call(&torrent::prioritize_files\n+\t\t\t, static_cast<aux::vector<download_priority_t, file_index_t> const&>(files));\n \t}\n \n-\tvoid part_file::flush_metadata(error_code& ec)\n+\tstd::vector<download_priority_t> torrent_handle::get_file_priorities() const\n \t{\n-\t\tstd::lock_guard<std::mutex> l(m_mutex);\n-\n-\t\tflush_metadata_impl(ec);\n+\t\taux::vector<download_priority_t, file_index_t> ret;\n+\t\tauto retp = &ret;\n+\t\tsync_call(&torrent::file_priorities, retp);\n+\t\treturn TORRENT_RVO(ret);\n \t}\n \n-
    \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+#if TORRENT_ABI_VERSION == 1\n \n-\t\tif (m_piece_map.empty())\n-\t\t{\n-\t\t\t// if we don't have any pieces left in the\n-\t\t\t// part file, remove it\n-\t\t\tstd::string const p = combine_path(m_path, m_name);\n-\t\t\tremove(p, ec);\n+// ============ start deprecation ===============\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+\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n+\t{\n+\t\taux::vector<download_priority_t, file_index_t> file_prio;\n+\t\tfile_prio.reserve(files.size());\n+\t\tfor (auto const p : files) {\n+\t\t\tfile_prio.push_back(download_priority_t(static_cast<std::uint8_t>(p)));\n \t\t}\n+\t\tasync_call(&torrent::prioritize_files, file_prio);\n+\t}\n \n-\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec);\n-\t\tif (ec) return;\n-\n-\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size));\n-\n-\t\tusing namespace libtorrent::aux;\n-\n-\t\tchar* ptr = header.data();\n-\t\twrite_uint32(m_max_pieces, ptr);\n-\t\twrite_uint32(m_piece_size, ptr);\n-\n-\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n-\t\t{\n-\t\t\tauto const i = m_piece_map.find(piece);\n-
    relevance 0../src/utp_socket_manager.cpp:204this should not be heap allocated, sockets should be movable

    this should not be heap allocated, sockets should be movable

    ../src/utp_socket_manager.cpp:204

    \n-//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str());\n-\n-\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp))\n-\t\t\treturn false;\n-\n-\t\t// if not found, see if it's a SYN packet, if it is,\n-\t\t// create a new utp_stream\n-\t\tif (ph->get_type() == ST_SYN)\n-\t\t{\n-\t\t\t// possible SYN flood. Just ignore\n-\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2)\n-\t\t\t\treturn false;\n-\n-\t\t\tTORRENT_ASSERT(m_new_connection == -1);\n-\t\t\t// create the new socket with this ID\n-\t\t\tm_new_connection = id;\n-\n-//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection);\n-\n-
    \t\t\taux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false));\n-
    \n-\t\t\tutp_stream* str = nullptr;\n-#ifdef TORRENT_SSL_PEERS\n-\t\t\tif (is_ssl(c))\n-\t\t\t\tstr = &boost::get<ssl_stream<utp_stream>>(c).next_layer();\n-\t\t\telse\n-#endif\n-\t\t\t\tstr = boost::get<utp_stream>(&c);\n+\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/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\t\tTORRENT_ASSERT(str);\n-\t\t\tint const mtu = mtu_for_dest(ep.address());\n-\t\t\tstr->get_impl()->init_mtu(mtu);\n-\t\t\tstr->get_impl()->m_sock = std::move(socket);\n-\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time);\n-\t\t\tif (!ret) return false;\n-\t\t\tm_last_socket = str->get_impl();\n-\t\t\tm_cb(std::move(c));\n-\t\t\t// the connection most likely changed its connection ID here\n-\t\t\t// we need to move it to the correct ID\n-\t\t\treturn true;\n-\t\t}\n+// 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\tif (ph->get_type() == ST_RESET) return false;\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-\t\t// #error send reset\n+int min_distance_exp(node_id const& n1, std::vector<node_id> const& ids)\n+{\n+\tTORRENT_ASSERT(ids.size() > 0);\n \n-\t\treturn false;\n+\tint min = 160; // see distance_exp for the why of this constant\n+\tfor (auto const& node_id : ids)\n+\t{\n+\t\tmin = std::min(min, distance_exp(n1, node_id));\n \t}\n \n-\tvoid utp_socket_manager::subscribe_writable(utp_socket_impl* s)\n-
    relevance 0../src/choker.cpp:255make configurable

    make configurable

    ../src/choker.cpp:255

    \t\t\t// first reset the number of unchoke slots, because we'll calculate\n-\t\t\t// it purely based on the current state of our peers.\n-\t\t\tupload_slots = 0;\n-\n-\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\n-\n-\t\t\tstd::sort(peers.begin(), peers.end()\n-\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs)\n-\t\t\t\t{ return upload_rate_compare(lhs, rhs); });\n+\treturn min;\n+}\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+node_id generate_id_impl(address const& ip_, std::uint32_t r)\n+{\n+\tstd::uint8_t* ip = nullptr;\n \n-\t\t\t\t// always have at least 1 unchoke slot\n-\t\t\t\tif (rate < rate_threshold) break;\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-\t\t\t\t++upload_slots;\n+\taddress_v4::bytes_type b4{};\n+\taddress_v6::bytes_type b6{};\n+\tif (ip_.is_v6())\n+\t{\n+\t\tb6 = ip_.to_v6().to_bytes();\n+\t\tip = b6.data();\n+
    relevance 0../src/kademlia/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\t\t\trate_threshold += 2048;\n-
    \t\t\t}\n-\t\t\t++upload_slots;\n-\t\t}\n+\treturn ed25519_sign({str, len}, pk, sk);\n+}\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+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\t// we use partial sort here, because we only care about the top\n-\t\t// upload_slots peers.\n+item::item(entry v)\n+\t: m_value(std::move(v))\n+{}\n \n-\t\tint const slots = std::min(upload_slots, int(peers.size()));\n+item::item(bdecode_node const& v)\n+{\n+
    \tm_value = v;\n+
    }\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+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\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/torrent_peer.cpp:181how do we deal with our external address changing?

    how do we deal with our external address changing?

    ../src/torrent_peer.cpp:181

    \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+void item::assign(entry v)\n+{\n+\tm_mutable = false;\n+\tm_value = std::move(v);\n+}\n \n-\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-
    \t\tif (peer_rank == 0)\n-
    \t\t\tpeer_rank = peer_priority(\n-\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port))\n-\t\t\t\t, tcp::endpoint(this->address(), this->port));\n-\t\treturn peer_rank;\n-\t}\n+void item::assign(entry v, span<char const> salt\n+\t, sequence_number const seq, public_key const& pk, secret_key const& sk)\n+{\n+\tstd::array<char, 1000> buffer;\n+\tint const bsize = bencode(buffer.begin(), v);\n+\tTORRENT_ASSERT(bsize <= 1000);\n+\tm_sig = sign_mutable_item(span<char const>(buffer).first(bsize)\n+\t\t, salt, seq, pk, sk);\n+\tm_salt.assign(salt.data(), static_cast<std::size_t>(salt.size()));\n+\tm_pk = pk;\n+\tm_seq = seq;\n+\tm_mutable = true;\n+\tm_value = std::move(v);\n+}\n \n+void item::assign(bdecode_node const& v)\n+
    relevance 0../src/kademlia/dht_tracker.cpp:317pick the closest node rather than the first

    pick the closest node rather than the first

    ../src/kademlia/dht_tracker.cpp:317

    \n #ifndef TORRENT_DISABLE_LOGGING\n-\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+\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\"\n+\t\t\t, int(m_nodes.size()));\n #endif\n-\n-\tstd::int64_t torrent_peer::total_download() const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-\t\tif (connection != nullptr)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n-\t\t\treturn connection->statistics().total_payload_download();\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\treturn std::int64_t(prev_amount_download) << 10;\n-\t\t}\n \t}\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-\t\tauto& merkle_tree = m_merkle_trees[f];\n-\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f);\n-\t\tstd::int64_t const block_offset = static_cast<int>(piece) * std::int64_t(m_files.piece_length())\n-\t\t\t+ offset - m_files.file_offset(f);\n-\t\tint const block_index = aux::numeric_cast<int>(block_offset / default_block_size);\n-\n-\t\tif (h.is_all_zeros())\n-\t\t{\n-\t\t\tTORRENT_ASSERT_FAIL();\n-\t\t\treturn set_block_hash_result::block_hash_failed();\n-\t\t}\n-\n-
    \t\taux::merkle_tree::set_block_result result;\n-
    \t\tint leafs_index;\n-\t\tint leafs_size;\n-\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h);\n \n-\t\tif (result == aux::merkle_tree::set_block_result::unknown)\n-\t\t\treturn set_block_hash_result::unknown();\n-\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed)\n-\t\t\treturn set_block_hash_result::block_hash_failed();\n-\n-\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed)\n-\t\t\t? set_block_hash_result::result::piece_hash_failed\n-\t\t\t: set_block_hash_result::result::success;\n-\n-\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size;\n-\n-\t\treturn { status\n-\t\t\t, int(leafs_index - static_cast<int>(piece - file_first_piece) * blocks_per_piece)\n-\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) };\n+\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-\tvoid hash_picker::hashes_rejected(hash_request const& req)\n+\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name)\n \t{\n-\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n-\n-\t\tfor (int i = req.index; i < req.index + req.count; i += 512)\n+\t\tTORRENT_UNUSED(id);\n+\t\tfor (auto& n : m_nodes)\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\tif (n.second.dht.protocol_family_name() == family_name)\n+
    \t\t\t\treturn &n.second.dht;\n \t\t}\n \n-
    relevance 0../src/disabled_disk_io.cpp:106it would be nice to return a valid hash of zeroes here

    it would be nice to return a valid hash of zeroes here

    ../src/disabled_disk_io.cpp:106

    \t\t});\n-\t}\n-\n-\tbool async_write(storage_index_t\n-\t\t, peer_request const& r\n-\t\t, char const*, std::shared_ptr<disk_observer>\n-\t\t, std::function<void(storage_error const&)> handler\n-\t\t, disk_job_flags_t) override\n-\t{\n-\t\tTORRENT_ASSERT(r.length <= default_block_size);\n-\t\tTORRENT_UNUSED(r);\n-\n-\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n-\t\treturn false;\n-\t}\n-\n-\tvoid async_hash(storage_index_t\n-\t\t, piece_index_t piece, span<sha256_hash>, disk_job_flags_t\n-\t\t, std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) override\n-\t{\n-
    \t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n-
    \t}\n-\n-\tvoid async_hash2(storage_index_t, piece_index_t piece, int\n-\t\t, disk_job_flags_t\n-\t\t, std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) override\n-\t{\n-\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); });\n+\t\treturn nullptr;\n \t}\n \n-\tvoid async_move_storage(storage_index_t\n-\t\t, std::string p, move_flags_t\n-\t\t, std::function<void(status_t, std::string const&, storage_error const&)> handler) override\n+\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\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\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n \t}\n \n-\tvoid async_release_files(storage_index_t, std::function<void()> handler) override\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\tpost(m_ios, [h = std::move(handler)] { h(); });\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.announce(ih, listen_port, flags, f);\n \t}\n \n-\tvoid async_delete_files(storage_index_t\n-\t\t, remove_flags_t, std::function<void(storage_error const&)> handler) override\n+\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\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/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\tfor (auto& n : m_nodes)\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-\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+\t\t\tif (ep.protocol() != (n.first.get_external_address().is_v4() ? udp::v4() : udp::v6()))\n+
    relevance 0../src/kademlia/put_data.cpp:92what if o is not an instance of put_data_observer? This need to be redesigned for better type safety.

    what if o is not an instance of put_data_observer? This need to be\n+redesigned for better type safety.

    ../src/kademlia/put_data.cpp:92

    \t}\n+}\n \n-\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+void put_data::done()\n+{\n+\tm_done = true;\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+#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-
    \t\tadd_fence_job(j);\n-
    \t}\n+bool put_data::invoke(observer_ptr o)\n+{\n+\tif (m_done) return false;\n \n-\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j)\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\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\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\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/ut_metadata.cpp:281we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

    we really need to increment the refcounter on the torrent\n-while this buffer is still in the peer's send buffer

    ../src/ut_metadata.cpp:281

    \t\t\t\tint const offset = piece * 16 * 1024;\n-\t\t\t\tmetadata = m_tp.metadata().data() + offset;\n-\t\t\t\tmetadata_piece_size = std::min(\n-\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024);\n-\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0);\n-\t\t\t\tTORRENT_ASSERT(offset >= 0);\n-\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size());\n-\t\t\t}\n-\n-\t\t\tchar msg[200];\n-\t\t\tchar* header = msg;\n-\t\t\tchar* p = &msg[6];\n-\t\t\tint const len = bencode(p, e);\n-\t\t\tint const total_size = 2 + len + metadata_piece_size;\n-\t\t\tnamespace io = aux;\n-\t\t\tio::write_uint32(total_size, header);\n-\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header);\n-\t\t\tio::write_uint8(m_message_index, header);\n-\n-\t\t\tm_pc.send_buffer({msg, len + 6});\n-
    \t\t\tif (metadata_piece_size)\n-
    \t\t\t{\n-\t\t\t\tm_pc.append_const_send_buffer(\n-\t\t\t\t\tspan<char>(const_cast<char*>(metadata), metadata_piece_size), metadata_piece_size);\n-\t\t\t}\n-\n-\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended);\n-\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata);\n+\t\t\ta[\"salt\"] = m_data.salt();\n \t\t}\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-\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+\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out);\n \n-\t\t\tif (!m_pc.packet_finished()) return true;\n+\treturn m_node.m_rpc.invoke(e, o->target_ep(), o);\n+}\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/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+} } // namespace libtorrent::dht\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 +10147,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,15 +10198,15 @@\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/routing_table.cpp:289This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next major version, break the ABI and support reporting all of them in the dht_stats_alert

    This is temporary. For now, only report the largest routing table\n+relevance 0../src/kademlia/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@@ -10032,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@@ -10087,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@@ -10139,216 +10340,299 @@\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/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../include/libtorrent/i2p_stream.hpp:539make this a string_view

    make this a string_view

    ../include/libtorrent/i2p_stream.hpp:539

    \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-// 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+\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-// 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+\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-int min_distance_exp(node_id const& n1, std::vector<node_id> const& ids)\n-{\n-\tTORRENT_ASSERT(ids.size() > 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-\tint min = 160; // see distance_exp for the why of this constant\n-\tfor (auto const& node_id : ids)\n+\ttemplate <typename Handler>\n+\tvoid async_name_lookup(char const* name, Handler handler)\n \t{\n-\t\tmin = std::min(min, distance_exp(n1, node_id));\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-\treturn min;\n-}\n+private:\n \n-node_id generate_id_impl(address const& ip_, std::uint32_t r)\n-{\n-\tstd::uint8_t* ip = nullptr;\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-\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+\t\tif (ec)\n+\t\t{\n+\t\t\th(ec);\n+\t\t\treturn;\n+\t\t}\n \n-\taddress_v4::bytes_type b4{};\n-\taddress_v6::bytes_type b6{};\n-\tif (ip_.is_v6())\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/hash_picker.hpp:155support batched adding of block hashes for reduced overhead?

    support batched adding of block hashes for reduced overhead?

    ../include/libtorrent/hash_picker.hpp:155

    \t\t// the number of hashes in the range\n+\t\tint count = 0;\n+\t\tint proof_layers = 0;\n+\t};\n+\n+\t// validates the hash_request, to ensure its invariant as well as matching\n+\t// the torrent's file_storage and the number of hashes accompanying the\n+\t// request\n+\tTORRENT_EXTRA_EXPORT\n+\tbool validate_hash_request(hash_request const& hr, file_storage const& fs);\n+\n+\tclass TORRENT_EXTRA_EXPORT hash_picker\n \t{\n-\t\tb6 = ip_.to_v6().to_bytes();\n-\t\tip = b6.data();\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+\tpublic:\n+\t\thash_picker(file_storage const& files\n+\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n \n-void put_data::done()\n-{\n-\tm_done = true;\n+\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\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+\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-\tm_put_callback(m_data, num_responses());\n-\ttraversal_algorithm::done();\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-bool put_data::invoke(observer_ptr o)\n-{\n-\tif (m_done) return false;\n+\t\tint piece_layer() const { return m_piece_layer; }\n \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+\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/socks5_stream.hpp:197we could bind the socket here, since we know what the target endpoint is of the proxy

    we could bind the socket here, since we know what the\n+target endpoint is of the proxy

    ../include/libtorrent/socks5_stream.hpp:197

    \t\t\t}, std::move(handler)));\n+\t}\n+\n+private:\n+\n+\ttemplate <typename Handler>\n+\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n+\t\t, Handler h)\n \t{\n-\t\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\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\");\n+\t\tif (handle_error(e, std::move(h))) return;\n+\n+\t\tauto i = ips.begin();\n+\t\tif (!m_sock.is_open())\n \t\t{\n-\t\t\ta[\"salt\"] = m_data.salt();\n+\t\t\terror_code ec;\n+\t\t\tm_sock.open(i->endpoint().protocol(), ec);\n+\t\t\tif (handle_error(ec, std::move(h))) return;\n \t\t}\n+\n+
    \t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n+
    \t\tm_sock.async_connect(i->endpoint(), wrap_allocator(\n+\t\t\t[this](error_code const& ec, Handler hn)\n+\t\t\t{ connected(ec, std::move(hn)); }, std::move(h)));\n \t}\n \n-\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out);\n+\ttemplate <typename Handler>\n+\tvoid connected(error_code const& e, Handler h)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\");\n+\t\tif (handle_error(e, std::move(h))) return;\n \n-\treturn m_node.m_rpc.invoke(e, o->target_ep(), o);\n+\t\tusing namespace libtorrent::aux;\n+\t\tif (m_version == 5)\n+\t\t{\n+\t\t\t// send SOCKS5 authentication methods\n+\t\t\tm_buffer.resize(m_user.empty()?3:4);\n+\t\t\tchar* p = &m_buffer[0];\n+\t\t\twrite_uint8(5, p); // SOCKS VERSION 5\n+\t\t\tif (m_user.empty())\n+\t\t\t{\n+\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth)\n+\t\t\t\twrite_uint8(0, p); // no authentication\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\twrite_uint8(2, p); // 2 authentication methods\n+\t\t\t\twrite_uint8(0, p); // no authentication\n+\t\t\t\twrite_uint8(2, p); // username/password\n+\t\t\t}\n+\t\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::handshake1\");\n+
    relevance 0../include/libtorrent/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\n+\n+// A type describing kinds of sockets involved in various operations or events.\n+enum class socket_type_t : std::uint8_t {\n+\ttcp,\n+\tsocks5,\n+\thttp,\n+\tutp,\n+\ti2p,\n+\ttcp_ssl,\n+\tsocks5_ssl,\n+\thttp_ssl,\n+\tutp_ssl,\n+\n+#if TORRENT_ABI_VERSION <= 2\n+\tudp TORRENT_DEPRECATED_ENUM = utp,\n+#endif\n+};\n+\n+// return a short human readable name for types of socket\n+
    char const* socket_type_name(socket_type_t);\n+
    \n }\n \n-} } // 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+
    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-\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+#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-\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+\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\treturn nullptr;\n-\t}\n+\t\t// this is a copy of the info section from the torrent.\n+\t\t// it use maintained in this flat format in order to\n+\t\t// make it available through the metadata extension\n+
    \t\tboost::shared_array<char> m_info_section;\n+
    \n+\t\t// if a comment is found in the torrent file\n+\t\t// this will be set to that comment\n+\t\tstd::string m_comment;\n \n-\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+\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-\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+\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-\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\t// if a creation date is found in the torrent file\n+\t\t// this will be set to that, otherwise it'll be\n+\t\t// 1970, Jan 1\n+\t\tstd::time_t m_creation_date = 0;\n+\n+\t\t// the hash(es) that identify this torrent\n+\t\tinfo_hash_t m_info_hash;\n+\n+\t\t// this is the offset into the m_info_section buffer to the first byte of\n+\t\t// the first SHA-1 hash\n+\t\tstd::int32_t m_piece_hashes = 0;\n+\n+\t\t// the number of bytes in m_info_section\n+\t\tstd::int32_t m_info_section_size = 0;\n+\n+\t\t// this is used when creating a torrent. If there's\n+\t\t// only one file there are cases where it's impossible\n+
    relevance 0../include/libtorrent/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\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+\t\t// internal\n+\t\tTORRENT_UNEXPORT announce_infohash();\n \n-\treturn ed25519_sign({str, len}, pk, sk);\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-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+\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-item::item(entry v)\n-\t: m_value(std::move(v))\n-{}\n+\t\t// the time of next tracker announce\n+\t\ttime_point32 next_announce = (time_point32::min)();\n \n-item::item(bdecode_node const& v)\n-{\n-
    \tm_value = v;\n-
    }\n+\t\t// no announces before this time\n+\t\ttime_point32 min_announce = (time_point32::min)();\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+
    \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-void item::assign(entry v)\n-{\n-\tm_mutable = false;\n-\tm_value = std::move(v);\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-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+\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-void item::assign(bdecode_node const& v)\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// 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@@ -10392,15 +10676,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@@ -10444,15 +10728,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@@ -10496,15 +10780,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:1396this wastes 5 bits per file

    this wastes 5 bits per file

    ../include/libtorrent/torrent.hpp:1396

    #ifndef TORRENT_DISABLE_EXTENSIONS\n+
    relevance 0../include/libtorrent/torrent.hpp:1396this wastes 5 bits per file

    this wastes 5 bits per file

    ../include/libtorrent/torrent.hpp:1396

    #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@@ -10547,15 +10831,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:1711this member can probably be removed

    this member can probably be removed

    ../include/libtorrent/torrent.hpp:1711

    \t\tunsigned int m_num_uploads:24;\n+
    relevance 0../include/libtorrent/torrent.hpp:1711this member can probably be removed

    this member can probably be removed

    ../include/libtorrent/torrent.hpp:1711

    \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@@ -10598,68 +10882,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/torrent_info.hpp:729change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now.

    change the type to std::shared_ptr in C++17\n-it is used as if immutable, it cannot be const for technical reasons\n-right now.

    ../include/libtorrent/torrent_info.hpp:729

    \n-\t\t// these are the collections from outside of the info-dict. These are\n-\t\t// owning strings, since we only keep the info-section around, these\n-\t\t// cannot be pointers into that buffer.\n-\t\tstd::vector<std::string> m_owned_collections;\n-\n-#if TORRENT_ABI_VERSION <= 2\n-\t\t// if this is a merkle torrent, this is the merkle\n-\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces))\n-\t\t// hashes\n-\t\taux::vector<sha1_hash> m_merkle_tree;\n-#endif\n-\n-\t\t// v2 merkle tree for each file\n-\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size())\n-\t\taux::vector<aux::vector<char>, file_index_t> m_piece_layers;\n-\n-\t\t// this is a copy of the info section from the torrent.\n-\t\t// it use maintained in this flat format in order to\n-\t\t// make it available through the metadata extension\n-
    \t\tboost::shared_array<char> m_info_section;\n-
    \n-\t\t// if a comment is found in the torrent file\n-\t\t// this will be set to that comment\n-\t\tstd::string m_comment;\n-\n-\t\t// an optional string naming the software used\n-\t\t// to create the torrent file\n-\t\tstd::string m_created_by;\n-\n-\t\t// the info section parsed. points into m_info_section\n-\t\t// parsed lazily\n-\t\tmutable bdecode_node m_info_dict;\n-\n-\t\t// if a creation date is found in the torrent file\n-\t\t// this will be set to that, otherwise it'll be\n-\t\t// 1970, Jan 1\n-\t\tstd::time_t m_creation_date = 0;\n-\n-\t\t// the hash(es) that identify this torrent\n-\t\tinfo_hash_t m_info_hash;\n-\n-\t\t// this is the offset into the m_info_section buffer to the first byte of\n-\t\t// the first SHA-1 hash\n-\t\tstd::int32_t m_piece_hashes = 0;\n-\n-\t\t// the number of bytes in m_info_section\n-\t\tstd::int32_t m_info_section_size = 0;\n-\n-\t\t// this is used when creating a torrent. If there's\n-\t\t// only one file there are cases where it's impossible\n-
    relevance 0../include/libtorrent/proxy_base.hpp:207it 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+relevance 0../include/libtorrent/proxy_base.hpp:207it 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:207

    \n \tvoid cancel()\n \t{\n \t\tm_sock.cancel();\n \t}\n \n \tvoid cancel(error_code& ec)\n@@ -10703,49 +10934,15 @@\n \n \tvoid close(error_code& ec)\n \t{\n \t\tm_remote_endpoint = endpoint_type();\n \t\tm_sock.close(ec);\n \t\tm_resolver.cancel();\n \t}\n-
    relevance 0../include/libtorrent/performance_counters.hpp:485some space could be saved here by making gauges 32 bits

    some space could be saved here by making gauges 32 bits

    ../include/libtorrent/performance_counters.hpp:485

    relevance 0../include/libtorrent/performance_counters.hpp:486restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

    restore these to regular integers. Instead have one copy\n-of the counters per thread and collect them at convenient\n-synchronization points

    ../include/libtorrent/performance_counters.hpp:486

    #ifdef ATOMIC_LLONG_LOCK_FREE\n-#define TORRENT_COUNTER_NOEXCEPT noexcept\n-#else\n-#define TORRENT_COUNTER_NOEXCEPT\n-#endif\n-\n-\t\tcounters() TORRENT_COUNTER_NOEXCEPT;\n-\n-\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT;\n-\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT;\n-\n-\t\t// returns the new value\n-\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT;\n-\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT;\n-\n-\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT;\n-\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT;\n-\n-\tprivate:\n-\n-
    #ifdef ATOMIC_LLONG_LOCK_FREE\n-
    \t\taux::array<std::atomic<std::int64_t>, num_counters> m_stats_counter;\n-#else\n-\t\t// if the atomic type isn't lock-free, use a single lock instead, for\n-\t\t// the whole array\n-\t\tmutable std::mutex m_mutex;\n-\t\taux::array<std::int64_t, num_counters> m_stats_counter;\n-#endif\n-\t};\n-}\n-\n-#endif\n-
    relevance 0../include/libtorrent/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \n+
    relevance 0../include/libtorrent/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \n */\n \n #ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP\n #define TORRENT_PEER_CONNECTION_INTERFACE_HPP\n \n #include \"libtorrent/fwd.hpp\"\n #include \"libtorrent/socket.hpp\"\n@@ -10788,116 +10985,15 @@\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/piece_picker.hpp:802should this be allocated lazily?

    should this be allocated lazily?

    ../include/libtorrent/piece_picker.hpp:802

    \t\t// download list it may live in now\n-\t\tstd::vector<downloading_piece>::iterator update_piece_state(\n-\t\t\tstd::vector<downloading_piece>::iterator dp);\n-\n-\tprivate:\n-\n-#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS\n-\t\tindex_range<download_queue_t> categories() const\n-\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; }\n-#endif\n-\n-\t\t// the following vectors are mutable because they sometimes may\n-\t\t// be updated lazily, triggered by const functions\n-\n-\t\t// this maps indices to number of peers that has this piece and\n-\t\t// index into the m_piece_info vectors.\n-\t\t// piece_pos::we_have_index means that we have the piece, so it\n-\t\t// doesn't exist in the piece_info buckets\n-\t\t// pieces with the filtered flag set doesn't have entries in\n-\t\t// the m_piece_info buckets either\n-
    \t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n-
    \n-\t\t// tracks the number of bytes in a specific piece that are part of a pad\n-\t\t// file. The padding is assumed to be at the end of the piece, and the\n-\t\t// blocks covered by the pad bytes are not picked by the piece picker\n-\t\tstd::unordered_map<piece_index_t, int> m_pads_in_piece;\n-\n-\t\t// when the adjacent_piece affinity is enabled, this contains the most\n-\t\t// recent \"extents\" of adjacent pieces that have been requested from\n-\t\t// this is mutable because it's updated by functions to pick pieces, which\n-\t\t// are const. That's an efficient place to update it, since it's being\n-\t\t// traversed already.\n-\t\tmutable std::vector<piece_extent_t> m_recent_extents;\n-\n-\t\t// the number of bytes of pad file set in this piece picker\n-\t\tint m_num_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks that we already have\n-\t\tint m_have_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks part of filtered pieces we don't have\n-\t\tint m_filtered_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks we have that are also filtered\n-\t\tint m_have_filtered_pad_bytes = 0;\n-\n-\t\t// the number of seeds. These are not added to\n-\t\t// the availability counters of the pieces\n-\t\tint m_seeds = 0;\n-\n-\t\t// the number of pieces that have passed the hash check\n-
    relevance 0../include/libtorrent/piece_picker.hpp:877it 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:877

    \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 + flushed).\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/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+
    relevance 0../include/libtorrent/upnp.hpp:162support using the windows API for UPnP operations as well

    support using the windows API for UPnP operations as well

    ../include/libtorrent/upnp.hpp:162

    {\n \tbool in_error_code = false;\n \tbool exit = false;\n \tint error_code = -1;\n };\n \n struct ip_address_parse_state: error_code_parse_state\n {\n@@ -10940,272 +11036,49 @@\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/socks5_stream.hpp:197we could bind the socket here, since we know what the target endpoint is of the proxy

    we could bind the socket here, since we know what the\n-target endpoint is of the proxy

    ../include/libtorrent/socks5_stream.hpp:197

    \t\t\t}, std::move(handler)));\n-\t}\n-\n-private:\n-\n-\ttemplate <typename Handler>\n-\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n-\t\t, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\");\n-\t\tif (handle_error(e, std::move(h))) return;\n-\n-\t\tauto i = ips.begin();\n-\t\tif (!m_sock.is_open())\n-\t\t{\n-\t\t\terror_code ec;\n-\t\t\tm_sock.open(i->endpoint().protocol(), ec);\n-\t\t\tif (handle_error(ec, std::move(h))) return;\n-\t\t}\n-\n-
    \t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n-
    \t\tm_sock.async_connect(i->endpoint(), wrap_allocator(\n-\t\t\t[this](error_code const& ec, Handler hn)\n-\t\t\t{ connected(ec, std::move(hn)); }, std::move(h)));\n-\t}\n-\n-\ttemplate <typename Handler>\n-\tvoid connected(error_code const& e, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\");\n-\t\tif (handle_error(e, std::move(h))) return;\n-\n-\t\tusing namespace libtorrent::aux;\n-\t\tif (m_version == 5)\n-\t\t{\n-\t\t\t// send SOCKS5 authentication methods\n-\t\t\tm_buffer.resize(m_user.empty()?3:4);\n-\t\t\tchar* p = &m_buffer[0];\n-\t\t\twrite_uint8(5, p); // SOCKS VERSION 5\n-\t\t\tif (m_user.empty())\n-\t\t\t{\n-\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth)\n-\t\t\t\twrite_uint8(0, p); // no authentication\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\twrite_uint8(2, p); // 2 authentication methods\n-\t\t\t\twrite_uint8(0, p); // no authentication\n-\t\t\t\twrite_uint8(2, p); // username/password\n-\t\t\t}\n-\t\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::handshake1\");\n-
    relevance 0../include/libtorrent/string_view.hpp:40replace this by the standard string_view in C++17

    replace this by the standard string_view in C++17

    ../include/libtorrent/string_view.hpp:40

    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED\n-#define TORRENT_STRING_VIEW_HPP_INCLUDED\n-\n-#include <boost/version.hpp>\n-\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-\n-
    \n-
    #if BOOST_VERSION < 106100\n-#include <boost/utility/string_ref.hpp>\n-#include <cstring> // for strchr\n-namespace libtorrent {\n-\n-using string_view = boost::string_ref;\n-using wstring_view = boost::wstring_ref;\n-\n-// internal\n-inline string_view::size_type find_first_of(string_view const v, char const c\n-\t, string_view::size_type pos)\n-{\n-\twhile (pos < v.size())\n-\t{\n-\t\tif (v[pos] == c) return pos;\n-\t\t++pos;\n-\t}\n-\treturn string_view::npos;\n-}\n-\n-// internal\n-inline string_view::size_type find_first_of(string_view const v, char const* c\n-\t, string_view::size_type pos)\n-{\n-\twhile (pos < v.size())\n-\t{\n-\t\tif (std::strchr(c, v[pos]) != nullptr) return pos;\n-\t\t++pos;\n-\t}\n-\treturn string_view::npos;\n-
    relevance 0../include/libtorrent/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+
    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-#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/i2p_stream.hpp:539make this a string_view

    make this a string_view

    ../include/libtorrent/i2p_stream.hpp:539

    \n-\t\tchar tmp[20];\n-\t\taux::random_bytes(tmp);\n-\t\tm_session_id.resize(sizeof(tmp)*2);\n-\t\taux::to_hex(tmp, &m_session_id[0]);\n-\n-\t\tm_sam_socket = std::make_shared<i2p_stream>(m_io_service);\n-\t\tm_sam_socket->set_proxy(m_hostname, m_port);\n-\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session);\n-\t\tm_sam_socket->set_session_id(m_session_id.c_str());\n-\t\tm_sam_socket->set_session_options(session_options);\n-\n-\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\");\n-\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator(\n-\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) {\n-\t\t\t\ton_sam_connect(ec, s, std::move(hn));\n-\t\t\t}, std::move(handler)));\n-\t}\n-\tvoid close(error_code&);\n-\n-
    \tchar const* session_id() const { return m_session_id.c_str(); }\n-
    \tstd::string const& local_endpoint() const { return m_i2p_local_endpoint; }\n-\n-\ttemplate <typename Handler>\n-\tvoid async_name_lookup(char const* name, Handler handler)\n-\t{\n-\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open())\n-\t\t\tdo_name_lookup(name, std::move(handler));\n-\t\telse\n-\t\t\tm_name_lookup.emplace_back(std::string(name)\n-\t\t\t\t, std::move(handler));\n-\t}\n-\n-private:\n-\n-\ttemplate <typename Handler>\n-\tvoid on_sam_connect(error_code const& ec, std::shared_ptr<i2p_stream>, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\");\n-\t\tm_state = sam_idle;\n-\n-\t\tif (ec)\n-\t\t{\n-\t\t\th(ec);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tdo_name_lookup(\"ME\", wrap_allocator(\n-\t\t\t[this](error_code const& e, char const* dst, Handler hn) {\n-\t\t\t\tset_local_endpoint(e, dst, std::move(hn));\n-\t\t\t}, std::move(h)));\n-
    relevance 0../include/libtorrent/hash_picker.hpp:155support batched adding of block hashes for reduced overhead?

    support batched adding of block hashes for reduced overhead?

    ../include/libtorrent/hash_picker.hpp:155

    \t\t// the number of hashes in the range\n-\t\tint count = 0;\n-\t\tint proof_layers = 0;\n-\t};\n-\n-\t// validates the hash_request, to ensure its invariant as well as matching\n-\t// the torrent's file_storage and the number of hashes accompanying the\n-\t// request\n-\tTORRENT_EXTRA_EXPORT\n-\tbool validate_hash_request(hash_request const& hr, file_storage const& fs);\n-\n-\tclass TORRENT_EXTRA_EXPORT hash_picker\n-\t{\n-\tpublic:\n-\t\thash_picker(file_storage const& files\n-\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n-\n-\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n+\t\tcounters() TORRENT_COUNTER_NOEXCEPT;\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\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT;\n+\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT;\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+\t\t// returns the new value\n+\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT;\n+\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT;\n \n-\t\tint piece_layer() const { return m_piece_layer; }\n+\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT;\n+\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT;\n \n \tprivate:\n-\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+
    #ifdef ATOMIC_LLONG_LOCK_FREE\n+
    \t\taux::array<std::atomic<std::int64_t>, num_counters> m_stats_counter;\n+#else\n+\t\t// if the atomic type isn't lock-free, use a single lock instead, for\n+\t\t// the whole array\n+\t\tmutable std::mutex m_mutex;\n+\t\taux::array<std::int64_t, num_counters> m_stats_counter;\n+#endif\n+\t};\n+}\n \n-\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.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+#endif\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@@ -11251,15 +11124,15 @@\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+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@@ -11303,92 +11176,255 @@\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/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\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-// 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 \n-#if TORRENT_ABI_VERSION <= 2\n-\tudp TORRENT_DEPRECATED_ENUM = utp,\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 \n-// return a short human readable name for types of socket\n-
    char const* socket_type_name(socket_type_t);\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-#endif\n-
    relevance 0../include/libtorrent/announce_entry.hpp:76include the number of peers received from this tracker, at last announce

    include the number of peers received from this tracker, at last\n-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+\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\t// if this tracker has returned an error or warning message\n-\t\t// that message is stored here\n-\t\tstd::string message;\n+\t// 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// 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+#if TORRENT_ABI_VERSION == 1\n \n-\t\t// the time of next tracker announce\n-\t\ttime_point32 next_announce = (time_point32::min)();\n+#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n \n-\t\t// no announces before this time\n-\t\ttime_point32 min_announce = (time_point32::min)();\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/string_view.hpp:40replace this by the standard string_view in C++17

    replace this by the standard string_view in C++17

    ../include/libtorrent/string_view.hpp:40

    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n+*/\n+\n+#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED\n+#define TORRENT_STRING_VIEW_HPP_INCLUDED\n+\n+#include <boost/version.hpp>\n+\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n \n 
    \n-
    \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+#if BOOST_VERSION < 106100\n+#include <boost/utility/string_ref.hpp>\n+#include <cstring> // for strchr\n+namespace libtorrent {\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+using string_view = boost::string_ref;\n+using wstring_view = boost::wstring_ref;\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+// internal\n+inline string_view::size_type find_first_of(string_view const v, char const c\n+\t, string_view::size_type pos)\n+{\n+\twhile (pos < v.size())\n+\t{\n+\t\tif (v[pos] == c) return pos;\n+\t\t++pos;\n+\t}\n+\treturn string_view::npos;\n+}\n \n-\t\t// true while we're waiting for a response from the tracker.\n-\t\tbool updating : 1;\n+// internal\n+inline string_view::size_type find_first_of(string_view const v, char const* c\n+\t, string_view::size_type pos)\n+{\n+\twhile (pos < v.size())\n+\t{\n+\t\tif (std::strchr(c, v[pos]) != nullptr) return pos;\n+\t\t++pos;\n+\t}\n+\treturn string_view::npos;\n+
    relevance 0../include/libtorrent/piece_picker.hpp:802should this be allocated lazily?

    should this be allocated lazily?

    ../include/libtorrent/piece_picker.hpp:802

    \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\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+\tprivate:\n \n-\t\t// set to true when we send a event=completed.\n-\t\tbool complete_sent : 1;\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+#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS\n+\t\tindex_range<download_queue_t> categories() const\n+\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; }\n+#endif\n+\n+\t\t// the following vectors are mutable because they sometimes may\n+\t\t// be updated lazily, triggered by const functions\n+\n+\t\t// this maps indices to number of peers that has this piece and\n+\t\t// index into the m_piece_info vectors.\n+\t\t// piece_pos::we_have_index means that we have the piece, so it\n+\t\t// doesn't exist in the piece_info buckets\n+\t\t// pieces with the filtered flag set doesn't have entries in\n+\t\t// the m_piece_info buckets either\n+
    \t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n+
    \n+\t\t// tracks the number of bytes in a specific piece that are part of a pad\n+\t\t// file. The padding is assumed to be at the end of the piece, and the\n+\t\t// blocks covered by the pad bytes are not picked by the piece picker\n+\t\tstd::unordered_map<piece_index_t, int> m_pads_in_piece;\n+\n+\t\t// when the adjacent_piece affinity is enabled, this contains the most\n+\t\t// recent \"extents\" of adjacent pieces that have been requested from\n+\t\t// this is mutable because it's updated by functions to pick pieces, which\n+\t\t// are const. That's an efficient place to update it, since it's being\n+\t\t// traversed already.\n+\t\tmutable std::vector<piece_extent_t> m_recent_extents;\n+\n+\t\t// the number of bytes of pad file set in this piece picker\n+\t\tint m_num_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks that we already have\n+\t\tint m_have_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks part of filtered pieces we don't have\n+\t\tint m_filtered_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks we have that are also filtered\n+\t\tint m_have_filtered_pad_bytes = 0;\n+\n+\t\t// the number of seeds. These are not added to\n+\t\t// the availability counters of the pieces\n+\t\tint m_seeds = 0;\n+\n+\t\t// the number of pieces that have passed the hash check\n+relevance 0../include/libtorrent/piece_picker.hpp:877it 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:877

    \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 + flushed).\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/msg.hpp:87move this to its own .hpp/.cpp pair?

    move this to its own .hpp/.cpp pair?

    ../include/libtorrent/kademlia/msg.hpp:87

    \tint flags;\n+\n+\tenum {\n+\t\t// this argument is optional, parsing will not\n+\t\t// fail if it's not present\n+\t\toptional = 1,\n+\t\t// for dictionaries, the following entries refer\n+\t\t// to child nodes to this node, up until and including\n+\t\t// the next item that has the last_child flag set.\n+\t\t// these flags are nestable\n+\t\tparse_children = 2,\n+\t\t// this is the last item in a child dictionary\n+\t\tlast_child = 4,\n+\t\t// the size argument refers to that the size\n+\t\t// has to be divisible by the number, instead\n+\t\t// of having that exact size\n+\t\tsize_divisible = 8\n+\t};\n+};\n+\n+
    TORRENT_EXTRA_EXPORT bool verify_message_impl(bdecode_node const& message, span<key_desc_t const> desc\n+
    \t, span<bdecode_node> ret, span<char> error);\n+\n+// verifies that a message has all the required\n+// entries and returns them in ret\n+template <int Size>\n+bool verify_message(bdecode_node const& msg, key_desc_t const (&desc)[Size]\n+\t, bdecode_node (&ret)[Size], span<char> error)\n+{\n+\treturn verify_message_impl(msg, desc, ret, error);\n+}\n+\n+}\n+}\n+\n+#endif\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 // calculate the target hash for an immutable item.\n@@ -11432,257 +11468,50 @@\n \t\t, secret_key const& sk);\n \texplicit item(bdecode_node const& v);\n \n \tvoid assign(entry v);\n \tvoid assign(entry v, span<char const> salt\n \t\t, sequence_number seq\n \t\t, public_key const& pk\n-
    relevance 0../include/libtorrent/kademlia/msg.hpp:87move this to its own .hpp/.cpp pair?

    move this to its own .hpp/.cpp pair?

    ../include/libtorrent/kademlia/msg.hpp:87

    \tint flags;\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-\tenum {\n-\t\t// this argument is optional, parsing will not\n-\t\t// fail if it's not present\n-\t\toptional = 1,\n-\t\t// for dictionaries, the following entries refer\n-\t\t// to child nodes to this node, up until and including\n-\t\t// the next item that has the last_child flag set.\n-\t\t// these flags are nestable\n-\t\tparse_children = 2,\n-\t\t// this is the last item in a child dictionary\n-\t\tlast_child = 4,\n-\t\t// the size argument refers to that the size\n-\t\t// has to be divisible by the number, instead\n-\t\t// of having that exact size\n-\t\tsize_divisible = 8\n-\t};\n-};\n-\n-
    TORRENT_EXTRA_EXPORT bool verify_message_impl(bdecode_node const& message, span<key_desc_t const> desc\n-
    \t, span<bdecode_node> ret, span<char> error);\n-\n-// verifies that a message has all the required\n-// entries and returns them in ret\n-template <int Size>\n-bool verify_message(bdecode_node const& msg, key_desc_t const (&desc)[Size]\n-\t, bdecode_node (&ret)[Size], span<char> error)\n-{\n-\treturn verify_message_impl(msg, desc, ret, error);\n-}\n+*/\n \n-}\n-}\n+#ifndef TORRENT_POOL_HPP\n+#define TORRENT_POOL_HPP\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-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+#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-// The leaf blocks on the other hand, MAY be invalid. For instance, when adding\n-// a magnet link for a torrent that we already have files for. Once we have the\n-// metadata, we have files on disk but no hashes. We won't know whether the data\n-// on disk is valid or not, until we've downloaded the hashes to validate them.\n+namespace libtorrent {\n+namespace aux {\n \n-// Idea for future space optimization:\n-// while downloading, we need to store interior nodes of this tree. However, we\n-// don't need to store the padding. a SHA-256 is 32 bytes. Instead of storing\n-// the full (padded) tree of SHA-256 hashes, store the full tree of 32 bit\n-// signed integers, being indices into the actual storage for the tree. We could\n-// even grow the storage lazily. Instead of storing the padding hashes, use\n-// negative indices to refer to fixed SHA-256(0), and SHA-256(SHA-256(0)) and so\n-// on\n-struct TORRENT_EXTRA_EXPORT merkle_tree\n+struct allocator_new_delete\n {\n-
    \tmerkle_tree() = default;\n-
    \tmerkle_tree(int num_blocks, int blocks_per_piece, char const* r);\n-\n-\tsha256_hash root() const;\n-\n-\tvoid load_tree(span<sha256_hash const> t, std::vector<bool> const& verified);\n-\tvoid load_sparse_tree(span<sha256_hash const> t, std::vector<bool> const& mask\n-\t\t, std::vector<bool> const& verified);\n-\tvoid load_verified_bits(std::vector<bool> const& verified);\n-\n-\tstd::size_t size() const;\n-\tint end_index() const { return int(size()); }\n-\n-\tbool has_node(int idx) const;\n-\n-\tbool compare_node(int idx, sha256_hash const& h) const;\n-\n-\tsha256_hash operator[](int idx) const;\n-\n-\tstd::vector<sha256_hash> build_vector() const;\n-\tstd::pair<std::vector<sha256_hash>, aux::vector<bool>> build_sparse_vector() const;\n-\n-\t// get bits indicating if each leaf hash is verified\n-\tstd::vector<bool> verified_leafs() const;\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-\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-\tint num_pieces() const;\n-\tint num_leafs() const;\n-\n-\tvoid optimize_storage();\n-\tvoid optimize_storage_piece_layer();\n-\tvoid allocate_full();\n-\n-\t// a pointer to the root hash for this file.\n-\tchar const* m_root = nullptr;\n-\n-\t// this is either the full tree, or some sparse representation of it,\n-\t// depending on m_mode\n-
    \taux::vector<sha256_hash> m_tree;\n-
    \n-\t// when the full tree is allocated, this has one bit for each block hash. a\n-\t// 1 means we have verified the block hash to be correct, otherwise the block\n-\t// hash may represent what's on disk, but we haven't been able to verify it\n-\t// yet\n-\tbitfield m_block_verified;\n-\n-\t// number of blocks in the file this tree represents. The number of leafs in\n-\t// the tree is rounded up to an even power of 2.\n-\tint m_num_blocks = 0;\n-\n-\t// the number of blocks per piece, specified as how many steps to shift\n-\t// right 1 to get the number of blocks in one piece. This is a compact\n-\t// representation that's valid because pieces are always powers of 2.\n-\t// this is necessary to know which layer in the tree the piece layer is.\n-\tstd::uint8_t m_blocks_per_piece_log = 0;\n-\n-\tenum class mode_t : std::uint8_t\n-\t{\n-\t\t// a default constructed tree is truly empty. It does not even have a\n-\t\t// root hash\n-\t\tuninitialized_tree,\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-\t\tfull_tree,\n-\n-
    relevance 0../include/libtorrent/aux_/allocating_handler.hpp:317in 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:317

    \n-\tprivate:\n-\n-\t\tHandler handler;\n-\t\thandler_storage<Size, Name>* storage;\n-#ifndef BOOST_NO_EXCEPTIONS\n-\t\terror_handler_interface* error_handler;\n-#endif\n-\t};\n-\n-\ttemplate <class Handler, size_t Size, HandlerName Name>\n-\taux::allocating_handler<Handler, Size, Name>\n-\tmake_handler(Handler handler\n-\t\t, handler_storage<Size, Name>& storage\n-\t\t, error_handler_interface& err_handler)\n-\t{\n-\t\treturn aux::allocating_handler<Handler, Size, Name>(\n-\t\t\tstd::forward<Handler>(handler), &storage, &err_handler);\n-\t}\n-\n-
    \ttemplate <typename T\n-
    \t\t, typename HandlerType\n-\t\t, HandlerType Handler\n-\t\t, void (T::*ErrorHandler)(error_code const&)\n-\t\t, void (T::*ExceptHandler)(std::exception const&)\n-\t\t, typename StorageType\n-\t\t, StorageType T::* Storage>\n-\tstruct handler\n-\t{\n-\t\texplicit handler(std::shared_ptr<T> p) : ptr_(std::move(p)) {}\n-\n-\t\tstd::shared_ptr<T> ptr_;\n-\n-\t\ttemplate <class... A>\n-\t\tvoid operator()(A&&... a)\n-\t\t{\n-#ifdef BOOST_NO_EXCEPTIONS\n-\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n-#else\n-\t\t\ttry\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n-\t\t\t}\n-\t\t\tcatch (system_error const& e)\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code());\n-\t\t\t}\n-\t\t\tcatch (std::exception const& e)\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*ExceptHandler)(e);\n-\t\t\t}\n-
    relevance 0../include/libtorrent/aux_/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+\tusing size_type = std::size_t;\n+\tusing difference_type = std::ptrdiff_t;\n \n-\t\tvirtual std::uint16_t listen_port() const = 0;\n-\t\tvirtual std::uint16_t ssl_listen_port() 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 int listen_port(aux::transport ssl, address const& local_addr) = 0;\n+using pool = boost::pool<allocator_new_delete>;\n \n-\t\tvirtual void for_each_listen_socket(std::function<void(aux::listen_socket_handle const&)> f) = 0;\n+template <typename T>\n+using object_pool = boost::object_pool<T, allocator_new_delete>;\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 \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_/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+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@@ -11726,15 +11555,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@@ -11750,15 +11579,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@@ -11776,15 +11605,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@@ -11827,15 +11656,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_/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+
    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@@ -11878,15 +11707,15 @@\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_/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+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@@ -11930,15 +11759,221 @@\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_/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+
    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_/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+// a magnet link for a torrent that we already have files for. Once we have the\n+// metadata, we have files on disk but no hashes. We won't know whether the data\n+// on disk is valid or not, until we've downloaded the hashes to validate them.\n+\n+// Idea for future space optimization:\n+// while downloading, we need to store interior nodes of this tree. However, we\n+// don't need to store the padding. a SHA-256 is 32 bytes. Instead of storing\n+// the full (padded) tree of SHA-256 hashes, store the full tree of 32 bit\n+// signed integers, being indices into the actual storage for the tree. We could\n+// even grow the storage lazily. Instead of storing the padding hashes, use\n+// negative indices to refer to fixed SHA-256(0), and SHA-256(SHA-256(0)) and so\n+// on\n+struct TORRENT_EXTRA_EXPORT merkle_tree\n+{\n+
    \tmerkle_tree() = default;\n+
    \tmerkle_tree(int num_blocks, int blocks_per_piece, char const* r);\n+\n+\tsha256_hash root() const;\n+\n+\tvoid load_tree(span<sha256_hash const> t, std::vector<bool> const& verified);\n+\tvoid load_sparse_tree(span<sha256_hash const> t, std::vector<bool> const& mask\n+\t\t, std::vector<bool> const& verified);\n+\tvoid load_verified_bits(std::vector<bool> const& verified);\n+\n+\tstd::size_t size() const;\n+\tint end_index() const { return int(size()); }\n+\n+\tbool has_node(int idx) const;\n+\n+\tbool compare_node(int idx, sha256_hash const& h) const;\n+\n+\tsha256_hash operator[](int idx) const;\n+\n+\tstd::vector<sha256_hash> build_vector() const;\n+\tstd::pair<std::vector<sha256_hash>, aux::vector<bool>> build_sparse_vector() const;\n+\n+\t// get bits indicating if each leaf hash is verified\n+\tstd::vector<bool> verified_leafs() const;\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+\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+\tint num_pieces() const;\n+\tint num_leafs() const;\n+\n+\tvoid optimize_storage();\n+\tvoid optimize_storage_piece_layer();\n+\tvoid allocate_full();\n+\n+\t// a pointer to the root hash for this file.\n+\tchar const* m_root = nullptr;\n+\n+\t// this is either the full tree, or some sparse representation of it,\n+\t// depending on m_mode\n+
    \taux::vector<sha256_hash> m_tree;\n+
    \n+\t// when the full tree is allocated, this has one bit for each block hash. a\n+\t// 1 means we have verified the block hash to be correct, otherwise the block\n+\t// hash may represent what's on disk, but we haven't been able to verify it\n+\t// yet\n+\tbitfield m_block_verified;\n+\n+\t// number of blocks in the file this tree represents. The number of leafs in\n+\t// the tree is rounded up to an even power of 2.\n+\tint m_num_blocks = 0;\n+\n+\t// the number of blocks per piece, specified as how many steps to shift\n+\t// right 1 to get the number of blocks in one piece. This is a compact\n+\t// representation that's valid because pieces are always powers of 2.\n+\t// this is necessary to know which layer in the tree the piece layer is.\n+\tstd::uint8_t m_blocks_per_piece_log = 0;\n+\n+\tenum class mode_t : std::uint8_t\n+\t{\n+\t\t// a default constructed tree is truly empty. It does not even have a\n+\t\t// root hash\n+\t\tuninitialized_tree,\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+\t\tfull_tree,\n+\n+
    relevance 0../include/libtorrent/aux_/allocating_handler.hpp:317in 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:317

    \n+\tprivate:\n+\n+\t\tHandler handler;\n+\t\thandler_storage<Size, Name>* storage;\n+#ifndef BOOST_NO_EXCEPTIONS\n+\t\terror_handler_interface* error_handler;\n+#endif\n+\t};\n+\n+\ttemplate <class Handler, size_t Size, HandlerName Name>\n+\taux::allocating_handler<Handler, Size, Name>\n+\tmake_handler(Handler handler\n+\t\t, handler_storage<Size, Name>& storage\n+\t\t, error_handler_interface& err_handler)\n+\t{\n+\t\treturn aux::allocating_handler<Handler, Size, Name>(\n+\t\t\tstd::forward<Handler>(handler), &storage, &err_handler);\n+\t}\n+\n+
    \ttemplate <typename T\n+
    \t\t, typename HandlerType\n+\t\t, HandlerType Handler\n+\t\t, void (T::*ErrorHandler)(error_code const&)\n+\t\t, void (T::*ExceptHandler)(std::exception const&)\n+\t\t, typename StorageType\n+\t\t, StorageType T::* Storage>\n+\tstruct handler\n+\t{\n+\t\texplicit handler(std::shared_ptr<T> p) : ptr_(std::move(p)) {}\n+\n+\t\tstd::shared_ptr<T> ptr_;\n+\n+\t\ttemplate <class... A>\n+\t\tvoid operator()(A&&... a)\n+\t\t{\n+#ifdef BOOST_NO_EXCEPTIONS\n+\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n+#else\n+\t\t\ttry\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n+\t\t\t}\n+\t\t\tcatch (system_error const& e)\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code());\n+\t\t\t}\n+\t\t\tcatch (std::exception const& e)\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*ExceptHandler)(e);\n+\t\t\t}\n+
    relevance 0../include/libtorrent/aux_/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@@ -11971,43 +12006,8 @@\n #endif\n \n #ifndef TORRENT_DEPRECATED_ENUM\n #define TORRENT_DEPRECATED_ENUM\n #endif\n \n #endif\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
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -454,14 +454,179 @@\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+| |_\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_\b1_\b9 |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\b11\b19\b9 *\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_\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 _\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\b02\b27\b7 *\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\tTORRENT_ASSERT(t); |\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_\b1_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* 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\b71\b13\b3 *\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@@ -673,14 +838,352 @@\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_\b8_\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\b18\b8 *\b**\b**\b* |\n+|// --- V2 HASHES --- |\n+| |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n+|\t\t{ |\n+|\t\t\tif (!p.merkle_trees.empty()) |\n+|\t\t\t\tload_merkle_trees( |\n+|\t\t\t\t\tstd::move(p.merkle_trees) |\n+|\t\t\t\t\t, std::move(p.merkle_tree_mask) |\n+|\t\t\t\t\t, std::move(p.verified_leaf_hashes)); |\n+| |\n+|\t\t\t// we really don't want to store extra copies of the trees |\n+|\t\t\tTORRENT_ASSERT(p.merkle_trees.empty()); |\n+|\t\t} |\n+| |\n+|\t\tif (valid_metadata()) |\n+|\t\t{ |\n+|\t\t\tinc_stats_counter(counters::num_total_pieces_added |\n+|\t\t\t\t, m_torrent_file->num_pieces()); |\n+|\t\t} |\n+| |\n+|m_add_torrent_params = std::make_unique(std::move(p)); |\n+|} |\n+| |\n+|\tvoid torrent::load_merkle_trees( |\n+|\t\taux::vector, file_index_t> trees_import |\n+|\t\t, aux::vector, file_index_t> mask |\n+|\t\t, aux::vector, file_index_t> verified) |\n+|\t{ |\n+|\t\tauto const& fs = m_torrent_file->orig_files(); |\n+| |\n+|\t\tstd::vector const empty_verified; |\n+|\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i) |\n+|\t\t{ |\n+|\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0) |\n+|\t\t\t\tcontinue; |\n+| |\n+|\t\t\tif (i >= trees_import.end_index()) break; |\n+|\t\t\tstd::vector const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i]; |\n+|\t\t\tif (i < mask.end_index() && !mask[i].empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false); |\n+|\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask); |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask); |\n+|\t\t\t} |\n+|\t\t} |\n+|\t} |\n+| |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b14\b4 *\b**\b**\b* |\n+|#endif |\n+| |\n+|\t\tif (!m_ses.dht()) return false; |\n+|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n+|\t\tif (!m_announce_to_dht) return false; |\n+|\t\tif (m_paused) return false; |\n+| |\n+|\t\t// don't announce private torrents |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n+|\t\tif (m_trackers.empty()) return true; |\n+|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n+| |\n+|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n+|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n+|\t} |\n+| |\n+|#endif |\n+| |\n+|\ttorrent::~torrent() |\n+|\t{ |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n+|\t\t{ |\n+|\t\t\tif (!m_links[i].in_list()) continue; |\n+|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n+|\t\t} |\n+|#endif |\n+| |\n+|\t\t// The invariant can't be maintained here, since the torrent |\n+|\t\t// is being destructed, all weak references to it have been |\n+|\t\t// reset, which means that all its peers already have an |\n+|\t\t// invalidated torrent pointer (so it cannot be verified to be correct) |\n+| |\n+|\t\t// i.e. the invariant can only be maintained if all connections have |\n+|\t\t// been closed by the time the torrent is destructed. And they are |\n+|\t\t// supposed to be closed. So we can still do the invariant check. |\n+| |\n+|\t\t// however, the torrent object may be destructed from the main |\n+|\t\t// thread when shutting down, if the disk cache has references to it. |\n+|\t\t// this means that the invariant check that this is called from the |\n+|\t\t// network thread cannot be maintained |\n+| |\n+|\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0}); |\n+|\t\tTORRENT_ASSERT(m_connections.empty()); |\n+|\t\t// just in case, make sure the session accounting is kept right |\n+|\t\tfor (auto p : m_connections) |\n+|\t\t\tm_ses.close_connection(p); |\n+|\t} |\n+| |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b2_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b32\b26\b6 *\b**\b**\b* |\n+|piece_picker& m_picker; |\n+|\t\tpiece_index_t m_piece; |\n+|\t}; |\n+| |\n+|\tvoid torrent::add_piece_async(piece_index_t const piece |\n+|\t\t, std::vector data, add_piece_flags_t const flags) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\t// make sure the piece index is correct |\n+|\t\tif (piece >= torrent_file().end_piece()) |\n+|\t\t\treturn; |\n+| |\n+|\t\t// make sure the piece size is correct |\n+|\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece))) |\n+|\t\t\treturn; |\n+| |\n+|\t\tadd_piece(piece, data.data(), flags); |\n+|\t} |\n+| |\n+|void torrent::add_piece(piece_index_t const piece, char const* data |\n+|, add_piece_flags_t const flags) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\t// make sure the piece index is correct |\n+|\t\tif (piece >= torrent_file().end_piece()) |\n+|\t\t\treturn; |\n+| |\n+|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n+|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n+| |\n+|\t\tif (m_deleted) return; |\n+| |\n+|\t\t// avoid crash trying to access the picker when there is none |\n+|\t\tif (m_have_all && !has_picker()) return; |\n+| |\n+|\t\t// we don't support clobbering the piece picker while checking the |\n+|\t\t// files. We may end up having the same piece multiple times |\n+|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n+|\t\t\t&& state() != torrent_status::checking_resume_data); |\n+|\t\tif (state() == torrent_status::checking_files |\n+|\t\t\t|| state() == torrent_status::checking_resume_data) |\n+|\t\t\treturn; |\n+| |\n+|\t\tneed_picker(); |\n+| |\n+|\t\tif (picker().have_piece(piece) |\n+|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n+|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b95\b51\b1 *\b**\b**\b* |\n+|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n+|\t{ |\n+|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n+| |\n+|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n+| |\n+|\t\t// if we have all pieces, we must also have the last one |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n+| |\n+|\t\t// every block should not be a pad block |\n+|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n+| |\n+|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n+|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n+|\t\t\t- std::int64_t(pc.pad_bytes); |\n+|\t} |\n+| |\n+|\t// fills in total_wanted, total_wanted_done and total_done |\n+|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tst.total_done = 0; |\n+|\t\tst.total_wanted_done = 0; |\n+|\t\tst.total_wanted = m_size_on_disk; |\n+| |\n+|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n+|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n+| |\n+|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n+|\t\tif (!valid_metadata()) return; |\n+| |\n+|\t\tif (m_seed_mode || is_seed()) |\n+|\t\t{ |\n+|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n+|\t\t\t// piece- and file priority. We consider everything as being |\n+|\t\t\t// \"wanted\" |\n+|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n+|\t\t\tst.total_wanted_done = m_size_on_disk; |\n+|\t\t\tst.total_wanted = m_size_on_disk; |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n+|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\telse if (!has_picker()) |\n+|\t\t{ |\n+|\t\t\tst.total_done = 0; |\n+|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b8_\b8_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b48\b88\b86\b6 *\b**\b**\b* |\n+|on_remove_peers(); |\n+|\t\tTORRENT_ASSERT(m_connections.empty()); |\n+| |\n+|\t\t// post a message to the main thread to destruct |\n+|\t\t// the torrent object from there |\n+|\t\tif (m_storage) |\n+|\t\t{ |\n+|\t\t\ttry { |\n+|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n+|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n+|\t\t\t} |\n+|\t\t\tcatch (std::exception const& e) |\n+|\t\t\t{ |\n+|\t\t\t\tTORRENT_UNUSED(e); |\n+|\t\t\t\tm_storage.reset(); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n+|#endif |\n+|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n+|\t\t\t\t// good idea to post it here, even though we failed |\n+|if (alerts().should_post()) |\n+|alerts().emplace_alert(get_handle()); |\n+|\t\t\t} |\n+|\t\t\tm_ses.deferred_submit_jobs(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tif (alerts().should_post()) |\n+|\t\t\t\talerts().emplace_alert(get_handle()); |\n+|\t\t\talerts().emplace_alert(get_handle() |\n+|\t\t\t\t, info_hash(), get_userdata()); |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b5_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b95\b56\b6 *\b**\b**\b* |\n+|} |\n+| |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|\tvoid torrent::set_super_seeding(bool const on) |\n+|\t{ |\n+|\t\tif (on == m_super_seeding) return; |\n+| |\n+|\t\tm_super_seeding = on; |\n+|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n+|\t\tstate_updated(); |\n+| |\n+|\t\tif (m_super_seeding) return; |\n+| |\n+|\t\t// disable super seeding for all peers |\n+|\t\tfor (auto pc : *this) |\n+|\t\t{ |\n+|\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1)); |\n+|\t\t} |\n+|\t} |\n+| |\n+|piece_index_t torrent::get_piece_to_super_seed(typed_bitfield const& bits) |\n+|{ |\n+|\t\t// return a piece with low availability that is not in |\n+|\t\t// the bitfield and that is not currently being super |\n+|\t\t// seeded by any peer |\n+|\t\tTORRENT_ASSERT(m_super_seeding); |\n+| |\n+|\t\t// do a linear search from the first piece |\n+|\t\tint min_availability = 9999; |\n+|\t\tstd::vector avail_vec; |\n+|\t\tfor (auto const i : m_torrent_file->piece_range()) |\n+|\t\t{ |\n+|\t\t\tif (bits[i]) continue; |\n+| |\n+|\t\t\tint availability = 0; |\n+|\t\t\tfor (auto pc : *this) |\n+|\t\t\t{ |\n+|\t\t\t\tif (pc->super_seeded_piece(i)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// avoid super-seeding the same piece to more than one |\n+|\t\t\t\t\t// peer if we can avoid it. Do this by artificially |\n+|\t\t\t\t\t// increase the availability |\n+|\t\t\t\t\tavailability = 999; |\n+|\t\t\t\t\tbreak; |\n+|\t\t\t\t} |\n+|\t\t\t\tif (pc->has_piece(i)) ++availability; |\n+|\t\t\t} |\n+|\t\t\tif (availability > min_availability) continue; |\n+|\t\t\tif (availability == min_availability) |\n+|\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\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@@ -1038,483 +1541,14 @@\n |\t\t\t\talerts.emplace_alert(pk.bytes, sig.bytes |\n |\t\t\t\t\t, std::move(salt), seq.value, num); |\n |\t\t\t} |\n |\t\t} |\n | |\n |\t\tvoid put_mutable_callback(dht::item& i |\n |_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b<_\bv_\bo_\bi_\bd_\b(_\be_\bn_\bt_\br_\by_\b&_\b,_\b _\bs_\bt_\bd_\b:_\b:_\ba_\br_\br_\ba_\by_\b<_\bc_\bh_\ba_\br_\b,_\b _\b6_\b4_\b>_\b&_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b8_\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\b18\b8 *\b**\b**\b* |\n-|// --- V2 HASHES --- |\n-| |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n-|\t\t{ |\n-|\t\t\tif (!p.merkle_trees.empty()) |\n-|\t\t\t\tload_merkle_trees( |\n-|\t\t\t\t\tstd::move(p.merkle_trees) |\n-|\t\t\t\t\t, std::move(p.merkle_tree_mask) |\n-|\t\t\t\t\t, std::move(p.verified_leaf_hashes)); |\n-| |\n-|\t\t\t// we really don't want to store extra copies of the trees |\n-|\t\t\tTORRENT_ASSERT(p.merkle_trees.empty()); |\n-|\t\t} |\n-| |\n-|\t\tif (valid_metadata()) |\n-|\t\t{ |\n-|\t\t\tinc_stats_counter(counters::num_total_pieces_added |\n-|\t\t\t\t, m_torrent_file->num_pieces()); |\n-|\t\t} |\n-| |\n-|m_add_torrent_params = std::make_unique(std::move(p)); |\n-|} |\n-| |\n-|\tvoid torrent::load_merkle_trees( |\n-|\t\taux::vector, file_index_t> trees_import |\n-|\t\t, aux::vector, file_index_t> mask |\n-|\t\t, aux::vector, file_index_t> verified) |\n-|\t{ |\n-|\t\tauto const& fs = m_torrent_file->orig_files(); |\n-| |\n-|\t\tstd::vector const empty_verified; |\n-|\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0) |\n-|\t\t\t\tcontinue; |\n-| |\n-|\t\t\tif (i >= trees_import.end_index()) break; |\n-|\t\t\tstd::vector const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i]; |\n-|\t\t\tif (i < mask.end_index() && !mask[i].empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false); |\n-|\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask); |\n-|\t\t\t} |\n-|\t\t} |\n-|\t} |\n-| |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b14\b4 *\b**\b**\b* |\n-|#endif |\n-| |\n-|\t\tif (!m_ses.dht()) return false; |\n-|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n-|\t\tif (!m_announce_to_dht) return false; |\n-|\t\tif (m_paused) return false; |\n-| |\n-|\t\t// don't announce private torrents |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n-|\t\tif (m_trackers.empty()) return true; |\n-|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n-| |\n-|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n-|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n-|\t} |\n-| |\n-|#endif |\n-| |\n-|\ttorrent::~torrent() |\n-|\t{ |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (!m_links[i].in_list()) continue; |\n-|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\t// The invariant can't be maintained here, since the torrent |\n-|\t\t// is being destructed, all weak references to it have been |\n-|\t\t// reset, which means that all its peers already have an |\n-|\t\t// invalidated torrent pointer (so it cannot be verified to be correct) |\n-| |\n-|\t\t// i.e. the invariant can only be maintained if all connections have |\n-|\t\t// been closed by the time the torrent is destructed. And they are |\n-|\t\t// supposed to be closed. So we can still do the invariant check. |\n-| |\n-|\t\t// however, the torrent object may be destructed from the main |\n-|\t\t// thread when shutting down, if the disk cache has references to it. |\n-|\t\t// this means that the invariant check that this is called from the |\n-|\t\t// network thread cannot be maintained |\n-| |\n-|\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0}); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-|\t\t// just in case, make sure the session accounting is kept right |\n-|\t\tfor (auto p : m_connections) |\n-|\t\t\tm_ses.close_connection(p); |\n-|\t} |\n-| |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b2_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b32\b26\b6 *\b**\b**\b* |\n-|piece_picker& m_picker; |\n-|\t\tpiece_index_t m_piece; |\n-|\t}; |\n-| |\n-|\tvoid torrent::add_piece_async(piece_index_t const piece |\n-|\t\t, std::vector data, add_piece_flags_t const flags) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\t// make sure the piece index is correct |\n-|\t\tif (piece >= torrent_file().end_piece()) |\n-|\t\t\treturn; |\n-| |\n-|\t\t// make sure the piece size is correct |\n-|\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece))) |\n-|\t\t\treturn; |\n-| |\n-|\t\tadd_piece(piece, data.data(), flags); |\n-|\t} |\n-| |\n-|void torrent::add_piece(piece_index_t const piece, char const* data |\n-|, add_piece_flags_t const flags) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\t// make sure the piece index is correct |\n-|\t\tif (piece >= torrent_file().end_piece()) |\n-|\t\t\treturn; |\n-| |\n-|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n-|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n-| |\n-|\t\tif (m_deleted) return; |\n-| |\n-|\t\t// avoid crash trying to access the picker when there is none |\n-|\t\tif (m_have_all && !has_picker()) return; |\n-| |\n-|\t\t// we don't support clobbering the piece picker while checking the |\n-|\t\t// files. We may end up having the same piece multiple times |\n-|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n-|\t\t\t&& state() != torrent_status::checking_resume_data); |\n-|\t\tif (state() == torrent_status::checking_files |\n-|\t\t\t|| state() == torrent_status::checking_resume_data) |\n-|\t\t\treturn; |\n-| |\n-|\t\tneed_picker(); |\n-| |\n-|\t\tif (picker().have_piece(piece) |\n-|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n-|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b95\b51\b1 *\b**\b**\b* |\n-|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n-|\t{ |\n-|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n-| |\n-|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n-| |\n-|\t\t// if we have all pieces, we must also have the last one |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n-| |\n-|\t\t// every block should not be a pad block |\n-|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n-| |\n-|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n-|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n-|\t\t\t- std::int64_t(pc.pad_bytes); |\n-|\t} |\n-| |\n-|\t// fills in total_wanted, total_wanted_done and total_done |\n-|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n-|{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tst.total_done = 0; |\n-|\t\tst.total_wanted_done = 0; |\n-|\t\tst.total_wanted = m_size_on_disk; |\n-| |\n-|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n-|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n-| |\n-|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n-|\t\tif (!valid_metadata()) return; |\n-| |\n-|\t\tif (m_seed_mode || is_seed()) |\n-|\t\t{ |\n-|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n-|\t\t\t// piece- and file priority. We consider everything as being |\n-|\t\t\t// \"wanted\" |\n-|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n-|\t\t\tst.total_wanted_done = m_size_on_disk; |\n-|\t\t\tst.total_wanted = m_size_on_disk; |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n-|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\telse if (!has_picker()) |\n-|\t\t{ |\n-|\t\t\tst.total_done = 0; |\n-|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b8_\b8_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b48\b88\b86\b6 *\b**\b**\b* |\n-|on_remove_peers(); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-| |\n-|\t\t// post a message to the main thread to destruct |\n-|\t\t// the torrent object from there |\n-|\t\tif (m_storage) |\n-|\t\t{ |\n-|\t\t\ttry { |\n-|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n-|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n-|\t\t\t} |\n-|\t\t\tcatch (std::exception const& e) |\n-|\t\t\t{ |\n-|\t\t\t\tTORRENT_UNUSED(e); |\n-|\t\t\t\tm_storage.reset(); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n-|#endif |\n-|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n-|\t\t\t\t// good idea to post it here, even though we failed |\n-|if (alerts().should_post()) |\n-|alerts().emplace_alert(get_handle()); |\n-|\t\t\t} |\n-|\t\t\tm_ses.deferred_submit_jobs(); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tif (alerts().should_post()) |\n-|\t\t\t\talerts().emplace_alert(get_handle()); |\n-|\t\t\talerts().emplace_alert(get_handle() |\n-|\t\t\t\t, info_hash(), get_userdata()); |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b5_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b95\b56\b6 *\b**\b**\b* |\n-|} |\n-| |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|\tvoid torrent::set_super_seeding(bool const on) |\n-|\t{ |\n-|\t\tif (on == m_super_seeding) return; |\n-| |\n-|\t\tm_super_seeding = on; |\n-|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n-|\t\tstate_updated(); |\n-| |\n-|\t\tif (m_super_seeding) return; |\n-| |\n-|\t\t// disable super seeding for all peers |\n-|\t\tfor (auto pc : *this) |\n-|\t\t{ |\n-|\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1)); |\n-|\t\t} |\n-|\t} |\n-| |\n-|piece_index_t torrent::get_piece_to_super_seed(typed_bitfield const& bits) |\n-|{ |\n-|\t\t// return a piece with low availability that is not in |\n-|\t\t// the bitfield and that is not currently being super |\n-|\t\t// seeded by any peer |\n-|\t\tTORRENT_ASSERT(m_super_seeding); |\n-| |\n-|\t\t// do a linear search from the first piece |\n-|\t\tint min_availability = 9999; |\n-|\t\tstd::vector avail_vec; |\n-|\t\tfor (auto const i : m_torrent_file->piece_range()) |\n-|\t\t{ |\n-|\t\t\tif (bits[i]) continue; |\n-| |\n-|\t\t\tint availability = 0; |\n-|\t\t\tfor (auto pc : *this) |\n-|\t\t\t{ |\n-|\t\t\t\tif (pc->super_seeded_piece(i)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\t// avoid super-seeding the same piece to more than one |\n-|\t\t\t\t\t// peer if we can avoid it. Do this by artificially |\n-|\t\t\t\t\t// increase the availability |\n-|\t\t\t\t\tavailability = 999; |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t} |\n-|\t\t\t\tif (pc->has_piece(i)) ++availability; |\n-|\t\t\t} |\n-|\t\t\tif (availability > min_availability) continue; |\n-|\t\t\tif (availability == min_availability) |\n-|\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| |_\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_\b1_\b9 |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\b11\b19\b9 *\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_\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 _\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\b02\b27\b7 *\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\tTORRENT_ASSERT(t); |\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_\b1_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* 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\b71\b13\b3 *\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 |_\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_\b7_\b2_\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\b67\b72\b2 *\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@@ -1561,48 +1595,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-|_\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 |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,172 @@\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/ |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+|\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+|\t\t// ``add_tracker()`` will look if the specified tracker is already in the |\n+|\t\t// set. If it is, it doesn't do anything. If it's not in the current set |\n+|\t\t// of trackers, it will insert it in the tier specified in the |\n+|\t\t// announce_entry. |\n+|\t\t// |\n+|\t\t// The updated set of trackers will be saved in the resume data, and when |\n+|\t\t// a torrent is started with resume data, the trackers from the resume |\n+|\t\t// data will replace the original ones. |\n+|\t\tstd::vector trackers() const; |\n+|\t\tvoid replace_trackers(std::vector const&) const; |\n+|\t\tvoid add_tracker(announce_entry const&) const; |\n+|\t\tvoid post_trackers() const; |\n+| |\n+| |\n+|// ``add_url_seed()`` adds another url to the torrent's list of url |\n+|\t\t// seeds. If the given url already exists in that list, the call has no |\n+|\t\t// effect. The torrent will connect to the server and try to download |\n+|\t\t// pieces from it, unless it's paused, queued, checking or seeding. |\n+|\t\t// ``remove_url_seed()`` removes the given url if it exists already. |\n+|\t\t// ``url_seeds()`` return a set of the url seeds currently in this |\n+|\t\t// torrent. Note that URLs that fails may be removed automatically from |\n+|\t\t// the list. |\n+|\t\t// |\n+|\t\t// See http-seeding_ for more information. |\n+|\t\tvoid add_url_seed(std::string const& url) const; |\n+|\t\tvoid remove_url_seed(std::string const& url) const; |\n+|\t\tstd::set url_seeds() const; |\n+| |\n+|\t\t// These functions are identical as the ``*_url_seed()`` variants, but |\n+|\t\t// they operate on `BEP 17`_ web seeds instead of `BEP 19`_. |\n+|\t\t// |\n+|\t\t// See http-seeding_ for more information. |\n+|\t\tvoid add_http_seed(std::string const& url) const; |\n+|\t\tvoid remove_http_seed(std::string const& url) const; |\n+|\t\tstd::set http_seeds() const; |\n+| |\n+|\t\t// add the specified extension to this torrent. The ``ext`` argument is |\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(torrent_handle const&, client_data_t)> const& ext |\n+|_\b\t_\b\t_\b\t_\b,_\b _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b _\b=_\b _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\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 |\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+|\t\t{ |\n+|\t\t\tm_stat[download_payload].offset(downloaded); |\n+|\t\t\tm_stat[upload_payload].offset(uploaded); |\n+|\t\t} |\n+| |\n+|\t\tint last_payload_downloaded() const |\n+|\t\t{ return m_stat[download_payload].counter(); } |\n+|\t\tint last_payload_uploaded() const |\n+|\t\t{ return m_stat[upload_payload].counter(); } |\n+|\t\tint last_protocol_downloaded() const |\n+|\t\t{ return m_stat[download_protocol].counter(); } |\n+|\t\tint last_protocol_uploaded() const |\n+|\t\t{ return m_stat[upload_protocol].counter(); } |\n+| |\n+|\t\t// these are the channels we keep stats for |\n+|\t\tenum |\n+|\t\t{ |\n+|upload_payload, |\n+|upload_protocol, |\n+|\t\t\tdownload_payload, |\n+|\t\t\tdownload_protocol, |\n+|\t\t\tupload_ip_protocol, |\n+|\t\t\tdownload_ip_protocol, |\n+|\t\t\tnum_channels |\n+|\t\t}; |\n+| |\n+|\t\tvoid clear() |\n+|\t\t{ |\n+|\t\t\tfor (int i = 0; i < num_channels; ++i) |\n+|\t\t\t\tm_stat[i].clear(); |\n+|\t\t} |\n+| |\n+|\t\tstat_channel const& operator[](int i) const |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels); |\n+|\t\t\treturn m_stat[i]; |\n+|\t\t} |\n+| |\n+|\tprivate: |\n+| |\n+|\t\tstat_channel m_stat[num_channels]; |\n+|\t}; |\n+| |\n+|} |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bS_\bT_\bA_\bT_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out predictive pieces and all operations on it into a separate class (to use as member here instead) |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\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 |\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\b43\b38\b8 *\b**\b**\b* |\n |#endif |\n | |\n |\t\tstd::string m_trackerid; |\n@@ -1759,67 +1917,14 @@\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/ |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-|\t\t{ |\n-|\t\t\tm_stat[download_payload].offset(downloaded); |\n-|\t\t\tm_stat[upload_payload].offset(uploaded); |\n-|\t\t} |\n-| |\n-|\t\tint last_payload_downloaded() const |\n-|\t\t{ return m_stat[download_payload].counter(); } |\n-|\t\tint last_payload_uploaded() const |\n-|\t\t{ return m_stat[upload_payload].counter(); } |\n-|\t\tint last_protocol_downloaded() const |\n-|\t\t{ return m_stat[download_protocol].counter(); } |\n-|\t\tint last_protocol_uploaded() const |\n-|\t\t{ return m_stat[upload_protocol].counter(); } |\n-| |\n-|\t\t// these are the channels we keep stats for |\n-|\t\tenum |\n-|\t\t{ |\n-|upload_payload, |\n-|upload_protocol, |\n-|\t\t\tdownload_payload, |\n-|\t\t\tdownload_protocol, |\n-|\t\t\tupload_ip_protocol, |\n-|\t\t\tdownload_ip_protocol, |\n-|\t\t\tnum_channels |\n-|\t\t}; |\n-| |\n-|\t\tvoid clear() |\n-|\t\t{ |\n-|\t\t\tfor (int i = 0; i < num_channels; ++i) |\n-|\t\t\t\tm_stat[i].clear(); |\n-|\t\t} |\n-| |\n-|\t\tstat_channel const& operator[](int i) const |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels); |\n-|\t\t\treturn m_stat[i]; |\n-|\t\t} |\n-| |\n-|\tprivate: |\n-| |\n-|\t\tstat_channel m_stat[num_channels]; |\n-|\t}; |\n-| |\n-|} |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bS_\bT_\bA_\bT_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |dh_key_exchange should probably move into its own file |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* d\bdh\bh_\b_k\bke\bey\by_\b_e\bex\bxc\bch\bha\ban\bng\bge\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by m\bmo\bov\bve\be i\bin\bnt\bto\bo i\bit\bts\bs o\bow\bwn\bn f\bfi\bil\ble\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.h\bhp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n |#include |\n |#include |\n |#include |\n@@ -1921,119 +2026,14 @@\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/ |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-|\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-|\t\t// ``add_tracker()`` will look if the specified tracker is already in the |\n-|\t\t// set. If it is, it doesn't do anything. If it's not in the current set |\n-|\t\t// of trackers, it will insert it in the tier specified in the |\n-|\t\t// announce_entry. |\n-|\t\t// |\n-|\t\t// The updated set of trackers will be saved in the resume data, and when |\n-|\t\t// a torrent is started with resume data, the trackers from the resume |\n-|\t\t// data will replace the original ones. |\n-|\t\tstd::vector trackers() const; |\n-|\t\tvoid replace_trackers(std::vector const&) const; |\n-|\t\tvoid add_tracker(announce_entry const&) const; |\n-|\t\tvoid post_trackers() const; |\n-| |\n-| |\n-|// ``add_url_seed()`` adds another url to the torrent's list of url |\n-|\t\t// seeds. If the given url already exists in that list, the call has no |\n-|\t\t// effect. The torrent will connect to the server and try to download |\n-|\t\t// pieces from it, unless it's paused, queued, checking or seeding. |\n-|\t\t// ``remove_url_seed()`` removes the given url if it exists already. |\n-|\t\t// ``url_seeds()`` return a set of the url seeds currently in this |\n-|\t\t// torrent. Note that URLs that fails may be removed automatically from |\n-|\t\t// the list. |\n-|\t\t// |\n-|\t\t// See http-seeding_ for more information. |\n-|\t\tvoid add_url_seed(std::string const& url) const; |\n-|\t\tvoid remove_url_seed(std::string const& url) const; |\n-|\t\tstd::set url_seeds() const; |\n-| |\n-|\t\t// These functions are identical as the ``*_url_seed()`` variants, but |\n-|\t\t// they operate on `BEP 17`_ web seeds instead of `BEP 19`_. |\n-|\t\t// |\n-|\t\t// See http-seeding_ for more information. |\n-|\t\tvoid add_http_seed(std::string const& url) const; |\n-|\t\tvoid remove_http_seed(std::string const& url) const; |\n-|\t\tstd::set http_seeds() const; |\n-| |\n-|\t\t// add the specified extension to this torrent. The ``ext`` argument is |\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(torrent_handle const&, client_data_t)> const& ext |\n-|_\b\t_\b\t_\b\t_\b,_\b _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b _\b=_\b _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\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 |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |to improve memory locality and scanning performance, turn the routing table into a single vector with boundaries for the nodes |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b._\b _\bP_\be_\br_\bh_\ba_\bp_\bs_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt_\b _\bn_\bo_\bd_\be_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bi_\bn_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bto\bo i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by l\blo\boc\bca\bal\bli\bit\bty\by a\ban\bnd\bd s\bsc\bca\ban\bnn\bni\bin\bng\bg p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be,\b, t\btu\bur\brn\bn t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be i\bin\bnt\bto\bo a\ba s\bsi\bin\bng\bgl\ble\be v\bve\bec\bct\bto\bor\br w\bwi\bit\bth\bh b\bbo\bou\bun\bnd\bda\bar\bri\bie\bes\bs f\bfo\bor\br t\bth\bhe\be n\bno\bod\bde\bes\bs i\bin\bns\bst\bte\bea\bad\bd.\b. P\bPe\ber\brh\bha\bap\bps\bs r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt n\bno\bod\bde\bes\bs s\bsh\bho\bou\bul\bld\bd |\n |b\bbe\be i\bin\bn a\ba s\bse\bep\bpa\bar\bra\bat\bte\be v\bve\bec\bct\bto\bor\br.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n |// * Nodes are not marked as being stale, they keep a counter |\n |// \tthat tells how many times in a row they have failed. When |\n@@ -2136,14 +2136,68 @@\n |\t\t, move_flags_t flags, storage_error& ec); |\n | |\n |\t// deletes the files on fs from save_path according to options. Options may |\n |\t// opt to only delete the partfile |\n |\tTORRENT_EXTRA_EXPORT void |\n |\tdelete_files(file_storage const& fs, std::string const& save_path |\n |_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bs_\bt_\br_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b,_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt_\b _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br_\b&_\b _\be_\bc_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b6_\b3_\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:6\b63\b39\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@@ -2244,181 +2298,186 @@\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:_\b6_\b3_\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:6\b63\b39\b9 *\b**\b**\b* |\n-|io->submit_jobs(); |\n-|\tios.restart(); |\n-|\trun_until(ios, done); |\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_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt 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_\b2\b2_\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 |\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_\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|_\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\b54\b48\b8 *\b**\b**\b* |\n+|} |\n+|#endif |\n | |\n-|\tTEST_EQUAL(oversized, bool(flags & test_oversized)); |\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-|\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+|\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->has_piece_passed(r.piece), peer_interested, false); |\n+|\t\t\t} |\n | |\n-|\tio->abort(true); |\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-|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+|\t\t\treturn; |\n+|\t\t} |\n | |\n-|\tstd::shared_ptr info; |\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-|\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+|\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-|\tdelete_dirs(\"temp_storage\"); |\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_\b2_\b9_\b3 |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\b32\b29\b93\b3 *\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-|\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+|\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r); |\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_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt 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_\b2\b2_\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 |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bs_\ba_\bl_\bt_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bh_\be_\ba_\bp_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bs_\bt_\ba_\bc_\bk_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be s\bsa\bal\blt\bt h\bhe\ber\bre\be i\bis\bs a\bal\bll\blo\boc\bca\bat\bte\bed\bd o\bon\bn t\bth\bhe\be h\bhe\bea\bap\bp.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be i\bin\bn t\bth\bhe\be s\bst\bta\bac\bck\bk_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt.\b.c\bcp\bpp\bp:\b:2\b20\b02\b21\b1 *\b**\b**\b* |\n-|} |\n+|\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-|\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+|\t\t\tif (m_requests.empty()) |\n+|\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1); |\n | |\n-|\tstd::string dht_immutable_item_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\" |\n-|\t\t\t, aux::to_hex(target).c_str() |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n+|\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-|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n-|, std::array const& k |\n-|\t\t, std::array const& sig |\n-|\t\t, std::int64_t sequence |\n-|\t\t, string_view s |\n-|\t\t, entry i |\n-|\t\t, bool a) |\n-|\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a) |\n-|\t{} |\n+|\t// ----------------------------- |\n+|\t// --------- DHT PORT ---------- |\n+|\t// ----------------------------- |\n | |\n-|\tstd::string dht_mutable_item_alert::message() const |\n+|\tvoid peer_connection::incoming_dht_port(int const listen_port) |\n |\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\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\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n-|\t\t\t, aux::to_hex(key).c_str() |\n-|\t\t\t, salt.c_str() |\n-|\t\t\t, seq |\n-|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n+|\t\tTORRENT_UNUSED(listen_port); |\n |#endif |\n |\t} |\n | |\n-|\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n) |\n-|\t\t: target(t) |\n-|\t\t, public_key() |\n-|\t\t, signature() |\n-|_\b\t_\b\t_\b,_\b _\bs_\ba_\bl_\bt_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b _\b _\b _\b|_\bf_\bo_\bl_\bl_\bo_\bw_\bi_\bn_\bg_\b _\bp_\ba_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bi_\bl_\bl_\b _\bm_\ba_\bk_\be_\b _\bi_\bt_\b _\bc_\bo_\bm_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* j\bju\bus\bst\bt m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpe\bee\ber\br n\bno\bot\bt h\bha\bav\bve\be t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd w\bwi\bit\bth\bh t\bth\bhe\be f\bfi\bil\ble\be w\bwe\be j\bju\bus\bst\bt r\bre\beq\bqu\bue\bes\bst\bte\bed\bd.\b. O\bOn\bnl\bly\by w\bwh\bhe\ben\bn i\bit\bt d\bdo\boe\bes\bsn\bn'\b't\bt h\bha\bav\bve\be a\ban\bny\by o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be d\bdo\bo t\bth\bhe\be f\bfo\bol\bll\blo\bow\bwi\bin\bng\bg p\bpa\bad\bd f\bfi\bil\ble\bes\bs w\bwi\bil\bll\bl m\bma\bak\bke\be i\bit\bt |\n-|c\bco\bom\bmp\bpl\bli\bic\bca\bat\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b62\b26\b6 *\b**\b**\b* |\n-|\tpeer_connection::received_invalid_data(index, single_peer); |\n-| |\n-|\t// if we don't think we have any of the files, allow banning the web seed |\n-|\tif (num_have_pieces() == 0) return true; |\n-| |\n-|\t// don't disconnect, we won't request anything from this file again |\n-|\treturn false; |\n-|} |\n-| |\n-|void web_peer_connection::on_receive_padfile() |\n-|{ |\n-|\thandle_padfile(); |\n-|} |\n+|\t// ----------------------------- |\n+|\t// --------- HAVE ALL ---------- |\n+|\t// ----------------------------- |\n | |\n-|void web_peer_connection::handle_error(int const bytes_left) |\n-|{ |\n-|\tstd::shared_ptr t = associated_torrent().lock(); |\n-|\tTORRENT_ASSERT(t); |\n+|\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_\b5_\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|_\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\b95\b58\b8 *\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-|// temporarily unavailable, retry later |\n-|\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\")); |\n-|\tif (t->alerts().should_post()) |\n-|\t{ |\n-|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n-|\t\t\t+ (\" \" + m_parser.message()); |\n-|\t\tt->alerts().emplace_alert(t->get_handle(), m_url |\n-|\t\t\t, error_msg); |\n-|\t} |\n-|\treceived_bytes(0, bytes_left); |\n-|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n-|} |\n+|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-|void web_peer_connection::disable(error_code const& ec) |\n-|{ |\n-|\t// we should not try this server again. |\n-|\tm_web->disabled = true; |\n-|\tdisconnect(ec, operation_t::bittorrent, peer_error); |\n-|\tif (m_web->ephemeral) |\n-|\t{ |\n-|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tt->remove_web_seed_conn(this); |\n-|\t} |\n-|\tm_web = nullptr; |\n-|\tTORRENT_ASSERT(is_disconnecting()); |\n-|} |\n+|\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-|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+|\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 |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@@ -2466,122 +2525,395 @@\n |\t\t\t\ts.set_impl(sm->new_utp_socket(&s)); |\n |\t\t\t\treturn socket_type(std::move(s)); |\n |\t\t\t} |\n |\t\t} |\n |#if TORRENT_USE_I2P |\n |\t\telse if (ps.type == settings_pack::i2p_proxy) |\n |_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\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-|\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-|\t\t\treturn false; |\n-|\t\t} |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b _\b _\b _\b|_\bf_\bo_\bl_\bl_\bo_\bw_\bi_\bn_\bg_\b _\bp_\ba_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bi_\bl_\bl_\b _\bm_\ba_\bk_\be_\b _\bi_\bt_\b _\bc_\bo_\bm_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* j\bju\bus\bst\bt m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpe\bee\ber\br n\bno\bot\bt h\bha\bav\bve\be t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd w\bwi\bit\bth\bh t\bth\bhe\be f\bfi\bil\ble\be w\bwe\be j\bju\bus\bst\bt r\bre\beq\bqu\bue\bes\bst\bte\bed\bd.\b. O\bOn\bnl\bly\by w\bwh\bhe\ben\bn i\bit\bt d\bdo\boe\bes\bsn\bn'\b't\bt h\bha\bav\bve\be a\ban\bny\by o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be d\bdo\bo t\bth\bhe\be f\bfo\bol\bll\blo\bow\bwi\bin\bng\bg p\bpa\bad\bd f\bfi\bil\ble\bes\bs w\bwi\bil\bll\bl m\bma\bak\bke\be i\bit\bt |\n+|c\bco\bom\bmp\bpl\bli\bic\bca\bat\bte\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b62\b26\b6 *\b**\b**\b* |\n+|\tpeer_connection::received_invalid_data(index, single_peer); |\n | |\n-|\t\tstd::shared_ptr const p = i->second; |\n-|\t\t// on_receive() may remove the tracker connection from the list |\n-|\t\treturn p->on_receive(ep, buf); |\n-|\t} |\n+|\t// if we don't think we have any of the files, allow banning the web seed |\n+|\tif (num_have_pieces() == 0) return true; |\n | |\n-|\tvoid tracker_manager::incoming_error(error_code const& |\n-|\t\t, udp::endpoint const&) |\n+|\t// don't disconnect, we won't request anything from this file again |\n+|\treturn false; |\n+|} |\n+| |\n+|void web_peer_connection::on_receive_padfile() |\n+|{ |\n+|\thandle_padfile(); |\n+|} |\n+| |\n+|void web_peer_connection::handle_error(int const bytes_left) |\n+|{ |\n+|\tstd::shared_ptr t = associated_torrent().lock(); |\n+|\tTORRENT_ASSERT(t); |\n+| |\n+| |\n+|// temporarily unavailable, retry later |\n+|\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\")); |\n+|\tif (t->alerts().should_post()) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n+|\t\t\t+ (\" \" + m_parser.message()); |\n+|\t\tt->alerts().emplace_alert(t->get_handle(), m_url |\n+|\t\t\t, error_msg); |\n+|\t} |\n+|\treceived_bytes(0, bytes_left); |\n+|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n |} |\n | |\n-|\tbool tracker_manager::incoming_packet(string_view const hostname |\n-|\t\t, span const buf) |\n+|void web_peer_connection::disable(error_code const& ec) |\n+|{ |\n+|\t// we should not try this server again. |\n+|\tm_web->disabled = true; |\n+|\tdisconnect(ec, operation_t::bittorrent, peer_error); |\n+|\tif (m_web->ephemeral) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\t// ignore packets smaller than 8 bytes |\n-|\t\tif (buf.size() < 16) return false; |\n+|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|\t\tt->remove_web_seed_conn(this); |\n+|\t} |\n+|\tm_web = nullptr; |\n+|\tTORRENT_ASSERT(is_disconnecting()); |\n+|} |\n | |\n-|\t\t// the first word is the action, if it's not [0, 3] |\n-|\t\t// it's not a valid udp tracker response |\n-|\t\tspan ptr = buf; |\n-|\t\tstd::uint32_t const action = aux::read_uint32(ptr); |\n-|\t\tif (action > 3) return false; |\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+|_\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\tstd::uint32_t const transaction = aux::read_uint32(ptr); |\n-|\t\tauto const i = m_udp_conns.find(transaction); |\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 (i == m_udp_conns.end()) |\n+|\t\tif (ret == 0) |\n |\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t// now, this may not have been meant to be a tracker response, |\n-|\t\t\t// but chances are pretty good, so it's probably worth logging |\n-|\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \" |\n-|\t\t\t\t\"transaction ID (%x)\", std::string(hostname).c_str(), int(transaction)); |\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\treturn false; |\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\tstd::shared_ptr const p = i->second; |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b(_\b)_\b _\bm_\ba_\by_\b _\br_\be_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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\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 need_encoding(char const* str, int const len) |\n+|\tbool is_directory(std::string const& f, error_code& ec) |\n |\t{ |\n-|\t\tfor (int i = 0; i < len; ++i) |\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+|\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 (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n-|\t\t\t\treturn true; |\n-|\t\t\t++str; |\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\treturn false; |\n+| |\n+|\t\t// this is the stack of bdecode_token indices, into m_tokens. |\n+|\t\t// sp is the stack pointer, as index into the array, stack |\n+|\t\tint sp = 0; |\n+|\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit); |\n+| |\n+|char const* start = buffer.data(); |\n+|char const* end = start + buffer.size(); |\n+|\t\tchar const* const orig_start = start; |\n+| |\n+|\t\tif (start == end) |\n+|\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n+| |\n+|\t\twhile (start <= end) |\n+|\t\t{ |\n+|\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n+| |\n+|\t\t\tif (sp >= depth_limit) |\n+|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded); |\n+| |\n+|\t\t\t--token_limit; |\n+|\t\t\tif (token_limit < 0) |\n+|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded); |\n+| |\n+|\t\t\t// look for a new token |\n+|\t\t\tchar const t = *start; |\n+| |\n+|\t\t\tint const current_frame = sp; |\n+| |\n+|\t\t\t// if we're currently parsing a dictionary, assert that |\n+|\t\t\t// every other node is a string. |\n+|\t\t\tif (current_frame > 0 |\n+|\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict) |\n+|\t\t\t{ |\n+|\t\t\t\tif (stack[current_frame - 1].state == 0) |\n+|\t\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bc_\bu_\br_\br_\be_\bn_\bt_\b _\bp_\ba_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\ba_\b _\bd_\bi_\bc_\bt_\b _\ba_\bn_\bd_\b _\bw_\be_\b _\ba_\br_\be_\b _\bp_\ba_\br_\bs_\bi_\bn_\bg_\b _\ba_\b _\bk_\be_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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 convert_path_to_posix(std::string& path) |\n+|\tvoid alert_manager::maybe_notify(alert* a) |\n |\t{ |\n-|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\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-|std::string read_until(char const*& str, char const delim, char const* end) |\n-|{ |\n-|\t\tTORRENT_ASSERT(str <= end); |\n+|m_condition.notify_all(); |\n+|} |\n | |\n-|\t\tstd::string ret; |\n-|\t\twhile (str != end && *str != delim) |\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\tret += *str; |\n-|\t\t\t++str; |\n+|\t\t\tif (m_notify) m_notify(); |\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+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\tvoid alert_manager::add_extension(std::shared_ptr ext) |\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\tm_ses_extensions.push_back(ext); |\n+|\t} |\n+|#endif |\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+|\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+| | |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+|\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 | |\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\t// if we ended up copying the file, don't do anything during |\n+|\t\t\t\t// roll-back |\n+|\t\t\t\tif (copied_files[file_index]) continue; |\n+| |\n+|\t\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(file_index)); |\n+|\t\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(file_index)); |\n+| |\n+|\t\t\t\t// ignore errors when rolling back |\n+|\t\t\t\tstorage_error ignore; |\n+|\t\t\t\tmove_file(new_path, old_path, ignore); |\n+|\t\t\t} |\n+| |\n+|\t\t\treturn { status_t::fatal_disk_error, save_path }; |\n+|\t\t} |\n+| |\n+| |\n+|std::set subdirs; |\n+|\t\tfor (auto const i : f.file_range()) |\n+|\t\t{ |\n+|\t\t\t// files moved out to absolute paths are not moved |\n+|\t\t\tif (f.file_absolute_path(i)) continue; |\n+| |\n+|\t\t\tif (has_parent_path(f.file_path(i))) |\n+|\t\t\t\tsubdirs.insert(parent_path(f.file_path(i))); |\n+| |\n+|\t\t\t// if we ended up renaming the file instead of moving it, there's no |\n+|\t\t\t// need to delete the source. |\n+|\t\t\tif (copied_files[i] == false) continue; |\n+| |\n+|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n+| |\n+|\t\t\t// we may still have some files in old save_path |\n+|\t\t\t// eg. if (flags == dont_replace && exists(new_path)) |\n+|\t\t\t// ignore errors when removing |\n+|\t\t\terror_code ignore; |\n+|\t\t\tremove(old_path, ignore); |\n+|\t\t} |\n+| |\n+|\t\tfor (std::string const& s : subdirs) |\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+|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bm_\bo_\bv_\be_\b(_\bs_\bu_\bb_\bd_\bi_\br_\b,_\b _\be_\br_\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 |\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:_\b4_\b8_\b6 |is 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 |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\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_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\bhi\bis\bs r\bri\bis\bsk\bky\by?\b? T\bTh\bhe\be u\bup\bpp\bpe\ber\br l\bla\bay\bye\ber\br w\bwi\bil\bll\bl a\bas\bss\bsu\bum\bme\be w\bwe\be h\bha\bav\bve\be t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be.\b. P\bPe\ber\brh\bha\bap\bps\bs w\bwe\be s\bsh\bho\bou\bul\bld\bd v\bve\ber\bri\bif\bfy\by t\bth\bha\bat\bt a\bat\bt l\ble\bea\bas\bst\bt t\bth\bhe\be s\bsi\biz\bze\be o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be i\bis\bs c\bco\bor\brr\bre\bec\bct\bt *\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:4\b48\b86\b6 *\b**\b**\b* |\n+|{ |\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+|\t\t\t\t\tif (err) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tec.file(idx); |\n+|\t\t\t\t\t\tec.operation = operation_t::mkdir; |\n+|\t\t\t\t\t\treturn false; |\n+|\t\t\t\t\t} |\n+| |\n+|\t\t\t\t\thard_link(s, file_path, err); |\n+|\t\t\t\t} |\n+| |\n+|\t\t\t\t// if the file already exists, that's not an error |\n+|\t\t\t\tif (err == boost::system::errc::file_exists) |\n+|\t\t\t\t\tcontinue; |\n+| |\n+|if (err) |\n+|{ |\n+|\t\t\t\t\tec.ec = err; |\n+|\t\t\t\t\tec.file(idx); |\n+|\t\t\t\t\tec.operation = operation_t::file_hard_link; |\n+|\t\t\t\t\treturn false; |\n+|\t\t\t\t} |\n+|\t\t\t\tadded_files = true; |\n+|\t\t\t\tstat.set_dirty(idx); |\n+|\t\t\t} |\n+|\t\t} |\n+|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n+| |\n+|\t\tbool const seed = (rd.have_pieces.size() >= fs.num_pieces() |\n+|\t\t\t&& rd.have_pieces.all_set()) |\n+|\t\t\t|| (rd.flags & torrent_flags::seed_mode); |\n+| |\n+|\t\tif (seed) |\n+|\t\t{ |\n+|\t\t\tfor (file_index_t const file_index : fs.file_range()) |\n+|\t\t\t{ |\n+|\t\t\t\tif (fs.pad_file_at(file_index)) continue; |\n+| |\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/_\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 | |_\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@@ -2630,322 +2962,177 @@\n |\t\t\treturn false; |\n |\t\t} |\n |\t\tret.hostname = i.string_value().to_string(); |\n | |\n |\t\t// extract port |\n |\t\ti = info.dict_find_int(\"port\"); |\n |_\b\t_\b\t_\bi_\bf_\b _\b(_\b!_\bi_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b9_\b9_\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\br_\be_\ba_\bs_\bo_\bn_\b _\bn_\bo_\bt_\b _\bt_\bo_\b _\bm_\bo_\bv_\be_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bi_\bn_\bt_\bo_\b _\bi_\bn_\bi_\bt_\b(_\b)_\b?_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bp_\bo_\bs_\bt_\b _\bi_\bt_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bi_\bo_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bis\bs t\bth\bhe\ber\bre\be a\ba r\bre\bea\bas\bso\bon\bn n\bno\bot\bt t\bto\bo m\bmo\bov\bve\be a\bal\bll\bl o\bof\bf t\bth\bhi\bis\bs i\bin\bnt\bto\bo i\bin\bni\bit\bt(\b()\b)?\b? a\ban\bnd\bd j\bju\bus\bst\bt p\bpo\bos\bst\bt i\bit\bt t\bto\bo t\bth\bhe\be i\bio\bo_\b_c\bco\bon\bnt\bte\bex\bxt\bt?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b59\b99\b9 *\b**\b**\b* |\n-|try |\n-|#endif |\n-|\t{ |\n-|\t\t(this->*f)(std::forward(a)...); |\n-|\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+|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-|\t\t// apply all m_settings to this session |\n-|\t\trun_all_updates(*this); |\n-|\t\treopen_listen_sockets(false); |\n+|\tstd::mutex udp_tracker_connection::m_cache_mutex; |\n | |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tcheck_invariant(); |\n-|#endif |\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-|#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+|\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\tentry& e = *eptr; |\n-|\t\t// make it a dict |\n-|\t\te.dict(); |\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 (flags & session::save_settings) |\n+|\t\tif (ec) |\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\ttracker_connection::fail(ec, operation_t::parse_address); |\n+|\t\t\treturn; |\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+|\t\taux::session_settings const& settings = m_man.settings(); |\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+|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\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_\b0 |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\b80\b0 *\b**\b**\b* |\n-|if (!m_dht_torrents.empty()) |\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\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\tm_hostname = hostname; |\n+|\t\t\tm_target.port(std::uint16_t(port)); |\n+|\t\t\tstart_announce(); |\n |\t\t} |\n-|\t\tif (m_torrents.empty()) return; |\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/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bs_\ba_\bl_\bt_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bh_\be_\ba_\bp_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bs_\bt_\ba_\bc_\bk_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be s\bsa\bal\blt\bt h\bhe\ber\bre\be i\bis\bs a\bal\bll\blo\boc\bca\bat\bte\bed\bd o\bon\bn t\bth\bhe\be h\bhe\bea\bap\bp.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be i\bin\bn t\bth\bhe\be s\bst\bta\bac\bck\bk_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt.\b.c\bcp\bpp\bp:\b:2\b20\b02\b21\b1 *\b**\b**\b* |\n+|} |\n | |\n-|\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+|\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-|\tvoid session_impl::on_lsd_announce(error_code const& e) |\n+|\tstd::string dht_immutable_item_alert::message() const |\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_\b3_\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\b13\b3 *\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+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tchar msg[1050]; |\n+|\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\" |\n+|\t\t\t, aux::to_hex(target).c_str() |\n+|\t\t\t, item.to_string().c_str()); |\n+|\t\treturn msg; |\n |#endif |\n |\t} |\n | |\n-|\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+|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n+|, std::array const& k |\n+|\t\t, std::array const& sig |\n+|\t\t, std::int64_t sequence |\n+|\t\t, string_view s |\n+|\t\t, entry i |\n+|\t\t, bool a) |\n+|\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a) |\n+|\t{} |\n | |\n-|\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const |\n+|\tstd::string dht_mutable_item_alert::message() 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 (!(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_\b3_\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\b53\b3 *\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+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\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+|\t\tchar msg[1050]; |\n+|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n+|\t\t\t, aux::to_hex(key).c_str() |\n+|\t\t\t, salt.c_str() |\n+|\t\t\t, seq |\n+|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n+|\t\t\t, item.to_string().c_str()); |\n+|\t\treturn msg; |\n |#endif |\n |\t} |\n | |\n-|std::uint16_t session_impl::ssl_listen_port() const |\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/_\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 ssl_listen_port(nullptr); |\n+|\t\treturn escape_string_impl(str.data(), int(str.size()), 10); |\n |\t} |\n | |\n-|\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const |\n+|\tbool need_encoding(char const* str, int const len) |\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\tfor (int i = 0; i < len; ++i) |\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\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n+|\t\t\t\treturn true; |\n+|\t\t\t++str; |\n |\t\t} |\n-|#else |\n-|\t\tTORRENT_UNUSED(sock); |\n-|#endif |\n-|\t\treturn 0; |\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_\b8_\b8_\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\b38\b88\b8 *\b**\b**\b* |\n-|return upload_rate_limit(m_local_peer_class); |\n-|\t} |\n-| |\n-|\tint session_impl::local_download_rate_limit() const |\n-|\t{ |\n-|\t\treturn download_rate_limit(m_local_peer_class); |\n-|\t} |\n-| |\n-|\tint session_impl::upload_rate_limit_depr() const |\n-|\t{ |\n-|\t\treturn upload_rate_limit(m_global_class); |\n+|\t\treturn false; |\n |\t} |\n | |\n-|\tint session_impl::download_rate_limit_depr() const |\n+|\tvoid convert_path_to_posix(std::string& path) |\n |\t{ |\n-|\t\treturn download_rate_limit(m_global_class); |\n+|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\n |\t} |\n-|#endif // DEPRECATE |\n | |\n-| |\n-|void session_impl::update_peer_dscp() |\n+|std::string read_until(char const*& str, char const delim, char const* end) |\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\tTORRENT_ASSERT(str <= end); |\n+| |\n+|\t\tstd::string ret; |\n+|\t\twhile (str != end && *str != delim) |\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+|\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-|#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+|\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\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+|\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-|#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+|\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/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b0_\b3_\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\b03\b3 *\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@@ -3208,123 +3395,322 @@\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-|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// 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\ttracker_connection::fail(ec, operation_t::parse_address); |\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\taux::session_settings const& settings = m_man.settings(); |\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\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\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-|\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+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx]) |\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\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_\b0 |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\b80\b0 *\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\telse |\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_\b3_\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\b13\b3 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (!node_list.empty() && nodes.empty()) |\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/_\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+|\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-|\tbdecode_node bdecode(span buffer |\n-|\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit) |\n+|\tvoid session_impl::update_count_slow() |\n |\t{ |\n-|\t\tbdecode_node ret; |\n-|\t\tec.clear(); |\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\tif (buffer.size() > bdecode_token::max_offset) |\n+|std::uint16_t session_impl::listen_port() const |\n+|{ |\n+|\t\treturn listen_port(nullptr); |\n+|\t} |\n+| |\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\tif (error_pos) *error_pos = 0; |\n-|\t\t\tec = bdecode_errors::limit_exceeded; |\n-|\t\t\treturn ret; |\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-|\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+|#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_\b3_\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\b53\b3 *\b**\b**\b* |\n+|return 0; |\n | |\n-|char const* start = buffer.data(); |\n-|char const* end = start + buffer.size(); |\n-|\t\tchar const* const orig_start = start; |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\tif (start == end) |\n-|\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\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-|\t\twhile (start <= end) |\n+|std::uint16_t session_impl::ssl_listen_port() const |\n+|{ |\n+|\t\treturn ssl_listen_port(nullptr); |\n+|\t} |\n+| |\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\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\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 (sp >= depth_limit) |\n-|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded); |\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\t--token_limit; |\n-|\t\t\tif (token_limit < 0) |\n-|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded); |\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-|\t\t\t// look for a new token |\n-|\t\t\tchar const t = *start; |\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_\b8_\b8_\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\b38\b88\b8 *\b**\b**\b* |\n+|return upload_rate_limit(m_local_peer_class); |\n+|\t} |\n | |\n-|\t\t\tint const current_frame = sp; |\n+|\tint session_impl::local_download_rate_limit() const |\n+|\t{ |\n+|\t\treturn download_rate_limit(m_local_peer_class); |\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+|\tint session_impl::upload_rate_limit_depr() const |\n+|\t{ |\n+|\t\treturn upload_rate_limit(m_global_class); |\n+|\t} |\n+| |\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+| |\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\tif (stack[current_frame - 1].state == 0) |\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-|_\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+|\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 |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b0_\b3_\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:2\b20\b00\b03\b3 *\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@@ -3481,14 +3867,68 @@\n |\t\tTORRENT_ASSERT(info.num_peers == 0); |\n | |\n |\t\tTORRENT_ASSERT(i->writing > 0); |\n |\t\tTORRENT_ASSERT(info.state == block_info::state_writing); |\n | |\n |\t\tif (info.state == block_info::state_finished) return; |\n |_\b\t_\b\t_\bi_\bf_\b _\b(_\bi_\bn_\bf_\bo_\b._\bs_\bt_\ba_\bt_\be_\b _\b=_\b=_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b)_\b _\b-_\b-_\bi_\b-_\b>_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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+|\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+|\t\t\treturn false; |\n+|\t\t} |\n+| |\n+|\t\tstd::shared_ptr const p = i->second; |\n+|\t\t// on_receive() may remove the tracker connection from the list |\n+|\t\treturn p->on_receive(ep, buf); |\n+|\t} |\n+| |\n+|\tvoid tracker_manager::incoming_error(error_code const& |\n+|\t\t, udp::endpoint const&) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|} |\n+| |\n+|\tbool tracker_manager::incoming_packet(string_view const hostname |\n+|\t\t, span const buf) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\t// ignore packets smaller than 8 bytes |\n+|\t\tif (buf.size() < 16) return false; |\n+| |\n+|\t\t// the first word is the action, if it's not [0, 3] |\n+|\t\t// it's not a valid udp tracker response |\n+|\t\tspan ptr = buf; |\n+|\t\tstd::uint32_t const action = aux::read_uint32(ptr); |\n+|\t\tif (action > 3) return false; |\n+| |\n+|\t\tstd::uint32_t const transaction = aux::read_uint32(ptr); |\n+|\t\tauto const i = m_udp_conns.find(transaction); |\n+| |\n+|\t\tif (i == m_udp_conns.end()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t// now, this may not have been meant to be a tracker response, |\n+|\t\t\t// but chances are pretty good, so it's probably worth logging |\n+|\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \" |\n+|\t\t\t\t\"transaction ID (%x)\", std::string(hostname).c_str(), int(transaction)); |\n+|#endif |\n+|\t\t\treturn false; |\n+|\t\t} |\n+| |\n+|\t\tstd::shared_ptr const p = i->second; |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b(_\b)_\b _\bm_\ba_\by_\b _\br_\be_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |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@@ -3537,454 +3977,69 @@\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/_\bp_\ba_\bt_\bh_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bt_\bh_\bi_\bs_\b _\bo_\bn_\b _\ba_\b _\bF_\bA_\bT_\b _\bv_\bo_\bl_\bu_\bm_\be_\b _\bt_\bo_\b _\bs_\be_\be_\b _\bw_\bh_\ba_\bt_\b _\be_\br_\br_\bo_\br_\b _\bw_\be_\b _\bg_\be_\bt_\b!_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhi\bis\bs o\bon\bn a\ba F\bFA\bAT\bT v\bvo\bol\blu\bum\bme\be t\bto\bo s\bse\bee\be w\bwh\bha\bat\bt e\ber\brr\bro\bor\br w\bwe\be g\bge\bet\bt!\b! *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bat\bth\bh.\b.c\bcp\bpp\bp:\b:4\b42\b29\b9 *\b**\b**\b* |\n-|// it's possible CreateHardLink will copy the file internally too, |\n-|\t\t\t// if the filesystem does not support it. |\n-|\t\t\tec.assign(GetLastError(), system_category()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// fall back to making a copy |\n-|#endif |\n-|#else |\n-|\t\t// assume posix's link() function exists |\n-|\t\tint ret = ::link(n_exist.c_str(), n_link.c_str()); |\n-| |\n-|\t\tif (ret == 0) |\n-|\t\t{ |\n-|\t\t\tec.clear(); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// most errors are passed through, except for the ones that indicate that |\n-|\t\t// hard links are not supported and require a copy. |\n-|if (errno != EMLINK |\n-|&& errno != EXDEV |\n-|#ifdef TORRENT_BEOS |\n-|\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link |\n-|\t\t\t&& errno != EPERM |\n-|#endif |\n-|\t\t\t) |\n-|\t\t{ |\n-|\t\t\t// some error happened, report up to the caller |\n-|\t\t\tec.assign(errno, system_category()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// fall back to making a copy |\n-| |\n-|#endif |\n-| |\n-|\t\t// if we get here, we should copy the file |\n-|\t\tstorage_error se; |\n-|\t\taux::copy_file(file, link, se); |\n-|\t\tec = se.ec; |\n-|\t} |\n-| |\n-|\tbool is_directory(std::string const& f, error_code& ec) |\n-|\t{ |\n-|\t\tec.clear(); |\n-|\t\terror_code e; |\n-|\t\tfile_status s; |\n-|\t\tstat_file(f, &s, e); |\n-|\t\tif (!e && s.mode & file_status::directory) return true; |\n-|_\b\t_\b\t_\be_\bc_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |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-|\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-| |\n-|\t\t\t\t// if we ended up copying the file, don't do anything during |\n-|\t\t\t\t// roll-back |\n-|\t\t\t\tif (copied_files[file_index]) continue; |\n-| |\n-|\t\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(file_index)); |\n-|\t\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(file_index)); |\n-| |\n-|\t\t\t\t// ignore errors when rolling back |\n-|\t\t\t\tstorage_error ignore; |\n-|\t\t\t\tmove_file(new_path, old_path, ignore); |\n-|\t\t\t} |\n-| |\n-|\t\t\treturn { status_t::fatal_disk_error, save_path }; |\n-|\t\t} |\n-| |\n-| |\n-|std::set subdirs; |\n-|\t\tfor (auto const i : f.file_range()) |\n-|\t\t{ |\n-|\t\t\t// files moved out to absolute paths are not moved |\n-|\t\t\tif (f.file_absolute_path(i)) continue; |\n-| |\n-|\t\t\tif (has_parent_path(f.file_path(i))) |\n-|\t\t\t\tsubdirs.insert(parent_path(f.file_path(i))); |\n-| |\n-|\t\t\t// if we ended up renaming the file instead of moving it, there's no |\n-|\t\t\t// need to delete the source. |\n-|\t\t\tif (copied_files[i] == false) continue; |\n-| |\n-|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n-| |\n-|\t\t\t// we may still have some files in old save_path |\n-|\t\t\t// eg. if (flags == dont_replace && exists(new_path)) |\n-|\t\t\t// ignore errors when removing |\n-|\t\t\terror_code ignore; |\n-|\t\t\tremove(old_path, ignore); |\n-|\t\t} |\n-| |\n-|\t\tfor (std::string const& s : subdirs) |\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-|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bm_\bo_\bv_\be_\b(_\bs_\bu_\bb_\bd_\bi_\br_\b,_\b _\be_\br_\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 |\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:_\b4_\b8_\b6 |is 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 |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\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_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\bhi\bis\bs r\bri\bis\bsk\bky\by?\b? T\bTh\bhe\be u\bup\bpp\bpe\ber\br l\bla\bay\bye\ber\br w\bwi\bil\bll\bl a\bas\bss\bsu\bum\bme\be w\bwe\be h\bha\bav\bve\be t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be.\b. P\bPe\ber\brh\bha\bap\bps\bs w\bwe\be s\bsh\bho\bou\bul\bld\bd v\bve\ber\bri\bif\bfy\by t\bth\bha\bat\bt a\bat\bt l\ble\bea\bas\bst\bt t\bth\bhe\be s\bsi\biz\bze\be o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be i\bis\bs c\bco\bor\brr\bre\bec\bct\bt *\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:4\b48\b86\b6 *\b**\b**\b* |\n-|{ |\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-|\t\t\t\t\tif (err) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tec.file(idx); |\n-|\t\t\t\t\t\tec.operation = operation_t::mkdir; |\n-|\t\t\t\t\t\treturn false; |\n-|\t\t\t\t\t} |\n-| |\n-|\t\t\t\t\thard_link(s, file_path, err); |\n-|\t\t\t\t} |\n-| |\n-|\t\t\t\t// if the file already exists, that's not an error |\n-|\t\t\t\tif (err == boost::system::errc::file_exists) |\n-|\t\t\t\t\tcontinue; |\n-| |\n-|if (err) |\n-|{ |\n-|\t\t\t\t\tec.ec = err; |\n-|\t\t\t\t\tec.file(idx); |\n-|\t\t\t\t\tec.operation = operation_t::file_hard_link; |\n-|\t\t\t\t\treturn false; |\n-|\t\t\t\t} |\n-|\t\t\t\tadded_files = true; |\n-|\t\t\t\tstat.set_dirty(idx); |\n-|\t\t\t} |\n-|\t\t} |\n-|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n-| |\n-|\t\tbool const seed = (rd.have_pieces.size() >= fs.num_pieces() |\n-|\t\t\t&& rd.have_pieces.all_set()) |\n-|\t\t\t|| (rd.flags & torrent_flags::seed_mode); |\n-| |\n-|\t\tif (seed) |\n-|\t\t{ |\n-|\t\t\tfor (file_index_t const file_index : fs.file_range()) |\n-|\t\t\t{ |\n-|\t\t\t\tif (fs.pad_file_at(file_index)) continue; |\n-| |\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-|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_\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|_\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\b54\b48\b8 *\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->has_piece_passed(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_\b2_\b9_\b3 |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\b32\b29\b93\b3 *\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+|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-|\tvoid peer_connection::incoming_dht_port(int const listen_port) |\n+|\t// internal |\n+|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\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_\b5_\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|_\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\b95\b58\b8 *\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-|_\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-|_\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\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-|\tvoid alert_manager::maybe_notify(alert* a) |\n+|\t// this is a group. It contains a set of group members |\n+|\tstruct torrent_entry |\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+|\t\tstd::string name; |\n+|\t\tstd::vector peers4; |\n+|\t\tstd::vector peers6; |\n+|\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+|constexpr time_duration announce_interval = minutes(30); |\n | |\n-|\tvoid alert_manager::set_notify_function(std::function const& fun) |\n+|\tstruct dht_immutable_item |\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+|\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-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\tvoid alert_manager::add_extension(std::shared_ptr ext) |\n+|\tstruct dht_mutable_item : dht_immutable_item |\n |\t{ |\n-|\t\tm_ses_extensions.push_back(ext); |\n-|\t} |\n-|#endif |\n+|\t\tsignature sig{}; |\n+|\t\tsequence_number seq{}; |\n+|\t\tpublic_key key{}; |\n+|\t\tstd::string salt; |\n+|\t}; |\n | |\n-|\tvoid alert_manager::get_all(std::vector& alerts) |\n+|\tvoid set_value(dht_immutable_item& item, span buf) |\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+|_\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@@ -4172,69 +4227,69 @@\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/ |use the resolver interface that has a built-in cache |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b2_\b9_\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 |\n |*\b**\b**\b**\b**\b* u\bus\bse\be t\bth\bhe\be r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be t\bth\bha\bat\bt h\bha\bas\bs a\ba b\bbu\bui\bil\blt\bt-\b-i\bin\bn c\bca\bac\bch\bhe\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:2\b29\b98\b8 *\b**\b**\b* |\n |protected: |\n | |\n |\t// The handler must be taken as lvalue reference here since we may not call |\n@@ -4336,124 +4391,14 @@\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/ |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_\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 |\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\b64\b47\b7 *\b**\b**\b* |\n-|else if (state() == piece_full) |\n-|\t\t\t\t\t\tstate(piece_full_reverse); |\n-|\t\t\t} |\n-| |\n-|\t\t\t// the number of peers that has this piece |\n-|\t\t\t// (availability) |\n-|\t\t\tstd::uint32_t peer_count : 26; |\n-| |\n-|\t\t\t// one of the download_queue_t values. This indicates whether this piece |\n-|\t\t\t// is currently being downloaded or not, and what state it's in if |\n-|\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks |\n-|\t\t\t// requested from them are separated out into separate lists to make |\n-|\t\t\t// lookups quicker. The main oddity is that whether a downloading piece |\n-|\t\t\t// has only been requested from peers that are reverse, that's |\n-|\t\t\t// recorded as piece_downloading_reverse, which really means the same |\n-|\t\t\t// as piece_downloading, it just saves space to also indicate that it |\n-|\t\t\t// has a bit lower priority. The reverse bit is only relevant if the |\n-|\t\t\t// state is piece_downloading. |\n-|\t\t\tstd::uint32_t download_state : 3; |\n-| |\n-| |\n-|// is 0 if the piece is filtered (not to be downloaded) |\n-|\t\t\t// 1 is low priority |\n-|\t\t\t// 2 is low priority |\n-|\t\t\t// 3 is mid priority |\n-|\t\t\t// 4 is default priority |\n-|\t\t\t// 5 is mid priority |\n-|\t\t\t// 6 is high priority |\n-|\t\t\t// 7 is high priority |\n-|\t\t\tstd::uint32_t piece_priority : 3; |\n-| |\n-|\t\t\t// index in to the piece_info vector |\n-|\t\t\tprio_index_t index; |\n-| |\n-|#ifdef TORRENT_DEBUG_REFCOUNTS |\n-|\t\t\t// all the peers that have this piece |\n-|\t\t\tstd::set have_peers; |\n-|#endif |\n-| |\n-|\t\t\t// index is set to this to indicate that we have the |\n-|\t\t\t// piece. There is no entry for the piece in the |\n-|\t\t\t// buckets if this is the case. |\n-|\t\t\tstatic constexpr prio_index_t we_have_index{-1}; |\n-| |\n-|\t\t\t// the priority value that means the piece is filtered |\n-|\t\t\tstatic constexpr std::uint32_t filter_priority = 0; |\n-| |\n-|\t\t\t// the max number the peer count can hold |\n-|\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff; |\n-| |\n-|_\b\t_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bh_\ba_\bv_\be_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b _\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bi_\bn_\bd_\be_\bx_\b _\b=_\b=_\b _\bw_\be_\b__\bh_\ba_\bv_\be_\b__\bi_\bn_\bd_\be_\bx_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |add async_connect() that takes a hostname and port as well |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\bas\bsy\byn\bnc\bc_\b_c\bco\bon\bnn\bne\bec\bct\bt(\b()\b) t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ba h\bho\bos\bst\btn\bna\bam\bme\be a\ban\bnd\bd p\bpo\bor\brt\bt a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n-|TORRENT_ASSERT(!aux::is_ip_address(host)); |\n-|\t\tm_dst_name = host; |\n-|\t\tif (m_dst_name.size() > 255) |\n-|\t\t\tm_dst_name.resize(255); |\n-|\t} |\n-| |\n-|\tvoid close(error_code& ec) |\n-|\t{ |\n-|\t\tm_dst_name.clear(); |\n-|\t\tproxy_base::close(ec); |\n-|\t} |\n-| |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid close() |\n-|\t{ |\n-|\t\tm_dst_name.clear(); |\n-|\t\tproxy_base::close(); |\n-|\t} |\n-|#endif |\n-| |\n-|template |\n-|void async_connect(endpoint_type const& endpoint, Handler handler) |\n-|\t{ |\n-|\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine, |\n-|\t\t// and using a hostname is fine on SOCKS version 5. |\n-|\t\tTORRENT_ASSERT(endpoint.address() != address() |\n-|\t\t\t|| (!m_dst_name.empty() && m_version == 5)); |\n-| |\n-|\t\tm_remote_endpoint = endpoint; |\n-| |\n-|\t\t// the connect is split up in the following steps: |\n-|\t\t// 1. resolve name of proxy server |\n-|\t\t// 2. connect to proxy server |\n-|\t\t// 3. if version == 5: |\n-|\t\t// 3.1 send SOCKS5 authentication method message |\n-|\t\t// 3.2 read SOCKS5 authentication response |\n-|\t\t// 3.3 send username+password |\n-|\t\t// 4. send SOCKS command message |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\"); |\n-|\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator( |\n-|\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) { |\n-|\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn)); |\n-|\t\t\t}, std::move(handler))); |\n-|\t} |\n-| |\n-|private: |\n-| |\n-|\ttemplate |\n-|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n-|_\b\t_\b\t_\b,_\b _\bH_\ba_\bn_\bd_\bl_\be_\br_\b _\bh_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |this should really be a circular buffer |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b9_\b9_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bea\bal\bll\bly\by b\bbe\be a\ba c\bci\bir\brc\bcu\bul\bla\bar\br b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:9\b99\b96\b6 *\b**\b**\b* |\n |// it just serves as a queue to remember what we've sent, to avoid |\n |\t\t// re-sending suggests for the same piece |\n |\t\t// i.e. outgoing suggest pieces |\n@@ -4553,69 +4498,69 @@\n |\t\t// and false if we got an incoming connection |\n |\t\t// could be considered: true = local, false = remote |\n |\t\tbool m_outgoing:1; |\n | |\n |\t\t// is true if we learn the incoming connections listening |\n |\t\t// during the extended handshake |\n |_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bm_\b__\br_\be_\bc_\be_\bi_\bv_\be_\bd_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b:_\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\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:_\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 |\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:6\b60\b0 *\b**\b**\b* |\n-|#include \"libtorrent/aux_/buffer.hpp\" |\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_\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 |\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\b64\b47\b7 *\b**\b**\b* |\n+|else if (state() == piece_full) |\n+|\t\t\t\t\t\tstate(piece_full_reverse); |\n+|\t\t\t} |\n | |\n-|#include |\n-|#include |\n+|\t\t\t// the number of peers that has this piece |\n+|\t\t\t// (availability) |\n+|\t\t\tstd::uint32_t peer_count : 26; |\n | |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|\t\t\t// one of the download_queue_t values. This indicates whether this piece |\n+|\t\t\t// is currently being downloaded or not, and what state it's in if |\n+|\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks |\n+|\t\t\t// requested from them are separated out into separate lists to make |\n+|\t\t\t// lookups quicker. The main oddity is that whether a downloading piece |\n+|\t\t\t// has only been requested from peers that are reverse, that's |\n+|\t\t\t// recorded as piece_downloading_reverse, which really means the same |\n+|\t\t\t// as piece_downloading, it just saves space to also indicate that it |\n+|\t\t\t// has a bit lower priority. The reverse bit is only relevant if the |\n+|\t\t\t// state is piece_downloading. |\n+|\t\t\tstd::uint32_t download_state : 3; |\n | |\n-|#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 | |\n-|namespace libtorrent { |\n-|namespace aux { |\n+|// is 0 if the piece is filtered (not to be downloaded) |\n+|\t\t\t// 1 is low priority |\n+|\t\t\t// 2 is low priority |\n+|\t\t\t// 3 is mid priority |\n+|\t\t\t// 4 is default priority |\n+|\t\t\t// 5 is mid priority |\n+|\t\t\t// 6 is high priority |\n+|\t\t\t// 7 is high priority |\n+|\t\t\tstd::uint32_t piece_priority : 3; |\n | |\n-|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+|\t\t\t// index in to the piece_info vector |\n+|\t\t\tprio_index_t index; |\n+| |\n+|#ifdef TORRENT_DEBUG_REFCOUNTS |\n+|\t\t\t// all the peers that have this piece |\n+|\t\t\tstd::set have_peers; |\n |#endif |\n-|\t\t} |\n | |\n-|\tprivate: |\n+|\t\t\t// index is set to this to indicate that we have the |\n+|\t\t\t// piece. There is no entry for the piece in the |\n+|\t\t\t// buckets if this is the case. |\n+|\t\t\tstatic constexpr prio_index_t we_have_index{-1}; |\n | |\n-|\t\t// 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\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\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\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/_\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@@ -4691,68 +4636,69 @@\n | |\n |\t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0; |\n |\t\tvirtual void remove_torrent_impl(std::shared_ptr tptr, remove_flags_t options) = 0; |\n | |\n |\t\t// port filter |\n |\t\tvirtual port_filter const& get_port_filter() const = 0; |\n |_\b\t_\b\t_\bv_\bi_\br_\bt_\bu_\ba_\bl_\b _\bv_\bo_\bi_\bd_\b _\bb_\ba_\bn_\b__\bi_\bp_\b(_\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\ba_\bd_\bd_\br_\b)_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b5_\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\b05\b5 *\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+|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:_\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 |\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:6\b60\b0 *\b**\b**\b* |\n+|#include \"libtorrent/aux_/buffer.hpp\" |\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+|#include |\n+|#include |\n | |\n-|\t\tif (!listen_socket) return; |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\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+|#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 | |\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+|namespace libtorrent { |\n+|namespace aux { |\n | |\n-|\t\tif (!ec && m_alerts.should_post()) |\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\tm_alerts.emplace_alert(mapping, port |\n-|\t\t\t\t, transport, proto, listen_socket->local_endpoint.address()); |\n+|\t\t\tthread_started(); |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\t\tm_destructed = false; |\n+|#endif |\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+|\tprivate: |\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+|\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\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+|\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 | | |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_\b5 |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\b25\b5 *\b**\b**\b* |\n |\t\t// notify the user of the error |\n@@ -4854,14 +4800,68 @@\n |\t\t\t// we need to keep the object alive during this operation |\n |\t\t\tm_ses.disk_thread().async_release_files(m_storage |\n |\t\t\t\t, std::bind(&torrent::on_cache_flushed, shared_from_this(), false)); |\n |\t\t\tm_ses.deferred_submit_jobs(); |\n |\t\t} |\n | |\n |_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bj_\bu_\bs_\bt_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b5_\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\b05\b5 *\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@@ -4884,18 +4884,14 @@\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 |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@@ -5004,14 +5000,227 @@\n |\tentry::list_type l; |\n |\tl.push_back(entry(\"http://foo.com/bar1\")); |\n |\tl.push_back(entry(\"http://foo.com/bar1\")); |\n |\tl.push_back(entry(\"http://foo.com/bar2\")); |\n |\tentry const e(l); |\n |\tentry torrent; |\n |_\b\t_\bt_\bo_\br_\br_\be_\bn_\bt_\b[_\b\"_\bu_\br_\bl_\b-_\bl_\bi_\bs_\bt_\b\"_\b]_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bs_\bc_\br_\ba_\bp_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsc\bcr\bra\bap\bpe\be r\bre\beq\bqu\bue\bes\bst\bts\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bp_\be_\be_\br_\bs_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be p\bpe\bee\ber\brs\bs6\b6 *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b-_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be t\btr\bra\bac\bck\bke\ber\br-\b-i\bid\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b-_\br_\be_\ba_\bs_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be f\bfa\bai\bil\blu\bur\bre\be-\b-r\bre\bea\bas\bso\bon\bn *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b4 |test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b _\bp_\be_\be_\br_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\bi_\be_\bs_\b _\bu_\bn_\be_\bv_\be_\bn_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bb_\by_\bt_\be_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\bs_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\bs_\b6_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\bl f\bfa\bai\bil\blu\bur\bre\be p\bpa\bat\bth\bhs\bs,\b, i\bin\bnc\bcl\blu\bud\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bdi\bin\bng\bg n\bno\bot\bt a\ba d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by n\bno\bo f\bfi\bil\ble\bes\bs e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be n\bno\bo i\bin\bnf\bfo\bo-\b-h\bha\bas\bsh\bh e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be m\bma\bal\blf\bfo\bor\brm\bme\bed\bd p\bpe\bee\ber\brs\bs i\bin\bn p\bpe\bee\ber\br l\bli\bis\bst\bt|\n+|o\bof\bf d\bdi\bic\bct\bti\bio\bon\bna\bar\bri\bie\bes\bs u\bun\bne\bev\bve\ben\bn n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bby\byt\bte\bes\bs i\bin\bn p\bpe\bee\ber\brs\bs a\ban\bnd\bd p\bpe\bee\ber\brs\bs6\b6 s\bst\btr\bri\bin\bng\bg r\bre\bes\bsp\bpo\bon\bns\bse\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:6\b64\b4 *\b**\b**\b* |\n+|#include \"test_utils.hpp\" |\n+|#include \"udp_tracker.hpp\" |\n+|#include \"settings.hpp\" |\n+|#include \"test_utils.hpp\" |\n+|#include \"libtorrent/alert.hpp\" |\n+|#include \"libtorrent/peer_info.hpp\" // for peer_list_entry |\n+|#include \"libtorrent/alert_types.hpp\" |\n+|#include \"libtorrent/session.hpp\" |\n+|#include \"libtorrent/session_params.hpp\" |\n+|#include \"libtorrent/error_code.hpp\" |\n+|#include \"libtorrent/tracker_manager.hpp\" |\n+|#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response |\n+|#include \"libtorrent/torrent_info.hpp\" |\n+|#include \"libtorrent/announce_entry.hpp\" |\n+|#include \"libtorrent/torrent.hpp\" |\n+|#include \"libtorrent/aux_/path.hpp\" |\n+|#include \"libtorrent/socket_io.hpp\" |\n+| |\n+|using namespace lt; |\n+| |\n+| |\n+|TORRENT_TEST(parse_hostname_peers) |\n+|{ |\n+|\tchar const response[] = \"d5:peersld7:peer id20:aaaaaaaaaaaaaaaaaaaa\" |\n+|\t\t\"2:ip13:test_hostname4:porti1000eed\" |\n+|\t\t\"7:peer id20:bbbbabaababababababa2:ip12:another_host4:porti1001eeee\"; |\n+|\terror_code ec; |\n+|\ttracker_response resp = parse_tracker_response(response |\n+|\t\t, ec, {}, sha1_hash()); |\n+| |\n+|\tTEST_EQUAL(ec, error_code()); |\n+|\tTEST_EQUAL(resp.peers.size(), 2); |\n+|\tif (resp.peers.size() == 2) |\n+|\t{ |\n+|\t\tpeer_entry const& e0 = resp.peers[0]; |\n+|\t\tpeer_entry const& e1 = resp.peers[1]; |\n+|\t\tTEST_EQUAL(e0.hostname, \"test_hostname\"); |\n+|\t\tTEST_EQUAL(e0.port, 1000); |\n+|\t\tTEST_EQUAL(e0.pid, peer_id(\"aaaaaaaaaaaaaaaaaaaa\")); |\n+| |\n+|\t\tTEST_EQUAL(e1.hostname, \"another_host\"); |\n+|\t\tTEST_EQUAL(e1.port, 1001); |\n+|\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\")); |\n+|\t} |\n+|} |\n+| |\n+|TORRENT_TEST(parse_peers4) |\n+|{ |\n+|\tchar const response[] = \"d5:peers12:\\x01\\x02\\x03\\x04\\x30\\x10\" |\n+|\t\t\"\\x09\\x08\\x07\\x06\\x20\\x10\" \"e\"; |\n+|_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b _\be_\bc_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test file attributes |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt f\bfi\bil\ble\be a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test symlinks |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsy\bym\bml\bli\bin\bnk\bks\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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+|_\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_\b6_\b6_\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\b16\b66\b6 *\b**\b**\b* |\n+|// to the time it will take to complete the test |\n+|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n+|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n+|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n+|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n+| |\n+|\t// make sure we announce to both http and udp trackers |\n+|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n+|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_lsd, false); |\n+|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n+|\tpack.set_bool(settings_pack::enable_upnp, false); |\n+|\tpack.set_bool(settings_pack::enable_dht, false); |\n+| |\n+|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n+|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n+| |\n+|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n+| |\n+|pack.set_int(settings_pack::unchoke_slots_limit, 0); |\n+|ses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0); |\n+| |\n+|\tpack.set_int(settings_pack::unchoke_slots_limit, -1); |\n+|\tses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1); |\n+| |\n+|\tpack.set_int(settings_pack::unchoke_slots_limit, 8); |\n+|\tses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8); |\n+| |\n+|\tses2.apply_settings(pack); |\n+| |\n+|\ttorrent_handle tor1; |\n+|\ttorrent_handle tor2; |\n+| |\n+|\tcreate_directory(\"tmp1_transfer\", ec); |\n+|\tstd::ofstream file(\"tmp1_transfer/temporary\"); |\n+|\tstd::shared_ptr t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false); |\n+|\tfile.close(); |\n+| |\n+|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\n+| |\n+|\tadd_torrent_params params; |\n+|\tparams.storage_mode = storage_mode; |\n+|\tparams.flags &= ~torrent_flags::paused; |\n+|\tparams.flags &= ~torrent_flags::auto_managed; |\n+| |\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__\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+| |\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/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test erasing peers |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt e\ber\bra\bas\bsi\bin\bng\bg p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test update_peer_port with allow_multiple_connections_per_ip and without |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt u\bup\bpd\bda\bat\bte\be_\b_p\bpe\bee\ber\br_\b_p\bpo\bor\brt\bt w\bwi\bit\bth\bh a\bal\bll\blo\bow\bw_\b_m\bmu\bul\blt\bti\bip\bpl\ble\be_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_p\bpe\ber\br_\b_i\bip\bp a\ban\bnd\bd w\bwi\bit\bth\bho\bou\but\bt *\b**\b**\b**\b**\b* |\n@@ -5040,278 +5249,50 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_c\bcl\blo\bos\bse\bed\bd *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |connect candidates recalculation when incrementing failcount |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs r\bre\bec\bca\bal\blc\bcu\bul\bla\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bti\bin\bng\bg f\bfa\bai\bil\blc\bco\bou\bun\bnt\bt *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |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+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test sending invalid requests (out of bound piece index, offsets and sizes) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bf_\ba_\bs_\bt_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b3_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bse\ben\bnd\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd r\bre\beq\bqu\bue\bes\bst\bts\bs (\b(o\bou\but\bt o\bof\bf b\bbo\bou\bun\bnd\bd p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx,\b, o\bof\bff\bfs\bse\bet\bts\bs a\ban\bnd\bd s\bsi\biz\bze\bes\bs)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\ba\ba_\bs\bs_\bt\bt_\b_\b__\be\be_\bx\bx_\bt\bt_\be\be_\bn\bn_\bs\bs_\bi\bi_\bo\bo_\bn\bn_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b2_\b _\b _\b _\b _\b _\b _\b|_\bc_\bh_\be_\bc_\bk_\b _\bt_\bo_\b _\bm_\ba_\bk_\be_\b _\bs_\bu_\br_\be_\b _\bt_\bh_\be_\b _\b\"_\bb_\be_\bs_\bt_\b\"_\b _\bi_\bt_\be_\bm_\bs_\b _\ba_\br_\be_\b _\bs_\bt_\bo_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bhe\bec\bck\bk t\bto\bo m\bma\bak\bke\be s\bsu\bur\bre\be t\bth\bhe\be \"\b\"b\bbe\bes\bst\bt\"\b\" i\bit\bte\bem\bms\bs a\bar\bre\be s\bst\bto\bor\bre\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b47\b72\b2 *\b**\b**\b* |\n+|, msg_args().target(items[j].target)); |\n | |\n-|\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+|\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// test that wrapping of the timestamp is properly handled |\n-|\th.add_sample(0xfffffff3, false); |\n-|\tTEST_EQUAL(h.base(), 0xfffffff3); |\n+|\t\tbdecode_node parsed[4]; |\n+|\t\tchar error_string[200]; |\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__\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\tint ret = verify_message(response, desc, parsed, error_string); |\n+|\t\tif (ret) |\n |\t\t{ |\n-|\t\t\tTEST_CHECK(!t.has_node(i)); |\n+|\t\t\titems_num.insert(items_num.begin(), j); |\n |\t\t} |\n |\t} |\n+| |\n+|TEST_EQUAL(items_num.size(), 4); |\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+|int sum_distance_exp(int s, node_entry const& e, node_id const& ref) |\n |{ |\n-|aux::vector mask; |\n-|std::vector tree; |\n-|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n+|\treturn s + distance_exp(e.id, ref); |\n+|} |\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/_\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-|_\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-| |\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\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-|\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-|\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-| |\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__\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-| |\n-|TEST_EQUAL(items_num.size(), 4); |\n-|} |\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-| |\n-|std::vector g_got_peers; |\n+|std::vector g_got_peers; |\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 | |\n |std::vector g_got_items; |\n@@ -5620,176 +5601,151 @@\n |template |\n |void test_unfinished_pieces(Fun f) |\n |{ |\n |\t// create a torrent and complete files |\n |\tstd::shared_ptr ti = generate_torrent(true, true); |\n | |\n |_\b\t_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bp_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3 |change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bp_\ba_\bu_\bs_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; t\bte\bes\bst\bt_\b_u\bun\bns\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:1\b16\b63\b3 *\b**\b**\b* |\n-|{ |\n-|\t// share-mode |\n-|\ttest_add_and_get_flags(torrent_flags::share_mode); |\n-|\ttest_set_after_add(torrent_flags::share_mode); |\n-|\ttest_unset_after_add(torrent_flags::share_mode); |\n-|} |\n-|#endif |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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-|TORRENT_TEST(flag_apply_ip_filter) |\n-|{ |\n-|\t// apply-ip-filter |\n-|\ttest_add_and_get_flags(torrent_flags::apply_ip_filter); |\n-|\ttest_set_after_add(torrent_flags::apply_ip_filter); |\n-|\ttest_unset_after_add(torrent_flags::apply_ip_filter); |\n-|} |\n+|\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-|TORRENT_TEST(flag_paused) |\n-|{ |\n-|\t// paused |\n-|\ttest_add_and_get_flags(torrent_flags::paused); |\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 | |\n-|TORRENT_TEST(flag_auto_managed) |\n-|{ |\n-|\t// auto-managed |\n-|\ttest_add_and_get_flags(torrent_flags::auto_managed); |\n-|\ttest_set_after_add(torrent_flags::auto_managed); |\n-|\ttest_unset_after_add(torrent_flags::auto_managed); |\n-|} |\n | |\n-|// super seeding mode is automatically turned off if we're not a seed |\n-|// since the posix_disk_io is not threaded, this will happen immediately |\n-|#if TORRENT_HAVE_MMAP |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|TORRENT_TEST(flag_super_seeding) |\n-|{ |\n-|\t// super-seeding |\n-|\ttest_add_and_get_flags(torrent_flags::super_seeding); |\n-|\ttest_unset_after_add(torrent_flags::super_seeding); |\n-|\ttest_set_after_add(torrent_flags::super_seeding); |\n-|} |\n-|#endif |\n-|#endif |\n+|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-|TORRENT_TEST(flag_sequential_download) |\n-|{ |\n-|\t// sequential-download |\n-|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n-|\ttest_set_after_add(torrent_flags::sequential_download); |\n-|\ttest_unset_after_add(torrent_flags::sequential_download); |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b5 |this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bl_\be_\ba_\br_\be_\bd_\b _\bt_\be_\bs_\bt_\b__\ba_\bd_\bd_\b__\ba_\bn_\bd_\b__\bg_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\bp_\b-_\bw_\bh_\be_\bn_\b-_\br_\be_\ba_\bd_\by_\b _\bw_\bh_\be_\bn_\b _\ba_\bl_\br_\be_\ba_\bd_\by_\b _\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\be_\bf_\bf_\be_\bc_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bte\bes\bst\bt i\bis\bs f\bfl\bla\bak\bky\by,\b, s\bsi\bin\bnc\bce\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bil\bll\bl b\bbe\bec\bco\bom\bme\be r\bre\bea\bad\bdy\by b\bbe\bef\bfo\bor\bre\be a\bas\bsk\bki\bin\bng\bg f\bfo\bor\br t\bth\bhe\be f\bfl\bla\bag\bgs\bs,\b, a\ban\bnd\bd b\bby\by t\bth\bhe\ben\bn s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by w\bwi\bil\bll\bl h\bha\bav\bve\be b\bbe\bee\ben\bn c\bcl\ble\bea\bar\bre\bed\bd t\bte\bes\bst\bt_\b_a\bad\bdd\bd_\b_a\ban\bnd\bd_\b_g\bge\bet\bt_\b_f\bfl\bla\bag\bgs\bs |\n-|(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; s\bse\bet\btt\bti\bin\bng\bg s\bst\bto\bop\bp-\b-w\bwh\bhe\ben\bn-\b-r\bre\bea\bad\bdy\by w\bwh\bhe\ben\bn a\bal\blr\bre\bea\bad\bdy\by s\bst\bto\bop\bpp\bpe\bed\bd h\bha\bas\bs n\bno\bo e\bef\bff\bfe\bec\bct\bt.\b. *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bl\bl_\ba\ba_\bg\bg_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b0\b0_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b9_\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bn_\bg_\be_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bt_\be_\bs_\bt_\b _\bs_\be_\bt_\bu_\bp_\b._\b _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b._\b _\bt_\be_\bs_\bt_\b__\bs_\be_\bt_\b__\ba_\bf_\bt_\be_\br_\b__\ba_\bd_\bd_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:2\b20\b09\b9 *\b**\b**\b* |\n-|test_set_after_add(torrent_flags::super_seeding); |\n-|} |\n-|#endif |\n-|#endif |\n+|\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-|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+|\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-|// the stop when ready flag will be cleared when the torrent is ready to start |\n-|// downloading. |\n-|// since the posix_disk_io is not threaded, this will happen immediately |\n-|#if TORRENT_HAVE_MMAP |\n-|TORRENT_TEST(flag_stop_when_ready) |\n-|{ |\n-|\t// stop-when-ready |\n-|test_unset_after_add(torrent_flags::stop_when_ready); |\n-|} |\n-|#endif |\n+|\t// fill in the peer-id |\n+|\tstd::generate(handshake + 48, handshake + 68, &rand); |\n | |\n-|TORRENT_TEST(flag_disable_dht) |\n-|{ |\n-|\ttest_add_and_get_flags(torrent_flags::disable_dht); |\n-|\ttest_set_after_add(torrent_flags::disable_dht); |\n-|\ttest_unset_after_add(torrent_flags::disable_dht); |\n-|} |\n+|\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 | |\n-|TORRENT_TEST(flag_disable_lsd) |\n-|{ |\n-|\ttest_add_and_get_flags(torrent_flags::disable_lsd); |\n-|\ttest_set_after_add(torrent_flags::disable_lsd); |\n-|\ttest_unset_after_add(torrent_flags::disable_lsd); |\n-|} |\n+|\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+|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(flag_disable_pex) |\n+|TORRENT_TEST(timestamp_history) |\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-|_\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_\b6_\b6_\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\b16\b66\b6 *\b**\b**\b* |\n-|// to the time it will take to complete the test |\n-|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n-|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n-|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n-|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n-| |\n-|\t// make sure we announce to both http and udp trackers |\n-|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n-|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_lsd, false); |\n-|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n-|\tpack.set_bool(settings_pack::enable_upnp, false); |\n-|\tpack.set_bool(settings_pack::enable_dht, false); |\n-| |\n-|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n-|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n-| |\n-|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n-| |\n-|pack.set_int(settings_pack::unchoke_slots_limit, 0); |\n-|ses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, -1); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, 8); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8); |\n-| |\n-|\tses2.apply_settings(pack); |\n-| |\n-|\ttorrent_handle tor1; |\n-|\ttorrent_handle tor2; |\n-| |\n-|\tcreate_directory(\"tmp1_transfer\", ec); |\n-|\tstd::ofstream file(\"tmp1_transfer/temporary\"); |\n-|\tstd::shared_ptr t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false); |\n-|\tfile.close(); |\n+|\tusing namespace lt; |\n | |\n-|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\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-|\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// test that wrapping of the timestamp is properly handled |\n+|\th.add_sample(0xfffffff3, false); |\n+|\tTEST_EQUAL(h.base(), 0xfffffff3); |\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+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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@@ -5862,748 +5818,371 @@\n |\t\tauto const num_matches = std::size_t(std::count_if(links.begin(), links.end() |\n |\t\t\t, std::bind(&resolve_links::link_t::ti, _1))); |\n | |\n |\t\t// some debug output in case the test fails |\n |\t\tif (num_matches > e.expected_matches) |\n |\t\t{ |\n |_\b\t_\b\t_\b\t_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bf_\bs_\b _\b=_\b _\bt_\bi_\b1_\b-_\b>_\bf_\bi_\bl_\be_\bs_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bu_\bp_\bn_\bp_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b6_\b _\b _\b _\b _\b _\b|_\bs_\bt_\bo_\br_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\bg_\b _\ba_\bn_\bd_\b _\bv_\be_\br_\bi_\bf_\by_\b _\bt_\bh_\ba_\bt_\b _\bs_\bo_\bm_\be_\b _\bk_\be_\by_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\bs_\b _\ba_\br_\be_\b _\bt_\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bst\bto\bor\bre\be t\bth\bhe\be l\blo\bog\bg a\ban\bnd\bd v\bve\ber\bri\bif\bfy\by t\bth\bha\bat\bt s\bso\bom\bme\be k\bke\bey\by m\bme\bes\bss\bsa\bag\bge\bes\bs a\bar\bre\be t\bth\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_u\bup\bpn\bnp\bp.\b.c\bcp\bpp\bp:\b:1\b15\b56\b6 *\b**\b**\b* |\n-|, portmap_protocol const protocol, error_code const& err |\n-|\t\t\t, portmap_transport, aux::listen_socket_handle const&) override |\n-|\t\t{ |\n-|\t\t\tcallback_info info = {mapping, port, err}; |\n-|\t\t\tcallbacks.push_back(info); |\n-|\t\t\tstd::cout << \"mapping: \" << static_cast(mapping) |\n-|\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-| |\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+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3 |change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bp_\ba_\bu_\bs_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; t\bte\bes\bst\bt_\b_u\bun\bns\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:1\b16\b63\b3 *\b**\b**\b* |\n+|{ |\n+|\t// share-mode |\n+|\ttest_add_and_get_flags(torrent_flags::share_mode); |\n+|\ttest_set_after_add(torrent_flags::share_mode); |\n+|\ttest_unset_after_add(torrent_flags::share_mode); |\n |} |\n |#endif |\n-|\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__\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+|TORRENT_TEST(flag_apply_ip_filter) |\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+|\t// apply-ip-filter |\n+|\ttest_add_and_get_flags(torrent_flags::apply_ip_filter); |\n+|\ttest_set_after_add(torrent_flags::apply_ip_filter); |\n+|\ttest_unset_after_add(torrent_flags::apply_ip_filter); |\n |} |\n | |\n-|TORRENT_TEST(parse_peers4) |\n+|TORRENT_TEST(flag_paused) |\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+|\t// paused |\n+|\ttest_add_and_get_flags(torrent_flags::paused); |\n |} |\n | |\n-|} // anonymous namespace |\n-| |\n-|TORRENT_TEST(bloom_filter) |\n+|TORRENT_TEST(flag_auto_managed) |\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/_\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+|\t// auto-managed |\n+|\ttest_add_and_get_flags(torrent_flags::auto_managed); |\n+|\ttest_set_after_add(torrent_flags::auto_managed); |\n+|\ttest_unset_after_add(torrent_flags::auto_managed); |\n+|} |\n | |\n-|\ttracker_error_alert::tracker_error_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep, int times |\n-|\t\t, protocol_version v, string_view u, operation_t const operation |\n-|\t\t, error_code const& e |\n-|\t\t, string_view m) |\n-|\t\t: tracker_alert(alloc, h, ep, u) |\n-|\t\t, times_in_row(times) |\n-|\t\t, error(e) |\n-|\t\t, op(operation) |\n-|\t\t, m_msg_idx(alloc.copy_string(m)) |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\t, status_code(e && e.category() == http_category() ? e.value() : -1) |\n-|\t\t, msg(m) |\n-|#endif |\n-|, version(v) |\n+|// super seeding mode is automatically turned off if we're not a seed |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|TORRENT_TEST(flag_super_seeding) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n-| |\n-|\tchar const* tracker_error_alert::failure_reason() const |\n-|\t{ |\n-|\t\treturn m_alloc.get().ptr(m_msg_idx); |\n-|\t} |\n-| |\n-|\tstd::string tracker_error_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\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-|\t\treturn ret; |\n+|\t// super-seeding |\n+|\ttest_add_and_get_flags(torrent_flags::super_seeding); |\n+|\ttest_unset_after_add(torrent_flags::super_seeding); |\n+|\ttest_set_after_add(torrent_flags::super_seeding); |\n+|} |\n |#endif |\n-|\t} |\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-|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bB_\bI_\b__\bV_\bE_\bR_\bS_\bI_\bO_\bN_\b _\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 |\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_\b3_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b43\b38\b8 *\b**\b**\b* |\n-|return {}; |\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-|\t\treturn ret; |\n |#endif |\n-|\t} |\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-|\t\t, msg(m) |\n-|#endif |\n-|, version(v) |\n+|TORRENT_TEST(flag_sequential_download) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n-| |\n-|\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-|\t\treturn {}; |\n-|#else |\n-|\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message(); |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b5 |this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bl_\be_\ba_\br_\be_\bd_\b _\bt_\be_\bs_\bt_\b__\ba_\bd_\bd_\b__\ba_\bn_\bd_\b__\bg_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\bp_\b-_\bw_\bh_\be_\bn_\b-_\br_\be_\ba_\bd_\by_\b _\bw_\bh_\be_\bn_\b _\ba_\bl_\br_\be_\ba_\bd_\by_\b _\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\be_\bf_\bf_\be_\bc_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bte\bes\bst\bt i\bis\bs f\bfl\bla\bak\bky\by,\b, s\bsi\bin\bnc\bce\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bil\bll\bl b\bbe\bec\bco\bom\bme\be r\bre\bea\bad\bdy\by b\bbe\bef\bfo\bor\bre\be a\bas\bsk\bki\bin\bng\bg f\bfo\bor\br t\bth\bhe\be f\bfl\bla\bag\bgs\bs,\b, a\ban\bnd\bd b\bby\by t\bth\bhe\ben\bn s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by w\bwi\bil\bll\bl h\bha\bav\bve\be b\bbe\bee\ben\bn c\bcl\ble\bea\bar\bre\bed\bd t\bte\bes\bst\bt_\b_a\bad\bdd\bd_\b_a\ban\bnd\bd_\b_g\bge\bet\bt_\b_f\bfl\bla\bag\bgs\bs |\n+|(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; s\bse\bet\btt\bti\bin\bng\bg s\bst\bto\bop\bp-\b-w\bwh\bhe\ben\bn-\b-r\bre\bea\bad\bdy\by w\bwh\bhe\ben\bn a\bal\blr\bre\bea\bad\bdy\by s\bst\bto\bop\bpp\bpe\bed\bd h\bha\bas\bs n\bno\bo e\bef\bff\bfe\bec\bct\bt.\b. *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bl\bl_\ba\ba_\bg\bg_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b0\b0_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b9_\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bn_\bg_\be_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bt_\be_\bs_\bt_\b _\bs_\be_\bt_\bu_\bp_\b._\b _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b._\b _\bt_\be_\bs_\bt_\b__\bs_\be_\bt_\b__\ba_\bf_\bt_\be_\br_\b__\ba_\bd_\bd_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:2\b20\b09\b9 *\b**\b**\b* |\n+|test_set_after_add(torrent_flags::super_seeding); |\n+|} |\n |#endif |\n-|\t} |\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-|_\b\t_\b\t_\b,_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b(_\bc_\bo_\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 _\b _\b _\b _\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_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b46\b64\b4 *\b**\b**\b* |\n-|char 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-|\t\treturn {}; |\n-|#else |\n-|\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message(); |\n |#endif |\n-|\t} |\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-|, version(v) |\n+|TORRENT_TEST(flag_sequential_download) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n-| |\n-|\tstd::string scrape_reply_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\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-|#endif |\n-|\t} |\n-| |\n-|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\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-|_\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/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b49\b93\b3 *\b**\b**\b* |\n-|return {}; |\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-|#endif |\n-|\t} |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n+|} |\n | |\n-|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\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-|, version(v) |\n+|// the stop when ready flag will be cleared when the torrent is ready to start |\n+|// downloading. |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|TORRENT_TEST(flag_stop_when_ready) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n-| |\n-|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\n-|\t\t, string_view u, string_view m) |\n-|\t\t: tracker_alert(alloc, h, ep, u) |\n-|\t\t, error(errors::tracker_failure) |\n-|\t\t, m_msg_idx(alloc.copy_string(m)) |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\t, msg(m) |\n-|#endif |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n-| |\n-|\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-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message(); |\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/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b2_\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:5\b53\b32\b2 *\b**\b**\b* |\n-|char 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-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message(); |\n+|\t// stop-when-ready |\n+|test_unset_after_add(torrent_flags::stop_when_ready); |\n+|} |\n |#endif |\n-|\t} |\n | |\n-|\ttracker_reply_alert::tracker_reply_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\n-|\t\t, int np, protocol_version v, string_view u) |\n-|\t\t: tracker_alert(alloc, h, ep, u) |\n-|\t\t, num_peers(np) |\n-|, version(v) |\n+|TORRENT_TEST(flag_disable_dht) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n+|\ttest_add_and_get_flags(torrent_flags::disable_dht); |\n+|\ttest_set_after_add(torrent_flags::disable_dht); |\n+|\ttest_unset_after_add(torrent_flags::disable_dht); |\n+|} |\n | |\n-|\tstd::string tracker_reply_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar ret[400]; |\n-|\t\tstd::snprintf(ret, sizeof(ret), \"%s %s received peers: %d\" |\n-|\t\t\t, tracker_alert::message().c_str() |\n-|\t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\" |\n-|\t\t\t, num_peers); |\n-|\t\treturn ret; |\n-|#endif |\n-|\t} |\n | |\n-|\tdht_reply_alert::dht_reply_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h |\n-|\t\t, int np) |\n-|\t\t: tracker_alert(alloc, h, {}, \"\") |\n-|\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-|_\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-|_\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:_\b5_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\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 _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhi\bis\bs t\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:5\b57\b76\b6 *\b**\b**\b* |\n-|, num_peers(np) |\n-|\t{} |\n+|TORRENT_TEST(flag_disable_lsd) |\n+|{ |\n+|\ttest_add_and_get_flags(torrent_flags::disable_lsd); |\n+|\ttest_set_after_add(torrent_flags::disable_lsd); |\n+|\ttest_unset_after_add(torrent_flags::disable_lsd); |\n+|} |\n | |\n-|\tstd::string dht_reply_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar ret[400]; |\n-|\t\tstd::snprintf(ret, sizeof(ret), \"%s received DHT peers: %d\" |\n-|\t\t\t, tracker_alert::message().c_str(), num_peers); |\n-|\t\treturn ret; |\n-|#endif |\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__\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-|\ttracker_announce_alert::tracker_announce_alert(aux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h, tcp::endpoint const& ep, string_view u |\n-|\t\t, protocol_version const v, event_t const e) |\n-|\t\t: tracker_alert(alloc, h, ep, u) |\n-|\t\t, event(e) |\n-|, version(v) |\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-|\t\tTORRENT_ASSERT(!u.empty()); |\n-|\t} |\n+|aux::vector mask; |\n+|std::vector tree; |\n+|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n | |\n-|\tstd::string tracker_announce_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tstatic const char* const event_str[] = {\"none\", \"completed\", \"started\", \"stopped\", \"paused\"}; |\n-|\t\treturn tracker_alert::message() |\n-|\t\t\t+ (version == protocol_version::V1 ? \" v1\" : \" v2\") |\n-|\t\t\t+ \" sending announce (\" + event_str[static_cast(event)] + \")\"; |\n-|#endif |\n-|\t} |\n+|\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data()); |\n+|\tt2.load_sparse_tree(tree, mask, empty_verified); |\n | |\n-|\thash_failed_alert::hash_failed_alert( |\n-|\t\taux::stack_allocator& alloc |\n-|\t\t, torrent_handle const& h |\n-|\t\t, piece_index_t index) |\n-|\t\t: torrent_alert(alloc, h) |\n-|\t\t, piece_index(index) |\n+|\tTEST_CHECK(t.build_vector() == t2.build_vector()); |\n+|\tfor (int i = 0; i < int(t.size()); ++i) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(index >= piece_index_t(0)); |\n-|\t} |\n+|\t\tTEST_EQUAL(t[i], t2[i]); |\n+|\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i)); |\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/_\bu_\bt_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b6_\b7_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bl_\bo_\bo_\bp_\b _\bi_\bs_\b _\bn_\bo_\bt_\b _\bv_\be_\br_\by_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b._\b _\bI_\bt_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\bi_\bx_\be_\bd_\b _\bb_\by_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\bs_\b _\bt_\bh_\ba_\bt_\b _\bn_\be_\be_\bd_\b _\br_\be_\bs_\be_\bn_\bd_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs l\blo\boo\bop\bp i\bis\bs n\bno\bot\bt v\bve\ber\bry\by e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt.\b. I\bIt\bt c\bco\bou\bul\bld\bd b\bbe\be f\bfi\bix\bxe\bed\bd b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt o\bof\bf s\bse\beq\bqu\bue\ben\bnc\bce\be n\bnu\bum\bmb\bbe\ber\brs\bs t\bth\bha\bat\bt n\bne\bee\bed\bd r\bre\bes\bse\ben\bnd\bdi\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.c\bcp\bpp\bp:\b:1\b14\b46\b67\b7 *\b**\b**\b* |\n-|#endif |\n+|\t\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-|\tif (m_stalled) |\n-|\t{ |\n-|\t\tif (flags & pkt_ack) |\n-|\t\t\tdefer_ack(); |\n-|\t\treturn false; |\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-|\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+|TORRENT_TEST(roundtrip_empty_tree) |\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+|\taux::merkle_tree t(num_blocks, 1, f[0].data()); |\n+|\ttest_roundtrip(t, num_blocks, 1); |\n+|} |\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+|_\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// MTU DISCOVERY |\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-|\t// under these conditions, the next packet we send should be an MTU probe. |\n-|\t// MTU probes get to use the mid-point packet size, whereas other packets |\n-|\t// use a conservative packet size of the largest known to work. The reason |\n-|\t// for the cwnd condition is to make sure the probe is surrounded by non- |\n-|\t// probes, to be able to distinguish a loss of the probe vs. just loss in |\n-|_\b\t_\b/_\b/_\b _\bg_\be_\bn_\be_\br_\ba_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b1_\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\b11\b1 *\b**\b**\b* |\n-|std::string& attr = e[\"attr\"].string(); |\n-|\t\tif (flags & file_storage::flag_pad_file) attr += 'p'; |\n-|\t\tif (flags & file_storage::flag_hidden) attr += 'h'; |\n-|\t\tif (flags & file_storage::flag_executable) attr += 'x'; |\n-|\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l'; |\n-|\t} |\n+|\tauto const& res = *result; |\n+|\tTEST_EQUAL(res.passed.size(), 0); |\n+|\tTEST_EQUAL(res.failed.size(), 0); |\n | |\n-|\tvoid add_symlink_path(entry& e, std::string symlink_path) |\n-|\t{ |\n-|\t\tentry& sympath_e = e[\"symlink path\"]; |\n+|\tfor (int i = 127; i < 127 + 4; ++i) |\n+|\t\tTEST_CHECK(t[i] == f[i]); |\n | |\n-|\t\tstd::string const link = lexically_relative(\"\", symlink_path); |\n-|\t\tfor (auto elems = lsplit_path(link); !elems.first.empty(); |\n-|\t\t\telems = lsplit_path(elems.second)) |\n-|\t\t\tsympath_e.list().emplace_back(elems.first); |\n-|\t} |\n+|\tTEST_CHECK(t.verified_leafs() == none_set(num_blocks)); |\n |} |\n | |\n-|\tstd::vector create_torrent::generate_buf() const |\n-|\t{ |\n-|std::vector ret; |\n-|bencode(std::back_inserter(ret), generate()); |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tentry create_torrent::generate() const |\n-|\t{ |\n-|\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0) |\n-|\t\t\taux::throw_ex(errors::torrent_missing_file_tree); |\n-| |\n-|\t\t// if all v2 hashes are set correctly, generate the v2 parts of the |\n-|\t\t// torrent |\n-|\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash); |\n-|\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash); |\n-| |\n-|\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent |\n-|\t\tif (!make_v1 && !make_v2) |\n-|\t\t\taux::throw_ex(errors::invalid_hash_entry); |\n-| |\n-|\t\tTORRENT_ASSERT(m_files.piece_length() > 0); |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b0_\b9_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\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\b10\b09\b91\b1 *\b**\b**\b* |\n+|\t\tint rate = 0; |\n | |\n-|\t\tentry dict; |\n+|\t\t// if we haven't received any data recently, the current download rate |\n+|\t\t// is not representative |\n+|\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0) |\n+|\t\t{ |\n+|\t\t\trate = m_download_rate_peak; |\n+|\t\t} |\n+|\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5) |\n+|\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000) |\n+|\t\t{ |\n+|\t\t\t// if we're have only been unchoked for a short period of time, |\n+|\t\t\t// we don't know what rate we can get from this peer. Instead of assuming |\n+|\t\t\t// the lowest possible rate, assume the average. |\n | |\n-|\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first; |\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\tif (!m_nodes.empty()) |\n+|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n+|} |\n+|\t\telse |\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+|\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\tauto file_iter = std::upper_bound( |\n-|\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset); |\n+|\t\t// avoid division by zero |\n+|\t\tif (rate < 50) rate = 50; |\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\t// average of current rate and peak |\n+|//\t\trate = (rate + m_download_rate_peak) / 2; |\n+| |\n+|\t\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n+|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n |\t} |\n | |\n-|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n+|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n |\t{ |\n-|\t\treturn file_index_at_offset(static_cast(piece) * std::int64_t(piece_length())); |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tm_statistics.add_stat(downloaded, uploaded); |\n |\t} |\n | |\n-|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const |\n+|\tsha1_hash peer_connection::associated_info_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\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_\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 _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\b52\b20\b0 *\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->has_piece_passed(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\treturn file_index_t{-1}; |\n |\t} |\n | |\n-|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n+|\tstd::vector const& peer_connection::allowed_fast() |\n |\t{ |\n-|\t\treturn piece_index_t{aux::numeric_cast(file_offset(f) / piece_length())}; |\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-|#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+|return m_allowed_fast; |\n+|} |\n | |\n-|\tint file_storage::file_name_len(file_index_t const index) const |\n+|\tbool peer_connection::can_request_time_critical() 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+|\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-|\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+|\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-|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\tbool peer_connection::make_time_critical(piece_block const& block) |\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\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/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b5_\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\b55\b5 *\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// 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\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n | |\n+|\t\t\tstd::sort(peers.begin(), peers.end() |\n+|\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t{ return upload_rate_compare(lhs, rhs); }); |\n | |\n-|// 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\tfor (auto const* p : peers) |\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\tint const rate = int(p->uploaded_in_last_round() |\n+|\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval)); |\n | |\n-|\t\taux::vector new_files; |\n-|\t\taux::vector new_file_hashes; |\n-|\t\taux::vector new_mtime; |\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// 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\t\t++upload_slots; |\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+|rate_threshold += 2048; |\n+|} |\n+|\t\t\t++upload_slots; |\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+|\t\t// sorts the peers that are eligible for unchoke by download rate and |\n+|\t\t// secondary by total upload. The reason for this is, if all torrents are |\n+|\t\t// being seeded, the download rate will be 0, and the peers we have sent |\n+|\t\t// the least to should be unchoked |\n | |\n-|\t\t// symbolic links that points to directories |\n-|\t\tstd::unordered_map dir_links; |\n+|\t\t// we use partial sort here, because we only care about the top |\n+|\t\t// upload_slots peers. |\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+|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n | |\n-|\t\tfor (auto const i : file_range()) |\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\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+|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\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+|\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/_\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@@ -6955,101 +6534,317 @@\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-|_\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+|_\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-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|\t\tauto file_iter = std::upper_bound( |\n+|\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset); |\n | |\n-|#include |\n-|#include |\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-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n+|\t{ |\n+|\t\treturn file_index_at_offset(static_cast(piece) * std::int64_t(piece_length())); |\n+|\t} |\n | |\n-|#include \"libtorrent/random.hpp\" |\n-|#include \"libtorrent/aux_/alloca.hpp\" |\n-|#include \"libtorrent/pe_crypto.hpp\" |\n-|#include \"libtorrent/hasher.hpp\" |\n+|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const |\n+|\t{ |\n+|for (file_index_t const i : file_range()) |\n+|{ |\n+|\t\t\tif (root(i) == root_hash) return i; |\n+|\t\t} |\n+|\t\treturn file_index_t{-1}; |\n+|\t} |\n | |\n-|namespace libtorrent { |\n+|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n+|\t{ |\n+|\t\treturn piece_index_t{aux::numeric_cast(file_offset(f) / piece_length())}; |\n+|\t} |\n | |\n-|\tnamespace mp = boost::multiprecision; |\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-|\tnamespace { |\n-|key_t const dh_prime |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\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::array export_key(key_t const& k) |\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\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+|\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-|namespace libtorrent { |\n+|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\n | |\n-|\tnamespace mp = boost::multiprecision; |\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-|\tnamespace { |\n-|\t\tkey_t const dh_prime |\n-|\t\t\t |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\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-|\tstd::array export_key(key_t const& k) |\n+|\tvoid file_storage::sanitize_symlinks() |\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\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-|if (end < begin + 96) |\n-|{ |\n-|\t\t\tint const len = int(end - begin); |\n-|#if defined __GNUC__ && __GNUC__ == 12 |\n-|#pragma GCC diagnostic push |\n-|#pragma GCC diagnostic ignored \"-Wstringop-overflow\" |\n-|#endif |\n-|\t\t\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast(len)); |\n-|#if defined __GNUC__ && __GNUC__ == 12 |\n-|#pragma GCC diagnostic pop |\n-|#endif |\n-|\t\t\tstd::memset(begin, 0, aux::numeric_cast(96 - len)); |\n+|\t\t// lazily instantiated set of all valid directories a symlink may point to |\n+|std::unordered_set dir_map; |\n+|bool dir_map_initialized = false; |\n+| |\n+|\t\t// symbolic links that points to directories |\n+|\t\tstd::unordered_map dir_links; |\n+| |\n+|\t\t// we validate symlinks in (potentially) 2 passes over the files. |\n+|\t\t// remaining symlinks to validate after the first pass |\n+|\t\tstd::vector symlinks_to_validate; |\n+| |\n+|\t\tfor (auto const i : file_range()) |\n+|\t\t{ |\n+|\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n+| |\n+|\t\t\tif (!file_map_initialized) |\n+|\t\t\t{ |\n+|\t\t\t\tfor (auto const j : file_range()) |\n+|\t\t\t\t\tfile_map.insert({internal_file_path(j), j}); |\n+|\t\t\t\tfile_map_initialized = true; |\n+|\t\t\t} |\n+| |\n+|\t\t\taux::file_entry const& fe = m_files[i]; |\n+|\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size())); |\n+| |\n+|\t\t\t// symlink targets are only allowed to point to files or directories in |\n+|\t\t\t// this torrent. |\n+|\t\t\t{ |\n+|\t\t\t\tstd::string target = m_symlinks[fe.symlink_index]; |\n+| |\n+|\t\t\t\tif (is_complete(target)) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bh_\ba_\bs_\bh_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b9_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bd_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs_\b _\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bru\buc\bct\btu\bur\bre\bed\bd b\bbi\bin\bnd\bdi\bin\bng\bgs\bs i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bha\bas\bsh\bh_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b30\b09\b9 *\b**\b**\b* |\n+|, int const offset, sha256_hash const& h) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(offset >= 0); |\n+|\t\tauto const f = m_files.file_index_at_piece(piece); |\n+| |\n+|\t\tif (m_files.pad_file_at(f)) |\n+|\t\t\treturn { set_block_hash_result::result::success, 0, 0 }; |\n+| |\n+|\t\tauto& merkle_tree = m_merkle_trees[f]; |\n+|\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f); |\n+|\t\tstd::int64_t const block_offset = static_cast(piece) * std::int64_t(m_files.piece_length()) |\n+|\t\t\t+ offset - m_files.file_offset(f); |\n+|\t\tint const block_index = aux::numeric_cast(block_offset / default_block_size); |\n+| |\n+|\t\tif (h.is_all_zeros()) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT_FAIL(); |\n+|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n |\t\t} |\n-|\t\treturn ret; |\n+| |\n+|aux::merkle_tree::set_block_result result; |\n+|int leafs_index; |\n+|\t\tint leafs_size; |\n+|\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h); |\n+| |\n+|\t\tif (result == aux::merkle_tree::set_block_result::unknown) |\n+|\t\t\treturn set_block_hash_result::unknown(); |\n+|\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed) |\n+|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n+| |\n+|\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed) |\n+|\t\t\t? set_block_hash_result::result::piece_hash_failed |\n+|\t\t\t: set_block_hash_result::result::success; |\n+| |\n+|\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size; |\n+| |\n+|\t\treturn { status |\n+|\t\t\t, int(leafs_index - static_cast(piece - file_first_piece) * blocks_per_piece) |\n+|\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) }; |\n |\t} |\n | |\n-|\tvoid 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+|\tvoid hash_picker::hashes_rejected(hash_request const& req) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0); |\n | |\n-|\t// Set the prime P and the generator, generate local public key |\n-|\tdh_key_exchange::dh_key_exchange() |\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__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:_\b8_\b7_\b5_\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\b87\b75\b5 *\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\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\tINVARIANT_CHECK; |\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\tTORRENT_ASSERT(is_loaded()); |\n+|\t\t// the new specified file storage must have the exact |\n+|\t\t// same size as the current file storage |\n+|\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size()); |\n | |\n-|\t\t// 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\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+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b._\b _\bu_\bs_\be_\b _\bi_\bf_\b _\bc_\bo_\bn_\bs_\bt_\be_\bx_\bp_\br_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIn\bn C\bC+\b++\b+1\b17\b7.\b. u\bus\bse\be i\bif\bf c\bco\bon\bns\bst\bte\bex\bxp\bpr\br i\bin\bns\bst\bte\bea\bad\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn.\b.c\bcp\bpp\bp:\b:5\b54\b40\b0 *\b**\b**\b* |\n+|{} |\n+|\tsession_proxy::session_proxy(session_proxy const&) = default; |\n+|\tsession_proxy& session_proxy::operator=(session_proxy const&) & = default; |\n+|\tsession_proxy::session_proxy(session_proxy&&) noexcept = default; |\n+|\tsession_proxy& session_proxy::operator=(session_proxy&&) & noexcept = default; |\n+|\tsession_proxy::~session_proxy() |\n+|\t{ |\n+|\t\tif (m_thread && m_thread.use_count() == 1) |\n+|\t\t{ |\n+|#if defined TORRENT_ASIO_DEBUGGING |\n+|\t\t\twait_for_asio_handlers(); |\n+|#endif |\n+|\t\t\tm_thread->join(); |\n+|\t\t} |\n+|\t} |\n+| |\n+|\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+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b7_\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bo_\bm_\bp_\ba_\br_\be_\b__\bl_\be_\bs_\bs_\b__\bw_\br_\ba_\bp_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bm_\bp_\ba_\br_\bi_\bs_\bo_\bn_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* u\bus\bse\be c\bco\bom\bmp\bpa\bar\bre\be_\b_l\ble\bes\bss\bs_\b_w\bwr\bra\bap\bp f\bfo\bor\br t\bth\bhi\bis\bs c\bco\bom\bmp\bpa\bar\bri\bis\bso\bon\bn a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bac\bck\bke\bet\bt_\b_b\bbu\buf\bff\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b15\b57\b7 *\b**\b**\b* |\n |{ |\n |\t\tINVARIANT_CHECK; |\n |\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size); |\n |\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity; |\n@@ -7096,14 +6891,343 @@\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+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b1_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bec\bch\bhn\bni\bic\bca\bal\bll\bly\by,\b, t\bth\bhi\bis\bs i\bis\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bos\bse\bed\bd t\bto\bo h\bha\bap\bpp\bpe\ben\bn,\b, b\bbu\but\bt i\bit\bt s\bse\bee\bem\bms\bs t\bto\bo s\bso\bom\bme\bet\bti\bim\bme\bes\bs.\b. S\bSo\bom\bme\be o\bof\bf t\bth\bhe\be a\bac\bcc\bco\bou\bun\bnt\bti\bin\bng\bg i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by w\bwr\bro\bon\bng\bg i\bin\bn c\bce\ber\brt\bta\bai\bin\bn c\bca\bas\bse\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b41\b1 *\b**\b**\b* |\n+|// cut out the chunk header from the receive buffer |\n+|\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX); |\n+|\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast(m_chunk_pos + m_body_start)); |\n+|\t\t\t\t\trecv_buffer = m_recv_buffer.get(); |\n+|\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start); |\n+|\t\t\t\t\tm_chunk_pos += chunk_size; |\n+|\t\t\t\t\tif (chunk_size == 0) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1 |\n+|\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == 'H' |\n+|\t\t\t\t\t\t\t|| (m_parser.chunked_encoding() |\n+|\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == '\\r')); |\n+|\t\t\t\t\t\tm_chunk_pos = -1; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+| |\n+|\t\t\tint payload = int(bytes_transferred); |\n+|\t\t\tif (payload > m_response_left) payload = int(m_response_left); |\n+|\t\t\tif (payload > front_request.length) payload = front_request.length; |\n+|if (payload > outstanding_bytes()) payload = outstanding_bytes(); |\n+|received_bytes(payload, 0); |\n+|\t\t\tincoming_piece_fragment(payload); |\n+|\t\t\tm_response_left -= payload; |\n+| |\n+|\t\t\tif (m_parser.status_code() == 503) |\n+|\t\t\t{ |\n+|\t\t\t\tif (!m_parser.finished()) return; |\n+| |\n+|\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str()); |\n+|\t\t\t\tif (retry_time <= 0) retry_time = 60; |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time); |\n+|#endif |\n+| |\n+|\t\t\t\treceived_bytes(0, int(bytes_transferred)); |\n+|\t\t\t\t// temporarily unavailable, retry later |\n+|\t\t\t\tt->retry_web_seed(this, seconds32(retry_time)); |\n+|\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n+|\t\t\t\treturn; |\n+|\t\t\t} |\n+| |\n+| |\n+|\t\t\t// we only received the header, no data |\n+|\t\t\tif (recv_buffer.empty()) break; |\n+| |\n+|\t\t\tif (recv_buffer.size() < front_request.length) break; |\n+| |\n+|\t\t\t// if the response is chunked, we need to receive the last |\n+|\t\t\t// terminating chunk and the tail headers before we can proceed |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b3_\b7|what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n+|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b33\b37\b7 *\b**\b**\b* |\n+|\t\t\tif (ec) return {}; |\n+| |\n+|#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\tif (ec) return {}; |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tvoid posix_part_file::free_piece(piece_index_t const piece) |\n+|\t{ |\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+|\t{ |\n+|\t\tflush_metadata_impl(ec); |\n+|\t\tif (ec) return; |\n+| |\n+|\t\tif (!m_piece_map.empty()) |\n+|\t\t{ |\n+|\t\t\tstd::string old_path = combine_path(m_path, m_name); |\n+|\t\t\tstd::string new_path = combine_path(path, m_name); |\n+| |\n+|\t\t\trename(old_path, new_path, ec); |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+| |\n+|\t\t\tif (ec) |\n+|\t\t\t{ |\n+|\t\t\t\tstorage_error se; |\n+|\t\t\t\taux::copy_file(old_path, new_path, se); |\n+|\t\t\t\tec = se.ec; |\n+|\t\t\t\tif (ec) return; |\n+|\t\t\t\tremove(old_path, ec); |\n+|\t\t\t} |\n+|\t\t} |\n+|\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_\b5_\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\b25\b5 *\b**\b**\b* |\n+|auto 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\tTORRENT_ASSERT(!ec); |\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 posix_part_file::flush_metadata(error_code& ec) |\n+|\t{ |\n+|\t\tflush_metadata_impl(ec); |\n+|\t} |\n+| |\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+|\t\t\t// part file, remove it |\n+|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n+|\t\t\tremove(p, ec); |\n+| |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tauto f = open_file(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/_\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+|\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+|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+|\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\"); |\n+|\tm_timer.expires_after(seconds(10)); |\n+|\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout |\n+|\t\t, self(), _1)); |\n+|} |\n+| |\n+|void socks5::on_connect_timeout(error_code const& e) |\n+|{ |\n+|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\n+| |\n+|\tif (e == boost::asio::error::operation_aborted) return; |\n+| |\n+|\tif (m_abort) return; |\n+| |\n+|\tif (m_alerts.should_post()) |\n+|\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::connect, errors::timed_out); |\n+| |\n+|\terror_code ignore; |\n+|\tm_socks5_sock.close(ignore); |\n+| |\n+|\t++m_failures; |\n+|\tretry_connection(); |\n+|} |\n+| |\n+|void socks5::on_connected(error_code const& e) |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0 |ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\bi_\be_\bd_\b._\b _\bT_\bh_\ba_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bl_\be_\bt_\b _\bu_\bs_\b _\br_\bo_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bw_\bi_\bt_\bh_\b _\bh_\bi_\bg_\bh_\be_\br_\b _\bc_\bo_\bn_\bf_\bi_\bd_\be_\bn_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bid\bde\bea\bal\bll\bly\by,\b, i\bif\bf w\bwe\be e\ben\bnd\bd u\bup\bp c\bco\bop\bpy\byi\bin\bng\bg f\bfi\bil\ble\bes\bs b\bbe\bec\bca\bau\bus\bse\be o\bof\bf a\ba m\bmo\bov\bve\be a\bac\bcr\bro\bos\bss\bs v\bvo\bol\blu\bum\bme\bes\bs,\b, t\bth\bhe\be s\bso\bou\bur\brc\bce\be s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be d\bde\bel\ble\bet\bte\bed\bd u\bun\bnt\bti\bil\bl t\bth\bhe\bey\by'\b'v\bve\be a\bal\bll\bl b\bbe\bee\ben\bn c\bco\bop\bpi\bie\bed\bd.\b. T\bTh\bha\bat\bt w\bwo\bou\bul\bld\bd l\ble\bet\bt u\bus\bs r\bro\bol\bll\blb\bba\bac\bck\bk w\bwi\bit\bth\bh |\n+|h\bhi\big\bgh\bhe\ber\br c\bco\bon\bnf\bfi\bid\bde\ben\bnc\bce\be.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:2\b23\b30\b0 *\b**\b**\b* |\n+|// later |\n+|\t\taux::vector copied_files(std::size_t(f.num_files()), false); |\n+| |\n+|\t\t// track how far we got in case of an error |\n+|\t\tfile_index_t file_index{}; |\n+|\t\tfor (auto const i : f.file_range()) |\n+|\t\t{ |\n+|\t\t\t// files moved out to absolute paths are not moved |\n+|\t\t\tif (f.file_absolute_path(i)) continue; |\n+| |\n+|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n+|\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i)); |\n+| |\n+|\t\t\terror_code ignore; |\n+|\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore)) |\n+|\t\t\t{ |\n+|\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check; |\n+|\t\t\t\tcontinue; |\n+|\t\t\t} |\n+| |\n+|move_file(old_path, new_path, ec); |\n+| |\n+|\t\t\t// if the source file doesn't exist. That's not a problem |\n+|\t\t\t// we just ignore that file |\n+|\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.ec.clear(); |\n+|\t\t\telse if (ec |\n+|\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument |\n+|\t\t\t\t&& ec.ec != boost::system::errc::permission_denied) |\n+|\t\t\t{ |\n+|\t\t\t\t// moving the file failed |\n+|\t\t\t\t// on OSX, the error when trying to rename a file across different |\n+|\t\t\t\t// volumes is EXDEV, which will make it fall back to copying. |\n+|\t\t\t\tec.ec.clear(); |\n+|\t\t\t\tcopy_file(old_path, new_path, ec); |\n+|\t\t\t\tif (!ec) copied_files[i] = true; |\n+|\t\t\t} |\n+| |\n+|\t\t\tif (ec) |\n+|\t\t\t{ |\n+|\t\t\t\tec.file(i); |\n+|\t\t\t\tfile_index = i; |\n+|\t\t\t\tbreak; |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\tif (!ec && move_partfile) |\n+|\t\t{ |\n+|\t\t\terror_code e; |\n+|\t\t\tmove_partfile(new_save_path, e); |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b8 |it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bo_\bg_\bi_\bc_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd s\bse\bee\bem\bm r\bre\bea\bas\bso\bon\bna\bab\bbl\ble\be t\bto\bo,\b, i\bin\bns\bst\bte\bea\bad\bd,\b, s\bse\bet\bt t\bth\bhe\be h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\bes\bs b\bbi\bit\bts\bs f\bfo\bor\br t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs r\bre\bep\bpr\bre\bes\bse\ben\bnt\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfi\bil\ble\bes\bs,\b, a\ban\bnd\bd r\bre\bes\bsu\bum\bme\be w\bwi\bit\bth\bh t\bth\bhe\be n\bno\bor\brm\bma\bal\bl l\blo\bog\bgi\bic\bc *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:5\b53\b38\b8 *\b**\b**\b* |\n+|continue; |\n+| |\n+|\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs |\n+|\t\t\t\t\t, save_path, ec); |\n+|\t\t\t\tif (size < 0) return false; |\n+| |\n+|\t\t\t\tif (size < fs.file_size(file_index)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tec.ec = errors::mismatching_file_size; |\n+|\t\t\t\t\tec.file(file_index); |\n+|\t\t\t\t\tec.operation = operation_t::check_resume; |\n+|\t\t\t\t\treturn false; |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t\treturn true; |\n+|\t\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\t// always trigger a full recheck when we pull in files from other |\n+|\t\t// torrents, via hard links |\n+|if (added_files) return false; |\n+|#endif |\n+| |\n+|\t\t// parse have bitmask. Verify that the files we expect to have |\n+|\t\t// actually do exist |\n+|\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece()); |\n+|\t\tfor (piece_index_t i(0); i < end_piece; ++i) |\n+|\t\t{ |\n+|\t\t\tif (rd.have_pieces.get_bit(i) == false) continue; |\n+| |\n+|\t\t\tstd::vector f = fs.map_block(i, 0, 1); |\n+|\t\t\tTORRENT_ASSERT(!f.empty()); |\n+| |\n+|\t\t\tfile_index_t const file_index = f[0].file_index; |\n+| |\n+|\t\t\t// files with priority zero may not have been saved to disk at their |\n+|\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n+|\t\t\t// from checking |\n+|\t\t\tif (file_index < file_priority.end_index() |\n+|\t\t\t\t&& file_priority[file_index] == dont_download) |\n+|\t\t\t\tcontinue; |\n+| |\n+|\t\t\tif (fs.pad_file_at(file_index)) continue; |\n+| |\n+|\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0) |\n+|\t\t\t\treturn false; |\n+| |\n+|\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in |\n+|\t\t\t// this file. We're just sanity-checking whether the files exist |\n+|\t\t\t// or not. |\n+|_\b\t_\b\t_\b\t_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\br_\b _\b=_\b _\bf_\bs_\b._\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b _\b _\b|_\bs_\bi_\bm_\bu_\bl_\ba_\bt_\bo_\br_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* s\bsi\bim\bmu\bul\bla\bat\bto\bor\br s\bsu\bup\bpp\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bip\bp_\b_n\bno\bot\bti\bif\bfi\bie\ber\br.\b.c\bcp\bpp\bp:\b:4\b41\b1 *\b**\b**\b* |\n | from this software without specific prior written permission. |\n | |\n |THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n |AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n@@ -7149,14 +7273,1123 @@\n | |\n |#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n |\t!defined TORRENT_BUILD_SIMULATOR |\n | |\n |// common utilities for Mac and iOS |\n |template void CFRefRetain(T h) { CFRetain(h); } |\n |_\bt_\be_\bm_\bp_\bl_\ba_\bt_\be_\b _\b<_\bt_\by_\bp_\be_\bn_\ba_\bm_\be_\b _\bT_\b>_\b _\bv_\bo_\bi_\bd_\b _\bC_\bF_\bR_\be_\bf_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bT_\b _\bh_\b)_\b _\b{_\b _\bC_\bF_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bh_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\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/ |move stats_counter_t out of counters |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br_\b_t\bt o\bou\but\bt o\bof\bf c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |should bittorrent keep-alive messages have a counter too? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt k\bke\bee\bep\bp-\b-a\bal\bli\biv\bve\be m\bme\bes\bss\bsa\bag\bge\bes\bs h\bha\bav\bve\be a\ba c\bco\bou\bun\bnt\bte\ber\br t\bto\boo\bo?\b? *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |It would be nice if this could be an internal type. default_disk_constructor depends on it now |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be a\ban\bn i\bin\bnt\bte\ber\brn\bna\bal\bl t\bty\byp\bpe\be.\b. d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br d\bde\bep\bpe\ben\bnd\bds\bs o\bon\bn i\bit\bt n\bno\bow\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.c\bcp\bpp\bp:\b:4\b42\b2 *\b**\b**\b* |\n+|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n+| |\n+|*/ |\n+| |\n+|#include \"libtorrent/performance_counters.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n+|#include // for memset |\n+| |\n+|namespace libtorrent { |\n+| |\n+|counters::counters() TORRENT_COUNTER_NOEXCEPT |\n+|{ |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (auto& counter : m_stats_counter) |\n+|\t\t\tcounter.store(0, std::memory_order_relaxed); |\n+|#else |\n+|\t\tm_stats_counter.fill(0); |\n+|#endif |\n+|\t} |\n+| |\n+|\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT |\n+|\t{ |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n+|\t\t\tm_stats_counter[i].store( |\n+|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n+|\t\t\t\t\t, std::memory_order_relaxed); |\n+|#else |\n+|\t\tstd::lock_guard l(c.m_mutex); |\n+|\t\tm_stats_counter = c.m_stats_counter; |\n+|#endif |\n+|\t} |\n+| |\n+|\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT |\n+|\t{ |\n+|\t\tif (&c == this) return *this; |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n+|\t\t\tm_stats_counter[i].store( |\n+|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\be_\bm_\bo_\br_\by_\b__\bo_\br_\bd_\be_\br_\b__\br_\be_\bl_\ba_\bx_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b: |it would be nice to return a valid hash of zeroes here |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bet\btu\bur\brn\bn a\ba v\bva\bal\bli\bid\bd h\bha\bas\bsh\bh o\bof\bf z\bze\ber\bro\boe\bes\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo.\b.c\bcp\bpp\bp:\b:1\b10\b06\b6 *\b**\b**\b* |\n+|}); |\n+|\t} |\n+| |\n+|\tbool async_write(storage_index_t |\n+|\t\t, peer_request const& r |\n+|\t\t, char const*, std::shared_ptr |\n+|\t\t, std::function handler |\n+|\t\t, disk_job_flags_t) override |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(r.length <= default_block_size); |\n+|\t\tTORRENT_UNUSED(r); |\n+| |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n+|\t\treturn false; |\n+|\t} |\n+| |\n+|\tvoid async_hash(storage_index_t |\n+|\t\t, piece_index_t piece, span, disk_job_flags_t |\n+|\t\t, std::function handler) override |\n+|\t{ |\n+|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n+|} |\n+| |\n+|\tvoid async_hash2(storage_index_t, piece_index_t piece, int |\n+|\t\t, disk_job_flags_t |\n+|\t\t, std::function handler) override |\n+|\t{ |\n+|\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); }); |\n+|\t} |\n+| |\n+|\tvoid async_move_storage(storage_index_t |\n+|\t\t, std::string p, move_flags_t |\n+|\t\t, std::function handler) override |\n+|\t{ |\n+|\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable |\n+|\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); }); |\n+|\t} |\n+| |\n+|\tvoid async_release_files(storage_index_t, std::function handler) override |\n+|\t{ |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n+|\t} |\n+| |\n+|\tvoid async_delete_files(storage_index_t |\n+|\t\t, remove_flags_t, std::function handler) override |\n+|\t{ |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n+|\t} |\n+| |\n+|\tvoid async_check_files(storage_index_t |\n+|_\b\t_\b\t_\b,_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:|this should not be heap allocated, sockets should be movable |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be h\bhe\bea\bap\bp a\bal\bll\blo\boc\bca\bat\bte\bed\bd,\b, s\bso\boc\bck\bke\bet\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bmo\bov\bva\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b04\b4 *\b**\b**\b* |\n+|//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str()); |\n+| |\n+|\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp)) |\n+|\t\t\treturn false; |\n+| |\n+|\t\t// if not found, see if it's a SYN packet, if it is, |\n+|\t\t// create a new utp_stream |\n+|\t\tif (ph->get_type() == ST_SYN) |\n+|\t\t{ |\n+|\t\t\t// possible SYN flood. Just ignore |\n+|\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2) |\n+|\t\t\t\treturn false; |\n+| |\n+|\t\t\tTORRENT_ASSERT(m_new_connection == -1); |\n+|\t\t\t// create the new socket with this ID |\n+|\t\t\tm_new_connection = id; |\n+| |\n+|//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection); |\n+| |\n+|aux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false)); |\n+| |\n+|\t\t\tutp_stream* str = nullptr; |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\t\tif (is_ssl(c)) |\n+|\t\t\t\tstr = &boost::get>(c).next_layer(); |\n+|\t\t\telse |\n+|#endif |\n+|\t\t\t\tstr = boost::get(&c); |\n+| |\n+|\t\t\tTORRENT_ASSERT(str); |\n+|\t\t\tint const mtu = mtu_for_dest(ep.address()); |\n+|\t\t\tstr->get_impl()->init_mtu(mtu); |\n+|\t\t\tstr->get_impl()->m_sock = std::move(socket); |\n+|\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time); |\n+|\t\t\tif (!ret) return false; |\n+|\t\t\tm_last_socket = str->get_impl(); |\n+|\t\t\tm_cb(std::move(c)); |\n+|\t\t\t// the connection most likely changed its connection ID here |\n+|\t\t\t// we need to move it to the correct ID |\n+|\t\t\treturn true; |\n+|\t\t} |\n+| |\n+|\t\tif (ph->get_type() == ST_RESET) return false; |\n+| |\n+|\t\t// #error send reset |\n+| |\n+|\t\treturn false; |\n+|\t} |\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/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b1_\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\b11\b1 *\b**\b**\b* |\n+|std::string& attr = e[\"attr\"].string(); |\n+|\t\tif (flags & file_storage::flag_pad_file) attr += 'p'; |\n+|\t\tif (flags & file_storage::flag_hidden) attr += 'h'; |\n+|\t\tif (flags & file_storage::flag_executable) attr += 'x'; |\n+|\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l'; |\n+|\t} |\n+| |\n+|\tvoid add_symlink_path(entry& e, std::string symlink_path) |\n+|\t{ |\n+|\t\tentry& sympath_e = e[\"symlink path\"]; |\n+| |\n+|\t\tstd::string const link = lexically_relative(\"\", symlink_path); |\n+|\t\tfor (auto elems = lsplit_path(link); !elems.first.empty(); |\n+|\t\t\telems = lsplit_path(elems.second)) |\n+|\t\t\tsympath_e.list().emplace_back(elems.first); |\n+|\t} |\n+|} |\n+| |\n+|\tstd::vector create_torrent::generate_buf() const |\n+|\t{ |\n+|std::vector ret; |\n+|bencode(std::back_inserter(ret), generate()); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tentry create_torrent::generate() const |\n+|\t{ |\n+|\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0) |\n+|\t\t\taux::throw_ex(errors::torrent_missing_file_tree); |\n+| |\n+|\t\t// if all v2 hashes are set correctly, generate the v2 parts of the |\n+|\t\t// torrent |\n+|\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash); |\n+|\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash); |\n+| |\n+|\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent |\n+|\t\tif (!make_v1 && !make_v2) |\n+|\t\t\taux::throw_ex(errors::invalid_hash_entry); |\n+| |\n+|\t\tTORRENT_ASSERT(m_files.piece_length() > 0); |\n+| |\n+|\t\tentry dict; |\n+| |\n+|\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first; |\n+| |\n+|\t\tif (!m_nodes.empty()) |\n+|\t\t{ |\n+|\t\t\tentry& nodes = dict[\"nodes\"]; |\n+|\t\t\tentry::list_type& nodes_list = nodes.list(); |\n+|\t\t\tfor (auto const& n : m_nodes) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |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/_\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+|\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+|\tbool supports_arm_crc32c() noexcept |\n+|\t{ |\n+|#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV |\n+|#if defined TORRENT_FORCE_ARM_CRC32 |\n+|\t\treturn true; |\n+|#elif defined __arm__ |\n+|\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32); |\n+|\t\treturn (helper_getauxval(26) & (1 << 4)); |\n+|#elif defined __aarch64__ |\n+|\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32); |\n+|\t\treturn (helper_getauxval(16) & (1 << 7)); |\n+|#endif |\n+|#else |\n+|\t\treturn false; |\n+|#endif |\n+|\t} |\n+| |\n+|} // anonymous namespace |\n+| |\n+|\tbool const sse42_support = supports_sse42(); |\n+|\tbool const mmx_support = supports_mmx(); |\n+|\tbool const arm_neon_support = supports_arm_neon(); |\n+|\tbool const arm_crc32c_support = supports_arm_crc32c(); |\n+|_\b}_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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+|\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/_\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+|_\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+| |\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+|\t\t, protocol_version v, string_view u, operation_t const operation |\n+|\t\t, error_code const& e |\n+|\t\t, string_view m) |\n+|\t\t: tracker_alert(alloc, h, ep, u) |\n+|\t\t, times_in_row(times) |\n+|\t\t, error(e) |\n+|\t\t, op(operation) |\n+|\t\t, m_msg_idx(alloc.copy_string(m)) |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\t, status_code(e && e.category() == http_category() ? e.value() : -1) |\n+|\t\t, msg(m) |\n+|#endif |\n+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\tchar const* tracker_error_alert::failure_reason() const |\n+|\t{ |\n+|\t\treturn m_alloc.get().ptr(m_msg_idx); |\n+|\t} |\n+| |\n+|\tstd::string tracker_error_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\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+|\t\treturn ret; |\n+|#endif |\n+|\t} |\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+|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bB_\bI_\b__\bV_\bE_\bR_\bS_\bI_\bO_\bN_\b _\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 |\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_\b3_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b43\b38\b8 *\b**\b**\b* |\n+|return {}; |\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+|\t\treturn ret; |\n+|#endif |\n+|\t} |\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+|\t\t, msg(m) |\n+|#endif |\n+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\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+|\t\treturn {}; |\n+|#else |\n+|\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message(); |\n+|#endif |\n+|\t} |\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+|_\b\t_\b\t_\b,_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b(_\bc_\bo_\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 _\b _\b _\b _\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_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b46\b64\b4 *\b**\b**\b* |\n+|char 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+|\t\treturn {}; |\n+|#else |\n+|\t\treturn tracker_alert::message() + (version == protocol_version::V1 ? \" v1\" : \" v2\") + \" warning: \" + warning_message(); |\n+|#endif |\n+|\t} |\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+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\tstd::string scrape_reply_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\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+|#endif |\n+|\t} |\n+| |\n+|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\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+|_\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/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\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 _\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 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\b49\b93\b3 *\b**\b**\b* |\n+|return {}; |\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+|#endif |\n+|\t} |\n+| |\n+|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\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+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\tscrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\n+|\t\t, string_view u, string_view m) |\n+|\t\t: tracker_alert(alloc, h, ep, u) |\n+|\t\t, error(errors::tracker_failure) |\n+|\t\t, m_msg_idx(alloc.copy_string(m)) |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\t, msg(m) |\n+|#endif |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\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+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message(); |\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/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b2_\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:5\b53\b32\b2 *\b**\b**\b* |\n+|char 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+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\treturn tracker_alert::message() + \" scrape failed: \" + error_message(); |\n+|#endif |\n+|\t} |\n+| |\n+|\ttracker_reply_alert::tracker_reply_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h, tcp::endpoint const& ep |\n+|\t\t, int np, protocol_version v, string_view u) |\n+|\t\t: tracker_alert(alloc, h, ep, u) |\n+|\t\t, num_peers(np) |\n+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\tstd::string tracker_reply_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tchar ret[400]; |\n+|\t\tstd::snprintf(ret, sizeof(ret), \"%s %s received peers: %d\" |\n+|\t\t\t, tracker_alert::message().c_str() |\n+|\t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\" |\n+|\t\t\t, num_peers); |\n+|\t\treturn ret; |\n+|#endif |\n+|\t} |\n+| |\n+|\tdht_reply_alert::dht_reply_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h |\n+|\t\t, int np) |\n+|\t\t: tracker_alert(alloc, h, {}, \"\") |\n+|\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+|_\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+|_\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:_\b5_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\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 _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhi\bis\bs t\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:5\b57\b76\b6 *\b**\b**\b* |\n+|, 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+|\t\tchar ret[400]; |\n+|\t\tstd::snprintf(ret, sizeof(ret), \"%s received DHT peers: %d\" |\n+|\t\t\t, tracker_alert::message().c_str(), num_peers); |\n+|\t\treturn ret; |\n+|#endif |\n+|\t} |\n+| |\n+|\ttracker_announce_alert::tracker_announce_alert(aux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h, tcp::endpoint const& ep, string_view u |\n+|\t\t, protocol_version const v, event_t const e) |\n+|\t\t: tracker_alert(alloc, h, ep, u) |\n+|\t\t, event(e) |\n+|, version(v) |\n+|{ |\n+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n+| |\n+|\tstd::string tracker_announce_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tstatic const char* const event_str[] = {\"none\", \"completed\", \"started\", \"stopped\", \"paused\"}; |\n+|\t\treturn tracker_alert::message() |\n+|\t\t\t+ (version == protocol_version::V1 ? \" v1\" : \" v2\") |\n+|\t\t\t+ \" sending announce (\" + event_str[static_cast(event)] + \")\"; |\n+|#endif |\n+|\t} |\n+| |\n+|\thash_failed_alert::hash_failed_alert( |\n+|\t\taux::stack_allocator& alloc |\n+|\t\t, torrent_handle const& h |\n+|\t\t, piece_index_t index) |\n+|\t\t: torrent_alert(alloc, h) |\n+|\t\t, piece_index(index) |\n+|\t{ |\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_\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_\b8_\b9_\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\b58\b89\b9 *\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+|\tsettings_pack default_settings() |\n+|\t{ |\n+|\t\tsettings_pack ret; |\n+|for (int i = 0; i < settings_pack::num_string_settings; ++i) |\n+|{ |\n+|\t\t\tif (str_settings[i].default_value == nullptr) continue; |\n+|\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value); |\n+|\t\t} |\n+| |\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+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b0 |what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n+|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b30\b00\b0 *\b**\b**\b* |\n+|create_directories(m_path, ec); |\n+|\t\t\t\tif (ec) return {}; |\n+|\t\t\t\treturn aux::file_handle(fn, 0, mode); |\n+|\t\t\t} |\n+|\t\t\treturn {}; |\n+|\t\t} |\n+|\t} |\n+|\tcatch (storage_error const& e) |\n+|\t{ |\n+|\t\tec = e.ec; |\n+|\t\treturn {}; |\n+|\t} |\n+| |\n+|\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 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+| |\n+|\t\t\trename(old_path, new_path, ec); |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+| |\n+|\t\t\tif (ec) |\n+|\t\t\t{ |\n+|\t\t\t\tstorage_error se; |\n+|\t\t\t\taux::copy_file(old_path, new_path, se); |\n+|\t\t\t\tec = se.ec; |\n+|\t\t\t\tif (ec) return; |\n+|\t\t\t\tremove(old_path, ec); |\n+|\t\t\t} |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b2_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b41\b12\b2 *\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 part_file::flush_metadata(error_code& ec) |\n+|\t{ |\n+|\t\tstd::lock_guard l(m_mutex); |\n+| |\n+|\t\tflush_metadata_impl(ec); |\n+|\t} |\n+| |\n+|void part_file::flush_metadata_impl(error_code& ec) |\n+|{ |\n+|\t\t// do we need to flush the metadata? |\n+|\t\tif (m_dirty_metadata == false) return; |\n+| |\n+|\t\tif (m_piece_map.empty()) |\n+|\t\t{ |\n+|\t\t\t// if we don't have any pieces left in the |\n+|\t\t\t// part file, remove it |\n+|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n+|\t\t\tremove(p, ec); |\n+| |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec); |\n+|\t\tif (ec) return; |\n+| |\n+|\t\tstd::vector header(static_cast(m_header_size)); |\n+| |\n+|\t\tusing namespace libtorrent::aux; |\n+| |\n+|\t\tchar* ptr = header.data(); |\n+|\t\twrite_uint32(m_max_pieces, ptr); |\n+|\t\twrite_uint32(m_piece_size, ptr); |\n+| |\n+|\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\ba_\bu_\bt_\bo_\b _\bc_\bo_\bn_\bs_\bt_\b _\bi_\b _\b=_\b _\bm_\b__\bp_\bi_\be_\bc_\be_\b__\bm_\ba_\bp_\b._\bf_\bi_\bn_\bd_\b(_\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |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@@ -7212,49 +8445,258 @@\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/_\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/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bl_\bo_\bg_\bi_\bc_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b _\bi_\bn_\bt_\bo_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhe\be l\blo\boa\bad\bdi\bin\bng\bg l\blo\bog\bgi\bic\bc f\bfr\bro\bom\bm t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br i\bin\bnt\bto\bo h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n+|mask.resize(std::size_t(full_size), false); |\n+|\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size) |\n+|\t\t\t\t\t, end = i + num_pieces; i < end; ++i) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tmask[std::size_t(i)] = true; |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t\tti->free_piece_layers(); |\n+|\t\t} |\n+|\t\tatp.info_hashes = atp.ti->info_hashes(); |\n+|\t} |\n+|} |\n+| |\n+|\tadd_torrent_params load_torrent_file(std::string const& filename) |\n+|\t{ return load_torrent_file(filename, load_torrent_limits{}); } |\n+|\tadd_torrent_params load_torrent_buffer(span buffer) |\n+|\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); } |\n+|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file) |\n+|\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); } |\n+| |\n+|add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg) |\n+|{ |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(filename, cfg); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tadd_torrent_params load_torrent_buffer(span buffer, load_torrent_limits const& cfg) |\n |\t{ |\n-|\t\tif (m_thread && m_thread.use_count() == 1) |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(buffer, cfg, from_span); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n+|\t{ |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(torrent_file, cfg); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |introduce a web-seed default class which has a low download priority |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be_\b._\bc_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnt\btr\bro\bod\bdu\buc\bce\be a\ba w\bwe\beb\bb-\b-s\bse\bee\bed\bd d\bde\bef\bfa\bau\bul\blt\bt c\bcl\bla\bas\bss\bs w\bwh\bhi\bic\bch\bh h\bha\bas\bs a\ba l\blo\bow\bw d\bdo\bow\bwn\bnl\blo\boa\bad\bd p\bpr\bri\bio\bor\bri\bit\bty\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_b\bba\bas\bse\be.\b.c\bcp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n+|: peer_connection(pack) |\n+|\t\t, m_first_request(true) |\n+|\t\t, m_ssl(false) |\n+|\t\t, m_external_auth(web.auth) |\n+|\t\t, m_extra_headers(web.extra_headers) |\n+|\t\t, m_parser(http_parser::dont_parse_chunks) |\n+|\t\t, m_body_start(0) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo); |\n+|\t\t// when going through a proxy, we don't necessarily have an endpoint here, |\n+|\t\t// since the proxy might be resolving the hostname, not us |\n+|\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp); |\n+| |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tTORRENT_ASSERT(is_outgoing()); |\n+| |\n+|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n+| |\n+|\t\t// we only want left-over bandwidth |\n+| |\n+|std::string protocol; |\n+|\t\terror_code ec; |\n+|\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path) |\n+|\t\t\t= parse_url_components(web.url, ec); |\n+|\t\tTORRENT_ASSERT(!ec); |\n+| |\n+|\t\tif (m_port == -1 && protocol == \"http\") |\n+|\t\t\tm_port = 80; |\n+| |\n+|#if TORRENT_USE_SSL |\n+|\t\tif (protocol == \"https\") |\n |\t\t{ |\n-|#if defined TORRENT_ASIO_DEBUGGING |\n-|\t\t\twait_for_asio_handlers(); |\n-|#endif |\n-|\t\t\tm_thread->join(); |\n+|\t\t\tm_ssl = true; |\n+|\t\t\tif (m_port == -1) m_port = 443; |\n |\t\t} |\n+|#endif |\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-|\tTORRENT_EXPORT std::unique_ptr default_disk_io_constructor( |\n-|\t\tio_context& ios, settings_interface const& sett, counters& cnt) |\n+|\tint web_connection_base::timeout() const |\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+|\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/_\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-|#else |\n-|\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\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\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast(len)); |\n+|#if defined __GNUC__ && __GNUC__ == 12 |\n+|#pragma GCC diagnostic pop |\n+|#endif |\n+|\t\t\tstd::memset(begin, 0, aux::numeric_cast(96 - len)); |\n+|\t\t} |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 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\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/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b1_\b _\b _\b _\b _\b|_\bw_\be_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\b _\bt_\bh_\be_\b _\br_\be_\bf_\bc_\bo_\bu_\bn_\bt_\be_\br_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\bh_\bi_\bl_\be_\b _\bt_\bh_\bi_\bs_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bi_\bs_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\b'_\bs_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be r\bre\bea\bal\bll\bly\by n\bne\bee\bed\bd t\bto\bo i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bt t\bth\bhe\be r\bre\bef\bfc\bco\bou\bun\bnt\bte\ber\br o\bon\bn t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhi\bil\ble\be t\bth\bhi\bis\bs b\bbu\buf\bff\bfe\ber\br i\bis\bs s\bst\bti\bil\bll\bl i\bin\bn t\bth\bhe\be p\bpe\bee\ber\br'\b's\bs s\bse\ben\bnd\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:2\b28\b81\b1 *\b**\b**\b* |\n+|int const offset = piece * 16 * 1024; |\n+|\t\t\t\tmetadata = m_tp.metadata().data() + offset; |\n+|\t\t\t\tmetadata_piece_size = std::min( |\n+|\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024); |\n+|\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset >= 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size()); |\n+|\t\t\t} |\n+| |\n+|\t\t\tchar msg[200]; |\n+|\t\t\tchar* header = msg; |\n+|\t\t\tchar* p = &msg[6]; |\n+|\t\t\tint const len = bencode(p, e); |\n+|\t\t\tint const total_size = 2 + len + metadata_piece_size; |\n+|\t\t\tnamespace io = aux; |\n+|\t\t\tio::write_uint32(total_size, header); |\n+|\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header); |\n+|\t\t\tio::write_uint8(m_message_index, header); |\n+| |\n+|\t\t\tm_pc.send_buffer({msg, len + 6}); |\n+|if (metadata_piece_size) |\n+|{ |\n+|\t\t\t\tm_pc.append_const_send_buffer( |\n+|\t\t\t\t\tspan(const_cast(metadata), metadata_piece_size), metadata_piece_size); |\n+|\t\t\t} |\n+| |\n+|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended); |\n+|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata); |\n+|\t\t} |\n+| |\n+|\t\tbool on_extended(int const length |\n+|\t\t\t, int const extended_msg, span body) override |\n+|\t\t{ |\n+|\t\t\tif (extended_msg != 2) return false; |\n+|\t\t\tif (m_message_index == 0) return false; |\n+| |\n+|\t\t\tif (length > 17 * 1024) |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\" |\n+|\t\t\t\t\t, \"packet too big %d\", length); |\n+|#endif |\n+|\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error); |\n+|\t\t\t\treturn true; |\n+|\t\t\t} |\n+| |\n+|\t\t\tif (!m_pc.packet_finished()) return true; |\n+| |\n+|\t\t\terror_code ec; |\n+|\t\t\tbdecode_node msg = bdecode(body, ec); |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\bs_\bg_\b._\bt_\by_\bp_\be_\b(_\b)_\b _\b!_\b=_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b:_\b:_\bd_\bi_\bc_\bt_\b__\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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@@ -7382,295 +8824,519 @@\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-|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+|_\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_\b4_\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\b94\b41\b1 *\b**\b**\b* |\n+|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n+|\t\t\t\twe_have(i); |\n+|\t\t\t} |\n+|\t\t} |\n | |\n-|\t\tINVARIANT_CHECK; |\n+|\t\tset_state(torrent_status::checking_resume_data); |\n | |\n-|\t\tTORRENT_ASSERT(is_outgoing()); |\n+|\t\taux::vector links; |\n+|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\tif (!m_torrent_file->similar_torrents().empty() |\n+|\t\t\t|| !m_torrent_file->collections().empty()) |\n+|\t\t{ |\n+|\t\t\tresolve_links res(m_torrent_file); |\n | |\n-|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n+|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n+|\t\t\t\tif (!t) continue; |\n | |\n-|\t\t// we only want left-over bandwidth |\n+|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|if (!t->is_seed()) continue; |\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+|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t} |\n+|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n | |\n-|\t\tif (m_port == -1 && protocol == \"http\") |\n-|\t\t\tm_port = 80; |\n+|\t\t\t\tfor (auto const& t : ts) |\n+|\t\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b54\b4 *\b**\b**\b* |\n+|{ |\n+|\t\t\tresolve_links res(m_torrent_file); |\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\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n+|\t\t\t\tif (!t) continue; |\n+| |\n+|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|\t\t\t\tif (!t->is_seed()) continue; |\n+| |\n+|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t} |\n+|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n+| |\n+|\t\t\t\tfor (auto const& t : ts) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|if (!t->is_seed()) continue; |\n+| |\n+|\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+| |\n+|\t\t\tstd::vector const& l = res.get_links(); |\n+|\t\t\tif (!l.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tlinks.resize(m_torrent_file->files().num_files()); |\n+|\t\t\t\tfor (auto const& i : l) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tif (!i.ti) continue; |\n+|\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path |\n+|\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx)); |\n+|\t\t\t\t} |\n+|\t\t\t} |\n |\t\t} |\n+|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n+|\t\tm_outstanding_check_files = true; |\n |#endif |\n | |\n-|\t\tif (!m_basic_auth.empty()) |\n-|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n+|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n+|\t\t{ |\n+|\t\t\tm_ses.disk_thread().async_check_files( |\n+|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n+|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b1_\b5 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b71\b15\b5 *\b**\b**\b* |\n+|// not ready for peers. Except, if we don't have metadata, |\n+|\t\t// we need peers to download from |\n+|\t\tif (!m_files_checked && valid_metadata()) return; |\n | |\n-|\t\tm_server_string = m_host; |\n-|\t\taux::verify_encoding(m_server_string); |\n-|\t} |\n+|\t\tif (!m_announce_to_lsd) return; |\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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |move stats_counter_t out of counters |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br_\b_t\bt o\bou\but\bt o\bof\bf c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |should bittorrent keep-alive messages have a counter too? |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt k\bke\bee\bep\bp-\b-a\bal\bli\biv\bve\be m\bme\bes\bss\bsa\bag\bge\bes\bs h\bha\bav\bve\be a\ba c\bco\bou\bun\bnt\bte\ber\br t\bto\boo\bo?\b? *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |It would be nice if this could be an internal type. default_disk_constructor depends on it now |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be a\ban\bn i\bin\bnt\bte\ber\brn\bna\bal\bl t\bty\byp\bpe\be.\b. d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br d\bde\bep\bpe\ben\bnd\bds\bs o\bon\bn i\bit\bt n\bno\bow\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.c\bcp\bpp\bp:\b:4\b42\b2 *\b**\b**\b* |\n-|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n-|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n-|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n+|\t\t// private torrents are never announced on LSD |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return; |\n | |\n-|*/ |\n+|#if TORRENT_USE_I2P |\n+|\t\t// i2p torrents are also never announced on LSD |\n+|\t\t// unless we allow mixed swarms |\n+|\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed)) |\n+|\t\t\treturn; |\n+|#endif |\n | |\n-|#include \"libtorrent/performance_counters.hpp\" |\n-|#include \"libtorrent/assert.hpp\" |\n-|#include // for memset |\n+|\t\tif (is_paused()) return; |\n | |\n-|namespace libtorrent { |\n+|\t\tif (!m_ses.has_lsd()) return; |\n | |\n-|counters::counters() TORRENT_COUNTER_NOEXCEPT |\n-|{ |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (auto& counter : m_stats_counter) |\n-|\t\t\tcounter.store(0, std::memory_order_relaxed); |\n+|#ifdef TORRENT_SSL_PEERS |\n+|int port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port(); |\n |#else |\n-|\t\tm_stats_counter.fill(0); |\n+|\t\tint port = m_ses.listen_port(); |\n |#endif |\n+| |\n+|\t\t// announce with the local discovery service |\n+|\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version) |\n+|\t\t{ |\n+|\t\t\tm_ses.announce_lsd(ih, port); |\n+|\t\t}); |\n |\t} |\n | |\n-|\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT |\n+|#ifndef TORRENT_DISABLE_DHT |\n+| |\n+|\tvoid torrent::dht_announce() |\n |\t{ |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n-|\t\t\tm_stats_counter[i].store( |\n-|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n-|\t\t\t\t\t, std::memory_order_relaxed); |\n-|#else |\n-|\t\tstd::lock_guard l(c.m_mutex); |\n-|\t\tm_stats_counter = c.m_stats_counter; |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (!m_ses.dht()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n+|#endif |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\tif (!should_announce_dht()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b87\b70\b0 *\b**\b**\b* |\n+|catch (...) { handle_exception(); } |\n |#endif |\n-|\t} |\n | |\n-|\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT |\n+|\tvoid torrent::on_peer_name_lookup(error_code const& e |\n+|\t\t, std::vector
    const& host_list, int const port |\n+|\t\t, protocol_version const v) try |\n |\t{ |\n-|\t\tif (&c == this) return *this; |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n-|\t\t\tm_stats_counter[i].store( |\n-|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\be_\bm_\bo_\br_\by_\b__\bo_\br_\bd_\be_\br_\b__\br_\be_\bl_\ba_\bx_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b9_\b _\b|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt m\bmo\bov\bvi\bin\bng\bg f\bfi\bil\ble\bes\bs i\bin\bnt\bto\bo t\bth\bhi\bis\bs c\bca\bal\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:5\b58\b89\b9 *\b**\b**\b* |\n-|auto retp = &prio; |\n-|\t\tsync_call(&torrent::piece_priorities, retp); |\n-|\t\tstd::vector ret; |\n-|\t\tret.reserve(prio.size()); |\n-|\t\tfor (auto p : prio) |\n-|\t\t\tret.push_back(int(static_cast(p))); |\n-|\t\treturn ret; |\n-|\t} |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\"); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (e && should_log()) |\n+|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n |#endif |\n | |\n-|\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const |\n-|\t{ |\n-|\t\tasync_call(&torrent::set_file_priority, index, priority); |\n-|\t} |\n+|\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return; |\n | |\n-|\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const |\n-|\t{ |\n-|\t\treturn sync_call_ret(dont_download, &torrent::file_priority, index); |\n-|\t} |\n+|tcp::endpoint host(host_list.front(), std::uint16_t(port)); |\n | |\n-|void torrent_handle::prioritize_files(std::vector const& files) const |\n+|\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str()); |\n+|\t\t\t} |\n+|#endif |\n+|\t\t\tif (m_ses.alerts().should_post()) |\n+|\t\t\t\tm_ses.alerts().emplace_alert(get_handle() |\n+|\t\t\t\t\t, host, peer_blocked_alert::ip_filter); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0))) |\n+|\t\t{ |\n+|\t\t\tstate_updated(); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\" |\n+|\t\t\t\t\t, host.address().to_string().c_str() |\n+|\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1); |\n+|\t\t\t} |\n+|#endif |\n+|\t\t} |\n+|\t\tupdate_want_peers(); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b56\b62\b2 *\b**\b**\b* |\n |{ |\n-|\t\tasync_call(&torrent::prioritize_files |\n-|\t\t\t, static_cast const&>(files)); |\n-|\t} |\n+|\t\t\tstd::set ret; |\n+|\t\t\tif (!blocks.empty() && !downloaders.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]); |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin())); |\n+|\t\t\t} |\n+|\t\t\treturn ret; |\n+|\t\t}(); |\n | |\n-|\tstd::vector torrent_handle::get_file_priorities() const |\n-|\t{ |\n-|\t\taux::vector ret; |\n-|\t\tauto retp = &ret; |\n-|\t\tsync_call(&torrent::file_priorities, retp); |\n-|\t\treturn TORRENT_RVO(ret); |\n-|\t} |\n+|\t\t// if this piece wasn't downloaded from peers, we just found it on disk. |\n+|\t\t// In that case, we should just consider it as \"not-have\" and there's no |\n+|\t\t// need to try to get higher fidelity hashes (yet) |\n+|\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr); |\n | |\n-|#if TORRENT_ABI_VERSION == 1 |\n+|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n+|\t\t{ |\n+|verify_block_hashes(index); |\n+|} |\n | |\n-|// ============ start deprecation =============== |\n+|\t\t// the below code is penalizing peers that sent use bad data. |\n+|\t\t// increase the total amount of failed bytes |\n+|\t\tif (!found_on_disk) |\n+|\t\t{ |\n+|\t\t\tif (blocks.empty()) |\n+|\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index)); |\n+|\t\t\telse |\n+|\t\t\t\tadd_failed_bytes(static_cast(blocks.size()) * default_block_size); |\n | |\n-|\tvoid torrent_handle::prioritize_files(std::vector const& files) const |\n-|\t{ |\n-|\t\taux::vector file_prio; |\n-|\t\tfile_prio.reserve(files.size()); |\n-|\t\tfor (auto const p : files) { |\n-|\t\t\tfile_prio.push_back(download_priority_t(static_cast(p))); |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\t\tfor (auto& ext : m_extensions) |\n+|\t\t\t{ |\n+|\t\t\t\text->on_piece_failed(index); |\n+|\t\t\t} |\n+|#endif |\n+| |\n+|\t\t\t// did we receive this piece from a single peer? |\n+|\t\t\t// if we know exactly which blocks failed the hash, we can also be certain |\n+|\t\t\t// that all peers in the list sent us bad data |\n+|\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty(); |\n+| |\n+|\t\t\tpenalize_peers(peers, index, known_bad_peer); |\n |\t\t} |\n-|\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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b3_\b7|what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n-|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b33\b37\b7 *\b**\b**\b* |\n-|\t\t\tif (ec) return {}; |\n+|\t\t// If m_storage isn't set here, it means we're shutting down |\n+|\t\tif (m_storage) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b0_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b50\b01\b1 *\b**\b**\b* |\n+||| peerinfo->confirmed_supports_utp)) |\n+|\t\t\t{ |\n+|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n+|\t\t\t} |\n | |\n-|#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+|\t\t\t// don't make a TCP connection if it's disabled |\n+|\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp)) |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \" |\n+|\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str() |\n+|\t\t\t\t\t\t, peerinfo->supports_utp); |\n+|\t\t\t\t} |\n |#endif |\n-|\t\t\tif (ret.file() == nullptr) |\n-|\t\t\t\tec.assign(errno, generic_category()); |\n+|\t\t\t\treturn false; |\n+|\t\t\t} |\n |\t\t} |\n-|\t\tif (ec) return {}; |\n-|\t\treturn ret; |\n+| |\n+|aux::socket_type s = [&] { |\n+| |\n+|#if TORRENT_USE_I2P |\n+|\t\tif (peerinfo->is_i2p_addr) |\n+|\t\t{ |\n+|\t\t\t// It's not entirely obvious why this peer connection is not marked as |\n+|\t\t\t// one. The main feature of a peer connection is that whether or not we |\n+|\t\t\t// proxy it is configurable. When we use i2p, we want to always prox |\n+|\t\t\t// everything via i2p. |\n+| |\n+|\t\t\taux::proxy_settings proxy; |\n+|\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname); |\n+|\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port)); |\n+|\t\t\tproxy.type = settings_pack::i2p_proxy; |\n+| |\n+|\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context() |\n+|\t\t\t\t, proxy, nullptr, nullptr, false, false); |\n+|\t\t\ti2p_stream& str = boost::get(ret); |\n+|\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint()); |\n+|\t\t\tstr.set_destination(static_cast(peerinfo)->dest()); |\n+|\t\t\tstr.set_command(i2p_stream::cmd_connect); |\n+|\t\t\tstr.set_session_id(m_ses.i2p_session()); |\n+|\t\t\treturn ret; |\n+|\t\t} |\n+|\t\telse |\n+|#endif |\n+|\t\t{ |\n+|\t\t\tvoid* userdata = nullptr; |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\t\tif (is_ssl_torrent()) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b0_\b9_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b90\b09\b91\b1 *\b**\b**\b* |\n+|// finished torrents may not change their queue positions, as it's set to |\n+|\t\t// -1 |\n+|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n+| |\n+|\t\tTORRENT_ASSERT((p == no_pos) == is_finished() |\n+|\t\t\t|| (!m_auto_managed && p == no_pos) |\n+|\t\t\t|| (m_abort && p == no_pos) |\n+|\t\t\t|| (!m_added && p == no_pos)); |\n+|\t\tif (p == m_sequence_number) return; |\n+| |\n+|\t\tTORRENT_ASSERT(p >= no_pos); |\n+| |\n+|\t\tstate_updated(); |\n+| |\n+|\t\tm_ses.set_queue_position(this, p); |\n |\t} |\n | |\n-|\tvoid posix_part_file::free_piece(piece_index_t const piece) |\n+|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n |\t{ |\n-|\t\tauto const i = m_piece_map.find(piece); |\n-|\t\tif (i == m_piece_map.end()) return; |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|if (limit <= 0) limit = (1 << 24) - 1; |\n+|if (int(m_max_uploads) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_uploads = aux::numeric_cast(limit); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n+|#endif |\n | |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n | |\n-|m_free_slots.push_back(i->second); |\n-|\t\tm_piece_map.erase(i); |\n-|\t\tm_dirty_metadata = true; |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n+|\t{ |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b0_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b10\b08\b8 *\b**\b**\b* |\n+|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (limit <= 0) limit = (1 << 24) - 1; |\n+|\t\tif (int(m_max_uploads) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_uploads = aux::numeric_cast(limit); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n+|#endif |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n |\t} |\n | |\n-|\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec) |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n |\t{ |\n-|\t\tflush_metadata_impl(ec); |\n-|\t\tif (ec) return; |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|if (limit <= 0) limit = (1 << 24) - 1; |\n+|if (int(m_max_connections) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_connections = aux::numeric_cast(limit); |\n+|\t\tupdate_want_peers(); |\n | |\n-|\t\tif (!m_piece_map.empty()) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections); |\n+|#endif |\n+| |\n+|\t\tif (num_peers() > int(m_max_connections)) |\n |\t\t{ |\n-|\t\t\tstd::string old_path = combine_path(m_path, m_name); |\n-|\t\t\tstd::string new_path = combine_path(path, m_name); |\n+|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n+|\t\t\t\t, errors::too_many_connections); |\n+|\t\t} |\n | |\n-|\t\t\trename(old_path, new_path, ec); |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n | |\n-|\t\t\tif (ec) |\n-|\t\t\t{ |\n-|\t\t\t\tstorage_error se; |\n-|\t\t\t\taux::copy_file(old_path, new_path, se); |\n-|\t\t\t\tec = se.ec; |\n-|\t\t\t\tif (ec) return; |\n-|\t\t\t\tremove(old_path, ec); |\n+|\tvoid torrent::set_upload_limit(int const limit) |\n+|\t{ |\n+|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid torrent::set_download_limit(int const limit) |\n+|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b3_\b4_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b03\b34\b4 *\b**\b**\b* |\n+|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n+|\t\t\t\t\t, m_average_piece_time); |\n+|#endif |\n |\t\t\t} |\n-|\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_\b5_\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\b25\b5 *\b**\b**\b* |\n-|auto 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\tTORRENT_ASSERT(!ec); |\n-|\t\t\t\tif (ec) return; |\n+|\t\t\t// pick all blocks for this piece. the peers list is kept up to date |\n+|\t\t\t// and sorted. when we issue a request to a peer, its download queue |\n+|\t\t\t// time will increase and it may need to be bumped in the peers list, |\n+|\t\t\t// since it's ordered by download queue time |\n+|\t\t\tpick_time_critical_block(peers, ignore_peers |\n+|\t\t\t\t, peers_with_requests |\n+|\t\t\t\t, pi, &i, m_picker.get() |\n+|\t\t\t\t, blocks_in_piece, timed_out); |\n | |\n-|\t\t\t\tf(file_offset, {buf.get(), block_to_copy}); |\n+|\t\t\t// put back the peers we ignored into the peer list for the next piece |\n+|\t\t\tif (!ignore_peers.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end()); |\n+|\t\t\t\tignore_peers.clear(); |\n+| |\n+|std::sort(peers.begin(), peers.end() |\n+|, [] (peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); }); |\n |\t\t\t} |\n-|\t\t\tfile_offset += block_to_copy; |\n-|\t\t\tpiece_offset = 0; |\n-|\t\t\tsize -= block_to_copy; |\n+| |\n+|\t\t\t// if this peer's download time exceeds 2 seconds, we're done. |\n+|\t\t\t// We don't want to build unreasonably long request queues |\n+|\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000)) |\n+|\t\t\t\tbreak; |\n |\t\t} |\n-|\t} |\n | |\n-|\tvoid posix_part_file::flush_metadata(error_code& ec) |\n-|\t{ |\n-|\t\tflush_metadata_impl(ec); |\n+|\t\t// commit all the time critical requests |\n+|\t\tfor (auto p : peers_with_requests) |\n+|\t\t{ |\n+|\t\t\tp->send_block_requests(); |\n+|\t\t} |\n |\t} |\n+|#endif // TORRENT_DISABLE_STREAMING |\n | |\n-|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+|\tstd::set torrent::web_seeds(web_seed_entry::type_t const type) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tstd::set ret; |\n+|\t\tfor (auto const& s : m_web_seeds) |\n |\t\t{ |\n-|\t\t\t// if we don't have any pieces left in the |\n-|\t\t\t// part file, remove it |\n-|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n-|\t\t\tremove(p, ec); |\n-| |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n-|\t\t\treturn; |\n+|\t\t\tif (s.peer_info.banned) continue; |\n+|\t\t\tif (s.removed) continue; |\n+|\t\t\tif (s.type != type) continue; |\n+|\t\t\tret.insert(s.url); |\n+|\t\t} |\n+|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\br_\be_\bt_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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\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+|\t\tvoid crypto_random_bytes(span buffer) |\n+|\t\t{ |\n+|#ifdef TORRENT_BUILD_SIMULATOR |\n+|\t\t\t// In the simulator we want deterministic random numbers |\n+|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n+|#elif TORRENT_USE_CNG |\n+|\t\t\taux::cng_gen_random(buffer); |\n+|#elif TORRENT_USE_CRYPTOAPI |\n+|\t\t\t// windows |\n+|\t\t\taux::crypt_gen_random(buffer); |\n+|#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL |\n+|// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the |\n+|// openssl compatibility layer. This function API does not support |\n+|// an arbitrary buffer size (openssl does), it is limited by the |\n+|// constant RNG_MAX_BLOCK_LEN. |\n | |\n-|\t\tusing namespace libtorrent::aux; |\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\tchar* ptr = header.data(); |\n-|\t\twrite_uint32(m_max_pieces, ptr); |\n-|\t\twrite_uint32(m_piece_size, ptr); |\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\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+|#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/_\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@@ -8421,945 +10087,14 @@\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/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bl_\bo_\bg_\bi_\bc_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b _\bi_\bn_\bt_\bo_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhe\be l\blo\boa\bad\bdi\bin\bng\bg l\blo\bog\bgi\bic\bc f\bfr\bro\bom\bm t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br i\bin\bnt\bto\bo h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n-|mask.resize(std::size_t(full_size), false); |\n-|\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size) |\n-|\t\t\t\t\t, end = i + num_pieces; i < end; ++i) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tmask[std::size_t(i)] = true; |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t\tti->free_piece_layers(); |\n-|\t\t} |\n-|\t\tatp.info_hashes = atp.ti->info_hashes(); |\n-|\t} |\n-|} |\n-| |\n-|\tadd_torrent_params load_torrent_file(std::string const& filename) |\n-|\t{ return load_torrent_file(filename, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_buffer(span buffer) |\n-|\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file) |\n-|\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); } |\n-| |\n-|add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg) |\n-|{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(filename, cfg); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tadd_torrent_params load_torrent_buffer(span buffer, load_torrent_limits const& cfg) |\n-|\t{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(buffer, cfg, from_span); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n-|\t{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(torrent_file, cfg); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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-|\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-|\tbool supports_arm_crc32c() noexcept |\n-|\t{ |\n-|#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV |\n-|#if defined TORRENT_FORCE_ARM_CRC32 |\n-|\t\treturn true; |\n-|#elif defined __arm__ |\n-|\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32); |\n-|\t\treturn (helper_getauxval(26) & (1 << 4)); |\n-|#elif defined __aarch64__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32); |\n-|\t\treturn (helper_getauxval(16) & (1 << 7)); |\n-|#endif |\n-|#else |\n-|\t\treturn false; |\n-|#endif |\n-|\t} |\n-| |\n-|} // anonymous namespace |\n-| |\n-|\tbool const sse42_support = supports_sse42(); |\n-|\tbool const mmx_support = supports_mmx(); |\n-|\tbool const arm_neon_support = supports_arm_neon(); |\n-|\tbool const arm_crc32c_support = supports_arm_crc32c(); |\n-|_\b}_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b7_\b5_\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\b87\b75\b5 *\b**\b**\b* |\n-|std::string ext = extension(filename); |\n-|\t\t\tint cnt = 0; |\n-|\t\t\tfor (;;) |\n-|\t\t\t{ |\n-|\t\t\t\t++cnt; |\n-|\t\t\t\tchar new_ext[50]; |\n-|\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str()); |\n-|\t\t\t\tfilename = base + new_ext; |\n-| |\n-|\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc; |\n-|\t\t\t\tprocess_string_lowercase(crc, filename); |\n-|\t\t\t\tstd::uint32_t const new_hash = crc.checksum(); |\n-|\t\t\t\tif (files.find(new_hash) == files.end()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tfiles.insert({new_hash, {i, 0}}); |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t} |\n-|\t\t\t\t++num_collisions; |\n-|\t\t\t\tif (num_collisions > 100) |\n-|\t\t\t\t{ |\n-|} |\n-|} |\n-| |\n-|\t\t\tcopy_on_write(); |\n-|\t\t\tm_files.rename_file(i, filename); |\n-|\t\t} |\n-|\t} |\n-| |\n-|\tvoid torrent_info::remap_files(file_storage const& f) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tTORRENT_ASSERT(is_loaded()); |\n-|\t\t// the new specified file storage must have the exact |\n-|\t\t// same size as the current file storage |\n-|\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size()); |\n-| |\n-|\t\tif (m_files.total_size() != f.total_size()) return; |\n-|\t\tcopy_on_write(); |\n-|\t\tm_files = f; |\n-|\t\tm_files.set_num_pieces(m_orig_files->num_pieces()); |\n-|\t\tm_files.set_piece_length(m_orig_files->piece_length()); |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t// standard constructor that parses a torrent file |\n-|\ttorrent_info::torrent_info(entry const& torrent_file) |\n-|\t{ |\n-|\t\tstd::vector tmp; |\n-|\t\tstd::back_insert_iterator> out(tmp); |\n-|_\b\t_\b\t_\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\bo_\bu_\bt_\b,_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\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_\b8_\b9_\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\b58\b89\b9 *\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-|\tsettings_pack default_settings() |\n-|\t{ |\n-|\t\tsettings_pack ret; |\n-|for (int i = 0; i < settings_pack::num_string_settings; ++i) |\n-|{ |\n-|\t\t\tif (str_settings[i].default_value == nullptr) continue; |\n-|\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value); |\n-|\t\t} |\n-| |\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/_\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-|\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-|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-|\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\"); |\n-|\tm_timer.expires_after(seconds(10)); |\n-|\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout |\n-|\t\t, self(), _1)); |\n-|} |\n-| |\n-|void socks5::on_connect_timeout(error_code const& e) |\n-|{ |\n-|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\n-| |\n-|\tif (e == boost::asio::error::operation_aborted) return; |\n-| |\n-|\tif (m_abort) return; |\n-| |\n-|\tif (m_alerts.should_post()) |\n-|\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::connect, errors::timed_out); |\n-| |\n-|\terror_code ignore; |\n-|\tm_socks5_sock.close(ignore); |\n-| |\n-|\t++m_failures; |\n-|\tretry_connection(); |\n-|} |\n-| |\n-|void socks5::on_connected(error_code const& e) |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b4_\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\b94\b41\b1 *\b**\b**\b* |\n-|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n-|\t\t\t\twe_have(i); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tset_state(torrent_status::checking_resume_data); |\n-| |\n-|\t\taux::vector links; |\n-|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n-|\t\tif (!m_torrent_file->similar_torrents().empty() |\n-|\t\t\t|| !m_torrent_file->collections().empty()) |\n-|\t\t{ |\n-|\t\t\tresolve_links res(m_torrent_file); |\n-| |\n-|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n-|\t\t\t\tif (!t) continue; |\n-| |\n-|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|if (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t} |\n-|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n-| |\n-|\t\t\t\tfor (auto const& t : ts) |\n-|\t\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b54\b4 *\b**\b**\b* |\n-|{ |\n-|\t\t\tresolve_links res(m_torrent_file); |\n-| |\n-|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n-|\t\t\t\tif (!t) continue; |\n-| |\n-|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|\t\t\t\tif (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t} |\n-|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n-| |\n-|\t\t\t\tfor (auto const& t : ts) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|if (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-| |\n-|\t\t\tstd::vector const& l = res.get_links(); |\n-|\t\t\tif (!l.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tlinks.resize(m_torrent_file->files().num_files()); |\n-|\t\t\t\tfor (auto const& i : l) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tif (!i.ti) continue; |\n-|\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path |\n-|\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx)); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t} |\n-|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n-|\t\tm_outstanding_check_files = true; |\n-|#endif |\n-| |\n-|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n-|\t\t{ |\n-|\t\t\tm_ses.disk_thread().async_check_files( |\n-|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n-|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n-|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b1_\b5 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b71\b15\b5 *\b**\b**\b* |\n-|// not ready for peers. Except, if we don't have metadata, |\n-|\t\t// we need peers to download from |\n-|\t\tif (!m_files_checked && valid_metadata()) return; |\n-| |\n-|\t\tif (!m_announce_to_lsd) return; |\n-| |\n-|\t\t// private torrents are never announced on LSD |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return; |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\t// i2p torrents are also never announced on LSD |\n-|\t\t// unless we allow mixed swarms |\n-|\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed)) |\n-|\t\t\treturn; |\n-|#endif |\n-| |\n-|\t\tif (is_paused()) return; |\n-| |\n-|\t\tif (!m_ses.has_lsd()) return; |\n-| |\n-|#ifdef TORRENT_SSL_PEERS |\n-|int port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port(); |\n-|#else |\n-|\t\tint port = m_ses.listen_port(); |\n-|#endif |\n-| |\n-|\t\t// announce with the local discovery service |\n-|\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version) |\n-|\t\t{ |\n-|\t\t\tm_ses.announce_lsd(ih, port); |\n-|\t\t}); |\n-|\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_DHT |\n-| |\n-|\tvoid torrent::dht_announce() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (!m_ses.dht()) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n-|#endif |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\tif (!should_announce_dht()) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b87\b70\b0 *\b**\b**\b* |\n-|catch (...) { handle_exception(); } |\n-|#endif |\n-| |\n-|\tvoid torrent::on_peer_name_lookup(error_code const& e |\n-|\t\t, std::vector
    const& host_list, int const port |\n-|\t\t, protocol_version const v) try |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\"); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (e && should_log()) |\n-|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n-|#endif |\n-| |\n-|\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return; |\n-| |\n-|tcp::endpoint host(host_list.front(), std::uint16_t(port)); |\n-| |\n-|\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str()); |\n-|\t\t\t} |\n-|#endif |\n-|\t\t\tif (m_ses.alerts().should_post()) |\n-|\t\t\t\tm_ses.alerts().emplace_alert(get_handle() |\n-|\t\t\t\t\t, host, peer_blocked_alert::ip_filter); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0))) |\n-|\t\t{ |\n-|\t\t\tstate_updated(); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\" |\n-|\t\t\t\t\t, host.address().to_string().c_str() |\n-|\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1); |\n-|\t\t\t} |\n-|#endif |\n-|\t\t} |\n-|\t\tupdate_want_peers(); |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b56\b62\b2 *\b**\b**\b* |\n-|{ |\n-|\t\t\tstd::set ret; |\n-|\t\t\tif (!blocks.empty() && !downloaders.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin())); |\n-|\t\t\t} |\n-|\t\t\treturn ret; |\n-|\t\t}(); |\n-| |\n-|\t\t// if this piece wasn't downloaded from peers, we just found it on disk. |\n-|\t\t// In that case, we should just consider it as \"not-have\" and there's no |\n-|\t\t// need to try to get higher fidelity hashes (yet) |\n-|\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr); |\n-| |\n-|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n-|\t\t{ |\n-|verify_block_hashes(index); |\n-|} |\n-| |\n-|\t\t// the below code is penalizing peers that sent use bad data. |\n-|\t\t// increase the total amount of failed bytes |\n-|\t\tif (!found_on_disk) |\n-|\t\t{ |\n-|\t\t\tif (blocks.empty()) |\n-|\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index)); |\n-|\t\t\telse |\n-|\t\t\t\tadd_failed_bytes(static_cast(blocks.size()) * default_block_size); |\n-| |\n-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\t\t\tfor (auto& ext : m_extensions) |\n-|\t\t\t{ |\n-|\t\t\t\text->on_piece_failed(index); |\n-|\t\t\t} |\n-|#endif |\n-| |\n-|\t\t\t// did we receive this piece from a single peer? |\n-|\t\t\t// if we know exactly which blocks failed the hash, we can also be certain |\n-|\t\t\t// that all peers in the list sent us bad data |\n-|\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty(); |\n-| |\n-|\t\t\tpenalize_peers(peers, index, known_bad_peer); |\n-|\t\t} |\n-| |\n-|\t\t// If m_storage isn't set here, it means we're shutting down |\n-|\t\tif (m_storage) |\n-|\t\t{ |\n-|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b0_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b50\b01\b1 *\b**\b**\b* |\n-||| peerinfo->confirmed_supports_utp)) |\n-|\t\t\t{ |\n-|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n-|\t\t\t} |\n-| |\n-|\t\t\t// don't make a TCP connection if it's disabled |\n-|\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp)) |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \" |\n-|\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str() |\n-|\t\t\t\t\t\t, peerinfo->supports_utp); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\treturn false; |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|aux::socket_type s = [&] { |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\tif (peerinfo->is_i2p_addr) |\n-|\t\t{ |\n-|\t\t\t// It's not entirely obvious why this peer connection is not marked as |\n-|\t\t\t// one. The main feature of a peer connection is that whether or not we |\n-|\t\t\t// proxy it is configurable. When we use i2p, we want to always prox |\n-|\t\t\t// everything via i2p. |\n-| |\n-|\t\t\taux::proxy_settings proxy; |\n-|\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname); |\n-|\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port)); |\n-|\t\t\tproxy.type = settings_pack::i2p_proxy; |\n-| |\n-|\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context() |\n-|\t\t\t\t, proxy, nullptr, nullptr, false, false); |\n-|\t\t\ti2p_stream& str = boost::get(ret); |\n-|\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint()); |\n-|\t\t\tstr.set_destination(static_cast(peerinfo)->dest()); |\n-|\t\t\tstr.set_command(i2p_stream::cmd_connect); |\n-|\t\t\tstr.set_session_id(m_ses.i2p_session()); |\n-|\t\t\treturn ret; |\n-|\t\t} |\n-|\t\telse |\n-|#endif |\n-|\t\t{ |\n-|\t\t\tvoid* userdata = nullptr; |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\t\tif (is_ssl_torrent()) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b0_\b9_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b90\b09\b91\b1 *\b**\b**\b* |\n-|// finished torrents may not change their queue positions, as it's set to |\n-|\t\t// -1 |\n-|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n-| |\n-|\t\tTORRENT_ASSERT((p == no_pos) == is_finished() |\n-|\t\t\t|| (!m_auto_managed && p == no_pos) |\n-|\t\t\t|| (m_abort && p == no_pos) |\n-|\t\t\t|| (!m_added && p == no_pos)); |\n-|\t\tif (p == m_sequence_number) return; |\n-| |\n-|\t\tTORRENT_ASSERT(p >= no_pos); |\n-| |\n-|\t\tstate_updated(); |\n-| |\n-|\t\tm_ses.set_queue_position(this, p); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|if (limit <= 0) limit = (1 << 24) - 1; |\n-|if (int(m_max_uploads) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_uploads = aux::numeric_cast(limit); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n-|#endif |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n-|\t{ |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b0_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b10\b08\b8 *\b**\b**\b* |\n-|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (limit <= 0) limit = (1 << 24) - 1; |\n-|\t\tif (int(m_max_uploads) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_uploads = aux::numeric_cast(limit); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n-|#endif |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|if (limit <= 0) limit = (1 << 24) - 1; |\n-|if (int(m_max_connections) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_connections = aux::numeric_cast(limit); |\n-|\t\tupdate_want_peers(); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections); |\n-|#endif |\n-| |\n-|\t\tif (num_peers() > int(m_max_connections)) |\n-|\t\t{ |\n-|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n-|\t\t\t\t, errors::too_many_connections); |\n-|\t\t} |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_upload_limit(int const limit) |\n-|\t{ |\n-|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n-|#endif |\n-|\t} |\n-| |\n-|\tvoid torrent::set_download_limit(int const limit) |\n-|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b3_\b4_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b03\b34\b4 *\b**\b**\b* |\n-|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n-|\t\t\t\t\t, m_average_piece_time); |\n-|#endif |\n-|\t\t\t} |\n-| |\n-|\t\t\t// pick all blocks for this piece. the peers list is kept up to date |\n-|\t\t\t// and sorted. when we issue a request to a peer, its download queue |\n-|\t\t\t// time will increase and it may need to be bumped in the peers list, |\n-|\t\t\t// since it's ordered by download queue time |\n-|\t\t\tpick_time_critical_block(peers, ignore_peers |\n-|\t\t\t\t, peers_with_requests |\n-|\t\t\t\t, pi, &i, m_picker.get() |\n-|\t\t\t\t, blocks_in_piece, timed_out); |\n-| |\n-|\t\t\t// put back the peers we ignored into the peer list for the next piece |\n-|\t\t\tif (!ignore_peers.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end()); |\n-|\t\t\t\tignore_peers.clear(); |\n-| |\n-|std::sort(peers.begin(), peers.end() |\n-|, [] (peer_connection const* lhs, peer_connection const* rhs) |\n-|\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); }); |\n-|\t\t\t} |\n-| |\n-|\t\t\t// if this peer's download time exceeds 2 seconds, we're done. |\n-|\t\t\t// We don't want to build unreasonably long request queues |\n-|\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000)) |\n-|\t\t\t\tbreak; |\n-|\t\t} |\n-| |\n-|\t\t// commit all the time critical requests |\n-|\t\tfor (auto p : peers_with_requests) |\n-|\t\t{ |\n-|\t\t\tp->send_block_requests(); |\n-|\t\t} |\n-|\t} |\n-|#endif // TORRENT_DISABLE_STREAMING |\n-| |\n-|\tstd::set torrent::web_seeds(web_seed_entry::type_t const type) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tstd::set ret; |\n-|\t\tfor (auto const& s : m_web_seeds) |\n-|\t\t{ |\n-|\t\t\tif (s.peer_info.banned) continue; |\n-|\t\t\tif (s.removed) continue; |\n-|\t\t\tif (s.type != type) continue; |\n-|\t\t\tret.insert(s.url); |\n-|\t\t} |\n-|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\br_\be_\bt_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\br_\ba_\bn_\bd_\bo_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bc_\ba_\bl_\bl_\bi_\bn_\bg_\b _\bR_\bA_\bN_\bD_\b__\bb_\by_\bt_\be_\bs_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bt_\bi_\bm_\be_\bs_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bf_\bo_\br_\b _\bn_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bim\bmp\bpr\bro\bov\bve\be c\bca\bal\bll\bli\bin\bng\bg R\bRA\bAN\bND\bD_\b_b\bby\byt\bte\bes\bs m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bim\bme\bes\bs,\b, u\bus\bsi\bin\bng\bg f\bfa\bal\bll\blb\bba\bac\bck\bk f\bfo\bor\br n\bno\bow\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/r\bra\ban\bnd\bdo\bom\bm.\b.c\bcp\bpp\bp:\b:1\b14\b41\b1 *\b**\b**\b* |\n-|#else |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#endif |\n-|\t\t} |\n-| |\n-|\t\tvoid crypto_random_bytes(span buffer) |\n-|\t\t{ |\n-|#ifdef TORRENT_BUILD_SIMULATOR |\n-|\t\t\t// In the simulator we want deterministic random numbers |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#elif TORRENT_USE_CNG |\n-|\t\t\taux::cng_gen_random(buffer); |\n-|#elif TORRENT_USE_CRYPTOAPI |\n-|\t\t\t// windows |\n-|\t\t\taux::crypt_gen_random(buffer); |\n-|#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL |\n-|// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the |\n-|// openssl compatibility layer. This function API does not support |\n-|// an arbitrary buffer size (openssl does), it is limited by the |\n-|// constant RNG_MAX_BLOCK_LEN. |\n-| |\n-|// openssl |\n-|\t\t\tint r = RAND_bytes(reinterpret_cast(buffer.data()) |\n-|\t\t\t\t, int(buffer.size())); |\n-|\t\t\tif (r != 1) aux::throw_ex(errors::no_entropy); |\n-|#elif TORRENT_USE_GETRANDOM |\n-|\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast(buffer.size()), 0); |\n-|\t\t\tif (r == ssize_t(buffer.size())) return; |\n-|\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex(error_code(errno, generic_category())); |\n-|\t\t\tstatic dev_random dev; |\n-|\t\t\tdev.read(buffer); |\n-|#elif TORRENT_USE_DEV_RANDOM |\n-|\t\t\tstatic dev_random dev; |\n-|\t\t\tdev.read(buffer); |\n-|#else |\n-| |\n-|#if TORRENT_BROKEN_RANDOM_DEVICE |\n-|\t\t\t// even pseudo random numbers rely on being able to seed the random |\n-|\t\t\t// generator |\n-|#error \"no entropy source available\" |\n-|#else |\n-|#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#else |\n-|#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\" |\n-|#endif |\n-|#endif |\n-| |\n-|#endif |\n-|\t\t} |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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@@ -9620,288 +10355,68 @@\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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0 |ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\bi_\be_\bd_\b._\b _\bT_\bh_\ba_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bl_\be_\bt_\b _\bu_\bs_\b _\br_\bo_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bw_\bi_\bt_\bh_\b _\bh_\bi_\bg_\bh_\be_\br_\b _\bc_\bo_\bn_\bf_\bi_\bd_\be_\bn_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bid\bde\bea\bal\bll\bly\by,\b, i\bif\bf w\bwe\be e\ben\bnd\bd u\bup\bp c\bco\bop\bpy\byi\bin\bng\bg f\bfi\bil\ble\bes\bs b\bbe\bec\bca\bau\bus\bse\be o\bof\bf a\ba m\bmo\bov\bve\be a\bac\bcr\bro\bos\bss\bs v\bvo\bol\blu\bum\bme\bes\bs,\b, t\bth\bhe\be s\bso\bou\bur\brc\bce\be s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be d\bde\bel\ble\bet\bte\bed\bd u\bun\bnt\bti\bil\bl t\bth\bhe\bey\by'\b'v\bve\be a\bal\bll\bl b\bbe\bee\ben\bn c\bco\bop\bpi\bie\bed\bd.\b. T\bTh\bha\bat\bt w\bwo\bou\bul\bld\bd l\ble\bet\bt u\bus\bs r\bro\bol\bll\blb\bba\bac\bck\bk w\bwi\bit\bth\bh |\n-|h\bhi\big\bgh\bhe\ber\br c\bco\bon\bnf\bfi\bid\bde\ben\bnc\bce\be.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:2\b23\b30\b0 *\b**\b**\b* |\n-|// later |\n-|\t\taux::vector copied_files(std::size_t(f.num_files()), false); |\n-| |\n-|\t\t// track how far we got in case of an error |\n-|\t\tfile_index_t file_index{}; |\n-|\t\tfor (auto const i : f.file_range()) |\n-|\t\t{ |\n-|\t\t\t// files moved out to absolute paths are not moved |\n-|\t\t\tif (f.file_absolute_path(i)) continue; |\n-| |\n-|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n-|\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i)); |\n-| |\n-|\t\t\terror_code ignore; |\n-|\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore)) |\n-|\t\t\t{ |\n-|\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check; |\n-|\t\t\t\tcontinue; |\n-|\t\t\t} |\n-| |\n-|move_file(old_path, new_path, ec); |\n-| |\n-|\t\t\t// if the source file doesn't exist. That's not a problem |\n-|\t\t\t// we just ignore that file |\n-|\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.ec.clear(); |\n-|\t\t\telse if (ec |\n-|\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument |\n-|\t\t\t\t&& ec.ec != boost::system::errc::permission_denied) |\n-|\t\t\t{ |\n-|\t\t\t\t// moving the file failed |\n-|\t\t\t\t// on OSX, the error when trying to rename a file across different |\n-|\t\t\t\t// volumes is EXDEV, which will make it fall back to copying. |\n-|\t\t\t\tec.ec.clear(); |\n-|\t\t\t\tcopy_file(old_path, new_path, ec); |\n-|\t\t\t\tif (!ec) copied_files[i] = true; |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (ec) |\n-|\t\t\t{ |\n-|\t\t\t\tec.file(i); |\n-|\t\t\t\tfile_index = i; |\n-|\t\t\t\tbreak; |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tif (!ec && move_partfile) |\n-|\t\t{ |\n-|\t\t\terror_code e; |\n-|\t\t\tmove_partfile(new_save_path, e); |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b8 |it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bo_\bg_\bi_\bc_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd s\bse\bee\bem\bm r\bre\bea\bas\bso\bon\bna\bab\bbl\ble\be t\bto\bo,\b, i\bin\bns\bst\bte\bea\bad\bd,\b, s\bse\bet\bt t\bth\bhe\be h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\bes\bs b\bbi\bit\bts\bs f\bfo\bor\br t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs r\bre\bep\bpr\bre\bes\bse\ben\bnt\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfi\bil\ble\bes\bs,\b, a\ban\bnd\bd r\bre\bes\bsu\bum\bme\be w\bwi\bit\bth\bh t\bth\bhe\be n\bno\bor\brm\bma\bal\bl l\blo\bog\bgi\bic\bc *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:5\b53\b38\b8 *\b**\b**\b* |\n-|continue; |\n-| |\n-|\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs |\n-|\t\t\t\t\t, save_path, ec); |\n-|\t\t\t\tif (size < 0) return false; |\n-| |\n-|\t\t\t\tif (size < fs.file_size(file_index)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tec.ec = errors::mismatching_file_size; |\n-|\t\t\t\t\tec.file(file_index); |\n-|\t\t\t\t\tec.operation = operation_t::check_resume; |\n-|\t\t\t\t\treturn false; |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t\treturn true; |\n-|\t\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n-|\t\t// always trigger a full recheck when we pull in files from other |\n-|\t\t// torrents, via hard links |\n-|if (added_files) return false; |\n+|_\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_\b8_\b1_\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\b18\b81\b1 *\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\t// parse have bitmask. Verify that the files we expect to have |\n-|\t\t// actually do exist |\n-|\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece()); |\n-|\t\tfor (piece_index_t i(0); i < end_piece; ++i) |\n-|\t\t{ |\n-|\t\t\tif (rd.have_pieces.get_bit(i) == false) continue; |\n-| |\n-|\t\t\tstd::vector f = fs.map_block(i, 0, 1); |\n-|\t\t\tTORRENT_ASSERT(!f.empty()); |\n-| |\n-|\t\t\tfile_index_t const file_index = f[0].file_index; |\n-| |\n-|\t\t\t// files with priority zero may not have been saved to disk at their |\n-|\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n-|\t\t\t// from checking |\n-|\t\t\tif (file_index < file_priority.end_index() |\n-|\t\t\t\t&& file_priority[file_index] == dont_download) |\n-|\t\t\t\tcontinue; |\n-| |\n-|\t\t\tif (fs.pad_file_at(file_index)) continue; |\n-| |\n-|\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0) |\n-|\t\t\t\treturn false; |\n-| |\n-|\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in |\n-|\t\t\t// this file. We're just sanity-checking whether the files exist |\n-|\t\t\t// or not. |\n-|_\b\t_\b\t_\b\t_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\br_\b _\b=_\b _\bf_\bs_\b._\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\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_\b0_\b9_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\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\b10\b09\b91\b1 *\b**\b**\b* |\n-|\t\tint rate = 0; |\n-| |\n-|\t\t// if we haven't received any data recently, the current download rate |\n-|\t\t// is not representative |\n-|\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0) |\n-|\t\t{ |\n-|\t\t\trate = m_download_rate_peak; |\n-|\t\t} |\n-|\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5) |\n-|\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000) |\n-|\t\t{ |\n-|\t\t\t// if we're have only been unchoked for a short period of time, |\n-|\t\t\t// we don't know what rate we can get from this peer. Instead of assuming |\n-|\t\t\t// the lowest possible rate, assume the average. |\n-| |\n-|\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]); |\n-|\t\t\t// avoid division by 0 |\n-|\t\t\tif (peers_with_requests == 0) peers_with_requests = 1; |\n-| |\n-|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n-|} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\t// current download rate in bytes per seconds |\n-|\t\t\trate = m_statistics.transfer_rate(stat::download_payload); |\n-|\t\t} |\n-| |\n-|\t\t// avoid division by zero |\n-|\t\tif (rate < 50) rate = 50; |\n-| |\n-|\t\t// average of current rate and peak |\n-|//\t\trate = (rate + m_download_rate_peak) / 2; |\n-| |\n-|\t\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n-|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n+|\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-|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\tstd::string torrent_peer::to_string() const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tm_statistics.add_stat(downloaded, uploaded); |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|#if TORRENT_USE_I2P |\n+|\t\tif (is_i2p_addr) return dest().to_string(); |\n+|#endif // TORRENT_USE_I2P |\n+|\t\treturn address().to_string(); |\n |\t} |\n+|#endif |\n | |\n-|\tsha1_hash peer_connection::associated_info_hash() const |\n+|\tstd::int64_t torrent_peer::total_download() 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_\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 _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\b52\b20\b0 *\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->has_piece_passed(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\tTORRENT_ASSERT(in_use); |\n+|\t\tif (connection != nullptr) |\n |\t\t{ |\n-|\t\t\tt->peer_is_interesting(*this); |\n+|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n+|\t\t\treturn connection->statistics().total_payload_download(); |\n |\t\t} |\n-|\t} |\n-| |\n-|\tstd::vector const& peer_connection::allowed_fast() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-| |\n-|return m_allowed_fast; |\n-|} |\n-| |\n-|\tbool peer_connection::can_request_time_critical() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (has_peer_choked() || !is_interesting()) return false; |\n-|\t\tif (int(m_download_queue.size()) + int(m_request_queue.size()) |\n-|\t\t\t> m_desired_queue_size * 2) return false; |\n-|\t\tif (on_parole()) return false; |\n-|\t\tif (m_disconnecting) return false; |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tif (t->upload_mode()) return false; |\n-| |\n-|\t\t// ignore snubbed peers, since they're not likely to return pieces in a |\n-|\t\t// timely manner anyway |\n-|\t\tif (m_snubbed) return false; |\n-|\t\treturn true; |\n-|\t} |\n-| |\n-|\tbool peer_connection::make_time_critical(piece_block const& block) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tauto const rit = std::find_if(m_request_queue.begin() |\n-|\t\t\t, m_request_queue.end(), aux::has_block(block)); |\n-|\t\tif (rit == m_request_queue.end()) return false; |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bt_\b-_\b>_\bh_\ba_\bs_\b__\bp_\bi_\bc_\bk_\be_\br_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b1_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bec\bch\bhn\bni\bic\bca\bal\bll\bly\by,\b, t\bth\bhi\bis\bs i\bis\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bos\bse\bed\bd t\bto\bo h\bha\bap\bpp\bpe\ben\bn,\b, b\bbu\but\bt i\bit\bt s\bse\bee\bem\bms\bs t\bto\bo s\bso\bom\bme\bet\bti\bim\bme\bes\bs.\b. S\bSo\bom\bme\be o\bof\bf t\bth\bhe\be a\bac\bcc\bco\bou\bun\bnt\bti\bin\bng\bg i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by w\bwr\bro\bon\bng\bg i\bin\bn c\bce\ber\brt\bta\bai\bin\bn c\bca\bas\bse\bes\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b41\b1 *\b**\b**\b* |\n-|// cut out the chunk header from the receive buffer |\n-|\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX); |\n-|\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast(m_chunk_pos + m_body_start)); |\n-|\t\t\t\t\trecv_buffer = m_recv_buffer.get(); |\n-|\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start); |\n-|\t\t\t\t\tm_chunk_pos += chunk_size; |\n-|\t\t\t\t\tif (chunk_size == 0) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1 |\n-|\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == 'H' |\n-|\t\t\t\t\t\t\t|| (m_parser.chunked_encoding() |\n-|\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == '\\r')); |\n-|\t\t\t\t\t\tm_chunk_pos = -1; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-| |\n-|\t\t\tint payload = int(bytes_transferred); |\n-|\t\t\tif (payload > m_response_left) payload = int(m_response_left); |\n-|\t\t\tif (payload > front_request.length) payload = front_request.length; |\n-|if (payload > outstanding_bytes()) payload = outstanding_bytes(); |\n-|received_bytes(payload, 0); |\n-|\t\t\tincoming_piece_fragment(payload); |\n-|\t\t\tm_response_left -= payload; |\n-| |\n-|\t\t\tif (m_parser.status_code() == 503) |\n-|\t\t\t{ |\n-|\t\t\t\tif (!m_parser.finished()) return; |\n-| |\n-|\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str()); |\n-|\t\t\t\tif (retry_time <= 0) retry_time = 60; |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time); |\n-|#endif |\n-| |\n-|\t\t\t\treceived_bytes(0, int(bytes_transferred)); |\n-|\t\t\t\t// temporarily unavailable, retry later |\n-|\t\t\t\tt->retry_web_seed(this, seconds32(retry_time)); |\n-|\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n-|\t\t\t\treturn; |\n-|\t\t\t} |\n-| |\n-| |\n-|\t\t\t// we only received the header, no data |\n-|\t\t\tif (recv_buffer.empty()) break; |\n-| |\n-|\t\t\tif (recv_buffer.size() < front_request.length) break; |\n-| |\n-|\t\t\t// if the response is chunked, we need to receive the last |\n-|\t\t\t// terminating chunk and the tail headers before we can proceed |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b8_\b5_\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\b48\b85\b5 *\b**\b**\b* |\n |async_add_torrent(add_torrent_params(params)); |\n |\t} |\n | |\n |\tvoid session_handle::async_add_torrent(add_torrent_params&& params) |\n@@ -9948,583 +10463,280 @@\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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b0 |what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n-|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b30\b00\b0 *\b**\b**\b* |\n-|create_directories(m_path, ec); |\n-|\t\t\t\tif (ec) return {}; |\n-|\t\t\t\treturn aux::file_handle(fn, 0, mode); |\n-|\t\t\t} |\n-|\t\t\treturn {}; |\n-|\t\t} |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b9_\b _\b|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt m\bmo\bov\bvi\bin\bng\bg f\bfi\bil\ble\bes\bs i\bin\bnt\bto\bo t\bth\bhi\bis\bs c\bca\bal\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:5\b58\b89\b9 *\b**\b**\b* |\n+|auto retp = &prio; |\n+|\t\tsync_call(&torrent::piece_priorities, retp); |\n+|\t\tstd::vector ret; |\n+|\t\tret.reserve(prio.size()); |\n+|\t\tfor (auto p : prio) |\n+|\t\t\tret.push_back(int(static_cast(p))); |\n+|\t\treturn ret; |\n |\t} |\n-|\tcatch (storage_error const& e) |\n+|#endif |\n+| |\n+|\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const |\n |\t{ |\n-|\t\tec = e.ec; |\n-|\t\treturn {}; |\n+|\t\tasync_call(&torrent::set_file_priority, index, priority); |\n |\t} |\n | |\n-|\tvoid part_file::free_piece(piece_index_t const piece) |\n+|\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const |\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+|\t\treturn sync_call_ret(dont_download, &torrent::file_priority, index); |\n+|\t} |\n | |\n-|m_free_slots.push_back(i->second); |\n-|\t\tm_piece_map.erase(i); |\n-|\t\tm_dirty_metadata = true; |\n+|void torrent_handle::prioritize_files(std::vector const& files) const |\n+|{ |\n+|\t\tasync_call(&torrent::prioritize_files |\n+|\t\t\t, static_cast const&>(files)); |\n |\t} |\n | |\n-|\tvoid part_file::move_partfile(std::string const& path, error_code& ec) |\n+|\tstd::vector torrent_handle::get_file_priorities() const |\n |\t{ |\n-|\t\tstd::lock_guard l(m_mutex); |\n-| |\n-|\t\tflush_metadata_impl(ec); |\n-|\t\tif (ec) return; |\n+|\t\taux::vector ret; |\n+|\t\tauto retp = &ret; |\n+|\t\tsync_call(&torrent::file_priorities, retp); |\n+|\t\treturn TORRENT_RVO(ret); |\n+|\t} |\n | |\n-|\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+|#if TORRENT_ABI_VERSION == 1 |\n | |\n-|\t\t\trename(old_path, new_path, ec); |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n+|// ============ start deprecation =============== |\n | |\n-|\t\t\tif (ec) |\n-|\t\t\t{ |\n-|\t\t\t\tstorage_error se; |\n-|\t\t\t\taux::copy_file(old_path, new_path, se); |\n-|\t\t\t\tec = se.ec; |\n-|\t\t\t\tif (ec) return; |\n-|\t\t\t\tremove(old_path, ec); |\n-|\t\t\t} |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b2_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b41\b12\b2 *\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+|\tvoid torrent_handle::prioritize_files(std::vector const& files) const |\n+|\t{ |\n+|\t\taux::vector file_prio; |\n+|\t\tfile_prio.reserve(files.size()); |\n+|\t\tfor (auto const p : files) { |\n+|\t\t\tfile_prio.push_back(download_priority_t(static_cast(p))); |\n |\t\t} |\n+|\t\tasync_call(&torrent::prioritize_files, file_prio); |\n |\t} |\n | |\n-|\tvoid part_file::flush_metadata(error_code& ec) |\n+|\tstd::vector torrent_handle::file_priorities() const |\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+|_\b\t_\b\t_\ba_\bu_\bx_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt_\b,_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b>_\b _\bp_\br_\bi_\bo_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\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-|\t\t// do we need to flush the metadata? |\n-|\t\tif (m_dirty_metadata == false) return; |\n-| |\n-|\t\tif (m_piece_map.empty()) |\n-|\t\t{ |\n-|\t\t\t// if we don't have any pieces left in the |\n-|\t\t\t// part file, remove it |\n-|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n-|\t\t\tremove(p, ec); |\n-| |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec); |\n-|\t\tif (ec) return; |\n-| |\n-|\t\tstd::vector 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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:|this should not be heap allocated, sockets should be movable |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be h\bhe\bea\bap\bp a\bal\bll\blo\boc\bca\bat\bte\bed\bd,\b, s\bso\boc\bck\bke\bet\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bmo\bov\bva\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b04\b4 *\b**\b**\b* |\n-|//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str()); |\n-| |\n-|\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp)) |\n-|\t\t\treturn false; |\n-| |\n-|\t\t// if not found, see if it's a SYN packet, if it is, |\n-|\t\t// create a new utp_stream |\n-|\t\tif (ph->get_type() == ST_SYN) |\n-|\t\t{ |\n-|\t\t\t// possible SYN flood. Just ignore |\n-|\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2) |\n-|\t\t\t\treturn false; |\n-| |\n-|\t\t\tTORRENT_ASSERT(m_new_connection == -1); |\n-|\t\t\t// create the new socket with this ID |\n-|\t\t\tm_new_connection = id; |\n-| |\n-|//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection); |\n-| |\n-|aux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false)); |\n-| |\n-|\t\t\tutp_stream* str = nullptr; |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\t\tif (is_ssl(c)) |\n-|\t\t\t\tstr = &boost::get>(c).next_layer(); |\n-|\t\t\telse |\n-|#endif |\n-|\t\t\t\tstr = boost::get(&c); |\n+|\treturn n1 ^ n2; |\n+|} |\n | |\n-|\t\t\tTORRENT_ASSERT(str); |\n-|\t\t\tint const mtu = mtu_for_dest(ep.address()); |\n-|\t\t\tstr->get_impl()->init_mtu(mtu); |\n-|\t\t\tstr->get_impl()->m_sock = std::move(socket); |\n-|\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time); |\n-|\t\t\tif (!ret) return false; |\n-|\t\t\tm_last_socket = str->get_impl(); |\n-|\t\t\tm_cb(std::move(c)); |\n-|\t\t\t// the connection most likely changed its connection ID here |\n-|\t\t\t// we need to move it to the correct ID |\n-|\t\t\treturn true; |\n-|\t\t} |\n+|// 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\tif (ph->get_type() == ST_RESET) return false; |\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-|\t\t// #error send reset |\n+|int min_distance_exp(node_id const& n1, std::vector const& ids) |\n+|{ |\n+|\tTORRENT_ASSERT(ids.size() > 0); |\n | |\n-|\t\treturn false; |\n+|\tint min = 160; // see distance_exp for the why of this constant |\n+|\tfor (auto const& node_id : ids) |\n+|\t{ |\n+|\t\tmin = std::min(min, distance_exp(n1, node_id)); |\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/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b5_\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\b55\b5 *\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+|\treturn min; |\n+|} |\n | |\n-|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n+|node_id generate_id_impl(address const& ip_, std::uint32_t r) |\n+|{ |\n+|\tstd::uint8_t* ip = nullptr; |\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+|\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-|\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+|\taddress_v4::bytes_type b4{}; |\n+|\taddress_v6::bytes_type b6{}; |\n+|\tif (ip_.is_v6()) |\n+|\t{ |\n+|\t\tb6 = ip_.to_v6().to_bytes(); |\n+|_\b\t_\b\t_\bi_\bp_\b _\b=_\b _\bb_\b6_\b._\bd_\ba_\bt_\ba_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\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-|\t\t\t\t// always have at least 1 unchoke slot |\n-|\t\t\t\tif (rate < rate_threshold) break; |\n+|\treturn ed25519_sign({str, len}, pk, sk); |\n+|} |\n | |\n-|\t\t\t\t++upload_slots; |\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-|rate_threshold += 2048; |\n-|} |\n-|\t\t\t++upload_slots; |\n-|\t\t} |\n+|item::item(entry v) |\n+|\t: m_value(std::move(v)) |\n+|{} |\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+|item::item(bdecode_node const& v) |\n+|{ |\n+|m_value = v; |\n+|} |\n | |\n-|\t\t// we use partial sort here, because we only care about the top |\n-|\t\t// upload_slots peers. |\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\tint const slots = std::min(upload_slots, int(peers.size())); |\n+|void item::assign(entry v) |\n+|{ |\n+|\tm_mutable = false; |\n+|\tm_value = std::move(v); |\n+|} |\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+|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\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/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b8_\b1_\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\b18\b81\b1 *\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+|_\bv_\bo_\bi_\bd_\b _\bi_\bt_\be_\bm_\b:_\b:_\ba_\bs_\bs_\bi_\bg_\bn_\b(_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bv_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |pick the closest node rather than the first |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpi\bic\bck\bk t\bth\bhe\be c\bcl\blo\bos\bse\bes\bst\bt n\bno\bod\bde\be r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b17\b7 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\" |\n+|\t\t\t, int(m_nodes.size())); |\n |#endif |\n-|\t\t, on_parole(false) |\n-|\t\t, banned(false) |\n-|\t\t, supports_utp(true) // assume peers support utp |\n-|\t\t, confirmed_supports_utp(false) |\n-|\t\t, supports_holepunch(false) |\n-|\t\t, web_seed(false) |\n-|\t\t, protocol_v2(false) |\n-|\t{} |\n-| |\n-|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|if (peer_rank == 0) |\n-|peer_rank = peer_priority( |\n-|\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port)) |\n-|\t\t\t\t, tcp::endpoint(this->address(), this->port)); |\n-|\t\treturn peer_rank; |\n |\t} |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\tstd::string torrent_peer::to_string() const |\n+|\tvoid dht_tracker::update_storage_node_ids() |\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\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-|#endif |\n | |\n-|\tstd::int64_t torrent_peer::total_download() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|\t\tif (connection != nullptr) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n-|\t\t\treturn connection->statistics().total_payload_download(); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\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/_\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+|\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(offset >= 0); |\n-|\t\tauto const f = m_files.file_index_at_piece(piece); |\n-| |\n-|\t\tif (m_files.pad_file_at(f)) |\n-|\t\t\treturn { set_block_hash_result::result::success, 0, 0 }; |\n-| |\n-|\t\tauto& merkle_tree = m_merkle_trees[f]; |\n-|\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f); |\n-|\t\tstd::int64_t const block_offset = static_cast(piece) * std::int64_t(m_files.piece_length()) |\n-|\t\t\t+ offset - m_files.file_offset(f); |\n-|\t\tint const block_index = aux::numeric_cast(block_offset / default_block_size); |\n-| |\n-|\t\tif (h.is_all_zeros()) |\n+|\t\tTORRENT_UNUSED(id); |\n+|\t\tfor (auto& n : m_nodes) |\n |\t\t{ |\n-|\t\t\tTORRENT_ASSERT_FAIL(); |\n-|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n+|if (n.second.dht.protocol_family_name() == family_name) |\n+|return &n.second.dht; |\n |\t\t} |\n | |\n-|aux::merkle_tree::set_block_result result; |\n-|int leafs_index; |\n-|\t\tint leafs_size; |\n-|\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h); |\n-| |\n-|\t\tif (result == aux::merkle_tree::set_block_result::unknown) |\n-|\t\t\treturn set_block_hash_result::unknown(); |\n-|\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed) |\n-|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n-| |\n-|\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed) |\n-|\t\t\t? set_block_hash_result::result::piece_hash_failed |\n-|\t\t\t: set_block_hash_result::result::success; |\n-| |\n-|\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size; |\n-| |\n-|\t\treturn { status |\n-|\t\t\t, int(leafs_index - static_cast(piece - file_first_piece) * blocks_per_piece) |\n-|\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) }; |\n+|\t\treturn nullptr; |\n |\t} |\n | |\n-|\tvoid hash_picker::hashes_rejected(hash_request const& req) |\n+|\tvoid dht_tracker::get_peers(sha1_hash const& ih |\n+|\t\t, std::function const&)> f) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0); |\n-| |\n-|\t\tfor (int i = req.index; i < req.index + req.count; i += 512) |\n-|\t\t{ |\n-|\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time(); |\n-|\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests; |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\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\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n |\t} |\n | |\n-|\tbool async_write(storage_index_t |\n-|\t\t, peer_request const& r |\n-|\t\t, char const*, std::shared_ptr |\n-|\t\t, std::function handler |\n-|\t\t, disk_job_flags_t) override |\n+|\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\tTORRENT_ASSERT(r.length <= default_block_size); |\n-|\t\tTORRENT_UNUSED(r); |\n-| |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t\treturn false; |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.announce(ih, listen_port, flags, f); |\n |\t} |\n | |\n-|\tvoid async_hash(storage_index_t |\n-|\t\t, piece_index_t piece, span, disk_job_flags_t |\n-|\t\t, std::function handler) override |\n+|\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-|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\bp_\b._\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b(_\b)_\b _\b!_\b=_\b _\b(_\bn_\b._\bf_\bi_\br_\bs_\bt_\b._\bg_\be_\bt_\b__\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b(_\b)_\b._\bi_\bs_\b__\bv_\b4_\b(_\b)_\b _\b?_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b4_\b(_\b)_\b _\b:_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b6_\b(_\b)_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bp_\bu_\bt_\b__\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b: |what if o is not an instance of put_data_observer? This need to be redesigned for better type safety. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt i\bif\bf o\bo i\bis\bs n\bno\bot\bt a\ban\bn i\bin\bns\bst\bta\ban\bnc\bce\be o\bof\bf p\bpu\but\bt_\b_d\bda\bat\bta\ba_\b_o\bob\bbs\bse\ber\brv\bve\ber\br?\b? T\bTh\bhi\bis\bs n\bne\bee\bed\bd t\bto\bo b\bbe\be r\bre\bed\bde\bes\bsi\big\bgn\bne\bed\bd f\bfo\bor\br b\bbe\bet\btt\bte\ber\br t\bty\byp\bpe\be s\bsa\baf\bfe\bet\bty\by.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/p\bpu\but\bt_\b_d\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:9\b92\b2 *\b**\b**\b* |\n+|} |\n |} |\n | |\n-|\tvoid async_hash2(storage_index_t, piece_index_t piece, int |\n-|\t\t, disk_job_flags_t |\n-|\t\t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_move_storage(storage_index_t |\n-|\t\t, std::string p, move_flags_t |\n-|\t\t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable |\n-|\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_release_files(storage_index_t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n-|\t} |\n-| |\n-|\tvoid async_delete_files(storage_index_t |\n-|\t\t, remove_flags_t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_check_files(storage_index_t |\n-|_\b\t_\b\t_\b,_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\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+|void put_data::done() |\n+|{ |\n+|\tm_done = true; |\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+|#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-|\t\tstd::shared_ptr storage = j->storage; |\n+|\tm_put_callback(m_data, num_responses()); |\n+|\ttraversal_algorithm::done(); |\n+|} |\n | |\n-|\t\tTORRENT_ASSERT(static_cast(j->action) < int(job_functions.size())); |\n+|bool put_data::invoke(observer_ptr o) |\n+|{ |\n+|\tif (m_done) return false; |\n | |\n-|\t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1); |\n+|auto* po = static_cast(o.get()); |\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+|\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\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\ta[\"salt\"] = m_data.salt(); |\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-|\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+|\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out); |\n | |\n-|add_fence_job(j); |\n+|\treturn m_node.m_rpc.invoke(e, o->target_ep(), o); |\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/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b1_\b _\b _\b _\b _\b|_\bw_\be_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\b _\bt_\bh_\be_\b _\br_\be_\bf_\bc_\bo_\bu_\bn_\bt_\be_\br_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\bh_\bi_\bl_\be_\b _\bt_\bh_\bi_\bs_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bi_\bs_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\b'_\bs_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be r\bre\bea\bal\bll\bly\by n\bne\bee\bed\bd t\bto\bo i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bt t\bth\bhe\be r\bre\bef\bfc\bco\bou\bun\bnt\bte\ber\br o\bon\bn t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhi\bil\ble\be t\bth\bhi\bis\bs b\bbu\buf\bff\bfe\ber\br i\bis\bs s\bst\bti\bil\bll\bl i\bin\bn t\bth\bhe\be p\bpe\bee\ber\br'\b's\bs s\bse\ben\bnd\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:2\b28\b81\b1 *\b**\b**\b* |\n-|int const offset = piece * 16 * 1024; |\n-|\t\t\t\tmetadata = m_tp.metadata().data() + offset; |\n-|\t\t\t\tmetadata_piece_size = std::min( |\n-|\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024); |\n-|\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0); |\n-|\t\t\t\tTORRENT_ASSERT(offset >= 0); |\n-|\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size()); |\n-|\t\t\t} |\n-| |\n-|\t\t\tchar msg[200]; |\n-|\t\t\tchar* header = msg; |\n-|\t\t\tchar* p = &msg[6]; |\n-|\t\t\tint const len = bencode(p, e); |\n-|\t\t\tint const total_size = 2 + len + metadata_piece_size; |\n-|\t\t\tnamespace io = aux; |\n-|\t\t\tio::write_uint32(total_size, header); |\n-|\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header); |\n-|\t\t\tio::write_uint8(m_message_index, header); |\n-| |\n-|\t\t\tm_pc.send_buffer({msg, len + 6}); |\n-|if (metadata_piece_size) |\n-|{ |\n-|\t\t\t\tm_pc.append_const_send_buffer( |\n-|\t\t\t\t\tspan(const_cast(metadata), metadata_piece_size), metadata_piece_size); |\n-|\t\t\t} |\n-| |\n-|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended); |\n-|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata); |\n-|\t\t} |\n-| |\n-|\t\tbool on_extended(int const length |\n-|\t\t\t, int const extended_msg, span body) override |\n-|\t\t{ |\n-|\t\t\tif (extended_msg != 2) return false; |\n-|\t\t\tif (m_message_index == 0) return false; |\n-| |\n-|\t\t\tif (length > 17 * 1024) |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\" |\n-|\t\t\t\t\t, \"packet too big %d\", length); |\n-|#endif |\n-|\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error); |\n-|\t\t\t\treturn true; |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (!m_pc.packet_finished()) return true; |\n-| |\n-|\t\t\terror_code ec; |\n-|\t\t\tbdecode_node msg = bdecode(body, ec); |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\bs_\bg_\b._\bt_\by_\bp_\be_\b(_\b)_\b _\b!_\b=_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b:_\b:_\bd_\bi_\bc_\bt_\b__\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\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 |_\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@@ -10766,226 +10978,315 @@\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/_\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/_\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_\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 |\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\b39\b9 *\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-|// 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+|\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-|// 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+|\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-|int min_distance_exp(node_id const& n1, std::vector const& ids) |\n-|{ |\n-|\tTORRENT_ASSERT(ids.size() > 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-|\tint min = 160; // see distance_exp for the why of this constant |\n-|\tfor (auto const& node_id : ids) |\n+|\ttemplate |\n+|\tvoid async_name_lookup(char const* name, Handler handler) |\n |\t{ |\n-|\t\tmin = std::min(min, distance_exp(n1, node_id)); |\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-|\treturn min; |\n-|} |\n+|private: |\n | |\n-|node_id generate_id_impl(address const& ip_, std::uint32_t r) |\n-|{ |\n-|\tstd::uint8_t* ip = nullptr; |\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-|\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+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\th(ec); |\n+|\t\t\treturn; |\n+|\t\t} |\n | |\n-|\taddress_v4::bytes_type b4{}; |\n-|\taddress_v6::bytes_type b6{}; |\n-|\tif (ip_.is_v6()) |\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/ |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+|\t// validates the hash_request, to ensure its invariant as well as matching |\n+|\t// the torrent's file_storage and the number of hashes accompanying the |\n+|\t// request |\n+|\tTORRENT_EXTRA_EXPORT |\n+|\tbool validate_hash_request(hash_request const& hr, file_storage const& fs); |\n+| |\n+|\tclass TORRENT_EXTRA_EXPORT hash_picker |\n |\t{ |\n-|\t\tb6 = ip_.to_v6().to_bytes(); |\n-|_\b\t_\b\t_\bi_\bp_\b _\b=_\b _\bb_\b6_\b._\bd_\ba_\bt_\ba_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\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+|\tpublic: |\n+|\t\thash_picker(file_storage const& files |\n+|\t\t\t, aux::vector& trees); |\n | |\n-|void put_data::done() |\n-|{ |\n-|\tm_done = true; |\n+|\t\thash_request pick_hashes(typed_bitfield const& pieces); |\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+|\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-|\tm_put_callback(m_data, num_responses()); |\n-|\ttraversal_algorithm::done(); |\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-|bool put_data::invoke(observer_ptr o) |\n-|{ |\n-|\tif (m_done) return false; |\n+|\t\tint piece_layer() const { return m_piece_layer; } |\n | |\n-|auto* po = static_cast(o.get()); |\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-|\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\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/ |we could bind the socket here, since we know what the target endpoint is of the proxy |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd b\bbi\bin\bnd\bd t\bth\bhe\be s\bso\boc\bck\bke\bet\bt h\bhe\ber\bre\be,\b, s\bsi\bin\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bha\bat\bt t\bth\bhe\be t\bta\bar\brg\bge\bet\bt e\ben\bnd\bdp\bpo\boi\bin\bnt\bt i\bis\bs o\bof\bf t\bth\bhe\be p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b19\b97\b7 *\b**\b**\b* |\n+|}, std::move(handler))); |\n+|\t} |\n+| |\n+|private: |\n+| |\n+|\ttemplate |\n+|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n+|\t\t, Handler h) |\n |\t{ |\n-|\t\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\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n+| |\n+|\t\tauto i = ips.begin(); |\n+|\t\tif (!m_sock.is_open()) |\n |\t\t{ |\n-|\t\t\ta[\"salt\"] = m_data.salt(); |\n+|\t\t\terror_code ec; |\n+|\t\t\tm_sock.open(i->endpoint().protocol(), ec); |\n+|\t\t\tif (handle_error(ec, std::move(h))) return; |\n |\t\t} |\n+| |\n+|ADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\"); |\n+|m_sock.async_connect(i->endpoint(), wrap_allocator( |\n+|\t\t\t[this](error_code const& ec, Handler hn) |\n+|\t\t\t{ connected(ec, std::move(hn)); }, std::move(h))); |\n |\t} |\n | |\n-|\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out); |\n+|\ttemplate |\n+|\tvoid connected(error_code const& e, Handler h) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n+| |\n+|\t\tusing namespace libtorrent::aux; |\n+|\t\tif (m_version == 5) |\n+|\t\t{ |\n+|\t\t\t// send SOCKS5 authentication methods |\n+|\t\t\tm_buffer.resize(m_user.empty()?3:4); |\n+|\t\t\tchar* p = &m_buffer[0]; |\n+|\t\t\twrite_uint8(5, p); // SOCKS VERSION 5 |\n+|\t\t\tif (m_user.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth) |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(2, p); // 2 authentication methods |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t\twrite_uint8(2, p); // username/password |\n+|\t\t\t} |\n+|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b:_\b:_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b1_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move to aux |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bto\bo a\bau\bux\bx *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be.\b.h\bhp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n+|namespace libtorrent { |\n+| |\n+|// A type describing kinds of sockets involved in various operations or events. |\n+|enum class socket_type_t : std::uint8_t { |\n+|\ttcp, |\n+|\tsocks5, |\n+|\thttp, |\n+|\tutp, |\n+|\ti2p, |\n+|\ttcp_ssl, |\n+|\tsocks5_ssl, |\n+|\thttp_ssl, |\n+|\tutp_ssl, |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|\tudp TORRENT_DEPRECATED_ENUM = utp, |\n+|#endif |\n+|}; |\n+| |\n+|// return a short human readable name for types of socket |\n+|char const* socket_type_name(socket_type_t); |\n | |\n-|\treturn m_node.m_rpc.invoke(e, o->target_ep(), o); |\n |} |\n | |\n-|_\b}_\b _\b}_\b _\b/_\b/_\b _\bn_\ba_\bm_\be_\bs_\bp_\ba_\bc_\be_\b _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bd_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\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+|_\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/ |change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bth\bhe\be t\bty\byp\bpe\be t\bto\bo s\bst\btd\bd:\b::\b:s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\br i\bin\bn C\bC+\b++\b+1\b17\b7 i\bit\bt i\bis\bs u\bus\bse\bed\bd a\bas\bs i\bif\bf i\bim\bmm\bmu\but\bta\bab\bbl\ble\be,\b, i\bit\bt c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bco\bon\bns\bst\bt f\bfo\bor\br t\bte\bec\bch\bhn\bni\bic\bca\bal\bl r\bre\bea\bas\bso\bon\bns\bs r\bri\big\bgh\bht\bt n\bno\bow\bw.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.h\bhp\bpp\bp:\b:7\b72\b29\b9 *\b**\b**\b* |\n+|\t\t// these are the collections from outside of the info-dict. These are |\n+|\t\t// owning strings, since we only keep the info-section around, these |\n+|\t\t// cannot be pointers into that buffer. |\n+|\t\tstd::vector m_owned_collections; |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|\t\t// if this is a merkle torrent, this is the merkle |\n+|\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces)) |\n+|\t\t// hashes |\n+|\t\taux::vector m_merkle_tree; |\n |#endif |\n-|\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+|\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-|\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+|\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\treturn nullptr; |\n-|\t} |\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-|\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+|\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-|\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+|\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-|\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\t// if a creation date is found in the torrent file |\n+|\t\t// this will be set to that, otherwise it'll be |\n+|\t\t// 1970, Jan 1 |\n+|\t\tstd::time_t m_creation_date = 0; |\n+| |\n+|\t\t// the hash(es) that identify this torrent |\n+|\t\tinfo_hash_t m_info_hash; |\n+| |\n+|\t\t// this is the offset into the m_info_section buffer to the first byte of |\n+|\t\t// the first SHA-1 hash |\n+|\t\tstd::int32_t m_piece_hashes = 0; |\n+| |\n+|\t\t// the number of bytes in m_info_section |\n+|\t\tstd::int32_t m_info_section_size = 0; |\n+| |\n+|\t\t// this is used when creating a torrent. If there's |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\be_\b _\bf_\bi_\bl_\be_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bc_\ba_\bs_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bm_\bp_\bo_\bs_\bs_\bi_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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\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+|\t\t// internal |\n+|\t\tTORRENT_UNEXPORT announce_infohash(); |\n | |\n-|\treturn ed25519_sign({str, len}, pk, sk); |\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-|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+|\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-|item::item(entry v) |\n-|\t: m_value(std::move(v)) |\n-|{} |\n+|\t\t// the time of next tracker announce |\n+|\t\ttime_point32 next_announce = (time_point32::min)(); |\n | |\n-|item::item(bdecode_node const& v) |\n-|{ |\n-|m_value = v; |\n-|} |\n+|\t\t// no announces before this time |\n+|\t\ttime_point32 min_announce = (time_point32::min)(); |\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+|// 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-|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+|\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-|_\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+|\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@@ -11251,68 +11552,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/ |change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now. |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bth\bhe\be t\bty\byp\bpe\be t\bto\bo s\bst\btd\bd:\b::\b:s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\br i\bin\bn C\bC+\b++\b+1\b17\b7 i\bit\bt i\bis\bs u\bus\bse\bed\bd a\bas\bs i\bif\bf i\bim\bmm\bmu\but\bta\bab\bbl\ble\be,\b, i\bit\bt c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bco\bon\bns\bst\bt f\bfo\bor\br t\bte\bec\bch\bhn\bni\bic\bca\bal\bl r\bre\bea\bas\bso\bon\bns\bs r\bri\big\bgh\bht\bt n\bno\bow\bw.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.h\bhp\bpp\bp:\b:7\b72\b29\b9 *\b**\b**\b* |\n-|\t\t// these are the collections from outside of the info-dict. These are |\n-|\t\t// owning strings, since we only keep the info-section around, these |\n-|\t\t// cannot be pointers into that buffer. |\n-|\t\tstd::vector m_owned_collections; |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\t\t// if this is a merkle torrent, this is the merkle |\n-|\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces)) |\n-|\t\t// hashes |\n-|\t\taux::vector m_merkle_tree; |\n-|#endif |\n-| |\n-|\t\t// v2 merkle tree for each file |\n-|\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size()) |\n-|\t\taux::vector, file_index_t> m_piece_layers; |\n-| |\n-|\t\t// this is a copy of the info section from the torrent. |\n-|\t\t// it use maintained in this flat format in order to |\n-|\t\t// make it available through the metadata extension |\n-|boost::shared_array m_info_section; |\n-| |\n-|\t\t// if a comment is found in the torrent file |\n-|\t\t// this will be set to that comment |\n-|\t\tstd::string m_comment; |\n-| |\n-|\t\t// an optional string naming the software used |\n-|\t\t// to create the torrent file |\n-|\t\tstd::string m_created_by; |\n-| |\n-|\t\t// the info section parsed. points into m_info_section |\n-|\t\t// parsed lazily |\n-|\t\tmutable bdecode_node m_info_dict; |\n-| |\n-|\t\t// if a creation date is found in the torrent file |\n-|\t\t// this will be set to that, otherwise it'll be |\n-|\t\t// 1970, Jan 1 |\n-|\t\tstd::time_t m_creation_date = 0; |\n-| |\n-|\t\t// the hash(es) that identify this torrent |\n-|\t\tinfo_hash_t m_info_hash; |\n-| |\n-|\t\t// this is the offset into the m_info_section buffer to the first byte of |\n-|\t\t// the first SHA-1 hash |\n-|\t\tstd::int32_t m_piece_hashes = 0; |\n-| |\n-|\t\t// the number of bytes in m_info_section |\n-|\t\tstd::int32_t m_info_section_size = 0; |\n-| |\n-|\t\t// this is used when creating a torrent. If there's |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\be_\b _\bf_\bi_\bl_\be_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bc_\ba_\bs_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bm_\bp_\bo_\bs_\bs_\bi_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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_\b0_\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\b20\b07\b7 *\b**\b**\b* |\n |\tvoid cancel() |\n |\t{ |\n |\t\tm_sock.cancel(); |\n@@ -11359,54 +11606,14 @@\n | |\n |\tvoid close(error_code& ec) |\n |\t{ |\n |\t\tm_remote_endpoint = endpoint_type(); |\n |\t\tm_sock.close(ec); |\n |\t\tm_resolver.cancel(); |\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/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |some space could be saved here by making gauges 32 bits |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bso\bom\bme\be s\bsp\bpa\bac\bce\be c\bco\bou\bul\bld\bd b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be b\bby\by m\bma\bak\bki\bin\bng\bg g\bga\bau\bug\bge\bes\bs 3\b32\b2 b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bi\bi_\bn\bn_\bc\bc_\bl\bl_\bu\bu_\bd\bd_\be\be_\b/\b/_\bl\bl_\bi\bi_\bb\bb_\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bh\bh_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b8\b8_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b6_\b _\b _\b|_\bp_\bo_\bi_\bn_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bes\bst\bto\bor\bre\be t\bth\bhe\bes\bse\be t\bto\bo r\bre\beg\bgu\bul\bla\bar\br i\bin\bnt\bte\beg\bge\ber\brs\bs.\b. I\bIn\bns\bst\bte\bea\bad\bd h\bha\bav\bve\be o\bon\bne\be c\bco\bop\bpy\by o\bof\bf t\bth\bhe\be c\bco\bou\bun\bnt\bte\ber\brs\bs p\bpe\ber\br t\bth\bhr\bre\bea\bad\bd a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\bem\bm a\bat\bt c\bco\bon\bnv\bve\ben\bni\bie\ben\bnt\bt s\bsy\byn\bnc\bch\bhr\bro\bon\bni\biz\bza\bat\bti\bio\bon\bn p\bpo\boi\bin\bnt\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.h\bhp\bpp\bp:\b:4\b48\b86\b6 *\b**\b**\b* |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|#define TORRENT_COUNTER_NOEXCEPT noexcept |\n-|#else |\n-|#define TORRENT_COUNTER_NOEXCEPT |\n-|#endif |\n-| |\n-|\t\tcounters() TORRENT_COUNTER_NOEXCEPT; |\n-| |\n-|\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT; |\n-| |\n-|\t\t// returns the new value |\n-|\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT; |\n-| |\n-|\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT; |\n-| |\n-|\tprivate: |\n-| |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|aux::array, num_counters> m_stats_counter; |\n-|#else |\n-|\t\t// if the atomic type isn't lock-free, use a single lock instead, for |\n-|\t\t// the whole array |\n-|\t\tmutable std::mutex m_mutex; |\n-|\t\taux::array m_stats_counter; |\n-|#endif |\n-|\t}; |\n-|} |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | |_\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@@ -11454,121 +11661,14 @@\n |\t\tvirtual stat const& statistics() const = 0; |\n |\t\tvirtual void get_peer_info(peer_info& p) const = 0; |\n |#ifndef TORRENT_DISABLE_LOGGING |\n |\t\tvirtual bool should_log(peer_log_alert::direction_t direction) const = 0; |\n |\t\tvirtual void peer_log(peer_log_alert::direction_t direction |\n |\t\t\t, char const* event, char const* fmt = \"\", ...) const noexcept TORRENT_FORMAT(4,5) = 0; |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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_\b0_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\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\b80\b02\b2 *\b**\b**\b* |\n-|// download list it may live in now |\n-|\t\tstd::vector::iterator update_piece_state( |\n-|\t\t\tstd::vector::iterator dp); |\n-| |\n-|\tprivate: |\n-| |\n-|#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tindex_range categories() const |\n-|\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; } |\n-|#endif |\n-| |\n-|\t\t// the following vectors are mutable because they sometimes may |\n-|\t\t// be updated lazily, triggered by const functions |\n-| |\n-|\t\t// this maps indices to number of peers that has this piece and |\n-|\t\t// index into the m_piece_info vectors. |\n-|\t\t// piece_pos::we_have_index means that we have the piece, so it |\n-|\t\t// doesn't exist in the piece_info buckets |\n-|\t\t// pieces with the filtered flag set doesn't have entries in |\n-|\t\t// the m_piece_info buckets either |\n-|mutable aux::vector m_piece_map; |\n-| |\n-|\t\t// tracks the number of bytes in a specific piece that are part of a pad |\n-|\t\t// file. The padding is assumed to be at the end of the piece, and the |\n-|\t\t// blocks covered by the pad bytes are not picked by the piece picker |\n-|\t\tstd::unordered_map m_pads_in_piece; |\n-| |\n-|\t\t// when the adjacent_piece affinity is enabled, this contains the most |\n-|\t\t// recent \"extents\" of adjacent pieces that have been requested from |\n-|\t\t// this is mutable because it's updated by functions to pick pieces, which |\n-|\t\t// are const. That's an efficient place to update it, since it's being |\n-|\t\t// traversed already. |\n-|\t\tmutable std::vector m_recent_extents; |\n-| |\n-|\t\t// the number of bytes of pad file set in this piece picker |\n-|\t\tint m_num_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks that we already have |\n-|\t\tint m_have_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks part of filtered pieces we don't have |\n-|\t\tint m_filtered_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks we have that are also filtered |\n-|\t\tint m_have_filtered_pad_bytes = 0; |\n-| |\n-|\t\t// the number of seeds. These are not added to |\n-|\t\t// the availability counters of the pieces |\n-|\t\tint m_seeds = 0; |\n-| |\n-|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\bh_\ba_\bv_\be_\b _\bp_\ba_\bs_\bs_\be_\bd_\b _\bt_\bh_\be_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b7_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\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\b87\b77\b7 *\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 + flushed). |\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/ |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@@ -11616,288 +11716,54 @@\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/ |we could bind the socket here, since we know what the target endpoint is of the proxy |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd b\bbi\bin\bnd\bd t\bth\bhe\be s\bso\boc\bck\bke\bet\bt h\bhe\ber\bre\be,\b, s\bsi\bin\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bha\bat\bt t\bth\bhe\be t\bta\bar\brg\bge\bet\bt e\ben\bnd\bdp\bpo\boi\bin\bnt\bt i\bis\bs o\bof\bf t\bth\bhe\be p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b19\b97\b7 *\b**\b**\b* |\n-|}, std::move(handler))); |\n-|\t} |\n-| |\n-|private: |\n-| |\n-|\ttemplate |\n-|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n-|\t\t, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\"); |\n-|\t\tif (handle_error(e, std::move(h))) return; |\n-| |\n-|\t\tauto i = ips.begin(); |\n-|\t\tif (!m_sock.is_open()) |\n-|\t\t{ |\n-|\t\t\terror_code ec; |\n-|\t\t\tm_sock.open(i->endpoint().protocol(), ec); |\n-|\t\t\tif (handle_error(ec, std::move(h))) return; |\n-|\t\t} |\n-| |\n-|ADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\"); |\n-|m_sock.async_connect(i->endpoint(), wrap_allocator( |\n-|\t\t\t[this](error_code const& ec, Handler hn) |\n-|\t\t\t{ connected(ec, std::move(hn)); }, std::move(h))); |\n-|\t} |\n-| |\n-|\ttemplate |\n-|\tvoid connected(error_code const& e, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\"); |\n-|\t\tif (handle_error(e, std::move(h))) return; |\n-| |\n-|\t\tusing namespace libtorrent::aux; |\n-|\t\tif (m_version == 5) |\n-|\t\t{ |\n-|\t\t\t// send SOCKS5 authentication methods |\n-|\t\t\tm_buffer.resize(m_user.empty()?3:4); |\n-|\t\t\tchar* p = &m_buffer[0]; |\n-|\t\t\twrite_uint8(5, p); // SOCKS VERSION 5 |\n-|\t\t\tif (m_user.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth) |\n-|\t\t\t\twrite_uint8(0, p); // no authentication |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\twrite_uint8(2, p); // 2 authentication methods |\n-|\t\t\t\twrite_uint8(0, p); // no authentication |\n-|\t\t\t\twrite_uint8(2, p); // username/password |\n-|\t\t\t} |\n-|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b:_\b:_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b1_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |replace this by the standard string_view in C++17 |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b._\bh_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by t\bth\bhe\be s\bst\bta\ban\bnd\bda\bar\brd\bd s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw.\b.h\bhp\bpp\bp:\b:4\b40\b0 *\b**\b**\b* |\n-|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n-|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED |\n-|#define TORRENT_STRING_VIEW_HPP_INCLUDED |\n-| |\n-|#include |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-| |\n-| |\n-|#if BOOST_VERSION < 106100 |\n-|#include |\n-|#include // for strchr |\n-|namespace libtorrent { |\n-| |\n-|using string_view = boost::string_ref; |\n-|using wstring_view = boost::wstring_ref; |\n-| |\n-|// internal |\n-|inline string_view::size_type find_first_of(string_view const v, char const c |\n-|\t, string_view::size_type pos) |\n-|{ |\n-|\twhile (pos < v.size()) |\n-|\t{ |\n-|\t\tif (v[pos] == c) return pos; |\n-|\t\t++pos; |\n-|\t} |\n-|\treturn string_view::npos; |\n-|} |\n-| |\n-|// internal |\n-|inline string_view::size_type find_first_of(string_view const v, char const* c |\n-|\t, string_view::size_type pos) |\n-|{ |\n-|\twhile (pos < v.size()) |\n-|\t{ |\n-|\t\tif (std::strchr(c, v[pos]) != nullptr) return pos; |\n-|\t\t++pos; |\n-|\t} |\n-|_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b:_\b:_\bn_\bp_\bo_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |hide this declaration when deprecated functions are disabled, and remove its internal use |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bd_\be_\bn_\bt_\bi_\bf_\by_\b__\bc_\bl_\bi_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* h\bhi\bid\bde\be t\bth\bhi\bis\bs d\bde\bec\bcl\bla\bar\bra\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs a\bar\bre\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd,\b, a\ban\bnd\bd r\bre\bem\bmo\bov\bve\be i\bit\bts\bs i\bin\bnt\bte\ber\brn\bna\bal\bl u\bus\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bid\bde\ben\bnt\bti\bif\bfy\by_\b_c\bcl\bli\bie\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:4\b48\b8 *\b**\b**\b* |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\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+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |some space could be saved here by making gauges 32 bits |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bso\bom\bme\be s\bsp\bpa\bac\bce\be c\bco\bou\bul\bld\bd b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be b\bby\by m\bma\bak\bki\bin\bng\bg g\bga\bau\bug\bge\bes\bs 3\b32\b2 b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bi\bi_\bn\bn_\bc\bc_\bl\bl_\bu\bu_\bd\bd_\be\be_\b/\b/_\bl\bl_\bi\bi_\bb\bb_\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bh\bh_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b8\b8_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b6_\b _\b _\b|_\bp_\bo_\bi_\bn_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bes\bst\bto\bor\bre\be t\bth\bhe\bes\bse\be t\bto\bo r\bre\beg\bgu\bul\bla\bar\br i\bin\bnt\bte\beg\bge\ber\brs\bs.\b. I\bIn\bns\bst\bte\bea\bad\bd h\bha\bav\bve\be o\bon\bne\be c\bco\bop\bpy\by o\bof\bf t\bth\bhe\be c\bco\bou\bun\bnt\bte\ber\brs\bs p\bpe\ber\br t\bth\bhr\bre\bea\bad\bd a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\bem\bm a\bat\bt c\bco\bon\bnv\bve\ben\bni\bie\ben\bnt\bt s\bsy\byn\bnc\bch\bhr\bro\bon\bni\biz\bza\bat\bti\bio\bon\bn p\bpo\boi\bin\bnt\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.h\bhp\bpp\bp:\b:4\b48\b86\b6 *\b**\b**\b* |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|#define TORRENT_COUNTER_NOEXCEPT noexcept |\n+|#else |\n+|#define TORRENT_COUNTER_NOEXCEPT |\n |#endif |\n | |\n-|#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/ |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_\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 |\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\b39\b9 *\b**\b**\b* |\n-|\t\tchar tmp[20]; |\n-|\t\taux::random_bytes(tmp); |\n-|\t\tm_session_id.resize(sizeof(tmp)*2); |\n-|\t\taux::to_hex(tmp, &m_session_id[0]); |\n-| |\n-|\t\tm_sam_socket = std::make_shared(m_io_service); |\n-|\t\tm_sam_socket->set_proxy(m_hostname, m_port); |\n-|\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session); |\n-|\t\tm_sam_socket->set_session_id(m_session_id.c_str()); |\n-|\t\tm_sam_socket->set_session_options(session_options); |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\"); |\n-|\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator( |\n-|\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) { |\n-|\t\t\t\ton_sam_connect(ec, s, std::move(hn)); |\n-|\t\t\t}, std::move(handler))); |\n-|\t} |\n-|\tvoid close(error_code&); |\n-| |\n-|char const* session_id() const { return m_session_id.c_str(); } |\n-|std::string const& local_endpoint() const { return m_i2p_local_endpoint; } |\n-| |\n-|\ttemplate |\n-|\tvoid async_name_lookup(char const* name, Handler handler) |\n-|\t{ |\n-|\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open()) |\n-|\t\t\tdo_name_lookup(name, std::move(handler)); |\n-|\t\telse |\n-|\t\t\tm_name_lookup.emplace_back(std::string(name) |\n-|\t\t\t\t, std::move(handler)); |\n-|\t} |\n-| |\n-|private: |\n-| |\n-|\ttemplate |\n-|\tvoid on_sam_connect(error_code const& ec, std::shared_ptr, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\"); |\n-|\t\tm_state = sam_idle; |\n-| |\n-|\t\tif (ec) |\n-|\t\t{ |\n-|\t\t\th(ec); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tdo_name_lookup(\"ME\", wrap_allocator( |\n-|\t\t\t[this](error_code const& e, char const* dst, Handler hn) { |\n-|\t\t\t\tset_local_endpoint(e, dst, std::move(hn)); |\n-|_\b\t_\b\t_\b\t_\b}_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bo_\bv_\be_\b(_\bh_\b)_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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-|\t// validates the hash_request, to ensure its invariant as well as matching |\n-|\t// the torrent's file_storage and the number of hashes accompanying the |\n-|\t// request |\n-|\tTORRENT_EXTRA_EXPORT |\n-|\tbool validate_hash_request(hash_request const& hr, file_storage const& fs); |\n-| |\n-|\tclass TORRENT_EXTRA_EXPORT hash_picker |\n-|\t{ |\n-|\tpublic: |\n-|\t\thash_picker(file_storage const& files |\n-|\t\t\t, aux::vector& trees); |\n-| |\n-|\t\thash_request pick_hashes(typed_bitfield const& pieces); |\n+|\t\tcounters() TORRENT_COUNTER_NOEXCEPT; |\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+|\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT; |\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+|\t\t// returns the new value |\n+|\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT; |\n | |\n-|\t\tint piece_layer() const { return m_piece_layer; } |\n+|\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT; |\n | |\n |\tprivate: |\n-|\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+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|aux::array, num_counters> m_stats_counter; |\n+|#else |\n+|\t\t// if the atomic type isn't lock-free, use a single lock instead, for |\n+|\t\t// the whole array |\n+|\t\tmutable std::mutex m_mutex; |\n+|\t\taux::array m_stats_counter; |\n+|#endif |\n+|\t}; |\n+|} |\n | |\n-|\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#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a raw pointer (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@@ -11999,152 +11865,231 @@\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/ |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+|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-|// 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 | |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tudp TORRENT_DEPRECATED_ENUM = utp, |\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 | |\n-|// return a short human readable name for types of socket |\n-|char const* socket_type_name(socket_type_t); |\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-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |include the number of peers received from this tracker, at last announce |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b76\b6 *\b**\b**\b* |\n-|\tstruct TORRENT_EXPORT announce_infohash |\n+|\t// 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/ |replace this by the standard string_view in C++17 |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b._\bh_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by t\bth\bhe\be s\bst\bta\ban\bnd\bda\bar\brd\bd s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw.\b.h\bhp\bpp\bp:\b:4\b40\b0 *\b**\b**\b* |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n+| |\n+|*/ |\n+| |\n+|#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED |\n+|#define TORRENT_STRING_VIEW_HPP_INCLUDED |\n+| |\n+|#include |\n+| |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+| |\n+| |\n+|#if BOOST_VERSION < 106100 |\n+|#include |\n+|#include // for strchr |\n+|namespace libtorrent { |\n+| |\n+|using string_view = boost::string_ref; |\n+|using wstring_view = boost::wstring_ref; |\n+| |\n+|// internal |\n+|inline string_view::size_type find_first_of(string_view const v, char const c |\n+|\t, string_view::size_type pos) |\n+|{ |\n+|\twhile (pos < v.size()) |\n |\t{ |\n-|\t\t// internal |\n-|\t\tTORRENT_UNEXPORT announce_infohash(); |\n+|\t\tif (v[pos] == c) return pos; |\n+|\t\t++pos; |\n+|\t} |\n+|\treturn string_view::npos; |\n+|} |\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+|// internal |\n+|inline string_view::size_type find_first_of(string_view const v, char const* c |\n+|\t, string_view::size_type pos) |\n+|{ |\n+|\twhile (pos < v.size()) |\n+|\t{ |\n+|\t\tif (std::strchr(c, v[pos]) != nullptr) return pos; |\n+|\t\t++pos; |\n+|\t} |\n+|_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b:_\b:_\bn_\bp_\bo_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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_\b0_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\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\b80\b02\b2 *\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\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+|\tprivate: |\n | |\n-|\t\t// the time of next tracker announce |\n-|\t\ttime_point32 next_announce = (time_point32::min)(); |\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// no announces before this time |\n-|\t\ttime_point32 min_announce = (time_point32::min)(); |\n+|\t\t// the following vectors are mutable because they sometimes may |\n+|\t\t// be updated lazily, triggered by const functions |\n | |\n+|\t\t// this maps indices to number of peers that has this piece and |\n+|\t\t// index into the m_piece_info vectors. |\n+|\t\t// piece_pos::we_have_index means that we have the piece, so it |\n+|\t\t// doesn't exist in the piece_info buckets |\n+|\t\t// pieces with the filtered flag set doesn't have entries in |\n+|\t\t// the m_piece_info buckets either |\n+|mutable aux::vector m_piece_map; |\n | |\n-|// these are either -1 or the scrape information this tracker last |\n-|\t\t// responded with. *incomplete* is the current number of downloaders in |\n-|\t\t// the swarm, *complete* is the current number of seeds in the swarm and |\n-|\t\t// *downloaded* is the cumulative number of completed downloads of this |\n-|\t\t// torrent, since the beginning of time (from this tracker's point of |\n-|\t\t// view). |\n+|\t\t// 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// if this tracker has returned scrape data, these fields are filled in |\n-|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n-|\t\t// the number of current downloaders. ``complete`` counts the number of |\n-|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n-|\t\t// cumulative number of completed downloads. |\n-|\t\tint scrape_incomplete = -1; |\n-|\t\tint scrape_complete = -1; |\n-|\t\tint scrape_downloaded = -1; |\n+|\t\t// when the adjacent_piece affinity is enabled, this contains the most |\n+|\t\t// recent \"extents\" of adjacent pieces that have been requested from |\n+|\t\t// this is mutable because it's updated by functions to pick pieces, which |\n+|\t\t// are const. That's an efficient place to update it, since it's being |\n+|\t\t// traversed already. |\n+|\t\tmutable std::vector m_recent_extents; |\n | |\n-|\t\t// the number of times in a row we have failed to announce to this |\n-|\t\t// tracker. |\n-|\t\tstd::uint8_t fails : 7; |\n+|\t\t// the number of bytes of pad file set in this piece picker |\n+|\t\tint m_num_pad_bytes = 0; |\n | |\n-|\t\t// true while we're waiting for a response from the tracker. |\n-|\t\tbool updating : 1; |\n+|\t\t// the number of pad blocks that we already have |\n+|\t\tint m_have_pad_bytes = 0; |\n | |\n-|\t\t// set to true when we get a valid response from an announce |\n-|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n-|\t\t// announces. |\n-|\t\tbool start_sent : 1; |\n+|\t\t// the number of pad blocks part of filtered pieces we don't have |\n+|\t\tint m_filtered_pad_bytes = 0; |\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/ |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+|\t\t// the number of pad blocks we have that are also filtered |\n+|\t\tint m_have_filtered_pad_bytes = 0; |\n | |\n-|namespace libtorrent { |\n-|namespace dht { |\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-|// calculate the target hash for an immutable item. |\n-|TORRENT_EXTRA_EXPORT sha1_hash item_target_id(span v); |\n+|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\bh_\ba_\bv_\be_\b _\bp_\ba_\bs_\bs_\be_\bd_\b _\bt_\bh_\be_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b7_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\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\b87\b77\b7 *\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-|// calculate the target hash for a mutable item. |\n-|TORRENT_EXTRA_EXPORT sha1_hash item_target_id(span salt |\n-|\t, public_key const& pk); |\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-|TORRENT_EXTRA_EXPORT bool verify_mutable_item( |\n-|\tspan v |\n-|\t, span salt |\n-|\t, sequence_number seq |\n-|\t, public_key const& pk |\n-|\t, signature const& sig); |\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-|// given a byte range ``v`` and an optional byte range ``salt``, a |\n-|// sequence number, public key ``pk`` (must be 32 bytes) and a secret key |\n-|// ``sk`` (must be 64 bytes), this function produces a signature which |\n-|// is written into a 64 byte buffer pointed to by ``sig``. The caller |\n-|// is responsible for allocating the destination buffer that's passed in |\n-|// as the ``sig`` argument. Typically it would be allocated on the stack. |\n-|TORRENT_EXPORT signature sign_mutable_item( |\n-|\tspan v |\n-|\t, span salt |\n-|\t, sequence_number seq |\n-|\t, public_key const& pk |\n-|\t, secret_key const& sk); |\n+|\t\t// the number of pieces we have that also are filtered |\n+|\t\tint m_num_have_filtered = 0; |\n | |\n-|class TORRENT_EXTRA_EXPORT item |\n-|{ |\n-|public: |\n-|\titem() {} |\n-|\titem(public_key const& pk, span salt); |\n-|\texplicit item(entry v); |\n-|\titem(entry v |\n-|\t\t, span salt |\n-|\t\t, sequence_number seq |\n-|\t\t, public_key const& pk |\n-|\t\t, secret_key const& sk); |\n-|\texplicit item(bdecode_node const& v); |\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-|\tvoid assign(entry v); |\n-|\tvoid assign(entry v, span salt |\n-|\t\t, sequence_number seq |\n-|_\b\t_\b\t_\b,_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bp_\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+|\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 + flushed). |\n+|\t\t// This includes pieces that we have filtered but still have |\n+|\t\tint m_num_have = 0; |\n+| |\n+|\t\t// if this is set to true, it means update_pieces() |\n+|\t\t// has to be called before accessing m_pieces. |\n+|\t\tmutable bool m_dirty = false; |\n+|\tpublic: |\n+| |\n+|\t\tenum { max_pieces = (std::numeric_limits::max)() - 1 }; |\n+| |\n+|\t}; |\n+|} |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bP_\bI_\bE_\bC_\bE_\b__\bP_\bI_\bC_\bK_\bE_\bR_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move this to its own .hpp/.cpp pair? |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bm_\bs_\bg_\b._\bh_\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 |\n |*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhi\bis\bs t\bto\bo i\bit\bts\bs o\bow\bwn\bn .\b.h\bhp\bpp\bp/\b/.\b.c\bcp\bpp\bp p\bpa\bai\bir\br?\b? *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/m\bms\bsg\bg.\b.h\bhp\bpp\bp:\b:8\b87\b7 *\b**\b**\b* |\n |int flags; |\n | |\n |\tenum { |\n@@ -12177,231 +12122,108 @@\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/ |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-|// 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-|// a magnet link for a torrent that we already have files for. Once we have the |\n-|// metadata, we have files on disk but no hashes. We won't know whether the data |\n-|// on disk is valid or not, until we've downloaded the hashes to validate them. |\n-| |\n-|// Idea for future space optimization: |\n-|// while downloading, we need to store interior nodes of this tree. However, we |\n-|// don't need to store the padding. a SHA-256 is 32 bytes. Instead of storing |\n-|// the full (padded) tree of SHA-256 hashes, store the full tree of 32 bit |\n-|// signed integers, being indices into the actual storage for the tree. We could |\n-|// even grow the storage lazily. Instead of storing the padding hashes, use |\n-|// negative indices to refer to fixed SHA-256(0), and SHA-256(SHA-256(0)) and so |\n-|// on |\n-|struct TORRENT_EXTRA_EXPORT merkle_tree |\n-|{ |\n-|merkle_tree() = default; |\n-|merkle_tree(int num_blocks, int blocks_per_piece, char const* r); |\n-| |\n-|\tsha256_hash root() const; |\n-| |\n-|\tvoid load_tree(span t, std::vector const& verified); |\n-|\tvoid load_sparse_tree(span t, std::vector const& mask |\n-|\t\t, std::vector const& verified); |\n-|\tvoid load_verified_bits(std::vector const& verified); |\n-| |\n-|\tstd::size_t size() const; |\n-|\tint end_index() const { return int(size()); } |\n-| |\n-|\tbool has_node(int idx) const; |\n-| |\n-|\tbool compare_node(int idx, sha256_hash const& h) const; |\n-| |\n-|\tsha256_hash operator[](int idx) const; |\n-| |\n-|\tstd::vector build_vector() const; |\n-|\tstd::pair, aux::vector> build_sparse_vector() const; |\n-| |\n-|\t// get bits indicating if each leaf hash is verified |\n-|\tstd::vector verified_leafs() const; |\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-|_\b\t_\bb_\bo_\bo_\bl_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b(_\bi_\bn_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bd_\bx_\b,_\b _\bi_\bn_\bt_\b _\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b)_\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 |\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 this a std::unique_ptr |\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:_\b1_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b]_\b>_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba s\bst\btd\bd:\b::\b:u\bun\bni\biq\bqu\bue\be_\b_p\bpt\btr\br]\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/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:1\b17\b75\b5 *\b**\b**\b* |\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-|\tint num_pieces() const; |\n-|\tint num_leafs() const; |\n-| |\n-|\tvoid optimize_storage(); |\n-|\tvoid optimize_storage_piece_layer(); |\n-|\tvoid allocate_full(); |\n-| |\n-|\t// a pointer to the root hash for this file. |\n-|\tchar const* m_root = nullptr; |\n-| |\n-|\t// this is either the full tree, or some sparse representation of it, |\n-|\t// depending on m_mode |\n-|aux::vector m_tree; |\n-| |\n-|\t// when the full tree is allocated, this has one bit for each block hash. a |\n-|\t// 1 means we have verified the block hash to be correct, otherwise the block |\n-|\t// hash may represent what's on disk, but we haven't been able to verify it |\n-|\t// yet |\n-|\tbitfield m_block_verified; |\n-| |\n-|\t// number of blocks in the file this tree represents. The number of leafs in |\n-|\t// the tree is rounded up to an even power of 2. |\n-|\tint m_num_blocks = 0; |\n-| |\n-|\t// the number of blocks per piece, specified as how many steps to shift |\n-|\t// right 1 to get the number of blocks in one piece. This is a compact |\n-|\t// representation that's valid because pieces are always powers of 2. |\n-|\t// this is necessary to know which layer in the tree the piece layer is. |\n-|\tstd::uint8_t m_blocks_per_piece_log = 0; |\n-| |\n-|\tenum class mode_t : std::uint8_t |\n-|\t{ |\n-|\t\t// a default constructed tree is truly empty. It does not even have a |\n-|\t\t// root hash |\n-|\t\tuninitialized_tree, |\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/ |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_\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 |\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\b17\b7 *\b**\b**\b* |\n-|\tprivate: |\n-| |\n-|\t\tHandler handler; |\n-|\t\thandler_storage* storage; |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\t\terror_handler_interface* error_handler; |\n-|#endif |\n-|\t}; |\n+|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-|\ttemplate |\n-|\taux::allocating_handler |\n-|\tmake_handler(Handler handler |\n-|\t\t, handler_storage& storage |\n-|\t\t, error_handler_interface& err_handler) |\n-|\t{ |\n-|\t\treturn aux::allocating_handler( |\n-|\t\t\tstd::forward(handler), &storage, &err_handler); |\n-|\t} |\n+|namespace libtorrent { |\n+|namespace dht { |\n | |\n-|template |\n-|\tstruct handler |\n-|\t{ |\n-|\t\texplicit handler(std::shared_ptr p) : ptr_(std::move(p)) {} |\n+|// calculate the target hash for an immutable item. |\n+|TORRENT_EXTRA_EXPORT sha1_hash item_target_id(span v); |\n | |\n-|\t\tstd::shared_ptr ptr_; |\n+|// calculate the target hash for a mutable item. |\n+|TORRENT_EXTRA_EXPORT sha1_hash item_target_id(span salt |\n+|\t, public_key const& pk); |\n | |\n-|\t\ttemplate |\n-|\t\tvoid operator()(A&&... a) |\n-|\t\t{ |\n-|#ifdef BOOST_NO_EXCEPTIONS |\n-|\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n-|#else |\n-|\t\t\ttry |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n-|\t\t\t} |\n-|\t\t\tcatch (system_error const& e) |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code()); |\n-|\t\t\t} |\n-|\t\t\tcatch (std::exception const& e) |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*ExceptHandler)(e); |\n-|_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |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+|TORRENT_EXTRA_EXPORT bool verify_mutable_item( |\n+|\tspan v |\n+|\t, span salt |\n+|\t, sequence_number seq |\n+|\t, public_key const& pk |\n+|\t, signature const& sig); |\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+|// given a byte range ``v`` and an optional byte range ``salt``, a |\n+|// sequence number, public key ``pk`` (must be 32 bytes) and a secret key |\n+|// ``sk`` (must be 64 bytes), this function produces a signature which |\n+|// is written into a 64 byte buffer pointed to by ``sig``. The caller |\n+|// is responsible for allocating the destination buffer that's passed in |\n+|// as the ``sig`` argument. Typically it would be allocated on the stack. |\n+|TORRENT_EXPORT signature sign_mutable_item( |\n+|\tspan v |\n+|\t, span salt |\n+|\t, sequence_number seq |\n+|\t, public_key const& pk |\n+|\t, secret_key const& sk); |\n | |\n-|\t\tvirtual void for_each_listen_socket(std::function f) = 0; |\n+|class TORRENT_EXTRA_EXPORT item |\n+|{ |\n+|public: |\n+|\titem() {} |\n+|\titem(public_key const& pk, span salt); |\n+|\texplicit item(entry v); |\n+|\titem(entry v |\n+|\t\t, span salt |\n+|\t\t, sequence_number seq |\n+|\t\t, public_key const& pk |\n+|\t\t, secret_key const& sk); |\n+|\texplicit item(bdecode_node const& v); |\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+|\tvoid assign(entry v); |\n+|\tvoid assign(entry v, span salt |\n+|\t\t, sequence_number seq |\n+|_\b\t_\b\t_\b,_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bp_\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/_\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@@ -12670,14 +12492,231 @@\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/ |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+|// 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+|// a magnet link for a torrent that we already have files for. Once we have the |\n+|// metadata, we have files on disk but no hashes. We won't know whether the data |\n+|// on disk is valid or not, until we've downloaded the hashes to validate them. |\n+| |\n+|// Idea for future space optimization: |\n+|// while downloading, we need to store interior nodes of this tree. However, we |\n+|// don't need to store the padding. a SHA-256 is 32 bytes. Instead of storing |\n+|// the full (padded) tree of SHA-256 hashes, store the full tree of 32 bit |\n+|// signed integers, being indices into the actual storage for the tree. We could |\n+|// even grow the storage lazily. Instead of storing the padding hashes, use |\n+|// negative indices to refer to fixed SHA-256(0), and SHA-256(SHA-256(0)) and so |\n+|// on |\n+|struct TORRENT_EXTRA_EXPORT merkle_tree |\n+|{ |\n+|merkle_tree() = default; |\n+|merkle_tree(int num_blocks, int blocks_per_piece, char const* r); |\n+| |\n+|\tsha256_hash root() const; |\n+| |\n+|\tvoid load_tree(span t, std::vector const& verified); |\n+|\tvoid load_sparse_tree(span t, std::vector const& mask |\n+|\t\t, std::vector const& verified); |\n+|\tvoid load_verified_bits(std::vector const& verified); |\n+| |\n+|\tstd::size_t size() const; |\n+|\tint end_index() const { return int(size()); } |\n+| |\n+|\tbool has_node(int idx) const; |\n+| |\n+|\tbool compare_node(int idx, sha256_hash const& h) const; |\n+| |\n+|\tsha256_hash operator[](int idx) const; |\n+| |\n+|\tstd::vector build_vector() const; |\n+|\tstd::pair, aux::vector> build_sparse_vector() const; |\n+| |\n+|\t// get bits indicating if each leaf hash is verified |\n+|\tstd::vector verified_leafs() const; |\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+|_\b\t_\bb_\bo_\bo_\bl_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b(_\bi_\bn_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bd_\bx_\b,_\b _\bi_\bn_\bt_\b _\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b)_\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 |\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 this a std::unique_ptr |\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:_\b1_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b]_\b>_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba s\bst\btd\bd:\b::\b:u\bun\bni\biq\bqu\bue\be_\b_p\bpt\btr\br]\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/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:1\b17\b75\b5 *\b**\b**\b* |\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+|\tint num_pieces() const; |\n+|\tint num_leafs() const; |\n+| |\n+|\tvoid optimize_storage(); |\n+|\tvoid optimize_storage_piece_layer(); |\n+|\tvoid allocate_full(); |\n+| |\n+|\t// a pointer to the root hash for this file. |\n+|\tchar const* m_root = nullptr; |\n+| |\n+|\t// this is either the full tree, or some sparse representation of it, |\n+|\t// depending on m_mode |\n+|aux::vector m_tree; |\n+| |\n+|\t// when the full tree is allocated, this has one bit for each block hash. a |\n+|\t// 1 means we have verified the block hash to be correct, otherwise the block |\n+|\t// hash may represent what's on disk, but we haven't been able to verify it |\n+|\t// yet |\n+|\tbitfield m_block_verified; |\n+| |\n+|\t// number of blocks in the file this tree represents. The number of leafs in |\n+|\t// the tree is rounded up to an even power of 2. |\n+|\tint m_num_blocks = 0; |\n+| |\n+|\t// the number of blocks per piece, specified as how many steps to shift |\n+|\t// right 1 to get the number of blocks in one piece. This is a compact |\n+|\t// representation that's valid because pieces are always powers of 2. |\n+|\t// this is necessary to know which layer in the tree the piece layer is. |\n+|\tstd::uint8_t m_blocks_per_piece_log = 0; |\n+| |\n+|\tenum class mode_t : std::uint8_t |\n+|\t{ |\n+|\t\t// a default constructed tree is truly empty. It does not even have a |\n+|\t\t// root hash |\n+|\t\tuninitialized_tree, |\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/ |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_\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 |\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\b17\b7 *\b**\b**\b* |\n+|\tprivate: |\n+| |\n+|\t\tHandler handler; |\n+|\t\thandler_storage* storage; |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\t\terror_handler_interface* error_handler; |\n+|#endif |\n+|\t}; |\n+| |\n+|\ttemplate |\n+|\taux::allocating_handler |\n+|\tmake_handler(Handler handler |\n+|\t\t, handler_storage& storage |\n+|\t\t, error_handler_interface& err_handler) |\n+|\t{ |\n+|\t\treturn aux::allocating_handler( |\n+|\t\t\tstd::forward(handler), &storage, &err_handler); |\n+|\t} |\n+| |\n+|template |\n+|\tstruct handler |\n+|\t{ |\n+|\t\texplicit handler(std::shared_ptr p) : ptr_(std::move(p)) {} |\n+| |\n+|\t\tstd::shared_ptr ptr_; |\n+| |\n+|\t\ttemplate |\n+|\t\tvoid operator()(A&&... a) |\n+|\t\t{ |\n+|#ifdef BOOST_NO_EXCEPTIONS |\n+|\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n+|#else |\n+|\t\t\ttry |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n+|\t\t\t} |\n+|\t\t\tcatch (system_error const& e) |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code()); |\n+|\t\t\t} |\n+|\t\t\tcatch (std::exception const& e) |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*ExceptHandler)(e); |\n+|_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |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@@ -12715,46 +12754,7 @@\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/ |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"}]}]}]}]}]}