{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.N2sRGGSe/b1/libtorrent-rasterbar_2.0.11-1_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.N2sRGGSe/b2/libtorrent-rasterbar_2.0.11-1_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,7 +1,7 @@\n \n 1e537d9298a8b265e97c6e12e4bbe431 366364 libdevel optional libtorrent-rasterbar-dev_2.0.11-1_amd64.deb\n- 99755b6129d04397015d589e76a93dbb 1669868 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n+ 15551be28e691e7f14365f9d015e2bd7 1672624 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n d03e085a33b5d6cb9d6ab0feb33da92f 51336924 debug optional libtorrent-rasterbar2.0t64-dbgsym_2.0.11-1_amd64.deb\n 4f12effee624959a605933367d3a11d3 1671540 libs optional libtorrent-rasterbar2.0t64_2.0.11-1_amd64.deb\n cb002f5518a59f3628f4b30ad4b79ed3 13345528 debug optional python3-libtorrent-dbgsym_2.0.11-1_amd64.deb\n 3a3d17a931722c987571a92e69305146 710292 python optional python3-libtorrent_2.0.11-1_amd64.deb\n"}, {"source1": "libtorrent-rasterbar-doc_2.0.11-1_all.deb", "source2": "libtorrent-rasterbar-doc_2.0.11-1_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2025-01-28 14:33:12.000000 debian-binary\n -rw-r--r-- 0 0 0 3628 2025-01-28 14:33:12.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1666048 2025-01-28 14:33:12.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 1668804 2025-01-28 14:33:12.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./control", "source2": "./control", "unified_diff": "@@ -1,13 +1,13 @@\n Package: libtorrent-rasterbar-doc\n Source: libtorrent-rasterbar\n Version: 2.0.11-1\n Architecture: all\n Maintainer: Christian Marillat <marillat@debian.org>\n-Installed-Size: 5773\n+Installed-Size: 5941\n Section: doc\n Priority: optional\n Multi-Arch: foreign\n Homepage: https://libtorrent.org/\n Description: Documentation for libtorrent-rasterbar\n Bittorrent library by Rasterbar Software (Arvid Norberg).\n libtorrent-rasterbar is a C++ library that aims to be a good alternative to\n"}, {"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -73,43 +73,43 @@\n -rw-r--r-- 0 root (0) root (0) 428298 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/troubleshooting.png\n -rw-r--r-- 0 root (0) root (0) 46281 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/troubleshooting_thumb.png\n -rw-r--r-- 0 root (0) root (0) 243 2025-01-28 10:57:42.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/utp_stack.diagram\n -rw-r--r-- 0 root (0) root (0) 2007 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/utp_stack.png\n -rw-r--r-- 0 root (0) root (0) 1156 2025-01-28 10:57:42.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/write_disk_buffers.diagram\n -rw-r--r-- 0 root (0) root (0) 9631 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/write_disk_buffers.png\n -rw-r--r-- 0 root (0) root (0) 9768 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/index.html\n--rw-r--r-- 0 root (0) root (0) 144610 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html\n+-rw-r--r-- 0 root (0) root (0) 144603 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html\n -rw-r--r-- 0 root (0) root (0) 9650 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/projects.html\n -rw-r--r-- 0 root (0) root (0) 22814 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/python_binding.html\n -rw-r--r-- 0 root (0) root (0) 33687 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html\n -rw-r--r-- 0 root (0) root (0) 256772 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html\n -rw-r--r-- 0 root (0) root (0) 27437 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html\n -rw-r--r-- 0 root (0) root (0) 25856 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html\n -rw-r--r-- 0 root (0) root (0) 88949 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html\n -rw-r--r-- 0 root (0) root (0) 43859 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html\n--rw-r--r-- 0 root (0) root (0) 50915 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html\n+-rw-r--r-- 0 root (0) root (0) 137008 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html\n -rw-r--r-- 0 root (0) root (0) 24960 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html\n -rw-r--r-- 0 root (0) root (0) 48763 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html\n -rw-r--r-- 0 root (0) root (0) 13261 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html\n -rw-r--r-- 0 root (0) root (0) 12804 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html\n -rw-r--r-- 0 root (0) root (0) 68487 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html\n -rw-r--r-- 0 root (0) root (0) 9618 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html\n--rw-r--r-- 0 root (0) root (0) 102476 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n+-rw-r--r-- 0 root (0) root (0) 102455 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n -rw-r--r-- 0 root (0) root (0) 169276 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html\n -rw-r--r-- 0 root (0) root (0) 9742 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html\n--rw-r--r-- 0 root (0) root (0) 56856 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html\n--rw-r--r-- 0 root (0) root (0) 129808 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n--rw-r--r-- 0 root (0) root (0) 55640 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n--rw-r--r-- 0 root (0) root (0) 48385 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n--rw-r--r-- 0 root (0) root (0) 16462 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n+-rw-r--r-- 0 root (0) root (0) 56848 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html\n+-rw-r--r-- 0 root (0) root (0) 129801 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n+-rw-r--r-- 0 root (0) root (0) 55629 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n+-rw-r--r-- 0 root (0) root (0) 48392 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n+-rw-r--r-- 0 root (0) root (0) 16461 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n -rw-r--r-- 0 root (0) root (0) 25530 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html\n -rw-r--r-- 0 root (0) root (0) 9129 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-ed25519.html\n -rw-r--r-- 0 root (0) root (0) 34353 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html\n -rw-r--r-- 0 root (0) root (0) 29242 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/security-audit.html\n--rw-r--r-- 0 root (0) root (0) 1274792 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n+-rw-r--r-- 0 root (0) root (0) 1360844 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n -rw-r--r-- 0 root (0) root (0) 10121 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/streaming.html\n -rw-r--r-- 0 root (0) root (0) 8807 2025-01-28 10:57:42.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/style.css\n -rw-r--r-- 0 root (0) root (0) 522888 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html\n -rw-r--r-- 0 root (0) root (0) 3023 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/troubleshooting.html\n -rw-r--r-- 0 root (0) root (0) 25162 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tuning-ref.html\n -rw-r--r-- 0 root (0) root (0) 132630 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tutorial-ref.html\n -rw-r--r-- 0 root (0) root (0) 16383 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/udp_tracker_protocol.html\n"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html", "unified_diff": "@@ -115,15 +115,15 @@\n <li><p class=\"first\">main loop (see <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>)</p>\n <blockquote>\n <ul class=\"simple\">\n <li>poll for alerts (see <a class=\"reference external\" href=\"reference-Session.html#wait_for_alert()\">wait_for_alert()</a>, <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>)</li>\n <li>handle updates to torrents, (see <a class=\"reference external\" href=\"reference-Alerts.html#state_update_alert\">state_update_alert</a>).</li>\n <li>handle other alerts, (see <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>).</li>\n <li>query the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> for information (see session::status()).</li>\n-<li>add and remove torrents from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (<a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a>)</li>\n+<li>add and remove torrents from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a>)</li>\n </ul>\n </blockquote>\n </li>\n <li><p class=\"first\">save resume data for all torrent_handles (optional, see\n <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a>)</p>\n </li>\n <li><p class=\"first\">save <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state (see <a class=\"reference external\" href=\"reference-Session.html#session_state()\">session_state()</a> and <a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a>)</p>\n"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html", "unified_diff": "@@ -28,65 +28,23 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#client-data-t\" id=\"toc-entry-1\">client_data_t</a><ul>\n-<li><a class=\"reference internal\" href=\"#client-data-t-1\" id=\"toc-entry-2\">client_data_t()</a></li>\n-<li><a class=\"reference internal\" href=\"#void-operator-const\" id=\"toc-entry-3\">void*() operator=() const*()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-torrent-params\" id=\"toc-entry-1\">add_torrent_params</a></li>\n+<li><a class=\"reference internal\" href=\"#client-data-t\" id=\"toc-entry-2\">client_data_t</a><ul>\n+<li><a class=\"reference internal\" href=\"#client-data-t-1\" id=\"toc-entry-3\">client_data_t()</a></li>\n+<li><a class=\"reference internal\" href=\"#void-operator-const\" id=\"toc-entry-4\">void*() operator=() const*()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#add-torrent-params\" id=\"toc-entry-4\">add_torrent_params</a></li>\n </ul>\n </div>\n-<a name=\"client_data_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+client_data_t&labels=documentation&body=Documentation+under+heading+%22class+client_data_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"client-data-t\">\n-<h1>client_data_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/client_data.hpp\">libtorrent/client_data.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct client_data_t\n-{\n- <strong>client_data_t</strong> () = default;\n- explicit <strong>client_data_t</strong> (T* v);\n- client_data_t& <strong>operator=</strong> (T* v);\n- T* <strong>get</strong> () const;\n- explicit operator <strong>T</strong> () const;\n- client_data_t& <strong>operator=</strong> (void*) = delete;\n- client_data_t& <strong>operator=</strong> (void const*) = delete;\n- operator <strong>void*</strong> () const = delete;\n- operator void <strong>const*</strong> () const = delete;\n-\n- template <typename T, typename <strong>U</strong> = typename std::enable_if<std::is_pointer<T>::value>::type>\n-};\n-</pre>\n-<a name=\"client_data_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bclient_data_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bclient_data_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"client-data-t-1\">\n-<h2>client_data_t()</h2>\n-<pre class=\"literal-block\">\n-<strong>client_data_t</strong> () = default;\n-</pre>\n-<p>construct a nullptr client data</p>\n-<a name=\"void*()\"></a>\n-<a name=\"operator=()\"></a>\n-<a name=\"const*()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bvoid%2A%28%29+operator%3D%28%29+const%2A%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bvoid%2A%28%29+operator%3D%28%29+const%2A%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"void-operator-const\">\n-<h2>void*() operator=() const*()</h2>\n-<pre class=\"literal-block\">\n-client_data_t& <strong>operator=</strong> (void*) = delete;\n-client_data_t& <strong>operator=</strong> (void const*) = delete;\n-operator <strong>void*</strong> () const = delete;\n-operator void <strong>const*</strong> () const = delete;\n-</pre>\n-<p>we don't allow type-unsafe operations</p>\n-<a name=\"add_torrent_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_params&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_params%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"add-torrent-params\">\n+<a name=\"add_torrent_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_params&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_params%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"add-torrent-params\">\n <h1>add_torrent_params</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/add_torrent_params.hpp\">libtorrent/add_torrent_params.hpp</a>"</p>\n <p>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> contains all the information in a .torrent file\n along with all information necessary to add that torrent to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n The key fields when adding a torrent are:</p>\n <ul class=\"simple\">\n <li>ti - the immutable info-dict part of the torrent</li>\n@@ -399,14 +357,56 @@\n <a name=\"last_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_download+last_upload%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_download+last_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>last_download last_upload</dt>\n <dd>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.</dd>\n </dl>\n+<a name=\"client_data_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+client_data_t&labels=documentation&body=Documentation+under+heading+%22class+client_data_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"client-data-t\">\n+<h1>client_data_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/client_data.hpp\">libtorrent/client_data.hpp</a>"</p>\n+<p>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.</p>\n+<pre class=\"literal-block\">\n+struct client_data_t\n+{\n+ <strong>client_data_t</strong> () = default;\n+ explicit <strong>client_data_t</strong> (T* v);\n+ client_data_t& <strong>operator=</strong> (T* v);\n+ T* <strong>get</strong> () const;\n+ explicit operator <strong>T</strong> () const;\n+ operator void <strong>const*</strong> () const = delete;\n+ operator <strong>void*</strong> () const = delete;\n+ client_data_t& <strong>operator=</strong> (void const*) = delete;\n+ client_data_t& <strong>operator=</strong> (void*) = delete;\n+\n+ template <typename T, typename <strong>U</strong> = typename std::enable_if<std::is_pointer<T>::value>::type>\n+};\n+</pre>\n+<a name=\"client_data_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bclient_data_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bclient_data_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"client-data-t-1\">\n+<h2>client_data_t()</h2>\n+<pre class=\"literal-block\">\n+<strong>client_data_t</strong> () = default;\n+</pre>\n+<p>construct a nullptr client data</p>\n+<a name=\"void*()\"></a>\n+<a name=\"operator=()\"></a>\n+<a name=\"const*()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bvoid%2A%28%29+operator%3D%28%29+const%2A%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bvoid%2A%28%29+operator%3D%28%29+const%2A%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"void-operator-const\">\n+<h2>void*() operator=() const*()</h2>\n+<pre class=\"literal-block\">\n+operator void <strong>const*</strong> () const = delete;\n+operator <strong>void*</strong> () const = delete;\n+client_data_t& <strong>operator=</strong> (void const*) = delete;\n+client_data_t& <strong>operator=</strong> (void*) = delete;\n+</pre>\n+<p>we don't allow type-unsafe operations</p>\n+</div>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n <div id=\"footer\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,48 +1,16 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n * _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n o _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b(_\b)\n o _\bv_\bo_\bi_\bd_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)\n- * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n-passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.\n-struct client_data_t\n-{\n- c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n- explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n- T* g\bge\bet\bt () const;\n- explicit operator T\bT () const;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n- operator v\bvo\boi\bid\bd*\b* () const = delete;\n- operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-\n- template <typename T, typename U\bU = typename std::enable_if<std::\n-is_pointer<T>::value>::type>\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n-construct a nullptr client data\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* v\bvo\boi\bid\bd*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) *\b**\b**\b**\b**\b*\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n-operator v\bvo\boi\bid\bd*\b* () const = delete;\n-operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-we don't allow type-unsafe operations\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs contains all the information in a .torrent file along\n with all information necessary to add that torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. The key fields\n when adding a torrent are:\n * ti - the immutable info-dict part of the torrent\n@@ -291,14 +259,46 @@\n applied before the torrent is added.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n last_download last_upload\n the posix time of the last time payload was received or sent for this\n torrent, respectively. A value of 0 means we don't know when we last\n uploaded or downloaded, or we have never uploaded or downloaded any\n payload for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+ explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n+ T* g\bge\bet\bt () const;\n+ explicit operator T\bT () const;\n+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+ operator v\bvo\boi\bid\bd*\b* () const = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+\n+ template <typename T, typename U\bU = typename std::enable_if<std::\n+is_pointer<T>::value>::type>\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+construct a nullptr client data\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* v\bvo\boi\bid\bd*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) *\b**\b**\b**\b**\b*\n+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+operator v\bvo\boi\bid\bd*\b* () const = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+we don't allow type-unsafe operations\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html", "unified_diff": "@@ -28,211 +28,211 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#alert\" id=\"toc-entry-1\">alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#timestamp\" id=\"toc-entry-2\">timestamp()</a></li>\n-<li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-3\">type()</a></li>\n-<li><a class=\"reference internal\" href=\"#what\" id=\"toc-entry-4\">what()</a></li>\n-<li><a class=\"reference internal\" href=\"#message\" id=\"toc-entry-5\">message()</a></li>\n-<li><a class=\"reference internal\" href=\"#category\" id=\"toc-entry-6\">category()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-routing-bucket\" id=\"toc-entry-1\">dht_routing_bucket</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-alert\" id=\"toc-entry-2\">torrent_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#message\" id=\"toc-entry-3\">message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-routing-bucket\" id=\"toc-entry-7\">dht_routing_bucket</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-alert\" id=\"toc-entry-8\">torrent_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#message-1\" id=\"toc-entry-9\">message()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-alert\" id=\"toc-entry-4\">peer_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-alert\" id=\"toc-entry-5\">tracker_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#tracker-url\" id=\"toc-entry-6\">tracker_url()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-alert\" id=\"toc-entry-10\">peer_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-alert\" id=\"toc-entry-11\">tracker_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#tracker-url\" id=\"toc-entry-12\">tracker_url()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-removed-alert\" id=\"toc-entry-7\">torrent_removed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#read-piece-alert\" id=\"toc-entry-8\">read_piece_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-completed-alert\" id=\"toc-entry-9\">file_completed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-renamed-alert\" id=\"toc-entry-10\">file_renamed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#new-name-old-name\" id=\"toc-entry-11\">new_name() old_name()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-removed-alert\" id=\"toc-entry-13\">torrent_removed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#read-piece-alert\" id=\"toc-entry-14\">read_piece_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-completed-alert\" id=\"toc-entry-15\">file_completed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-renamed-alert\" id=\"toc-entry-16\">file_renamed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#new-name-old-name\" id=\"toc-entry-17\">new_name() old_name()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-rename-failed-alert\" id=\"toc-entry-12\">file_rename_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#performance-alert\" id=\"toc-entry-13\">performance_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-performance-warning-t\" id=\"toc-entry-14\">enum performance_warning_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#file-rename-failed-alert\" id=\"toc-entry-18\">file_rename_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#performance-alert\" id=\"toc-entry-19\">performance_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-performance-warning-t\" id=\"toc-entry-20\">enum performance_warning_t</a></li>\n+<li><a class=\"reference internal\" href=\"#state-changed-alert\" id=\"toc-entry-15\">state_changed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-error-alert\" id=\"toc-entry-16\">tracker_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#failure-reason\" id=\"toc-entry-17\">failure_reason()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#state-changed-alert\" id=\"toc-entry-21\">state_changed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-error-alert\" id=\"toc-entry-22\">tracker_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#failure-reason\" id=\"toc-entry-23\">failure_reason()</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-warning-alert\" id=\"toc-entry-18\">tracker_warning_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#warning-message\" id=\"toc-entry-19\">warning_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#tracker-warning-alert\" id=\"toc-entry-24\">tracker_warning_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#warning-message\" id=\"toc-entry-25\">warning_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#scrape-reply-alert\" id=\"toc-entry-20\">scrape_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#scrape-failed-alert\" id=\"toc-entry-21\">scrape_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#error-message\" id=\"toc-entry-22\">error_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#scrape-reply-alert\" id=\"toc-entry-26\">scrape_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#scrape-failed-alert\" id=\"toc-entry-27\">scrape_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#error-message\" id=\"toc-entry-28\">error_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-reply-alert\" id=\"toc-entry-23\">tracker_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-reply-alert\" id=\"toc-entry-24\">dht_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-announce-alert\" id=\"toc-entry-25\">tracker_announce_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#hash-failed-alert\" id=\"toc-entry-26\">hash_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-ban-alert\" id=\"toc-entry-27\">peer_ban_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-unsnubbed-alert\" id=\"toc-entry-28\">peer_unsnubbed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-snubbed-alert\" id=\"toc-entry-29\">peer_snubbed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-error-alert\" id=\"toc-entry-30\">peer_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-connect-alert\" id=\"toc-entry-31\">peer_connect_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t\" id=\"toc-entry-32\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#tracker-reply-alert\" id=\"toc-entry-29\">tracker_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-reply-alert\" id=\"toc-entry-30\">dht_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-announce-alert\" id=\"toc-entry-31\">tracker_announce_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#hash-failed-alert\" id=\"toc-entry-32\">hash_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-ban-alert\" id=\"toc-entry-33\">peer_ban_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-unsnubbed-alert\" id=\"toc-entry-34\">peer_unsnubbed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-snubbed-alert\" id=\"toc-entry-35\">peer_snubbed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-error-alert\" id=\"toc-entry-36\">peer_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-connect-alert\" id=\"toc-entry-37\">peer_connect_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t\" id=\"toc-entry-38\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-disconnected-alert\" id=\"toc-entry-33\">peer_disconnected_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#invalid-request-alert\" id=\"toc-entry-34\">invalid_request_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-finished-alert\" id=\"toc-entry-35\">torrent_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-finished-alert\" id=\"toc-entry-36\">piece_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#request-dropped-alert\" id=\"toc-entry-37\">request_dropped_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-timeout-alert\" id=\"toc-entry-38\">block_timeout_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-finished-alert\" id=\"toc-entry-39\">block_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-downloading-alert\" id=\"toc-entry-40\">block_downloading_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#unwanted-block-alert\" id=\"toc-entry-41\">unwanted_block_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-moved-alert\" id=\"toc-entry-42\">storage_moved_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#old-path-storage-path\" id=\"toc-entry-43\">old_path() storage_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-disconnected-alert\" id=\"toc-entry-39\">peer_disconnected_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#invalid-request-alert\" id=\"toc-entry-40\">invalid_request_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-finished-alert\" id=\"toc-entry-41\">torrent_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-finished-alert\" id=\"toc-entry-42\">piece_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#request-dropped-alert\" id=\"toc-entry-43\">request_dropped_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-timeout-alert\" id=\"toc-entry-44\">block_timeout_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-finished-alert\" id=\"toc-entry-45\">block_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-downloading-alert\" id=\"toc-entry-46\">block_downloading_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#unwanted-block-alert\" id=\"toc-entry-47\">unwanted_block_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#storage-moved-alert\" id=\"toc-entry-48\">storage_moved_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#old-path-storage-path\" id=\"toc-entry-49\">old_path() storage_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-moved-failed-alert\" id=\"toc-entry-44\">storage_moved_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#file-path\" id=\"toc-entry-45\">file_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#storage-moved-failed-alert\" id=\"toc-entry-50\">storage_moved_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#file-path\" id=\"toc-entry-51\">file_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-deleted-alert\" id=\"toc-entry-46\">torrent_deleted_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-delete-failed-alert\" id=\"toc-entry-47\">torrent_delete_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#save-resume-data-alert\" id=\"toc-entry-48\">save_resume_data_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#save-resume-data-failed-alert\" id=\"toc-entry-49\">save_resume_data_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-paused-alert\" id=\"toc-entry-50\">torrent_paused_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-resumed-alert\" id=\"toc-entry-51\">torrent_resumed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-checked-alert\" id=\"toc-entry-52\">torrent_checked_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#url-seed-alert\" id=\"toc-entry-53\">url_seed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#server-url\" id=\"toc-entry-54\">server_url()</a></li>\n+<li><a class=\"reference internal\" href=\"#error-message-1\" id=\"toc-entry-55\">error_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-deleted-alert\" id=\"toc-entry-52\">torrent_deleted_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-delete-failed-alert\" id=\"toc-entry-53\">torrent_delete_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#save-resume-data-alert\" id=\"toc-entry-54\">save_resume_data_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#save-resume-data-failed-alert\" id=\"toc-entry-55\">save_resume_data_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-paused-alert\" id=\"toc-entry-56\">torrent_paused_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-resumed-alert\" id=\"toc-entry-57\">torrent_resumed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-checked-alert\" id=\"toc-entry-58\">torrent_checked_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#url-seed-alert\" id=\"toc-entry-59\">url_seed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#server-url\" id=\"toc-entry-60\">server_url()</a></li>\n-<li><a class=\"reference internal\" href=\"#error-message-1\" id=\"toc-entry-61\">error_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-error-alert\" id=\"toc-entry-56\">file_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#filename\" id=\"toc-entry-57\">filename()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#file-error-alert\" id=\"toc-entry-62\">file_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#filename\" id=\"toc-entry-63\">filename()</a></li>\n+<li><a class=\"reference internal\" href=\"#metadata-failed-alert\" id=\"toc-entry-58\">metadata_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#metadata-received-alert\" id=\"toc-entry-59\">metadata_received_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#udp-error-alert\" id=\"toc-entry-60\">udp_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#external-ip-alert\" id=\"toc-entry-61\">external_ip_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#listen-failed-alert\" id=\"toc-entry-62\">listen_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#listen-interface\" id=\"toc-entry-63\">listen_interface()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#metadata-failed-alert\" id=\"toc-entry-64\">metadata_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#metadata-received-alert\" id=\"toc-entry-65\">metadata_received_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#udp-error-alert\" id=\"toc-entry-66\">udp_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#external-ip-alert\" id=\"toc-entry-67\">external_ip_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#listen-failed-alert\" id=\"toc-entry-68\">listen_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#listen-interface\" id=\"toc-entry-69\">listen_interface()</a></li>\n+<li><a class=\"reference internal\" href=\"#listen-succeeded-alert\" id=\"toc-entry-64\">listen_succeeded_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-error-alert\" id=\"toc-entry-65\">portmap_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-alert\" id=\"toc-entry-66\">portmap_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-log-alert\" id=\"toc-entry-67\">portmap_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message\" id=\"toc-entry-68\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#listen-succeeded-alert\" id=\"toc-entry-70\">listen_succeeded_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-error-alert\" id=\"toc-entry-71\">portmap_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-alert\" id=\"toc-entry-72\">portmap_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-log-alert\" id=\"toc-entry-73\">portmap_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message\" id=\"toc-entry-74\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#fastresume-rejected-alert\" id=\"toc-entry-69\">fastresume_rejected_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#file-path-1\" id=\"toc-entry-70\">file_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#fastresume-rejected-alert\" id=\"toc-entry-75\">fastresume_rejected_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#file-path-1\" id=\"toc-entry-76\">file_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-blocked-alert\" id=\"toc-entry-71\">peer_blocked_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-reason-t\" id=\"toc-entry-72\">enum reason_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-blocked-alert\" id=\"toc-entry-77\">peer_blocked_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-reason-t\" id=\"toc-entry-78\">enum reason_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-announce-alert\" id=\"toc-entry-73\">dht_announce_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-peers-alert\" id=\"toc-entry-74\">dht_get_peers_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#cache-flushed-alert\" id=\"toc-entry-75\">cache_flushed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#lsd-peer-alert\" id=\"toc-entry-76\">lsd_peer_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#trackerid-alert\" id=\"toc-entry-77\">trackerid_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#tracker-id\" id=\"toc-entry-78\">tracker_id()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-announce-alert\" id=\"toc-entry-79\">dht_announce_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-alert\" id=\"toc-entry-80\">dht_get_peers_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#cache-flushed-alert\" id=\"toc-entry-81\">cache_flushed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#lsd-peer-alert\" id=\"toc-entry-82\">lsd_peer_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#trackerid-alert\" id=\"toc-entry-83\">trackerid_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#tracker-id\" id=\"toc-entry-84\">tracker_id()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-bootstrap-alert\" id=\"toc-entry-79\">dht_bootstrap_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-error-alert\" id=\"toc-entry-80\">torrent_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#filename-1\" id=\"toc-entry-81\">filename()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-bootstrap-alert\" id=\"toc-entry-85\">dht_bootstrap_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-error-alert\" id=\"toc-entry-86\">torrent_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#filename-1\" id=\"toc-entry-87\">filename()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-need-cert-alert\" id=\"toc-entry-82\">torrent_need_cert_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#incoming-connection-alert\" id=\"toc-entry-83\">incoming_connection_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#add-torrent-alert\" id=\"toc-entry-84\">add_torrent_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#state-update-alert\" id=\"toc-entry-85\">state_update_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#session-stats-alert\" id=\"toc-entry-86\">session_stats_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-87\">counters()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-need-cert-alert\" id=\"toc-entry-88\">torrent_need_cert_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#incoming-connection-alert\" id=\"toc-entry-89\">incoming_connection_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#add-torrent-alert\" id=\"toc-entry-90\">add_torrent_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#state-update-alert\" id=\"toc-entry-91\">state_update_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#session-stats-alert\" id=\"toc-entry-92\">session_stats_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-93\">counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-error-alert\" id=\"toc-entry-88\">dht_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-immutable-item-alert\" id=\"toc-entry-89\">dht_immutable_item_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-mutable-item-alert\" id=\"toc-entry-90\">dht_mutable_item_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-put-alert\" id=\"toc-entry-91\">dht_put_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#i2p-alert\" id=\"toc-entry-92\">i2p_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-outgoing-get-peers-alert\" id=\"toc-entry-93\">dht_outgoing_get_peers_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#log-alert\" id=\"toc-entry-94\">log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-1\" id=\"toc-entry-95\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-error-alert\" id=\"toc-entry-94\">dht_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-immutable-item-alert\" id=\"toc-entry-95\">dht_immutable_item_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-mutable-item-alert\" id=\"toc-entry-96\">dht_mutable_item_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-put-alert\" id=\"toc-entry-97\">dht_put_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#i2p-alert\" id=\"toc-entry-98\">i2p_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-outgoing-get-peers-alert\" id=\"toc-entry-99\">dht_outgoing_get_peers_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#log-alert\" id=\"toc-entry-100\">log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-1\" id=\"toc-entry-101\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-log-alert\" id=\"toc-entry-96\">torrent_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-2\" id=\"toc-entry-97\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-log-alert\" id=\"toc-entry-102\">torrent_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-2\" id=\"toc-entry-103\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-log-alert\" id=\"toc-entry-98\">peer_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-3\" id=\"toc-entry-99\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t-1\" id=\"toc-entry-100\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-log-alert\" id=\"toc-entry-104\">peer_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-3\" id=\"toc-entry-105\">log_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t-1\" id=\"toc-entry-106\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#lsd-error-alert\" id=\"toc-entry-101\">lsd_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-lookup\" id=\"toc-entry-102\">dht_lookup</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-stats-alert\" id=\"toc-entry-103\">dht_stats_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#incoming-request-alert\" id=\"toc-entry-104\">incoming_request_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-log-alert\" id=\"toc-entry-105\">dht_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-4\" id=\"toc-entry-106\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-dht-module-t\" id=\"toc-entry-107\">enum dht_module_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#lsd-error-alert\" id=\"toc-entry-107\">lsd_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-lookup\" id=\"toc-entry-108\">dht_lookup</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-stats-alert\" id=\"toc-entry-109\">dht_stats_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#incoming-request-alert\" id=\"toc-entry-110\">incoming_request_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-log-alert\" id=\"toc-entry-111\">dht_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-4\" id=\"toc-entry-112\">log_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-dht-module-t\" id=\"toc-entry-113\">enum dht_module_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-pkt-alert\" id=\"toc-entry-108\">dht_pkt_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#pkt-buf\" id=\"toc-entry-109\">pkt_buf()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t-2\" id=\"toc-entry-110\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-pkt-alert\" id=\"toc-entry-114\">dht_pkt_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#pkt-buf\" id=\"toc-entry-115\">pkt_buf()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t-2\" id=\"toc-entry-116\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-peers-reply-alert\" id=\"toc-entry-111\">dht_get_peers_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-direct-response-alert\" id=\"toc-entry-112\">dht_direct_response_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#picker-log-alert\" id=\"toc-entry-113\">picker_log_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#session-error-alert\" id=\"toc-entry-114\">session_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-live-nodes-alert\" id=\"toc-entry-115\">dht_live_nodes_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#nodes-num-nodes\" id=\"toc-entry-116\">nodes() num_nodes()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-reply-alert\" id=\"toc-entry-117\">dht_get_peers_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-direct-response-alert\" id=\"toc-entry-118\">dht_direct_response_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#picker-log-alert\" id=\"toc-entry-119\">picker_log_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#session-error-alert\" id=\"toc-entry-120\">session_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-live-nodes-alert\" id=\"toc-entry-121\">dht_live_nodes_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#nodes-num-nodes\" id=\"toc-entry-122\">nodes() num_nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-stats-header-alert\" id=\"toc-entry-117\">session_stats_header_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-sample-infohashes-alert\" id=\"toc-entry-118\">dht_sample_infohashes_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#num-samples-samples\" id=\"toc-entry-119\">num_samples() samples()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-nodes\" id=\"toc-entry-120\">num_nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#nodes\" id=\"toc-entry-121\">nodes()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-stats-header-alert\" id=\"toc-entry-123\">session_stats_header_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-sample-infohashes-alert\" id=\"toc-entry-124\">dht_sample_infohashes_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#samples-num-samples\" id=\"toc-entry-125\">samples() num_samples()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-nodes\" id=\"toc-entry-126\">num_nodes()</a></li>\n-<li><a class=\"reference internal\" href=\"#nodes\" id=\"toc-entry-127\">nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#block-uploaded-alert\" id=\"toc-entry-122\">block_uploaded_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#alerts-dropped-alert\" id=\"toc-entry-123\">alerts_dropped_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#socks5-alert\" id=\"toc-entry-124\">socks5_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-prio-alert\" id=\"toc-entry-125\">file_prio_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#oversized-file-alert\" id=\"toc-entry-126\">oversized_file_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-conflict-alert\" id=\"toc-entry-127\">torrent_conflict_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-info-alert\" id=\"toc-entry-128\">peer_info_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-progress-alert\" id=\"toc-entry-129\">file_progress_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-info-alert\" id=\"toc-entry-130\">piece_info_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-availability-alert\" id=\"toc-entry-131\">piece_availability_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-list-alert\" id=\"toc-entry-132\">tracker_list_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#alert\" id=\"toc-entry-133\">alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#timestamp\" id=\"toc-entry-134\">timestamp()</a></li>\n+<li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-135\">type()</a></li>\n+<li><a class=\"reference internal\" href=\"#what\" id=\"toc-entry-136\">what()</a></li>\n+<li><a class=\"reference internal\" href=\"#message-1\" id=\"toc-entry-137\">message()</a></li>\n+<li><a class=\"reference internal\" href=\"#category\" id=\"toc-entry-138\">category()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#block-uploaded-alert\" id=\"toc-entry-128\">block_uploaded_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#alerts-dropped-alert\" id=\"toc-entry-129\">alerts_dropped_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#socks5-alert\" id=\"toc-entry-130\">socks5_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-prio-alert\" id=\"toc-entry-131\">file_prio_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#oversized-file-alert\" id=\"toc-entry-132\">oversized_file_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-conflict-alert\" id=\"toc-entry-133\">torrent_conflict_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-info-alert\" id=\"toc-entry-134\">peer_info_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-progress-alert\" id=\"toc-entry-135\">file_progress_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-info-alert\" id=\"toc-entry-136\">piece_info_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-availability-alert\" id=\"toc-entry-137\">piece_availability_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-list-alert\" id=\"toc-entry-138\">tracker_list_alert</a></li>\n <li><a class=\"reference internal\" href=\"#alert-cast\" id=\"toc-entry-139\">alert_cast()</a></li>\n <li><a class=\"reference internal\" href=\"#operation-name\" id=\"toc-entry-140\">operation_name()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-operation-t\" id=\"toc-entry-141\">enum operation_t</a></li>\n-<li><a class=\"reference internal\" href=\"#alert-category-t\" id=\"toc-entry-142\">alert_category_t</a></li>\n-<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-143\">int</a></li>\n+<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-142\">int</a></li>\n+<li><a class=\"reference internal\" href=\"#alert-category-t\" id=\"toc-entry-143\">alert_category_t</a></li>\n </ul>\n </div>\n <p>The <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> function on <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have\n been posted by libtorrent <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> will return an empty list.</p>\n <p>By default, only errors are reported. <a class=\"reference external\" href=\"reference-Settings.html#alert_mask\">settings_pack::alert_mask</a> can be\n used to specify which kinds of events should be reported. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask is\n@@ -246,124 +246,15 @@\n <p>There are other <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> base classes that some alerts derive from, all the\n alerts that are generated for a specific torrent are derived from\n <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>, and tracker events derive from <a class=\"reference external\" href=\"reference-Alerts.html#tracker_alert\">tracker_alert</a>.</p>\n <p>Alerts returned by <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> are only valid until the next call to\n <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. You may not copy an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> object to access it after the next\n call to <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. Internal members of alerts also become invalid once\n <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> is called again.</p>\n-<a name=\"alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alert&labels=documentation&body=Documentation+under+heading+%22class+alert%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"alert\">\n-<h1>alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">alert</tt> class is the base class that specific messages are derived from.\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">session_handle::pop_alerts()</a>)</p>\n-<pre class=\"literal-block\">\n-struct alert\n-{\n- time_point <strong>timestamp</strong> () const;\n- virtual int <strong>type</strong> () const noexcept = 0;\n- virtual char const* <strong>what</strong> () const noexcept = 0;\n- virtual std::string <strong>message</strong> () const = 0;\n- virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n-\n- static constexpr alert_category_t <strong>error_notification</strong> = 0_bit;\n- static constexpr alert_category_t <strong>peer_notification</strong> = 1_bit;\n- static constexpr alert_category_t <strong>port_mapping_notification</strong> = 2_bit;\n- static constexpr alert_category_t <strong>storage_notification</strong> = 3_bit;\n- static constexpr alert_category_t <strong>tracker_notification</strong> = 4_bit;\n- static constexpr alert_category_t <strong>connect_notification</strong> = 5_bit;\n- static constexpr alert_category_t <strong>status_notification</strong> = 6_bit;\n- static constexpr alert_category_t <strong>ip_block_notification</strong> = 8_bit;\n- static constexpr alert_category_t <strong>performance_warning</strong> = 9_bit;\n- static constexpr alert_category_t <strong>dht_notification</strong> = 10_bit;\n- static constexpr alert_category_t <strong>session_log_notification</strong> = 13_bit;\n- static constexpr alert_category_t <strong>torrent_log_notification</strong> = 14_bit;\n- static constexpr alert_category_t <strong>peer_log_notification</strong> = 15_bit;\n- static constexpr alert_category_t <strong>incoming_request_notification</strong> = 16_bit;\n- static constexpr alert_category_t <strong>dht_log_notification</strong> = 17_bit;\n- static constexpr alert_category_t <strong>dht_operation_notification</strong> = 18_bit;\n- static constexpr alert_category_t <strong>port_mapping_log_notification</strong> = 19_bit;\n- static constexpr alert_category_t <strong>picker_log_notification</strong> = 20_bit;\n- static constexpr alert_category_t <strong>file_progress_notification</strong> = 21_bit;\n- static constexpr alert_category_t <strong>piece_progress_notification</strong> = 22_bit;\n- static constexpr alert_category_t <strong>upload_notification</strong> = 23_bit;\n- static constexpr alert_category_t <strong>block_progress_notification</strong> = 24_bit;\n- static constexpr alert_category_t <strong>all_categories</strong> = alert_category_t::all();\n-};\n-</pre>\n-<a name=\"timestamp()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btimestamp%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btimestamp%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"timestamp\">\n-<h2>timestamp()</h2>\n-<pre class=\"literal-block\">\n-time_point <strong>timestamp</strong> () const;\n-</pre>\n-<p>a timestamp is automatically created in the constructor</p>\n-<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"type\">\n-<h2>type()</h2>\n-<pre class=\"literal-block\">\n-virtual int <strong>type</strong> () const noexcept = 0;\n-</pre>\n-<p>returns an integer that is unique to this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type. It can be\n-compared against a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> by querying a static constant called <tt class=\"docutils literal\">alert_type</tt>\n-in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It can be used to determine the run-time type of an alert* in\n-order to cast to that <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type and access specific members.</p>\n-<p>e.g:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">switch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"operator\">-></span><span class=\"name\">type</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n-\n- </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">read_piece_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">auto</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">read_piece_alert</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">p</span><span class=\"operator\">-></span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// read_piece failed\n-</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// use p\n-</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">file_renamed_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// etc...\n-</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span>\n-</pre>\n-<a name=\"what()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bwhat%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bwhat%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"what\">\n-<h2>what()</h2>\n-<pre class=\"literal-block\">\n-virtual char const* <strong>what</strong> () const noexcept = 0;\n-</pre>\n-<p>returns a string literal describing the type of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It does\n-not include any information that might be bundled with the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"message\">\n-<h2>message()</h2>\n-<pre class=\"literal-block\">\n-virtual std::string <strong>message</strong> () const = 0;\n-</pre>\n-<p>generate a string describing the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-type individually and extract and render the information from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> depending\n-on the locale.</p>\n-<a name=\"category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bcategory%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bcategory%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"category\">\n-<h2>category()</h2>\n-<pre class=\"literal-block\">\n-virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n-</pre>\n-<p>returns a bitmask specifying which categories this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belong to.</p>\n-<a name=\"dht_routing_bucket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_routing_bucket&labels=documentation&body=Documentation+under+heading+%22class+dht_routing_bucket%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-routing-bucket\">\n+<a name=\"dht_routing_bucket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_routing_bucket&labels=documentation&body=Documentation+under+heading+%22class+dht_routing_bucket%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"dht-routing-bucket\">\n <h1>dht_routing_bucket</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n <p>struct to hold information about a single DHT routing table bucket</p>\n <pre class=\"literal-block\">\n struct dht_routing_bucket\n {\n int num_nodes;\n@@ -394,15 +285,15 @@\n {\n std::string <strong>message</strong> () const override;\n char const* <strong>torrent_name</strong> () const;\n \n torrent_handle handle;\n };\n </pre>\n-<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"message-1\">\n+<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"message\">\n <h2>message()</h2>\n <pre class=\"literal-block\">\n std::string <strong>message</strong> () const override;\n </pre>\n <p>returns the message associated with this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a></p>\n <a name=\"handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bhandle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>handle</dt>\n@@ -544,27 +435,27 @@\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n <p>This is posted as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#rename_file()\">torrent_handle::rename_file()</a> call, if the rename\n operation succeeds.</p>\n <pre class=\"literal-block\">\n struct file_renamed_alert final : torrent_alert\n {\n std::string <strong>message</strong> () const override;\n- char const* <strong>new_name</strong> () const;\n char const* <strong>old_name</strong> () const;\n+ char const* <strong>new_name</strong> () const;\n \n static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n file_index_t const index;\n };\n </pre>\n <a name=\"new_name()\"></a>\n <a name=\"old_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-name-old-name\">\n <h2>new_name() old_name()</h2>\n <pre class=\"literal-block\">\n-char const* <strong>new_name</strong> () const;\n char const* <strong>old_name</strong> () const;\n+char const* <strong>new_name</strong> () const;\n </pre>\n <p>returns the new and previous file name, respectively.</p>\n <a name=\"index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bindex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>index</dt>\n <dd>refers to the index of the file that was renamed,</dd>\n </dl>\n <a name=\"file_rename_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_rename_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_rename_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n@@ -3005,17 +2896,17 @@\n static constexpr alert_category_t <strong>static_category</strong> = 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 </pre>\n-<a name=\"samples()\"></a>\n-<a name=\"num_samples()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"samples-num-samples\">\n-<h2>samples() num_samples()</h2>\n+<a name=\"num_samples()\"></a>\n+<a name=\"samples()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_samples%28%29+samples%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_samples%28%29+samples%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"num-samples-samples\">\n+<h2>num_samples() samples()</h2>\n <pre class=\"literal-block\">\n int <strong>num_samples</strong> () const;\n std::vector<sha1_hash> <strong>samples</strong> () const;\n </pre>\n <p>returns the number of info-hashes returned by the node, as well as the\n actual info-hashes. <tt class=\"docutils literal\">num_samples()</tt> is more efficient than\n <tt class=\"docutils literal\"><span class=\"pre\">samples().size()</span></tt>.</p>\n@@ -3079,16 +2970,16 @@\n <p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted to indicate to the client that some alerts were\n dropped. Dropped meaning that the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> failed to be delivered to the\n client. The most common cause of such failure is that the internal <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n queue grew too big (controlled by alert_queue_size).</p>\n <pre class=\"literal-block\">\n struct alerts_dropped_alert final : alert\n {\n- <strong>static_assert</strong> (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n std::string <strong>message</strong> () const override;\n+ <strong>static_assert</strong> (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n \n static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n std::bitset<abi_alert_count> dropped_alerts;\n };\n </pre>\n <a name=\"dropped_alerts\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D&labels=documentation&body=Documentation+under+heading+%22alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>dropped_alerts</dt>\n@@ -3294,21 +3185,130 @@\n std::vector<announce_entry> trackers;\n };\n </pre>\n <a name=\"trackers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_list_alert%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_list_alert%3A%3A%5Btrackers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>trackers</dt>\n <dd>list of trackers and their status for the torrent</dd>\n </dl>\n+<a name=\"alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alert&labels=documentation&body=Documentation+under+heading+%22class+alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"alert\">\n+<h1>alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">alert</tt> class is the base class that specific messages are derived from.\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">session_handle::pop_alerts()</a>)</p>\n+<pre class=\"literal-block\">\n+struct alert\n+{\n+ time_point <strong>timestamp</strong> () const;\n+ virtual int <strong>type</strong> () const noexcept = 0;\n+ virtual char const* <strong>what</strong> () const noexcept = 0;\n+ virtual std::string <strong>message</strong> () const = 0;\n+ virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n+\n+ static constexpr alert_category_t <strong>error_notification</strong> = 0_bit;\n+ static constexpr alert_category_t <strong>peer_notification</strong> = 1_bit;\n+ static constexpr alert_category_t <strong>port_mapping_notification</strong> = 2_bit;\n+ static constexpr alert_category_t <strong>storage_notification</strong> = 3_bit;\n+ static constexpr alert_category_t <strong>tracker_notification</strong> = 4_bit;\n+ static constexpr alert_category_t <strong>connect_notification</strong> = 5_bit;\n+ static constexpr alert_category_t <strong>status_notification</strong> = 6_bit;\n+ static constexpr alert_category_t <strong>ip_block_notification</strong> = 8_bit;\n+ static constexpr alert_category_t <strong>performance_warning</strong> = 9_bit;\n+ static constexpr alert_category_t <strong>dht_notification</strong> = 10_bit;\n+ static constexpr alert_category_t <strong>session_log_notification</strong> = 13_bit;\n+ static constexpr alert_category_t <strong>torrent_log_notification</strong> = 14_bit;\n+ static constexpr alert_category_t <strong>peer_log_notification</strong> = 15_bit;\n+ static constexpr alert_category_t <strong>incoming_request_notification</strong> = 16_bit;\n+ static constexpr alert_category_t <strong>dht_log_notification</strong> = 17_bit;\n+ static constexpr alert_category_t <strong>dht_operation_notification</strong> = 18_bit;\n+ static constexpr alert_category_t <strong>port_mapping_log_notification</strong> = 19_bit;\n+ static constexpr alert_category_t <strong>picker_log_notification</strong> = 20_bit;\n+ static constexpr alert_category_t <strong>file_progress_notification</strong> = 21_bit;\n+ static constexpr alert_category_t <strong>piece_progress_notification</strong> = 22_bit;\n+ static constexpr alert_category_t <strong>upload_notification</strong> = 23_bit;\n+ static constexpr alert_category_t <strong>block_progress_notification</strong> = 24_bit;\n+ static constexpr alert_category_t <strong>all_categories</strong> = alert_category_t::all();\n+};\n+</pre>\n+<a name=\"timestamp()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btimestamp%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btimestamp%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"timestamp\">\n+<h2>timestamp()</h2>\n+<pre class=\"literal-block\">\n+time_point <strong>timestamp</strong> () const;\n+</pre>\n+<p>a timestamp is automatically created in the constructor</p>\n+<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"type\">\n+<h2>type()</h2>\n+<pre class=\"literal-block\">\n+virtual int <strong>type</strong> () const noexcept = 0;\n+</pre>\n+<p>returns an integer that is unique to this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type. It can be\n+compared against a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> by querying a static constant called <tt class=\"docutils literal\">alert_type</tt>\n+in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It can be used to determine the run-time type of an alert* in\n+order to cast to that <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type and access specific members.</p>\n+<p>e.g:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">switch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"operator\">-></span><span class=\"name\">type</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">read_piece_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">read_piece_alert</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">p</span><span class=\"operator\">-></span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// read_piece failed\n+</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// use p\n+</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">file_renamed_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// etc...\n+</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<a name=\"what()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bwhat%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bwhat%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"what\">\n+<h2>what()</h2>\n+<pre class=\"literal-block\">\n+virtual char const* <strong>what</strong> () const noexcept = 0;\n+</pre>\n+<p>returns a string literal describing the type of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It does\n+not include any information that might be bundled with the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"message-1\">\n+<h2>message()</h2>\n+<pre class=\"literal-block\">\n+virtual std::string <strong>message</strong> () const = 0;\n+</pre>\n+<p>generate a string describing the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+type individually and extract and render the information from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> depending\n+on the locale.</p>\n+<a name=\"category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bcategory%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bcategory%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"category\">\n+<h2>category()</h2>\n+<pre class=\"literal-block\">\n+virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n+</pre>\n+<p>returns a bitmask specifying which categories this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belong to.</p>\n <a name=\"alert_cast()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_cast%28%29&labels=documentation&body=Documentation+under+heading+%22alert_cast%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n <div class=\"section\" id=\"alert-cast\">\n <h1>alert_cast()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n <pre class=\"literal-block\">\n-template <typename T> T const* <strong>alert_cast</strong> (alert const* a);\n template <typename T> T* <strong>alert_cast</strong> (alert* a);\n+template <typename T> T const* <strong>alert_cast</strong> (alert const* a);\n </pre>\n <p>When you get an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you can use <tt class=\"docutils literal\">alert_cast<></tt> to attempt to cast the\n pointer to a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, in order to query it for more\n information.</p>\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n <p class=\"last\"><tt class=\"docutils literal\">alert_cast<></tt> can only cast to an exact <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, not a base class</p>\n@@ -3530,14 +3530,26 @@\n </tr>\n <tr><td>file_truncate</td>\n <td>46</td>\n <td>call to ftruncate() (or SetEndOfFile() on windows)</td>\n </tr>\n </tbody>\n </table>\n+<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"int\">\n+<h1>int</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<a name=\"int::user_alert_id\"></a><dl class=\"docutils\">\n+<dt>user_alert_id</dt>\n+<dd>user defined alerts should use IDs greater than this</dd>\n+</dl>\n+<a name=\"int::num_alert_types\"></a><dl class=\"docutils\">\n+<dt>num_alert_types</dt>\n+<dd>this constant represents "max_alert_index" + 1</dd>\n+</dl>\n <a name=\"alert_category_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_category_t&labels=documentation&body=Documentation+under+heading+%22alert_category_t%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"alert-category-t\">\n <h1>alert_category_t</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n <a name=\"alert_category_t::error\"></a><dl class=\"docutils\">\n <dt>error</dt>\n <dd><p class=\"first\">Enables alerts that report an error. This includes:</p>\n@@ -3665,26 +3677,14 @@\n <dd><p class=\"first\">The full bitmask, representing all available categories.</p>\n <p class=\"last\">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.</p>\n </dd>\n </dl>\n-<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"int\">\n-<h1>int</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<a name=\"int::user_alert_id\"></a><dl class=\"docutils\">\n-<dt>user_alert_id</dt>\n-<dd>user defined alerts should use IDs greater than this</dd>\n-</dl>\n-<a name=\"int::num_alert_types\"></a><dl class=\"docutils\">\n-<dt>num_alert_types</dt>\n-<dd>this constant represents "max_alert_index" + 1</dd>\n-</dl>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n <div id=\"footer\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,18 +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.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\ba_\bl_\be_\br_\bt\n- o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\bw_\bh_\ba_\bt_\b(_\b)\n- o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n * _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bu_\br_\bl_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n@@ -123,33 +117,39 @@\n * _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\bc_\bk_\be_\br_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b__\ba_\bl_\be_\br_\bt\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bh_\be_\ba_\bd_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\ba_\bl_\be_\br_\bt\n- o _\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)_\b _\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)\n o _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)\n * _\bb_\bl_\bo_\bc_\bk_\b__\bu_\bp_\bl_\bo_\ba_\bd_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\ba_\bl_\be_\br_\bt_\bs_\b__\bd_\br_\bo_\bp_\bp_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\bo_\bc_\bk_\bs_\b5_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n+ * _\ba_\bl_\be_\br_\bt\n+ o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\bw_\bh_\ba_\bt_\b(_\b)\n+ o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n+ o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n- * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n * _\bi_\bn_\bt\n+ * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n The _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) function on _\bs_\be_\bs_\bs_\bi_\bo_\bn is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have been\n posted by libtorrent _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) will return an empty list.\n By default, only errors are reported. _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk can be used to\n specify which kinds of events should be reported. The _\ba_\bl_\be_\br_\bt mask is a\n combination of the _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt flags in the _\ba_\bl_\be_\br_\bt class.\n Every _\ba_\bl_\be_\br_\bt belongs to one or more category. There is a cost associated with\n@@ -162,103 +162,14 @@\n that are generated for a specific torrent are derived from _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt, and\n tracker events derive from _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt.\n Alerts returned by _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) are only valid until the next call to\n _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). You may not copy an _\ba_\bl_\be_\br_\bt object to access it after the next call\n to _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). Internal members of alerts also become invalid once _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs\n _\b(_\b) is called again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-The alert class is the base class that specific messages are derived from.\n-_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n-struct alert\n-{\n- time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n- virtual int t\bty\byp\bpe\be () const noexcept = 0;\n- virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n- virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n- virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-\n- static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n- static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n- static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n- static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n- static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n- static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n- static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n- static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n- static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n- static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n- static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n- static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n- static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n- static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n- static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n- static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n-time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n-a timestamp is automatically created in the constructor\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual int t\bty\byp\bpe\be () const noexcept = 0;\n-returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n-against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n-_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n-cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n-e.g:\n-std::vector<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-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n-returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n-any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n-generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n-This is mainly intended for debug and development use. It is not suitable to\n-use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n-type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n-depending on the locale.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_r\bro\bou\but\bti\bin\bng\bg_\b_b\bbu\buc\bck\bke\bet\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n struct to hold information about a single DHT routing table bucket\n struct dht_routing_bucket\n {\n int num_nodes;\n int num_replacements;\n@@ -400,25 +311,25 @@\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n This is posted as a response to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b) call, if the\n rename operation succeeds.\n struct file_renamed_alert final : torrent_alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+ char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::\n storage;\n file_index_t const index;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bne\bew\bw_\b_n\bna\bam\bme\be(\b()\b) o\bol\bld\bd_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n returns the new and previous file name, respectively.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n index\n refers to the index of the file that was renamed,\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfa\bai\bil\ble\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n@@ -2339,15 +2250,15 @@\n 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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs () const;\n std::vector<sha1_hash> 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@@ -2394,17 +2305,17 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n this _\ba_\bl_\be_\br_\bt is posted to indicate to the client that some alerts were dropped.\n Dropped meaning that the _\ba_\bl_\be_\br_\bt failed to be delivered to the client. The most\n common cause of such failure is that the internal _\ba_\bl_\be_\br_\bt queue grew too big\n (controlled by alert_queue_size).\n struct alerts_dropped_alert final : alert\n {\n+ std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt (num_alert_types <= abi_alert_count, \"need to increase bitset.\n This is an ABI break\");\n- std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::error;\n std::bitset<abi_alert_count> dropped_alerts;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n dropped_alerts\n a bitmask indicating which alerts were dropped. Each bit represents the\n@@ -2572,18 +2483,107 @@\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<announce_entry> 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<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+[_\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* 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 <typename T> T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n template <typename T> T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n+template <typename T> T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n Note\n alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n@@ -2648,14 +2648,21 @@\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@@ -2726,21 +2733,14 @@\n rejected, time-out and cancelled. This is likely to post alerts at a high\n rate.\n all\n The full bitmask, representing all available categories.\n since the enum is signed, make sure this isn't interpreted as -1. For\n instance, boost.python does that and fails when assigning it to an\n unsigned parameter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n- user_alert_id\n- user defined alerts should use IDs greater than this\n- num_alert_types\n- this constant represents \"max_alert_index\" + 1\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html", "unified_diff": "@@ -35,18 +35,18 @@\n <li><a class=\"reference internal\" href=\"#bdecode-node\" id=\"toc-entry-1\">bdecode_node</a><ul>\n <li><a class=\"reference internal\" href=\"#bdecode-node-1\" id=\"toc-entry-2\">bdecode_node()</a></li>\n <li><a class=\"reference internal\" href=\"#bdecode-node-operator\" id=\"toc-entry-3\">bdecode_node() operator=()</a></li>\n <li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-4\">type()</a></li>\n <li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-5\">bool()</a></li>\n <li><a class=\"reference internal\" href=\"#non-owning\" id=\"toc-entry-6\">non_owning()</a></li>\n <li><a class=\"reference internal\" href=\"#data-section-data-offset\" id=\"toc-entry-7\">data_section() data_offset()</a></li>\n-<li><a class=\"reference internal\" href=\"#list-int-value-at-list-size-list-at-list-string-value-at\" id=\"toc-entry-8\">list_int_value_at() list_size() list_at() list_string_value_at()</a></li>\n-<li><a class=\"reference internal\" href=\"#dict-find-string-dict-at-dict-size-dict-find-dict-find-list-dict-find-dict-dict-at-node-dict-find-int-dict-find-string-value-dict-find-int-value\" id=\"toc-entry-9\">dict_find_string() dict_at() dict_size() dict_find() dict_find_list() dict_find_dict() dict_at_node() dict_find_int() dict_find_string_value() dict_find_int_value()</a></li>\n+<li><a class=\"reference internal\" href=\"#list-at-list-string-value-at-list-size-list-int-value-at\" id=\"toc-entry-8\">list_at() list_string_value_at() list_size() list_int_value_at()</a></li>\n+<li><a class=\"reference internal\" href=\"#dict-at-node-dict-at-dict-find-dict-dict-find-int-dict-find-string-value-dict-find-list-dict-find-string-dict-find-int-value-dict-size-dict-find\" id=\"toc-entry-9\">dict_at_node() dict_at() dict_find_dict() dict_find_int() dict_find_string_value() dict_find_list() dict_find_string() dict_find_int_value() dict_size() dict_find()</a></li>\n <li><a class=\"reference internal\" href=\"#int-value\" id=\"toc-entry-10\">int_value()</a></li>\n-<li><a class=\"reference internal\" href=\"#string-value-string-length-string-ptr-string-offset\" id=\"toc-entry-11\">string_value() string_length() string_ptr() string_offset()</a></li>\n+<li><a class=\"reference internal\" href=\"#string-offset-string-length-string-ptr-string-value\" id=\"toc-entry-11\">string_offset() string_length() string_ptr() string_value()</a></li>\n <li><a class=\"reference internal\" href=\"#clear\" id=\"toc-entry-12\">clear()</a></li>\n <li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-13\">swap()</a></li>\n <li><a class=\"reference internal\" href=\"#reserve\" id=\"toc-entry-14\">reserve()</a></li>\n <li><a class=\"reference internal\" href=\"#switch-underlying-buffer\" id=\"toc-entry-15\">switch_underlying_buffer()</a></li>\n <li><a class=\"reference internal\" href=\"#has-soft-error\" id=\"toc-entry-16\">has_soft_error()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-type-t\" id=\"toc-entry-17\">enum type_t</a></li>\n </ul>\n@@ -62,46 +62,46 @@\n to be able to copy it as a reference for instance). For that, use the\n <a class=\"reference external\" href=\"reference-Bdecoding.html#non_owning()\">non_owning()</a> member function.</p>\n <p>There are 5 different types of nodes, see <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>.</p>\n <pre class=\"literal-block\">\n struct bdecode_node\n {\n <strong>bdecode_node</strong> () = default;\n+ <strong>bdecode_node</strong> (bdecode_node const&);\n <strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n- bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n- <strong>bdecode_node</strong> (bdecode_node const&);\n+ bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n type_t <strong>type</strong> () const noexcept;\n explicit operator <strong>bool</strong> () const noexcept;\n bdecode_node <strong>non_owning</strong> () const;\n std::ptrdiff_t <strong>data_offset</strong> () const noexcept;\n span<char const> <strong>data_section</strong> () const noexcept;\n- string_view <strong>list_string_value_at</strong> (int i\n- , string_view default_val = string_view()) const;\n std::int64_t <strong>list_int_value_at</strong> (int i\n , std::int64_t default_val = 0) const;\n- bdecode_node <strong>list_at</strong> (int i) const;\n int <strong>list_size</strong> () const;\n+ string_view <strong>list_string_value_at</strong> (int i\n+ , string_view default_val = string_view()) const;\n+ bdecode_node <strong>list_at</strong> (int i) const;\n+ bdecode_node <strong>dict_find</strong> (string_view key) const;\n+ std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n- bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n string_view <strong>dict_find_string_value</strong> (string_view key\n , string_view default_value = string_view()) const;\n- bdecode_node <strong>dict_find</strong> (string_view key) const;\n- std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n- bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n std::int64_t <strong>dict_find_int_value</strong> (string_view key\n , std::int64_t default_val = 0) const;\n- std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n+ bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n int <strong>dict_size</strong> () const;\n+ bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n+ std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n std::int64_t <strong>int_value</strong> () const;\n- char const* <strong>string_ptr</strong> () const;\n- std::ptrdiff_t <strong>string_offset</strong> () const;\n int <strong>string_length</strong> () const;\n string_view <strong>string_value</strong> () const;\n+ char const* <strong>string_ptr</strong> () const;\n+ std::ptrdiff_t <strong>string_offset</strong> () const;\n void <strong>clear</strong> ();\n void <strong>swap</strong> (bdecode_node& n);\n void <strong>reserve</strong> (int tokens);\n void <strong>switch_underlying_buffer</strong> (char const* buf) noexcept;\n bool <strong>has_soft_error</strong> (span<char> error) const;\n \n enum type_t\n@@ -121,18 +121,18 @@\n </pre>\n <p>creates a default constructed node, it will have the type <tt class=\"docutils literal\">none_t</tt>.</p>\n <a name=\"bdecode_node()\"></a>\n <a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbdecode_node%28%29+operator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbdecode_node%28%29+operator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"bdecode-node-operator\">\n <h2>bdecode_node() operator=()</h2>\n <pre class=\"literal-block\">\n+<strong>bdecode_node</strong> (bdecode_node const&);\n <strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n-bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n-<strong>bdecode_node</strong> (bdecode_node const&);\n+bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n </pre>\n <p>For owning nodes, the copy will create a copy of the tree, but the\n underlying buffer remains the same.</p>\n <a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"type\">\n <h2>type()</h2>\n <pre class=\"literal-block\">\n@@ -164,57 +164,57 @@\n </pre>\n <p>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 <tt class=\"docutils literal\">d</tt> and ends with <tt class=\"docutils literal\">e</tt>, and has all the content of the\n dictionary in between.\n the <tt class=\"docutils literal\">data_offset()</tt> function returns the byte-offset to this node in,\n starting from the beginning of the buffer that was parsed.</p>\n-<a name=\"list_int_value_at()\"></a>\n-<a name=\"list_size()\"></a>\n <a name=\"list_at()\"></a>\n-<a name=\"list_string_value_at()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Blist_int_value_at%28%29+list_size%28%29+list_at%28%29+list_string_value_at%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Blist_int_value_at%28%29+list_size%28%29+list_at%28%29+list_string_value_at%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"list-int-value-at-list-size-list-at-list-string-value-at\">\n-<h2>list_int_value_at() list_size() list_at() list_string_value_at()</h2>\n+<a name=\"list_string_value_at()\"></a>\n+<a name=\"list_size()\"></a>\n+<a name=\"list_int_value_at()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Blist_at%28%29+list_string_value_at%28%29+list_size%28%29+list_int_value_at%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Blist_at%28%29+list_string_value_at%28%29+list_size%28%29+list_int_value_at%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"list-at-list-string-value-at-list-size-list-int-value-at\">\n+<h2>list_at() list_string_value_at() list_size() list_int_value_at()</h2>\n <pre class=\"literal-block\">\n-string_view <strong>list_string_value_at</strong> (int i\n- , string_view default_val = string_view()) const;\n std::int64_t <strong>list_int_value_at</strong> (int i\n , std::int64_t default_val = 0) const;\n-bdecode_node <strong>list_at</strong> (int i) const;\n int <strong>list_size</strong> () const;\n+string_view <strong>list_string_value_at</strong> (int i\n+ , string_view default_val = string_view()) const;\n+bdecode_node <strong>list_at</strong> (int i) const;\n </pre>\n <p>functions with the <tt class=\"docutils literal\">list_</tt> prefix operate on lists. These functions are\n only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">list_t</tt>. <tt class=\"docutils literal\">list_at()</tt> returns the item\n in the list at index <tt class=\"docutils literal\">i</tt>. <tt class=\"docutils literal\">i</tt> may not be greater than or equal to the\n size of the list. <tt class=\"docutils literal\">size()</tt> returns the size of the list.</p>\n-<a name=\"dict_find_string()\"></a>\n+<a name=\"dict_at_node()\"></a>\n <a name=\"dict_at()\"></a>\n-<a name=\"dict_size()\"></a>\n-<a name=\"dict_find()\"></a>\n-<a name=\"dict_find_list()\"></a>\n <a name=\"dict_find_dict()\"></a>\n-<a name=\"dict_at_node()\"></a>\n <a name=\"dict_find_int()\"></a>\n <a name=\"dict_find_string_value()\"></a>\n-<a name=\"dict_find_int_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdict_find_string%28%29+dict_at%28%29+dict_size%28%29+dict_find%28%29+dict_find_list%28%29+dict_find_dict%28%29+dict_at_node%28%29+dict_find_int%28%29+dict_find_string_value%28%29+dict_find_int_value%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdict_find_string%28%29+dict_at%28%29+dict_size%28%29+dict_find%28%29+dict_find_list%28%29+dict_find_dict%28%29+dict_at_node%28%29+dict_find_int%28%29+dict_find_string_value%28%29+dict_find_int_value%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dict-find-string-dict-at-dict-size-dict-find-dict-find-list-dict-find-dict-dict-at-node-dict-find-int-dict-find-string-value-dict-find-int-value\">\n-<h2>dict_find_string() dict_at() dict_size() dict_find() dict_find_list() dict_find_dict() dict_at_node() dict_find_int() dict_find_string_value() dict_find_int_value()</h2>\n+<a name=\"dict_find_list()\"></a>\n+<a name=\"dict_find_string()\"></a>\n+<a name=\"dict_find_int_value()\"></a>\n+<a name=\"dict_size()\"></a>\n+<a name=\"dict_find()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdict_at_node%28%29+dict_at%28%29+dict_find_dict%28%29+dict_find_int%28%29+dict_find_string_value%28%29+dict_find_list%28%29+dict_find_string%28%29+dict_find_int_value%28%29+dict_size%28%29+dict_find%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdict_at_node%28%29+dict_at%28%29+dict_find_dict%28%29+dict_find_int%28%29+dict_find_string_value%28%29+dict_find_list%28%29+dict_find_string%28%29+dict_find_int_value%28%29+dict_size%28%29+dict_find%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dict-at-node-dict-at-dict-find-dict-dict-find-int-dict-find-string-value-dict-find-list-dict-find-string-dict-find-int-value-dict-size-dict-find\">\n+<h2>dict_at_node() dict_at() dict_find_dict() dict_find_int() dict_find_string_value() dict_find_list() dict_find_string() dict_find_int_value() dict_size() dict_find()</h2>\n <pre class=\"literal-block\">\n+bdecode_node <strong>dict_find</strong> (string_view key) const;\n+std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n-bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n string_view <strong>dict_find_string_value</strong> (string_view key\n , string_view default_value = string_view()) const;\n-bdecode_node <strong>dict_find</strong> (string_view key) const;\n-std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n-bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n std::int64_t <strong>dict_find_int_value</strong> (string_view key\n , std::int64_t default_val = 0) const;\n-std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n+bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n int <strong>dict_size</strong> () const;\n+bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n+std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n </pre>\n <p>Functions with the <tt class=\"docutils literal\">dict_</tt> prefix operates on dictionaries. They are\n only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">dict_t</tt>. 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 <tt class=\"docutils literal\">string_view</tt> instead. <tt class=\"docutils literal\">dict_find_list</tt> will return a\n valid <tt class=\"docutils literal\">bdecode_node</tt> if the key is found _and_ it is a list. Otherwise\n it will return a default-constructed <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.</p>\n@@ -229,25 +229,25 @@\n <div class=\"section\" id=\"int-value\">\n <h2>int_value()</h2>\n <pre class=\"literal-block\">\n std::int64_t <strong>int_value</strong> () const;\n </pre>\n <p>this function is only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">int_t</tt>. It returns the\n value of the integer.</p>\n-<a name=\"string_value()\"></a>\n+<a name=\"string_offset()\"></a>\n <a name=\"string_length()\"></a>\n <a name=\"string_ptr()\"></a>\n-<a name=\"string_offset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bstring_value%28%29+string_length%28%29+string_ptr%28%29+string_offset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bstring_value%28%29+string_length%28%29+string_ptr%28%29+string_offset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"string-value-string-length-string-ptr-string-offset\">\n-<h2>string_value() string_length() string_ptr() string_offset()</h2>\n+<a name=\"string_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bstring_offset%28%29+string_length%28%29+string_ptr%28%29+string_value%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bstring_offset%28%29+string_length%28%29+string_ptr%28%29+string_value%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"string-offset-string-length-string-ptr-string-value\">\n+<h2>string_offset() string_length() string_ptr() string_value()</h2>\n <pre class=\"literal-block\">\n-char const* <strong>string_ptr</strong> () const;\n-std::ptrdiff_t <strong>string_offset</strong> () const;\n int <strong>string_length</strong> () const;\n string_view <strong>string_value</strong> () const;\n+char const* <strong>string_ptr</strong> () const;\n+std::ptrdiff_t <strong>string_offset</strong> () const;\n </pre>\n <p>these functions are only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">string_t</tt>. They return\n the string values. Note that <tt class=\"docutils literal\">string_ptr()</tt> is <em>not</em> 0-terminated.\n <tt class=\"docutils literal\">string_length()</tt> returns the number of bytes in the string.\n <tt class=\"docutils literal\">string_offset()</tt> returns the byte offset from the start of the parsed\n bencoded buffer this string can be found.</p>\n <a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n@@ -345,22 +345,22 @@\n <p>print the bencoded structure in a human-readable format to a string\n that's returned.</p>\n <a name=\"bdecode()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode%28%29&labels=documentation&body=Documentation+under+heading+%22bdecode%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"bdecode\">\n <h1>bdecode()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n <pre class=\"literal-block\">\n-int <strong>bdecode</strong> (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 <strong>bdecode</strong> (span<char const> buffer\n , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n , int token_limit = 2000000);\n bdecode_node <strong>bdecode</strong> (span<char const> buffer\n , int depth_limit = 100, int token_limit = 2000000);\n+int <strong>bdecode</strong> (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 </pre>\n <p>This function decodes/parses bdecoded data (for example a .torrent file).\n The data structure is returned in the <tt class=\"docutils literal\">ret</tt> argument. the buffer to parse\n is specified by the <tt class=\"docutils literal\">start</tt> of the buffer as well as the <tt class=\"docutils literal\">end</tt>, 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 <tt class=\"docutils literal\">ec</tt> with the error code. The optional\n argument <tt class=\"docutils literal\">error_pos</tt>, if set to non-nullptr, will be set to the byte offset\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,20 +6,20 @@\n * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\b__\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)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)\n- o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt\n- _\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n+ o _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\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)\n+ o _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)\n o _\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n- o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n o _\bs_\bw_\bi_\bt_\bc_\bh_\b__\bu_\bn_\bd_\be_\br_\bl_\by_\bi_\bn_\bg_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n o _\bh_\ba_\bs_\b__\bs_\bo_\bf_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n@@ -30,46 +30,46 @@\n Sometimes it's important to get a non-owning reference to the root node ( to be\n able to copy it as a reference for instance). For that, use the _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n member function.\n There are 5 different types of nodes, see _\bt_\by_\bp_\be_\b__\bt.\n struct bdecode_node\n {\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node 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<char const> 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- bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+ 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+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n 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 (string_view key) const;\n- std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n , std::int64_t default_val = 0) const;\n- std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+ std::pair<bdecode_node, bdecode_node> 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- char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n- std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+ char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+ std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () 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<char> error) const;\n \n enum type_t\n@@ -83,18 +83,18 @@\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n creates a default constructed node, it will have the type none_t.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+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&&) & = default;\n bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node 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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n type_t t\bty\byp\bpe\be () const noexcept;\n the type of this node. See _\bt_\by_\bp_\be_\b__\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -112,41 +112,41 @@\n span<char const> d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n returns the buffer and length of the section in the original bencoded buffer\n where this node is defined. For a dictionary for instance, this starts with d\n and ends with e, and has all the content of the dictionary in between. the\n data_offset() function returns the byte-offset to this node in, starting from\n the beginning of the buffer that was parsed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) *\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+*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_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) *\b**\b**\b**\b**\b*\n std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n , std::int64_t default_val = 0) const;\n-bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+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 functions with the list_ prefix operate on lists. These functions are only\n valid if type() == list_t. list_at() returns the item in the list at index i. i\n may not be greater than or equal to the size of the list. size() returns the\n size of the list.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b)\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+*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\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_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n 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 (string_view key) const;\n-std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n , std::int64_t default_val = 0) const;\n-std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+std::pair<bdecode_node, bdecode_node> 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@@ -158,19 +158,19 @@\n string).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n this function is only valid if type() == int_t. It returns the value of the\n integer.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n-std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n these functions are only valid if type() == string_t. They return the string\n values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n number of bytes in the string. string_offset() returns the byte offset from the\n start of the parsed bencoded buffer this string can be found.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br ();\n@@ -214,22 +214,22 @@\n std::string p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by (bdecode_node const& e\n , bool single_line = false, int indent = 0);\n print the bencoded structure in a human-readable format to a string that's\n returned.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span<char const> 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<char const> buffer\n , int depth_limit = 100, int token_limit = 2000000);\n+int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n+ , 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html", "unified_diff": "@@ -34,15 +34,15 @@\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#entry\" id=\"toc-entry-1\">entry</a><ul>\n <li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-2\">type()</a></li>\n <li><a class=\"reference internal\" href=\"#entry-1\" id=\"toc-entry-3\">entry()</a></li>\n <li><a class=\"reference internal\" href=\"#entry-2\" id=\"toc-entry-4\">entry()</a></li>\n <li><a class=\"reference internal\" href=\"#entry-3\" id=\"toc-entry-5\">entry()</a></li>\n <li><a class=\"reference internal\" href=\"#operator\" id=\"toc-entry-6\">operator=()</a></li>\n-<li><a class=\"reference internal\" href=\"#dict-integer-preformatted-string-list\" id=\"toc-entry-7\">dict() integer() preformatted() string() list()</a></li>\n+<li><a class=\"reference internal\" href=\"#preformatted-dict-integer-list-string\" id=\"toc-entry-7\">preformatted() dict() integer() list() string()</a></li>\n <li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-8\">swap()</a></li>\n <li><a class=\"reference internal\" href=\"#operator-1\" id=\"toc-entry-9\">operator[]()</a></li>\n <li><a class=\"reference internal\" href=\"#find-key\" id=\"toc-entry-10\">find_key()</a></li>\n <li><a class=\"reference internal\" href=\"#to-string\" id=\"toc-entry-11\">to_string()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-data-type\" id=\"toc-entry-12\">enum data_type</a></li>\n </ul>\n </li>\n@@ -71,39 +71,39 @@\n or a string.</p>\n <pre class=\"literal-block\">\n class entry\n {\n data_type <strong>type</strong> () const;\n <strong>entry</strong> (integer_type);\n <strong>entry</strong> (preformatted_type);\n- <strong>entry</strong> (list_type);\n <strong>entry</strong> (span<char const>);\n <strong>entry</strong> (dictionary_type);\n+ <strong>entry</strong> (list_type);\n <strong>entry</strong> (U v);\n <strong>entry</strong> (data_type t);\n <strong>entry</strong> (bdecode_node const& n);\n- entry& <strong>operator=</strong> (span<char const>) &;\n- entry& <strong>operator=</strong> (list_type) &;\n- entry& <strong>operator=</strong> (entry const&) &;\n- entry& <strong>operator=</strong> (dictionary_type) &;\n entry& <strong>operator=</strong> (preformatted_type) &;\n+ entry& <strong>operator=</strong> (span<char const>) &;\n entry& <strong>operator=</strong> (integer_type) &;\n entry& <strong>operator=</strong> (entry&&) & noexcept;\n+ entry& <strong>operator=</strong> (list_type) &;\n+ entry& <strong>operator=</strong> (dictionary_type) &;\n+ entry& <strong>operator=</strong> (entry const&) &;\n entry& <strong>operator=</strong> (bdecode_node const&) &;\n entry& <strong>operator=</strong> (U v) &;\n- list_type const& <strong>list</strong> () const;\n- dictionary_type const& <strong>dict</strong> () const;\n integer_type const& <strong>integer</strong> () const;\n- list_type& <strong>list</strong> ();\n+ dictionary_type& <strong>dict</strong> ();\n string_type& <strong>string</strong> ();\n- string_type const& <strong>string</strong> () const;\n+ list_type const& <strong>list</strong> () const;\n+ integer_type& <strong>integer</strong> ();\n preformatted_type& <strong>preformatted</strong> ();\n+ list_type& <strong>list</strong> ();\n+ dictionary_type const& <strong>dict</strong> () const;\n preformatted_type const& <strong>preformatted</strong> () const;\n- dictionary_type& <strong>dict</strong> ();\n- integer_type& <strong>integer</strong> ();\n+ string_type const& <strong>string</strong> () const;\n void <strong>swap</strong> (entry& e);\n entry const& <strong>operator[]</strong> (string_view key) const;\n entry& <strong>operator[]</strong> (string_view key);\n entry const* <strong>find_key</strong> (string_view key) const;\n entry* <strong>find_key</strong> (string_view key);\n std::string <strong>to_string</strong> (bool single_line = false) const;\n \n@@ -126,17 +126,17 @@\n <p>returns the concrete type of the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n <a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"entry-1\">\n <h2>entry()</h2>\n <pre class=\"literal-block\">\n <strong>entry</strong> (integer_type);\n <strong>entry</strong> (preformatted_type);\n-<strong>entry</strong> (list_type);\n <strong>entry</strong> (span<char const>);\n <strong>entry</strong> (dictionary_type);\n+<strong>entry</strong> (list_type);\n </pre>\n <p>constructors directly from a specific type.\n The content of the argument is copied into the\n newly constructed <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n <a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"entry-2\">\n <h2>entry()</h2>\n@@ -152,43 +152,43 @@\n <strong>entry</strong> (bdecode_node const& n);\n </pre>\n <p>construct from <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> parsed form (see <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>)</p>\n <a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Boperator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Boperator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"operator\">\n <h2>operator=()</h2>\n <pre class=\"literal-block\">\n-entry& <strong>operator=</strong> (span<char const>) &;\n-entry& <strong>operator=</strong> (list_type) &;\n-entry& <strong>operator=</strong> (entry const&) &;\n-entry& <strong>operator=</strong> (dictionary_type) &;\n entry& <strong>operator=</strong> (preformatted_type) &;\n+entry& <strong>operator=</strong> (span<char const>) &;\n entry& <strong>operator=</strong> (integer_type) &;\n entry& <strong>operator=</strong> (entry&&) & noexcept;\n+entry& <strong>operator=</strong> (list_type) &;\n+entry& <strong>operator=</strong> (dictionary_type) &;\n+entry& <strong>operator=</strong> (entry const&) &;\n entry& <strong>operator=</strong> (bdecode_node const&) &;\n </pre>\n <p>copies the structure of the right hand side into this\n <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a>.</p>\n+<a name=\"preformatted()\"></a>\n <a name=\"dict()\"></a>\n <a name=\"integer()\"></a>\n-<a name=\"preformatted()\"></a>\n-<a name=\"string()\"></a>\n-<a name=\"list()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bdict%28%29+integer%28%29+preformatted%28%29+string%28%29+list%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bdict%28%29+integer%28%29+preformatted%28%29+string%28%29+list%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dict-integer-preformatted-string-list\">\n-<h2>dict() integer() preformatted() string() list()</h2>\n+<a name=\"list()\"></a>\n+<a name=\"string()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bpreformatted%28%29+dict%28%29+integer%28%29+list%28%29+string%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bpreformatted%28%29+dict%28%29+integer%28%29+list%28%29+string%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"preformatted-dict-integer-list-string\">\n+<h2>preformatted() dict() integer() list() string()</h2>\n <pre class=\"literal-block\">\n-list_type const& <strong>list</strong> () const;\n-dictionary_type const& <strong>dict</strong> () const;\n integer_type const& <strong>integer</strong> () const;\n-list_type& <strong>list</strong> ();\n+dictionary_type& <strong>dict</strong> ();\n string_type& <strong>string</strong> ();\n-string_type const& <strong>string</strong> () const;\n+list_type const& <strong>list</strong> () const;\n+integer_type& <strong>integer</strong> ();\n preformatted_type& <strong>preformatted</strong> ();\n+list_type& <strong>list</strong> ();\n+dictionary_type const& <strong>dict</strong> () const;\n preformatted_type const& <strong>preformatted</strong> () const;\n-dictionary_type& <strong>dict</strong> ();\n-integer_type& <strong>integer</strong> ();\n+string_type const& <strong>string</strong> () const;\n </pre>\n <p>The <tt class=\"docutils literal\">integer()</tt>, <tt class=\"docutils literal\">string()</tt>, <tt class=\"docutils literal\">list()</tt> and <tt class=\"docutils literal\">dict()</tt> functions\n are accessors that return the respective type. If the <tt class=\"docutils literal\">entry</tt> object\n isn't of the type you request, the accessor will throw\n system_error. You can ask an <tt class=\"docutils literal\">entry</tt> for its type through the\n <tt class=\"docutils literal\">type()</tt> function.</p>\n <p>If you want to create an <tt class=\"docutils literal\">entry</tt> you give it the type you want it to\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,15 +5,15 @@\n Table of contents\n * _\be_\bn_\bt_\br_\by\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)\n+ o _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bk_\be_\by_\b(_\b)\n o _\bt_\bo_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be\n * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n@@ -37,39 +37,39 @@\n variant type, it can be either a list, a dictionary (std::map), an integer or a\n string.\n class entry\n {\n data_type t\bty\byp\bpe\be () const;\n e\ben\bnt\btr\bry\by (integer_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<char const>);\n e\ben\bnt\btr\bry\by (dictionary_type);\n+ e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (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= (span<char const>) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry 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= (preformatted_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & 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= (dictionary_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n- list_type const& l\bli\bis\bst\bt () const;\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+ dictionary_type& d\bdi\bic\bct\bt ();\n string_type& s\bst\btr\bri\bin\bng\bg ();\n- string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+ list_type const& l\bli\bis\bst\bt () const;\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+ list_type& l\bli\bis\bst\bt ();\n+ dictionary_type const& d\bdi\bic\bct\bt () const;\n preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n- dictionary_type& d\bdi\bic\bct\bt ();\n- integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ string_type const& s\bst\btr\bri\bin\bng\bg () const;\n void s\bsw\bwa\bap\bp (entry& e);\n entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n \n@@ -87,50 +87,50 @@\n *\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n data_type t\bty\byp\bpe\be () const;\n returns the concrete type of the _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (integer_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<char const>);\n e\ben\bnt\btr\bry\by (dictionary_type);\n+e\ben\bnt\btr\bry\by (list_type);\n constructors directly from a specific type. The content of the argument is\n copied into the newly constructed _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (data_type t);\n construct an empty _\be_\bn_\bt_\br_\by of the specified type. see _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be enum.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (bdecode_node const& n);\n construct from _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be parsed form (see _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b))\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry 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= (preformatted_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & 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= (dictionary_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n 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) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) l\bli\bis\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-list_type const& l\bli\bis\bst\bt () const;\n-dictionary_type const& d\bdi\bic\bct\bt () const;\n+*\b**\b**\b**\b**\b* p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) d\bdi\bic\bct\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) l\bli\bis\bst\bt(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n-list_type& l\bli\bis\bst\bt ();\n+dictionary_type& d\bdi\bic\bct\bt ();\n string_type& s\bst\btr\bri\bin\bng\bg ();\n-string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+list_type const& l\bli\bis\bst\bt () const;\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+list_type& l\bli\bis\bst\bt ();\n+dictionary_type const& d\bdi\bic\bct\bt () const;\n preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n-dictionary_type& d\bdi\bic\bct\bt ();\n-integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+string_type const& s\bst\btr\bri\bin\bng\bg () const;\n The integer(), string(), list() and dict() functions are accessors that return\n the respective type. If the entry object isn't of the type you request, the\n accessor will throw system_error. You can ask an entry for its type through the\n type() function.\n If you want to create an entry you give it the type you want it to have in its\n constructor, and then use one of the non-const accessors to get a reference\n which you then can assign the value you want it to have.\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html", "unified_diff": "@@ -28,52 +28,88 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#piece-block\" id=\"toc-entry-1\">piece_block</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hash-t\" id=\"toc-entry-2\">info_hash_t</a><ul>\n-<li><a class=\"reference internal\" href=\"#info-hash-t-1\" id=\"toc-entry-3\">info_hash_t()</a></li>\n-<li><a class=\"reference internal\" href=\"#has-v2-has-has-v1\" id=\"toc-entry-4\">has_v2() has() has_v1()</a></li>\n-<li><a class=\"reference internal\" href=\"#get\" id=\"toc-entry-5\">get()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-best\" id=\"toc-entry-6\">get_best()</a></li>\n-<li><a class=\"reference internal\" href=\"#for-each\" id=\"toc-entry-7\">for_each()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-request\" id=\"toc-entry-1\">peer_request</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator\" id=\"toc-entry-2\">operator==()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-info\" id=\"toc-entry-8\">peer_info</a><ul>\n-<li><a class=\"reference internal\" href=\"#i2p-destination\" id=\"toc-entry-9\">i2p_destination()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-block\" id=\"toc-entry-3\">piece_block</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-info\" id=\"toc-entry-4\">peer_info</a><ul>\n+<li><a class=\"reference internal\" href=\"#i2p-destination\" id=\"toc-entry-5\">i2p_destination()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-request\" id=\"toc-entry-10\">peer_request</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator\" id=\"toc-entry-11\">operator==()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hash-t\" id=\"toc-entry-6\">info_hash_t</a><ul>\n+<li><a class=\"reference internal\" href=\"#info-hash-t-1\" id=\"toc-entry-7\">info_hash_t()</a></li>\n+<li><a class=\"reference internal\" href=\"#has-has-v2-has-v1\" id=\"toc-entry-8\">has() has_v2() has_v1()</a></li>\n+<li><a class=\"reference internal\" href=\"#get\" id=\"toc-entry-9\">get()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-best\" id=\"toc-entry-10\">get_best()</a></li>\n+<li><a class=\"reference internal\" href=\"#for-each\" id=\"toc-entry-11\">for_each()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-peer-equal\" id=\"toc-entry-12\">torrent_peer_equal()</a></li>\n-<li><a class=\"reference internal\" href=\"#make-magnet-uri\" id=\"toc-entry-13\">make_magnet_uri()</a></li>\n-<li><a class=\"reference internal\" href=\"#parse-magnet-uri\" id=\"toc-entry-14\">parse_magnet_uri()</a></li>\n-<li><a class=\"reference internal\" href=\"#truncate-files\" id=\"toc-entry-15\">truncate_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#version\" id=\"toc-entry-16\">version()</a></li>\n-<li><a class=\"reference internal\" href=\"#load-torrent-parsed-load-torrent-buffer-load-torrent-file\" id=\"toc-entry-17\">load_torrent_parsed() load_torrent_buffer() load_torrent_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-protocol-version\" id=\"toc-entry-18\">enum protocol_version</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-socket-type-t\" id=\"toc-entry-19\">enum socket_type_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-portmap-transport\" id=\"toc-entry-20\">enum portmap_transport</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-portmap-protocol\" id=\"toc-entry-21\">enum portmap_protocol</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-event-t\" id=\"toc-entry-22\">enum event_t</a></li>\n+<li><a class=\"reference internal\" href=\"#load-torrent-file-load-torrent-parsed-load-torrent-buffer\" id=\"toc-entry-12\">load_torrent_file() load_torrent_parsed() load_torrent_buffer()</a></li>\n+<li><a class=\"reference internal\" href=\"#truncate-files\" id=\"toc-entry-13\">truncate_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#make-magnet-uri\" id=\"toc-entry-14\">make_magnet_uri()</a></li>\n+<li><a class=\"reference internal\" href=\"#parse-magnet-uri\" id=\"toc-entry-15\">parse_magnet_uri()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-peer-equal\" id=\"toc-entry-16\">torrent_peer_equal()</a></li>\n+<li><a class=\"reference internal\" href=\"#version\" id=\"toc-entry-17\">version()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-event-t\" id=\"toc-entry-18\">enum event_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-portmap-transport\" id=\"toc-entry-19\">enum portmap_transport</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-portmap-protocol\" id=\"toc-entry-20\">enum portmap_protocol</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-protocol-version\" id=\"toc-entry-21\">enum protocol_version</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-socket-type-t\" id=\"toc-entry-22\">enum socket_type_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-connection-type\" id=\"toc-entry-23\">enum connection_type</a></li>\n <li><a class=\"reference internal\" href=\"#torrent-flags-t\" id=\"toc-entry-24\">torrent_flags_t</a></li>\n-<li><a class=\"reference internal\" href=\"#pex-flags-t\" id=\"toc-entry-25\">pex_flags_t</a></li>\n-<li><a class=\"reference internal\" href=\"#download-priority-t\" id=\"toc-entry-26\">download_priority_t</a></li>\n-<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-27\">int</a></li>\n-<li><a class=\"reference internal\" href=\"#char-const\" id=\"toc-entry-28\">char const*</a></li>\n-<li><a class=\"reference internal\" href=\"#std-uint64-t\" id=\"toc-entry-29\">std::uint64_t</a></li>\n+<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-25\">int</a></li>\n+<li><a class=\"reference internal\" href=\"#pex-flags-t\" id=\"toc-entry-26\">pex_flags_t</a></li>\n+<li><a class=\"reference internal\" href=\"#char-const\" id=\"toc-entry-27\">char const*</a></li>\n+<li><a class=\"reference internal\" href=\"#std-uint64-t\" id=\"toc-entry-28\">std::uint64_t</a></li>\n+<li><a class=\"reference internal\" href=\"#download-priority-t\" id=\"toc-entry-29\">download_priority_t</a></li>\n </ul>\n </div>\n-<a name=\"piece_block\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_block&labels=documentation&body=Documentation+under+heading+%22class+piece_block%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"piece-block\">\n+<a name=\"peer_request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_request&labels=documentation&body=Documentation+under+heading+%22class+peer_request%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"peer-request\">\n+<h1>peer_request</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_request.hpp\">libtorrent/peer_request.hpp</a>"</p>\n+<p>represents a byte range within a piece. Internally this is is used for\n+incoming piece requests.</p>\n+<pre class=\"literal-block\">\n+struct peer_request\n+{\n+ bool <strong>operator==</strong> (peer_request const& r) const;\n+\n+ piece_index_t piece;\n+ int start;\n+ int length;\n+};\n+</pre>\n+<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator\">\n+<h2>operator==()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator==</strong> (peer_request const& r) const;\n+</pre>\n+<p>returns true if the right hand side <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> refers to the same\n+range as this does.</p>\n+<a name=\"piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bpiece%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bpiece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece</dt>\n+<dd>The index of the piece in which the range starts.</dd>\n+</dl>\n+<a name=\"start\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bstart%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bstart%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>start</dt>\n+<dd>The byte offset within that piece where the range starts.</dd>\n+</dl>\n+<a name=\"length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Blength%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Blength%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>length</dt>\n+<dd>The size of the range, in bytes.</dd>\n+</dl>\n+<a name=\"piece_block\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_block&labels=documentation&body=Documentation+under+heading+%22class+piece_block%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"piece-block\">\n <h1>piece_block</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/piece_block.hpp\">libtorrent/piece_block.hpp</a>"</p>\n <pre class=\"literal-block\">\n struct piece_block\n {\n <strong>piece_block</strong> () = default;\n <strong>piece_block</strong> (piece_index_t p_index, int b_index);\n@@ -82,100 +118,15 @@\n bool <strong>operator!=</strong> (piece_block const& b) const;\n \n static const piece_block invalid;\n piece_index_t piece_index {0};\n int <strong>block_index</strong> = 0;\n };\n </pre>\n-<a name=\"info_hash_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+info_hash_t&labels=documentation&body=Documentation+under+heading+%22class+info_hash_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hash-t\">\n-<h1>info_hash_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n-<p>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.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">If <tt class=\"docutils literal\">has_v2()</tt> is false then the v1 hash might actually be a truncated\n-v2 hash</p>\n-</div>\n-<pre class=\"literal-block\">\n-struct info_hash_t\n-{\n- <strong>info_hash_t</strong> () noexcept = default;\n- <strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n- explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n- explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n- bool <strong>has_v2</strong> () const;\n- bool <strong>has</strong> (protocol_version v) const;\n- bool <strong>has_v1</strong> () const;\n- sha1_hash <strong>get</strong> (protocol_version v) const;\n- sha1_hash <strong>get_best</strong> () const;\n- friend bool <strong>operator!=</strong> (info_hash_t const& lhs, info_hash_t const& rhs);\n- friend bool <strong>operator==</strong> (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n- template <typename F> void <strong>for_each</strong> (F f) const;\n- bool <strong>operator<</strong> (info_hash_t const& o) const;\n- friend std::ostream& <strong>operator<<</strong> (std::ostream& os, info_hash_t const& ih);\n-\n- sha1_hash v1;\n- sha256_hash v2;\n-};\n-</pre>\n-<a name=\"info_hash_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"info-hash-t-1\">\n-<h2>info_hash_t()</h2>\n-<pre class=\"literal-block\">\n-<strong>info_hash_t</strong> () noexcept = default;\n-<strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n-explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n-explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n-</pre>\n-<p>The default constructor creates an object that has neither a v1 or v2\n-hash.</p>\n-<p>For backwards compatibility, make it possible to construct directly\n-from a v1 hash. This constructor allows <em>implicit</em> conversion from a\n-v1 hash, but the implicitness is deprecated.</p>\n-<a name=\"has_v2()\"></a>\n-<a name=\"has()\"></a>\n-<a name=\"has_v1()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bhas_v2%28%29+has%28%29+has_v1%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bhas_v2%28%29+has%28%29+has_v1%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"has-v2-has-has-v1\">\n-<h2>has_v2() has() has_v1()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>has_v2</strong> () const;\n-bool <strong>has</strong> (protocol_version v) const;\n-bool <strong>has_v1</strong> () const;\n-</pre>\n-<p>returns true if the corresponding info hash is present in this\n-object.</p>\n-<a name=\"get()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get\">\n-<h2>get()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>get</strong> (protocol_version v) const;\n-</pre>\n-<p>returns the has for the specified protocol version</p>\n-<a name=\"get_best()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget_best%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget_best%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-best\">\n-<h2>get_best()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>get_best</strong> () const;\n-</pre>\n-<p>returns the v2 (truncated) info-hash, if there is one, otherwise\n-returns the v1 info-hash</p>\n-<a name=\"for_each()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bfor_each%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bfor_each%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"for-each\">\n-<h2>for_each()</h2>\n-<pre class=\"literal-block\">\n-template <typename F> void <strong>for_each</strong> (F f) const;\n-</pre>\n-<p>calls the function object <tt class=\"docutils literal\">f</tt> for each hash that is available.\n-starting with v1. The signature of <tt class=\"docutils literal\">F</tt> is:</p>\n-<pre class=\"literal-block\">\n-void(sha1_hash const&, protocol_version);\n-</pre>\n <a name=\"peer_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_info&labels=documentation&body=Documentation+under+heading+%22class+peer_info%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n <div class=\"section\" id=\"peer-info\">\n <h1>peer_info</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_info.hpp\">libtorrent/peer_info.hpp</a>"</p>\n <p>holds information and statistics about one peer\n that libtorrent is connected to</p>\n <pre class=\"literal-block\">\n struct peer_info\n@@ -653,66 +604,150 @@\n <a name=\"write_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bread_state+write_state%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bread_state+write_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>read_state write_state</dt>\n <dd>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.</dd>\n </dl>\n-<a name=\"peer_request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_request&labels=documentation&body=Documentation+under+heading+%22class+peer_request%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"info_hash_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+info_hash_t&labels=documentation&body=Documentation+under+heading+%22class+info_hash_t%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"info-hash-t\">\n+<h1>info_hash_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n+<p>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.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">If <tt class=\"docutils literal\">has_v2()</tt> is false then the v1 hash might actually be a truncated\n+v2 hash</p>\n </div>\n-<div class=\"section\" id=\"peer-request\">\n-<h1>peer_request</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_request.hpp\">libtorrent/peer_request.hpp</a>"</p>\n-<p>represents a byte range within a piece. Internally this is is used for\n-incoming piece requests.</p>\n <pre class=\"literal-block\">\n-struct peer_request\n+struct info_hash_t\n {\n- bool <strong>operator==</strong> (peer_request const& r) const;\n+ explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n+ <strong>info_hash_t</strong> () noexcept = default;\n+ explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n+ <strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n+ bool <strong>has_v2</strong> () const;\n+ bool <strong>has</strong> (protocol_version v) const;\n+ bool <strong>has_v1</strong> () const;\n+ sha1_hash <strong>get</strong> (protocol_version v) const;\n+ sha1_hash <strong>get_best</strong> () const;\n+ friend bool <strong>operator!=</strong> (info_hash_t const& lhs, info_hash_t const& rhs);\n+ friend bool <strong>operator==</strong> (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n+ template <typename F> void <strong>for_each</strong> (F f) const;\n+ bool <strong>operator<</strong> (info_hash_t const& o) const;\n+ friend std::ostream& <strong>operator<<</strong> (std::ostream& os, info_hash_t const& ih);\n \n- piece_index_t piece;\n- int start;\n- int length;\n+ sha1_hash v1;\n+ sha256_hash v2;\n };\n </pre>\n-<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator\">\n-<h2>operator==()</h2>\n+<a name=\"info_hash_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"info-hash-t-1\">\n+<h2>info_hash_t()</h2>\n <pre class=\"literal-block\">\n-bool <strong>operator==</strong> (peer_request const& r) const;\n+explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n+<strong>info_hash_t</strong> () noexcept = default;\n+explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n+<strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n </pre>\n-<p>returns true if the right hand side <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> refers to the same\n-range as this does.</p>\n-<a name=\"piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bpiece%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bpiece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece</dt>\n-<dd>The index of the piece in which the range starts.</dd>\n-</dl>\n-<a name=\"start\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bstart%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bstart%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>start</dt>\n-<dd>The byte offset within that piece where the range starts.</dd>\n-</dl>\n-<a name=\"length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Blength%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Blength%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>length</dt>\n-<dd>The size of the range, in bytes.</dd>\n-</dl>\n-<a name=\"torrent_peer_equal()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_peer_equal%28%29&labels=documentation&body=Documentation+under+heading+%22torrent_peer_equal%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<p>The default constructor creates an object that has neither a v1 or v2\n+hash.</p>\n+<p>For backwards compatibility, make it possible to construct directly\n+from a v1 hash. This constructor allows <em>implicit</em> conversion from a\n+v1 hash, but the implicitness is deprecated.</p>\n+<a name=\"has()\"></a>\n+<a name=\"has_v2()\"></a>\n+<a name=\"has_v1()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bhas%28%29+has_v2%28%29+has_v1%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bhas%28%29+has_v2%28%29+has_v1%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"has-has-v2-has-v1\">\n+<h2>has() has_v2() has_v1()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>has_v2</strong> () const;\n+bool <strong>has</strong> (protocol_version v) const;\n+bool <strong>has_v1</strong> () const;\n+</pre>\n+<p>returns true if the corresponding info hash is present in this\n+object.</p>\n+<a name=\"get()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get\">\n+<h2>get()</h2>\n+<pre class=\"literal-block\">\n+sha1_hash <strong>get</strong> (protocol_version v) const;\n+</pre>\n+<p>returns the has for the specified protocol version</p>\n+<a name=\"get_best()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget_best%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget_best%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-best\">\n+<h2>get_best()</h2>\n+<pre class=\"literal-block\">\n+sha1_hash <strong>get_best</strong> () const;\n+</pre>\n+<p>returns the v2 (truncated) info-hash, if there is one, otherwise\n+returns the v1 info-hash</p>\n+<a name=\"for_each()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bfor_each%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bfor_each%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"for-each\">\n+<h2>for_each()</h2>\n+<pre class=\"literal-block\">\n+template <typename F> void <strong>for_each</strong> (F f) const;\n+</pre>\n+<p>calls the function object <tt class=\"docutils literal\">f</tt> for each hash that is available.\n+starting with v1. The signature of <tt class=\"docutils literal\">F</tt> is:</p>\n+<pre class=\"literal-block\">\n+void(sha1_hash const&, protocol_version);\n+</pre>\n+<a name=\"load_torrent_file()\"></a>\n+<a name=\"load_torrent_parsed()\"></a>\n+<a name=\"load_torrent_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_file%28%29+load_torrent_parsed%28%29+load_torrent_buffer%28%29&labels=documentation&body=Documentation+under+heading+%22load_torrent_file%28%29+load_torrent_parsed%28%29+load_torrent_buffer%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"torrent-peer-equal\">\n-<h1>torrent_peer_equal()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_peer.hpp\">libtorrent/torrent_peer.hpp</a>"</p>\n+<div class=\"section\" id=\"load-torrent-file-load-torrent-parsed-load-torrent-buffer\">\n+<h1>load_torrent_file() load_torrent_parsed() load_torrent_buffer()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/load_torrent.hpp\">libtorrent/load_torrent.hpp</a>"</p>\n <pre class=\"literal-block\">\n-inline bool <strong>torrent_peer_equal</strong> (torrent_peer const* lhs, torrent_peer const* rhs);\n+add_torrent_params <strong>load_torrent_buffer</strong> (\n+ span<char const> buffer);\n+add_torrent_params <strong>load_torrent_file</strong> (\n+ std::string const& filename);\n+add_torrent_params <strong>load_torrent_file</strong> (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params <strong>load_torrent_parsed</strong> (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params <strong>load_torrent_parsed</strong> (\n+ bdecode_node const& torrent_file);\n+add_torrent_params <strong>load_torrent_buffer</strong> (\n+ span<char const> buffer, load_torrent_limits const& cfg);\n+</pre>\n+<p>These functions load the content of a .torrent file into an\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.\n+The immutable part of a torrent file (the info-dictionary) is stored in\n+the <tt class=\"docutils literal\">ti</tt> field in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object (as a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n+object).\n+The returned object is suitable to be:</p>\n+<blockquote>\n+<ul class=\"simple\">\n+<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n+<li>saved as a .torrent_file via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n+<li>turned into a magnet link via <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n+</ul>\n+</blockquote>\n+<a name=\"truncate_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:truncate_files%28%29&labels=documentation&body=Documentation+under+heading+%22truncate_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"truncate-files\">\n+<h1>truncate_files()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/truncate.hpp\">libtorrent/truncate.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+void <strong>truncate_files</strong> (file_storage const& fs, std::string const& save_path, storage_error& ec);\n </pre>\n+<p>Truncates files larger than specified in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>, saved under\n+the specified save_path.</p>\n <a name=\"make_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:make_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22make_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"make-magnet-uri\">\n <h1>make_magnet_uri()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n <pre class=\"literal-block\">\n-std::string <strong>make_magnet_uri</strong> (add_torrent_params const& atp);\n std::string <strong>make_magnet_uri</strong> (torrent_info const& info);\n std::string <strong>make_magnet_uri</strong> (torrent_handle const& handle);\n+std::string <strong>make_magnet_uri</strong> (add_torrent_params const& atp);\n </pre>\n <p>Generates a magnet URI from the specified torrent.</p>\n <p>Several fields from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> objects are recorded in the\n magnet link. In order to not include them, they have to be cleared before\n calling <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a>. These fields are used:</p>\n <blockquote>\n <tt class=\"docutils literal\">ti</tt>, <tt class=\"docutils literal\">info_hashes</tt>, <tt class=\"docutils literal\">url_seeds</tt>, <tt class=\"docutils literal\">dht_nodes</tt>,\n@@ -733,157 +768,75 @@\n <p>For more information about magnet links, see <a class=\"reference external\" href=\"manual-ref.html#magnet-links\">magnet links</a>.</p>\n <a name=\"parse_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:parse_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22parse_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"parse-magnet-uri\">\n <h1>parse_magnet_uri()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n <pre class=\"literal-block\">\n add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri, error_code& ec);\n-void <strong>parse_magnet_uri</strong> (string_view uri, add_torrent_params& p, error_code& ec);\n add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri);\n+void <strong>parse_magnet_uri</strong> (string_view uri, add_torrent_params& p, error_code& ec);\n </pre>\n <p>This function parses out information from the magnet link and populates the\n <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. The overload that does not take an\n <tt class=\"docutils literal\">error_code</tt> reference will throw a system_error on error\n The overload taking an <tt class=\"docutils literal\">add_torrent_params</tt> reference will fill in the\n fields specified in the magnet URI.</p>\n-<a name=\"truncate_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:truncate_files%28%29&labels=documentation&body=Documentation+under+heading+%22truncate_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"truncate-files\">\n-<h1>truncate_files()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/truncate.hpp\">libtorrent/truncate.hpp</a>"</p>\n+<a name=\"torrent_peer_equal()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_peer_equal%28%29&labels=documentation&body=Documentation+under+heading+%22torrent_peer_equal%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-peer-equal\">\n+<h1>torrent_peer_equal()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_peer.hpp\">libtorrent/torrent_peer.hpp</a>"</p>\n <pre class=\"literal-block\">\n-void <strong>truncate_files</strong> (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+inline bool <strong>torrent_peer_equal</strong> (torrent_peer const* lhs, torrent_peer const* rhs);\n </pre>\n-<p>Truncates files larger than specified in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>, saved under\n-the specified save_path.</p>\n <a name=\"version()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:version%28%29&labels=documentation&body=Documentation+under+heading+%22version%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"version\">\n <h1>version()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n <pre class=\"literal-block\">\n char const* <strong>version</strong> ();\n </pre>\n <p>returns the libtorrent version as string form in this format:\n "<major>.<minor>.<tiny>.<tag>"</p>\n-<a name=\"load_torrent_parsed()\"></a>\n-<a name=\"load_torrent_buffer()\"></a>\n-<a name=\"load_torrent_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_parsed%28%29+load_torrent_buffer%28%29+load_torrent_file%28%29&labels=documentation&body=Documentation+under+heading+%22load_torrent_parsed%28%29+load_torrent_buffer%28%29+load_torrent_file%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"load-torrent-parsed-load-torrent-buffer-load-torrent-file\">\n-<h1>load_torrent_parsed() load_torrent_buffer() load_torrent_file()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/load_torrent.hpp\">libtorrent/load_torrent.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-add_torrent_params <strong>load_torrent_file</strong> (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params <strong>load_torrent_buffer</strong> (\n- span<char const> buffer);\n-add_torrent_params <strong>load_torrent_parsed</strong> (\n- bdecode_node const& torrent_file);\n-add_torrent_params <strong>load_torrent_file</strong> (\n- std::string const& filename);\n-add_torrent_params <strong>load_torrent_parsed</strong> (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-add_torrent_params <strong>load_torrent_buffer</strong> (\n- span<char const> buffer, load_torrent_limits const& cfg);\n-</pre>\n-<p>These functions load the content of a .torrent file into an\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.\n-The immutable part of a torrent file (the info-dictionary) is stored in\n-the <tt class=\"docutils literal\">ti</tt> field in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object (as a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n-object).\n-The returned object is suitable to be:</p>\n-<blockquote>\n-<ul class=\"simple\">\n-<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n-<li>saved as a .torrent_file via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n-<li>turned into a magnet link via <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n-</ul>\n-</blockquote>\n-<a name=\"protocol_version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+protocol_version&labels=documentation&body=Documentation+under+heading+%22enum+protocol_version%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-protocol-version\">\n-<h1>enum protocol_version</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"8%\" />\n-<col width=\"10%\" />\n-<col width=\"82%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>V1</td>\n-<td>0</td>\n-<td>The original BitTorrent version, using SHA-1 hashes</td>\n-</tr>\n-<tr><td>V2</td>\n-<td>1</td>\n-<td>Version 2 of the BitTorrent protocol, using SHA-256 hashes</td>\n-</tr>\n-<tr><td>NUM</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-socket-type-t\">\n-<h1>enum socket_type_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socket_type.hpp\">libtorrent/socket_type.hpp</a>"</p>\n+<a name=\"event_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+event_t&labels=documentation&body=Documentation+under+heading+%22enum+event_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-event-t\">\n+<h1>enum event_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/tracker_manager.hpp\">libtorrent/tracker_manager.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"38%\" />\n-<col width=\"22%\" />\n-<col width=\"41%\" />\n+<col width=\"35%\" />\n+<col width=\"23%\" />\n+<col width=\"42%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>tcp</td>\n+<tr><td>none</td>\n <td>0</td>\n <td> </td>\n </tr>\n-<tr><td>socks5</td>\n+<tr><td>completed</td>\n <td>1</td>\n <td> </td>\n </tr>\n-<tr><td>http</td>\n+<tr><td>started</td>\n <td>2</td>\n <td> </td>\n </tr>\n-<tr><td>utp</td>\n+<tr><td>stopped</td>\n <td>3</td>\n <td> </td>\n </tr>\n-<tr><td>i2p</td>\n+<tr><td>paused</td>\n <td>4</td>\n <td> </td>\n </tr>\n-<tr><td>tcp_ssl</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>socks5_ssl</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>http_ssl</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>utp_ssl</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n </tbody>\n </table>\n <a name=\"portmap_transport\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+portmap_transport&labels=documentation&body=Documentation+under+heading+%22enum+portmap_transport%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-portmap-transport\">\n <h1>enum portmap_transport</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/portmap.hpp\">libtorrent/portmap.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n@@ -936,51 +889,98 @@\n </tr>\n <tr><td>udp</td>\n <td>2</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"event_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+event_t&labels=documentation&body=Documentation+under+heading+%22enum+event_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-event-t\">\n-<h1>enum event_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/tracker_manager.hpp\">libtorrent/tracker_manager.hpp</a>"</p>\n+<a name=\"protocol_version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+protocol_version&labels=documentation&body=Documentation+under+heading+%22enum+protocol_version%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-protocol-version\">\n+<h1>enum protocol_version</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"35%\" />\n-<col width=\"23%\" />\n-<col width=\"42%\" />\n+<col width=\"8%\" />\n+<col width=\"10%\" />\n+<col width=\"82%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>none</td>\n+<tr><td>V1</td>\n <td>0</td>\n+<td>The original BitTorrent version, using SHA-1 hashes</td>\n+</tr>\n+<tr><td>V2</td>\n+<td>1</td>\n+<td>Version 2 of the BitTorrent protocol, using SHA-256 hashes</td>\n+</tr>\n+<tr><td>NUM</td>\n+<td>2</td>\n <td> </td>\n </tr>\n-<tr><td>completed</td>\n+</tbody>\n+</table>\n+<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-socket-type-t\">\n+<h1>enum socket_type_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socket_type.hpp\">libtorrent/socket_type.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"38%\" />\n+<col width=\"22%\" />\n+<col width=\"41%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tcp</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>socks5</td>\n <td>1</td>\n <td> </td>\n </tr>\n-<tr><td>started</td>\n+<tr><td>http</td>\n <td>2</td>\n <td> </td>\n </tr>\n-<tr><td>stopped</td>\n+<tr><td>utp</td>\n <td>3</td>\n <td> </td>\n </tr>\n-<tr><td>paused</td>\n+<tr><td>i2p</td>\n <td>4</td>\n <td> </td>\n </tr>\n+<tr><td>tcp_ssl</td>\n+<td>5</td>\n+<td> </td>\n+</tr>\n+<tr><td>socks5_ssl</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>http_ssl</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>utp_ssl</td>\n+<td>8</td>\n+<td> </td>\n+</tr>\n </tbody>\n </table>\n <a name=\"connection_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+connection_type&labels=documentation&body=Documentation+under+heading+%22enum+connection_type%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-connection-type\">\n <h1>enum connection_type</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection.hpp\">libtorrent/peer_connection.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n@@ -1240,14 +1240,30 @@\n URL.</dd>\n </dl>\n <a name=\"torrent_flags_t::all\"></a><dl class=\"docutils\">\n <dt>all</dt>\n <dd>all torrent flags combined. Can conveniently be used when creating masks\n for flags</dd>\n </dl>\n+<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"int\">\n+<h1>int</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"int::version_major\"></a><dl class=\"docutils\">\n+<dt>version_major</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n+<a name=\"int::version_minor\"></a><dl class=\"docutils\">\n+<dt>version_minor</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n+<a name=\"int::version_tiny\"></a><dl class=\"docutils\">\n+<dt>version_tiny</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n <a name=\"pex_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:pex_flags_t&labels=documentation&body=Documentation+under+heading+%22pex_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"pex-flags-t\">\n <h1>pex_flags_t</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/pex_flags.hpp\">libtorrent/pex_flags.hpp</a>"</p>\n <a name=\"pex_flags_t::pex_encryption\"></a><dl class=\"docutils\">\n <dt>pex_encryption</dt>\n <dd>the peer supports protocol encryption</dd>\n@@ -1267,14 +1283,30 @@\n the peer fail</dd>\n </dl>\n <a name=\"pex_flags_t::pex_lt_v2\"></a><dl class=\"docutils\">\n <dt>pex_lt_v2</dt>\n <dd>protocol v2\n this is not a standard flag, it is only used internally</dd>\n </dl>\n+<a name=\"char const*\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:char+const%2A&labels=documentation&body=Documentation+under+heading+%22char+const%2A%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"char-const\">\n+<h1>char const*</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"char const*::version_str\"></a><dl class=\"docutils\">\n+<dt>version_str</dt>\n+<dd>the libtorrent version in string form</dd>\n+</dl>\n+<a name=\"std::uint64_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:std%3A%3Auint64_t&labels=documentation&body=Documentation+under+heading+%22std%3A%3Auint64_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"std-uint64-t\">\n+<h1>std::uint64_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"std::uint64_t::version_revision\"></a><dl class=\"docutils\">\n+<dt>version_revision</dt>\n+<dd>the git commit of this libtorrent version</dd>\n+</dl>\n <a name=\"download_priority_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:download_priority_t&labels=documentation&body=Documentation+under+heading+%22download_priority_t%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"download-priority-t\">\n <h1>download_priority_t</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/download_priority.hpp\">libtorrent/download_priority.hpp</a>"</p>\n <a name=\"download_priority_t::dont_download\"></a><dl class=\"docutils\">\n <dt>dont_download</dt>\n <dd>Don't download the file or piece. Partial pieces may still be downloaded when\n@@ -1288,46 +1320,14 @@\n <dt>low_priority</dt>\n <dd>The lowest priority for files and pieces.</dd>\n </dl>\n <a name=\"download_priority_t::top_priority\"></a><dl class=\"docutils\">\n <dt>top_priority</dt>\n <dd>The highest priority for files and pieces.</dd>\n </dl>\n-<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"int\">\n-<h1>int</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"int::version_major\"></a><dl class=\"docutils\">\n-<dt>version_major</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"int::version_minor\"></a><dl class=\"docutils\">\n-<dt>version_minor</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"int::version_tiny\"></a><dl class=\"docutils\">\n-<dt>version_tiny</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"char const*\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:char+const%2A&labels=documentation&body=Documentation+under+heading+%22char+const%2A%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"char-const\">\n-<h1>char const*</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"char const*::version_str\"></a><dl class=\"docutils\">\n-<dt>version_str</dt>\n-<dd>the libtorrent version in string form</dd>\n-</dl>\n-<a name=\"std::uint64_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:std%3A%3Auint64_t&labels=documentation&body=Documentation+under+heading+%22std%3A%3Auint64_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"std-uint64-t\">\n-<h1>std::uint64_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"std::uint64_t::version_revision\"></a><dl class=\"docutils\">\n-<dt>version_revision</dt>\n-<dd>the git commit of this libtorrent version</dd>\n-</dl>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n <div id=\"footer\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,41 +1,68 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+ * _\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 * _\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(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\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_\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- * _\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__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+ * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n- * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\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 _\be_\bv_\be_\bn_\bt_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\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- * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n * _\bi_\bn_\bt\n+ * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+ * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_r\bre\beq\bqu\bue\bes\bst\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b._\bh_\bp_\bp\"\n+represents a byte range within a piece. Internally this is is used for incoming\n+piece requests.\n+struct peer_request\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+\n+ piece_index_t piece;\n+ int start;\n+ int length;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n+this does.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece\n+ The index of the piece in which the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ start\n+ The byte offset within that piece where the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ length\n+ The size of the range, in bytes.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n struct piece_block\n {\n p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n@@ -44,73 +71,14 @@\n bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n \n static const piece_block invalid;\n piece_index_t piece_index {0};\n int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n-class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n-a v2 info-hash (SHA-256) or both.\n-Note\n-If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n-struct info_hash_t\n-{\n- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n- explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (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_\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 <typename F> void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (info_hash_t const& o) const;\n- friend std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, info_hash_t const& ih);\n-\n- sha1_hash v1;\n- sha256_hash v2;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n-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 (sha256_hash h2) noexcept;\n-explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n-The default constructor creates an object that has neither a v1 or v2 hash.\n-For backwards compatibility, make it possible to construct directly from a v1\n-hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n-implicitness is deprecated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs(\b()\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 <typename F> 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@@ -479,51 +447,107 @@\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\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+*\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- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+ bool h\bha\bas\bs_\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 <typename F> 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- piece_index_t piece;\n- int start;\n- int length;\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* 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+*\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 () noexcept = default;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+The default constructor creates an object that has neither a v1 or v2 hash.\n+For backwards compatibility, make it possible to construct directly from a v1\n+hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n+implicitness is deprecated.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece\n- The index of the piece in which the range starts.\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- start\n- The byte offset within that piece where the range starts.\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- length\n- The size of the range, in bytes.\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**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n-inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n-rhs);\n+*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n+template <typename F> 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* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n+ span<char const> buffer);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+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<char const> 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 (add_torrent_params const& atp);\n std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_info const& info);\n std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n+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@@ -539,56 +563,57 @@\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+void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n This function parses out information from the magnet link and populates the\n _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. The overload that does not take an error_code\n reference will throw a system_error on error The overload taking an\n add_torrent_params reference will fill in the fields specified in the magnet\n URI.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n-void t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs (file_storage const& fs, std::string const& save_path,\n-storage_error& ec);\n-Truncates files larger than specified in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be, saved under the\n-specified save_path.\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n+inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n+rhs);\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n returns the libtorrent version as string form in this format:\n \"<major>.<minor>.<tiny>.<tag>\"\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span<char const> buffer);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span<char const> 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+*\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@@ -604,39 +629,14 @@\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* 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@@ -813,14 +813,23 @@\n This flag is set automatically when adding a torrent that has at least\n one tracker whose hostname ends with .i2p. It's also set by\n _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n all\n all torrent flags combined. Can conveniently be used when creating masks\n for flags\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ version_major\n+ the major, minor and tiny versions of libtorrent\n+ version_minor\n+ the major, minor and tiny versions of libtorrent\n+ version_tiny\n+ the major, minor and tiny versions of libtorrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* 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@@ -828,44 +837,35 @@\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* 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* c\bch\bha\bar\br c\bco\bon\bns\bst\bt*\b* *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_str\n- the libtorrent version in string form\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bst\btd\bd:\b::\b:u\bui\bin\bnt\bt6\b64\b4_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_revision\n- the git commit of this libtorrent version\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html", "unified_diff": "@@ -30,32 +30,32 @@\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#create-torrent\" id=\"toc-entry-1\">create_torrent</a><ul>\n <li><a class=\"reference internal\" href=\"#create-torrent-1\" id=\"toc-entry-2\">create_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#generate-buf-generate\" id=\"toc-entry-3\">generate_buf() generate()</a></li>\n+<li><a class=\"reference internal\" href=\"#generate-generate-buf\" id=\"toc-entry-3\">generate() generate_buf()</a></li>\n <li><a class=\"reference internal\" href=\"#files\" id=\"toc-entry-4\">files()</a></li>\n <li><a class=\"reference internal\" href=\"#set-comment\" id=\"toc-entry-5\">set_comment()</a></li>\n <li><a class=\"reference internal\" href=\"#set-creator\" id=\"toc-entry-6\">set_creator()</a></li>\n <li><a class=\"reference internal\" href=\"#set-creation-date\" id=\"toc-entry-7\">set_creation_date()</a></li>\n <li><a class=\"reference internal\" href=\"#set-hash\" id=\"toc-entry-8\">set_hash()</a></li>\n <li><a class=\"reference internal\" href=\"#set-hash2\" id=\"toc-entry-9\">set_hash2()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-url-seed-add-http-seed\" id=\"toc-entry-10\">add_url_seed() add_http_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-http-seed-add-url-seed\" id=\"toc-entry-10\">add_http_seed() add_url_seed()</a></li>\n <li><a class=\"reference internal\" href=\"#add-node\" id=\"toc-entry-11\">add_node()</a></li>\n <li><a class=\"reference internal\" href=\"#add-tracker\" id=\"toc-entry-12\">add_tracker()</a></li>\n <li><a class=\"reference internal\" href=\"#set-root-cert\" id=\"toc-entry-13\">set_root_cert()</a></li>\n-<li><a class=\"reference internal\" href=\"#priv-set-priv\" id=\"toc-entry-14\">priv() set_priv()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-priv-priv\" id=\"toc-entry-14\">set_priv() priv()</a></li>\n <li><a class=\"reference internal\" href=\"#num-pieces\" id=\"toc-entry-15\">num_pieces()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-range\" id=\"toc-entry-16\">piece_range()</a></li>\n <li><a class=\"reference internal\" href=\"#file-range\" id=\"toc-entry-17\">file_range()</a></li>\n <li><a class=\"reference internal\" href=\"#file-piece-range\" id=\"toc-entry-18\">file_piece_range()</a></li>\n <li><a class=\"reference internal\" href=\"#total-size\" id=\"toc-entry-19\">total_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-size-piece-length\" id=\"toc-entry-20\">piece_size() piece_length()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-length-piece-size\" id=\"toc-entry-20\">piece_length() piece_size()</a></li>\n <li><a class=\"reference internal\" href=\"#add-similar-torrent-add-collection\" id=\"toc-entry-21\">add_similar_torrent() add_collection()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#add-files\" id=\"toc-entry-22\">add_files()</a></li>\n <li><a class=\"reference internal\" href=\"#set-piece-hashes\" id=\"toc-entry-23\">set_piece_hashes()</a></li>\n </ul>\n </div>\n@@ -105,61 +105,61 @@\n <p>This class holds state for creating a torrent. After having added\n all information to it, call <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">create_torrent::generate()</a> to generate\n the torrent. The <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> that's returned can then be bencoded into a\n .torrent file using <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a>.</p>\n <pre class=\"literal-block\">\n struct create_torrent\n {\n+ explicit <strong>create_torrent</strong> (torrent_info const& ti);\n explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n- explicit <strong>create_torrent</strong> (torrent_info const& ti);\n- std::vector<char> <strong>generate_buf</strong> () const;\n entry <strong>generate</strong> () const;\n+ std::vector<char> <strong>generate_buf</strong> () const;\n file_storage const& <strong>files</strong> () const;\n void <strong>set_comment</strong> (char const* str);\n void <strong>set_creator</strong> (char const* str);\n void <strong>set_creation_date</strong> (std::time_t timestamp);\n void <strong>set_hash</strong> (piece_index_t index, sha1_hash const& h);\n void <strong>set_hash2</strong> (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n void <strong>add_url_seed</strong> (string_view url);\n void <strong>add_http_seed</strong> (string_view url);\n void <strong>add_node</strong> (std::pair<std::string, int> node);\n void <strong>add_tracker</strong> (string_view url, int tier = 0);\n void <strong>set_root_cert</strong> (string_view cert);\n bool <strong>priv</strong> () const;\n void <strong>set_priv</strong> (bool p);\n- bool <strong>is_v1_only</strong> () const;\n bool <strong>is_v2_only</strong> () const;\n+ bool <strong>is_v1_only</strong> () const;\n int <strong>num_pieces</strong> () const;\n piece_index_t <strong>end_piece</strong> () const;\n index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n file_index_t <strong>end_file</strong> () const;\n index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t f);\n std::int64_t <strong>total_size</strong> () const;\n- int <strong>piece_length</strong> () const;\n int <strong>piece_size</strong> (piece_index_t i) const;\n- void <strong>add_similar_torrent</strong> (sha1_hash ih);\n+ int <strong>piece_length</strong> () const;\n void <strong>add_collection</strong> (string_view c);\n+ void <strong>add_similar_torrent</strong> (sha1_hash ih);\n \n static constexpr create_flags_t <strong>modification_time</strong> = 2_bit;\n static constexpr create_flags_t <strong>symlinks</strong> = 3_bit;\n static constexpr create_flags_t <strong>v2_only</strong> = 5_bit;\n static constexpr create_flags_t <strong>v1_only</strong> = 6_bit;\n static constexpr create_flags_t <strong>canonical_files</strong> = 7_bit;\n static constexpr create_flags_t <strong>no_attributes</strong> = 8_bit;\n static constexpr create_flags_t <strong>canonical_files_no_tail_padding</strong> = 9_bit;\n };\n </pre>\n <a name=\"create_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcreate_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcreate_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"create-torrent-1\">\n <h2>create_torrent()</h2>\n <pre class=\"literal-block\">\n+explicit <strong>create_torrent</strong> (torrent_info const& ti);\n explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n-explicit <strong>create_torrent</strong> (torrent_info const& ti);\n </pre>\n <p>The <tt class=\"docutils literal\">piece_size</tt> is the size of each piece in bytes. It must be a\n power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n specified, a piece_size will be set automatically.\n Piece sizes greater than 128 MiB are considered unreasonable and will\n be rejected (with an lt::system_error exception).</p>\n <p>The <tt class=\"docutils literal\">flags</tt> arguments specifies options for the torrent creation. It can\n@@ -175,21 +175,21 @@\n have any affect. Instead of using this overload, consider using\n <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a> instead.</p>\n <div class=\"admonition warning\">\n <p class=\"first admonition-title\">Warning</p>\n <p class=\"last\">The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> and <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> objects must stay alive for the\n entire duration of the <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> object.</p>\n </div>\n-<a name=\"generate_buf()\"></a>\n-<a name=\"generate()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bgenerate_buf%28%29+generate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bgenerate_buf%28%29+generate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"generate-buf-generate\">\n-<h2>generate_buf() generate()</h2>\n+<a name=\"generate()\"></a>\n+<a name=\"generate_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"generate-generate-buf\">\n+<h2>generate() generate_buf()</h2>\n <pre class=\"literal-block\">\n-std::vector<char> <strong>generate_buf</strong> () const;\n entry <strong>generate</strong> () const;\n+std::vector<char> <strong>generate_buf</strong> () const;\n </pre>\n <p>This function will generate the .torrent file as a bencode tree, or a\n bencoded into a buffer.\n In order to encode the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> into a flat file, use the <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a> function.</p>\n <p>The function returning an <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> may be useful to add custom entries\n to the torrent file before bencoding it and saving it to disk.</p>\n <p>Whether the resulting torrent object is v1, v2 or hybrid depends on\n@@ -272,18 +272,18 @@\n 16 kiB blocks. Note that piece sizes must be powers-of-2, so all\n per-piece merkle trees are complete.\n A SHA-256 hash of all zeros is internally used to indicate a hash\n that has not been set. Setting such hash will not be considered set\n when calling <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>.\n This function will throw <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> if it is called on an\n object constructed with the v1_only flag.</p>\n-<a name=\"add_url_seed()\"></a>\n-<a name=\"add_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-url-seed-add-http-seed\">\n-<h2>add_url_seed() add_http_seed()</h2>\n+<a name=\"add_http_seed()\"></a>\n+<a name=\"add_url_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_http_seed%28%29+add_url_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_http_seed%28%29+add_url_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-http-seed-add-url-seed\">\n+<h2>add_http_seed() add_url_seed()</h2>\n <pre class=\"literal-block\">\n void <strong>add_url_seed</strong> (string_view url);\n void <strong>add_http_seed</strong> (string_view url);\n </pre>\n <p>This adds a url seed to the torrent. You can have any number of url seeds. For a\n single file torrent, this should be an HTTP url, pointing to a file with identical\n content as the file of the torrent. For a multi-file torrent, it should point to\n@@ -320,18 +320,18 @@\n </pre>\n <p>This function sets an X.509 certificate in PEM format to the torrent. This makes the\n torrent an <em>SSL torrent</em>. 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 <a class=\"reference external\" href=\"manual-ref.html#ssl-torrents\">ssl torrents</a>.</p>\n <p>The string is not the path to the cert, it's the actual content of the\n certificate.</p>\n-<a name=\"priv()\"></a>\n-<a name=\"set_priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpriv%28%29+set_priv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpriv%28%29+set_priv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"priv-set-priv\">\n-<h2>priv() set_priv()</h2>\n+<a name=\"set_priv()\"></a>\n+<a name=\"priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_priv%28%29+priv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_priv%28%29+priv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-priv-priv\">\n+<h2>set_priv() priv()</h2>\n <pre class=\"literal-block\">\n bool <strong>priv</strong> () const;\n void <strong>set_priv</strong> (bool p);\n </pre>\n <p>Sets and queries the private flag of the torrent.\n Torrents with the private flag set ask the client to not use any other\n sources than the tracker for peers, and to not use DHT to advertise itself publicly,\n@@ -369,32 +369,32 @@\n <a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"total-size\">\n <h2>total_size()</h2>\n <pre class=\"literal-block\">\n std::int64_t <strong>total_size</strong> () const;\n </pre>\n <p>the total number of bytes of all files and pad files</p>\n-<a name=\"piece_size()\"></a>\n-<a name=\"piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_size%28%29+piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_size%28%29+piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-size-piece-length\">\n-<h2>piece_size() piece_length()</h2>\n+<a name=\"piece_length()\"></a>\n+<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-length-piece-size\">\n+<h2>piece_length() piece_size()</h2>\n <pre class=\"literal-block\">\n-int <strong>piece_length</strong> () const;\n int <strong>piece_size</strong> (piece_index_t i) const;\n+int <strong>piece_length</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">piece_length()</tt> returns the piece size of all pieces but the\n last one. <tt class=\"docutils literal\">piece_size()</tt> returns the size of the specified piece.\n these functions are just forwarding to the associated <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n <a name=\"add_similar_torrent()\"></a>\n <a name=\"add_collection()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_similar_torrent%28%29+add_collection%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_similar_torrent%28%29+add_collection%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"add-similar-torrent-add-collection\">\n <h2>add_similar_torrent() add_collection()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_similar_torrent</strong> (sha1_hash ih);\n void <strong>add_collection</strong> (string_view c);\n+void <strong>add_similar_torrent</strong> (sha1_hash ih);\n </pre>\n <p>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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a>.</p>\n@@ -483,28 +483,28 @@\n constructor.</p>\n <a name=\"set_piece_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:set_piece_hashes%28%29&labels=documentation&body=Documentation+under+heading+%22set_piece_hashes%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-piece-hashes\">\n <h1>set_piece_hashes()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n <pre class=\"literal-block\">\n void <strong>set_piece_hashes</strong> (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 <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p, error_code& ec);\n void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , settings_interface const& settings, disk_io_constructor_type disk_io\n , std::function<void(piece_index_t)> const& f, error_code& ec);\n inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p);\n+void <strong>set_piece_hashes</strong> (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 <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n , std::function<void(piece_index_t)> const& f);\n inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n , std::function<void(piece_index_t)> const& f);\n-inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p, error_code& ec);\n-void <strong>set_piece_hashes</strong> (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 </pre>\n <p>This function will assume that the files added to the torrent file exists at path\n <tt class=\"docutils literal\">p</tt>, read those files and hash the content and set the hashes in the <tt class=\"docutils literal\">create_torrent</tt>\n object. The optional function <tt class=\"docutils literal\">f</tt> is called in between every hash that is set. <tt class=\"docutils literal\">f</tt>\n must have the following signature:</p>\n <pre class=\"code c++ literal-block\">\n <span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name function\">Fun</span><span class=\"punctuation\">(</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">);</span>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,32 +1,32 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n o _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bb_\bu_\bf_\b(_\b)_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b)\n+ o _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b)_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bb_\bu_\bf_\b(_\b)\n o _\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\bo_\bm_\bm_\be_\bn_\bt_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bo_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\br_\bo_\bo_\bt_\b__\bc_\be_\br_\bt_\b(_\b)\n- o _\bp_\br_\bi_\bv_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n * _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n * _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n This section describes the functions and classes that are used to create\n torrent files. It is a layered API with low level classes and higher level\n convenience functions. A torrent is created in 4 steps:\n 1. first the files that will be part of the torrent are determined.\n@@ -66,60 +66,60 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n This class holds state for creating a torrent. After having added all\n information to it, call _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) to generate the torrent. The\n _\be_\bn_\bt_\br_\by that's returned can then be bencoded into a .torrent file using _\bb_\be_\bn_\bc_\bo_\bd_\be\n _\b(_\b).\n struct create_torrent\n {\n+ explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n- explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n- std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n+ std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n file_storage const& f\bfi\bil\ble\bes\bs () const;\n void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece,\n sha256_hash const& h);\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> node);\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n bool p\bpr\bri\biv\bv () const;\n void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n- bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n+ bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n index_range<piece_index_t> 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<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n index_range<piece_index_t::diff_type> 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_l\ble\ben\bng\bgt\bth\bh () const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n- void a\bad\bdd\bd_\b_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_l\ble\ben\bng\bgt\bth\bh () const;\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+ void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n \n static constexpr create_flags_t m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn_\b_t\bti\bim\bme\be = 2_bit;\n static constexpr create_flags_t s\bsy\bym\bml\bli\bin\bnk\bks\bs = 3_bit;\n static constexpr create_flags_t v\bv2\b2_\b_o\bon\bnl\bly\by = 5_bit;\n static constexpr create_flags_t v\bv1\b1_\b_o\bon\bnl\bly\by = 6_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs = 7_bit;\n static constexpr create_flags_t n\bno\bo_\b_a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs = 8_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs_\b_n\bno\bo_\b_t\bta\bai\bil\bl_\b_p\bpa\bad\bdd\bdi\bin\bng\bg = 9_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n-explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n The piece_size is the size of each piece in bytes. It must be a power of 2 and\n a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be\n set automatically. Piece sizes greater than 128 MiB are considered unreasonable\n and will be rejected (with an lt::system_error exception).\n The flags arguments specifies options for the torrent creation. It can be any\n combination of the flags defined by create_flags_t.\n The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be (fs) parameter defines the files, sizes and their properties\n@@ -131,17 +131,17 @@\n functions of _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt that affects the content of the info dictionary\n (such as _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)), will have any affect. Instead of using this overload,\n consider using _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) instead.\n Warning\n The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be and _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo objects must stay alive for the entire\n duration of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n+*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b*\n entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n+std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n This function will generate the .torrent file as a bencode tree, or a bencoded\n into a buffer. In order to encode the _\be_\bn_\bt_\br_\by into a flat file, use the _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n function.\n The function returning an _\be_\bn_\bt_\br_\by may be useful to add custom entries to the\n torrent file before bencoding it and saving it to disk.\n Whether the resulting torrent object is v1, v2 or hybrid depends on whether any\n of the v1_only or v2_only flags were set on the constructor. If neither were\n@@ -198,15 +198,15 @@\n the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must\n be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n all zeros is internally used to indicate a hash that has not been set. Setting\n such hash will not be considered set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function\n will throw std::system_error if it is called on an object constructed with the\n v1_only flag.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n This adds a url seed to the torrent. You can have any number of url seeds. For\n a single file torrent, this should be an HTTP url, pointing to a file with\n identical content as the file of the torrent. For a multi-file torrent, it\n should point to a directory containing a directory with the same name as this\n torrent, and all the files of the torrent in it.\n@@ -235,15 +235,15 @@\n makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n valid certificate signed by this root certificate. For SSL torrents, all peers\n are connecting over SSL connections. For more information, see the section on\n _\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n The string is not the path to the cert, it's the actual content of the\n certificate.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n bool p\bpr\bri\biv\bv () const;\n void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n Sets and queries the private flag of the torrent. Torrents with the private\n flag set ask the client to not use any other sources than the tracker for\n peers, and to not use DHT to advertise itself publicly, only the tracker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n@@ -263,24 +263,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_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+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n piece_length() returns the piece size of all pieces but the last one.\n piece_size() returns the size of the specified piece. these functions are just\n forwarding to the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+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@@ -349,29 +349,29 @@\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 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<void(piece_index_t)> 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 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<void(piece_index_t)> const& f, error_code& ec);\n inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function<void(piece_index_t)> const& f, error_code& ec);\n inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n , std::function<void(piece_index_t)> const& f);\n inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n , std::function<void(piece_index_t)> const& f);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n-error_code& ec);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings, disk_io_constructor_type disk_io\n- , std::function<void(piece_index_t)> 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html", "unified_diff": "@@ -28,85 +28,443 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#disk-observer\" id=\"toc-entry-1\">disk_observer</a><ul>\n-<li><a class=\"reference internal\" href=\"#on-disk\" id=\"toc-entry-2\">on_disk()</a></li>\n+<li><a class=\"reference internal\" href=\"#settings-interface\" id=\"toc-entry-1\">settings_interface</a></li>\n+<li><a class=\"reference internal\" href=\"#buffer-allocator-interface\" id=\"toc-entry-2\">buffer_allocator_interface</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder\" id=\"toc-entry-3\">disk_buffer_holder</a><ul>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-1\" id=\"toc-entry-4\">disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-2\" id=\"toc-entry-5\">disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-3\" id=\"toc-entry-6\">~disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#data\" id=\"toc-entry-7\">data()</a></li>\n+<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-8\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-9\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-mutable\" id=\"toc-entry-10\">is_mutable()</a></li>\n+<li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-11\">bool()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#open-file-state\" id=\"toc-entry-3\">open_file_state</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-interface\" id=\"toc-entry-4\">disk_interface</a><ul>\n-<li><a class=\"reference internal\" href=\"#new-torrent\" id=\"toc-entry-5\">new_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#remove-torrent\" id=\"toc-entry-6\">remove_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-read-async-write\" id=\"toc-entry-7\">async_read() async_write()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-hash\" id=\"toc-entry-8\">async_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-hash2\" id=\"toc-entry-9\">async_hash2()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-move-storage\" id=\"toc-entry-10\">async_move_storage()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-release-files\" id=\"toc-entry-11\">async_release_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-check-files\" id=\"toc-entry-12\">async_check_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-stop-torrent\" id=\"toc-entry-13\">async_stop_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-rename-file\" id=\"toc-entry-14\">async_rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-delete-files\" id=\"toc-entry-15\">async_delete_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-set-file-priority\" id=\"toc-entry-16\">async_set_file_priority()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-clear-piece\" id=\"toc-entry-17\">async_clear_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#update-stats-counters\" id=\"toc-entry-18\">update_stats_counters()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-status\" id=\"toc-entry-19\">get_status()</a></li>\n-<li><a class=\"reference internal\" href=\"#abort\" id=\"toc-entry-20\">abort()</a></li>\n-<li><a class=\"reference internal\" href=\"#submit-jobs\" id=\"toc-entry-21\">submit_jobs()</a></li>\n-<li><a class=\"reference internal\" href=\"#settings-updated\" id=\"toc-entry-22\">settings_updated()</a></li>\n+<li><a class=\"reference internal\" href=\"#open-file-state\" id=\"toc-entry-12\">open_file_state</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-interface\" id=\"toc-entry-13\">disk_interface</a><ul>\n+<li><a class=\"reference internal\" href=\"#new-torrent\" id=\"toc-entry-14\">new_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#remove-torrent\" id=\"toc-entry-15\">remove_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-read-async-write\" id=\"toc-entry-16\">async_read() async_write()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-hash\" id=\"toc-entry-17\">async_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-hash2\" id=\"toc-entry-18\">async_hash2()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-move-storage\" id=\"toc-entry-19\">async_move_storage()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-release-files\" id=\"toc-entry-20\">async_release_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-check-files\" id=\"toc-entry-21\">async_check_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-stop-torrent\" id=\"toc-entry-22\">async_stop_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-rename-file\" id=\"toc-entry-23\">async_rename_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-delete-files\" id=\"toc-entry-24\">async_delete_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-set-file-priority\" id=\"toc-entry-25\">async_set_file_priority()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-clear-piece\" id=\"toc-entry-26\">async_clear_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#update-stats-counters\" id=\"toc-entry-27\">update_stats_counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-status\" id=\"toc-entry-28\">get_status()</a></li>\n+<li><a class=\"reference internal\" href=\"#abort\" id=\"toc-entry-29\">abort()</a></li>\n+<li><a class=\"reference internal\" href=\"#submit-jobs\" id=\"toc-entry-30\">submit_jobs()</a></li>\n+<li><a class=\"reference internal\" href=\"#settings-updated\" id=\"toc-entry-31\">settings_updated()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#storage-holder\" id=\"toc-entry-23\">storage_holder</a></li>\n-<li><a class=\"reference internal\" href=\"#settings-interface\" id=\"toc-entry-24\">settings_interface</a></li>\n-<li><a class=\"reference internal\" href=\"#buffer-allocator-interface\" id=\"toc-entry-25\">buffer_allocator_interface</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder\" id=\"toc-entry-26\">disk_buffer_holder</a><ul>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-1\" id=\"toc-entry-27\">disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-2\" id=\"toc-entry-28\">disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-3\" id=\"toc-entry-29\">~disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#data\" id=\"toc-entry-30\">data()</a></li>\n-<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-31\">reset()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-32\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-mutable\" id=\"toc-entry-33\">is_mutable()</a></li>\n-<li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-34\">bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-holder\" id=\"toc-entry-32\">storage_holder</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-observer\" id=\"toc-entry-33\">disk_observer</a><ul>\n+<li><a class=\"reference internal\" href=\"#on-disk\" id=\"toc-entry-34\">on_disk()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#file-open-mode-t\" id=\"toc-entry-35\">file_open_mode_t</a></li>\n </ul>\n </div>\n-<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the session::apply_settings()\n-member function. To change one or more configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>\n-object and fill it with the settings to be set and pass it in to session::apply_settings().</p>\n-<p>The <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> object is a collection of settings updates that are applied\n-to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when passed to session::apply_settings(). It's empty when\n-constructed.</p>\n-<p>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.</p>\n-<p>Each configuration option is named with an enum value inside the\n-<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> class. These are the available settings:</p>\n-<a name=\"disk_observer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_observer&labels=documentation&body=Documentation+under+heading+%22class+disk_observer%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"disk-observer\">\n-<h1>disk_observer</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_observer.hpp\">libtorrent/disk_observer.hpp</a>"</p>\n+<p>The disk I/O can be customized in libtorrent. In previous versions, the\n+customization was at the level of each torrent. Now, the customization point\n+is at the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> level. All torrents added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> will use the same\n+disk I/O subsystem, as determined by the disk_io_constructor (in\n+<a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a>).</p>\n+<p>This allows the disk subsystem to also customize threading and disk job\n+management.</p>\n+<p>To customize the disk subsystem, implement <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a> and provide a\n+factory function to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor (via <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a>).</p>\n+<p>Example use:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"keyword\">struct</span><span class=\"whitespace\"> </span><span class=\"name class\">temp_storage</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">explicit</span><span class=\"whitespace\"> </span><span class=\"name\">temp_storage</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">fs</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">readv</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\"><=</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">length</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">writev</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">data</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">[</span><span class=\"name\">piece</span><span class=\"punctuation\">];</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// allocate the whole piece, otherwise we'll invalidate the pointers\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// we have returned back to libtorrent\n+</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">size</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">resize</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">size_t</span><span class=\"punctuation\">(</span><span class=\"name\">size</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">TORRENT_ASSERT</span><span class=\"punctuation\">(</span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\"><=</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()));</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">memcpy</span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">size_t</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"operator\">!</span><span class=\"name\">block_hashes</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_size2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">blocks_in_piece2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">blocks_in_piece2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">int64_t</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">k</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"name\">k</span><span class=\"whitespace\"> </span><span class=\"operator\"><</span><span class=\"whitespace\"> </span><span class=\"name\">blocks_in_piece2</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"operator\">++</span><span class=\"name\">k</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher256</span><span class=\"whitespace\"> </span><span class=\"name\">h2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">ptrdiff_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">default_block_size</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">piece_size2</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"name\">h2</span><span class=\"punctuation\">.</span><span class=\"name\">update</span><span class=\"punctuation\">({</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">+=</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">+=</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">[</span><span class=\"name\">k</span><span class=\"punctuation\">]</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">h2</span><span class=\"punctuation\">.</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">).</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"name\">hash2</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_size2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">ptrdiff_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">len</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">default_block_size</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">len</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher256</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">).</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">private</span><span class=\"operator\">:</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">((</span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">total_size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">/</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\"><</span><span class=\"whitespace\"> </span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">?</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">total_size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">int64_t</span><span class=\"punctuation\">(</span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">map</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">>></span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+\n+</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name function\">pop</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">>&</span><span class=\"whitespace\"> </span><span class=\"name\">q</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">TORRENT_ASSERT</span><span class=\"punctuation\">(</span><span class=\"operator\">!</span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">ret</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">back</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">pop_back</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">ret</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">struct</span><span class=\"whitespace\"> </span><span class=\"name class\">temp_disk_io</span><span class=\"whitespace\"> </span><span class=\"keyword\">final</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_interface</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">buffer_allocator_interface</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">explicit</span><span class=\"whitespace\"> </span><span class=\"name\">temp_disk_io</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ioc</span><span class=\"punctuation\">)</span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">m_ioc</span><span class=\"punctuation\">(</span><span class=\"name\">ioc</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">settings_updated</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_holder</span><span class=\"whitespace\"> </span><span class=\"name\">new_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_params</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">params</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">?</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">end_index</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">pop</span><span class=\"punctuation\">(</span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">make_unique</span><span class=\"operator\"><</span><span class=\"name\">temp_storage</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">files</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">end_index</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">emplace_back</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">storage</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">else</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">idx</span><span class=\"punctuation\">]</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">storage</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_holder</span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"keyword\">this</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">remove_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">idx</span><span class=\"punctuation\">].</span><span class=\"name\">reset</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">.</span><span class=\"name\">push_back</span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">abort</span><span class=\"punctuation\">(</span><span class=\"keyword type\">bool</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_read</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_buffer_holder</span><span class=\"whitespace\"> </span><span class=\"name\">block</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">se</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// this buffer is owned by the storage. It will remain valid for as\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// long as the torrent remains in the session. We don't need any lifetime\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// management of it.\n+</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">readv</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"name\">handler</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword\">this</span><span class=\"punctuation\">]</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_buffer_holder</span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"keyword\">this</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword\">const_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()),</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())),</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">bool</span><span class=\"whitespace\"> </span><span class=\"name\">async_write</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_observer</span><span class=\"operator\">></span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">length</span><span class=\"whitespace\"> </span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">writev</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name builtin\">false</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_hash</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">hash</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_hash2</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">hash2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_move_storage</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">move_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"operator\">::</span><span class=\"name\">fatal_disk_error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">error_code</span><span class=\"punctuation\">(</span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">system</span><span class=\"operator\">::</span><span class=\"name\">errc</span><span class=\"operator\">::</span><span class=\"name\">operation_not_supported</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_category</span><span class=\"punctuation\">())));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_release_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">()</span><span class=\"operator\">></span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_delete_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">remove_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_check_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">add_torrent_params</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"operator\">::</span><span class=\"name\">no_error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_rename_file</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">name</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">name</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_stop_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">()</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_set_file_priority</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">download_priority_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">prio</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">download_priority_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">error_code</span><span class=\"punctuation\">(</span><span class=\"whitespace\">\n+ </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">system</span><span class=\"operator\">::</span><span class=\"name\">errc</span><span class=\"operator\">::</span><span class=\"name\">operation_not_supported</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_category</span><span class=\"punctuation\">())),</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">prio</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_clear_piece</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">index</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">index</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// implements buffer_allocator_interface\n+</span><span class=\"whitespace\"> </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">free_disk_buffer</span><span class=\"punctuation\">(</span><span class=\"keyword type\">char</span><span class=\"operator\">*</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// never free any buffer. We only return buffers owned by the storage\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// object\n+</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">update_stats_counters</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">counters</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">open_file_state</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">get_status</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">submit_jobs</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">private</span><span class=\"operator\">:</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">temp_storage</span><span class=\"operator\">></span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// slots that are unused in the m_torrents vector\n+</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// callbacks are posted on this\n+</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">m_ioc</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">unique_ptr</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_interface</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">temp_disk_constructor</span><span class=\"punctuation\">(</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">settings_interface</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">counters</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">make_unique</span><span class=\"operator\"><</span><span class=\"name\">temp_disk_io</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">ioc</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<a name=\"settings_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_interface&labels=documentation&body=Documentation+under+heading+%22class+settings_interface%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"settings-interface\">\n+<h1>settings_interface</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<p>the common interface to <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> and the internal representation of\n+settings.</p>\n <pre class=\"literal-block\">\n-struct disk_observer\n+struct settings_interface\n {\n- virtual void <strong>on_disk</strong> () = 0;\n+ virtual void <strong>set_str</strong> (int name, std::string val) = 0;\n+ virtual void <strong>set_int</strong> (int name, int val) = 0;\n+ virtual void <strong>set_bool</strong> (int name, bool val) = 0;\n+ virtual bool <strong>has_val</strong> (int name) const = 0;\n+ virtual int <strong>get_int</strong> (int name) const = 0;\n+ virtual bool <strong>get_bool</strong> (int name) const = 0;\n+ virtual std::string const& <strong>get_str</strong> (int name) const = 0;\n };\n </pre>\n-<a name=\"on_disk()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_observer%3A%3A%5Bon_disk%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_observer%3A%3A%5Bon_disk%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"on-disk\">\n-<h2>on_disk()</h2>\n+<a name=\"buffer_allocator_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+buffer_allocator_interface&labels=documentation&body=Documentation+under+heading+%22class+buffer_allocator_interface%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"buffer-allocator-interface\">\n+<h1>buffer_allocator_interface</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n+<p>the interface for freeing disk buffers, used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>.\n+when implementing <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>, this must also be implemented in order\n+to return disk buffers back to libtorrent</p>\n <pre class=\"literal-block\">\n-virtual void <strong>on_disk</strong> () = 0;\n+struct buffer_allocator_interface\n+{\n+ virtual void <strong>free_disk_buffer</strong> (char* b) = 0;\n+};\n </pre>\n-<p>called when the disk cache size has dropped\n-below the low watermark again and we can\n-resume downloading from peers</p>\n+<a name=\"disk_buffer_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_buffer_holder&labels=documentation&body=Documentation+under+heading+%22class+disk_buffer_holder%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder\">\n+<h1>disk_buffer_holder</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n+<p>The disk buffer holder acts like a <tt class=\"docutils literal\">unique_ptr</tt> that frees a disk buffer\n+when it's destructed</p>\n+<p>If this buffer holder is moved-from, default constructed or reset,\n+<tt class=\"docutils literal\">data()</tt> will return nullptr.</p>\n+<pre class=\"literal-block\">\n+struct disk_buffer_holder\n+{\n+ <strong>disk_buffer_holder</strong> (disk_buffer_holder&&) noexcept;\n+ disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder&&) & noexcept;\n+ <strong>disk_buffer_holder</strong> (disk_buffer_holder const&) = delete;\n+ disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder const&) = delete;\n+ <strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n+ <strong>disk_buffer_holder</strong> () noexcept = default;\n+ <strong>~disk_buffer_holder</strong> ();\n+ char* <strong>data</strong> () const noexcept;\n+ void <strong>reset</strong> ();\n+ void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n+ bool <strong>is_mutable</strong> () const noexcept;\n+ explicit operator <strong>bool</strong> () const noexcept;\n+ std::ptrdiff_t <strong>size</strong> () const;\n+};\n+</pre>\n+<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"disk-buffer-holder-1\">\n+<h2>disk_buffer_holder()</h2>\n+<pre class=\"literal-block\">\n+<strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>)</p>\n+<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder-2\">\n+<h2>disk_buffer_holder()</h2>\n+<pre class=\"literal-block\">\n+<strong>disk_buffer_holder</strong> () noexcept = default;\n+</pre>\n+<p>default construct a holder that does not own any buffer</p>\n+<a name=\"~disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder-3\">\n+<h2>~disk_buffer_holder()</h2>\n+<pre class=\"literal-block\">\n+<strong>~disk_buffer_holder</strong> ();\n+</pre>\n+<p>frees disk buffer held by this object</p>\n+<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"data\">\n+<h2>data()</h2>\n+<pre class=\"literal-block\">\n+char* <strong>data</strong> () const noexcept;\n+</pre>\n+<p>return a pointer to the held buffer, if any. Otherwise returns nullptr.</p>\n+<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reset\">\n+<h2>reset()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reset</strong> ();\n+</pre>\n+<p>free the held disk buffer, if any, and clear the holder. This sets the\n+holder object to a default-constructed state</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap\">\n+<h2>swap()</h2>\n+<pre class=\"literal-block\">\n+void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n+</pre>\n+<p>swap pointers of two disk buffer holders.</p>\n+<a name=\"is_mutable()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-mutable\">\n+<h2>is_mutable()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_mutable</strong> () const noexcept;\n+</pre>\n+<p>if this returns true, the buffer may not be modified in place</p>\n+<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bool\">\n+<h2>bool()</h2>\n+<pre class=\"literal-block\">\n+explicit operator <strong>bool</strong> () const noexcept;\n+</pre>\n+<p>implicitly convertible to true if the object is currently holding a\n+buffer</p>\n <a name=\"open_file_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+open_file_state&labels=documentation&body=Documentation+under+heading+%22class+open_file_state%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n <div class=\"section\" id=\"open-file-state\">\n <h1>open_file_state</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n <p>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.</p>\n@@ -152,21 +510,21 @@\n the constructor. The callbacks will be run in the network thread.</p>\n <pre class=\"literal-block\">\n struct disk_interface\n {\n virtual storage_holder <strong>new_torrent</strong> (storage_params const& p\n , std::shared_ptr<void> const& torrent) = 0;\n virtual void <strong>remove_torrent</strong> (storage_index_t) = 0;\n+ virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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 <strong>async_read</strong> (storage_index_t storage, peer_request const& r\n- , std::function<void(disk_buffer_holder, storage_error const&)> handler\n- , disk_job_flags_t flags = {}) = 0;\n virtual void <strong>async_hash</strong> (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 <strong>async_hash2</strong> (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 <strong>async_move_storage</strong> (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@@ -223,21 +581,21 @@\n delete any files from disk, just to clean up any resources associated\n with the specified storage.</p>\n <a name=\"async_read()\"></a>\n <a name=\"async_write()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"async-read-async-write\">\n <h2>async_read() async_write()</h2>\n <pre class=\"literal-block\">\n+virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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 <strong>async_read</strong> (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 </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>, holding the buffer with\n the result. Flags may be set to affect the read operation. See\n disk_job_flags_t.</p>\n <p>The <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_observer\">disk_observer</a> is a callback to indicate that\n@@ -489,143 +847,43 @@\n for a torrent to the lifetime of the internal torrent object. When a\n torrent is removed from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, this holder is destructed and will\n inform the disk object.</p>\n <pre class=\"literal-block\">\n struct storage_holder\n {\n <strong>storage_holder</strong> (storage_index_t idx, disk_interface& disk_io);\n- <strong>~storage_holder</strong> ();\n <strong>storage_holder</strong> () = default;\n+ <strong>~storage_holder</strong> ();\n explicit operator <strong>bool</strong> () const;\n operator <strong>storage_index_t</strong> () const;\n void <strong>reset</strong> ();\n- storage_holder& <strong>operator=</strong> (storage_holder const&) = delete;\n <strong>storage_holder</strong> (storage_holder const&) = delete;\n+ storage_holder& <strong>operator=</strong> (storage_holder const&) = delete;\n <strong>storage_holder</strong> (storage_holder&& rhs) noexcept;\n storage_holder& <strong>operator=</strong> (storage_holder&& rhs) noexcept;\n };\n </pre>\n-<a name=\"settings_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_interface&labels=documentation&body=Documentation+under+heading+%22class+settings_interface%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"settings-interface\">\n-<h1>settings_interface</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<p>the common interface to <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> and the internal representation of\n-settings.</p>\n-<pre class=\"literal-block\">\n-struct settings_interface\n-{\n- virtual void <strong>set_int</strong> (int name, int val) = 0;\n- virtual bool <strong>has_val</strong> (int name) const = 0;\n- virtual void <strong>set_bool</strong> (int name, bool val) = 0;\n- virtual void <strong>set_str</strong> (int name, std::string val) = 0;\n- virtual bool <strong>get_bool</strong> (int name) const = 0;\n- virtual std::string const& <strong>get_str</strong> (int name) const = 0;\n- virtual int <strong>get_int</strong> (int name) const = 0;\n-};\n-</pre>\n-<a name=\"buffer_allocator_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+buffer_allocator_interface&labels=documentation&body=Documentation+under+heading+%22class+buffer_allocator_interface%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"buffer-allocator-interface\">\n-<h1>buffer_allocator_interface</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n-<p>the interface for freeing disk buffers, used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>.\n-when implementing <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>, this must also be implemented in order\n-to return disk buffers back to libtorrent</p>\n-<pre class=\"literal-block\">\n-struct buffer_allocator_interface\n-{\n- virtual void <strong>free_disk_buffer</strong> (char* b) = 0;\n-};\n-</pre>\n-<a name=\"disk_buffer_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_buffer_holder&labels=documentation&body=Documentation+under+heading+%22class+disk_buffer_holder%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder\">\n-<h1>disk_buffer_holder</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n-<p>The disk buffer holder acts like a <tt class=\"docutils literal\">unique_ptr</tt> that frees a disk buffer\n-when it's destructed</p>\n-<p>If this buffer holder is moved-from, default constructed or reset,\n-<tt class=\"docutils literal\">data()</tt> will return nullptr.</p>\n+<a name=\"disk_observer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_observer&labels=documentation&body=Documentation+under+heading+%22class+disk_observer%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-observer\">\n+<h1>disk_observer</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_observer.hpp\">libtorrent/disk_observer.hpp</a>"</p>\n <pre class=\"literal-block\">\n-struct disk_buffer_holder\n+struct disk_observer\n {\n- disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder&&) & noexcept;\n- <strong>disk_buffer_holder</strong> (disk_buffer_holder&&) noexcept;\n- <strong>disk_buffer_holder</strong> (disk_buffer_holder const&) = delete;\n- disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder const&) = delete;\n- <strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n- , char* buf, int sz) noexcept;\n- <strong>disk_buffer_holder</strong> () noexcept = default;\n- <strong>~disk_buffer_holder</strong> ();\n- char* <strong>data</strong> () const noexcept;\n- void <strong>reset</strong> ();\n- void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n- bool <strong>is_mutable</strong> () const noexcept;\n- explicit operator <strong>bool</strong> () const noexcept;\n- std::ptrdiff_t <strong>size</strong> () const;\n+ virtual void <strong>on_disk</strong> () = 0;\n };\n </pre>\n-<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"disk-buffer-holder-1\">\n-<h2>disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n- , char* buf, int sz) noexcept;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>)</p>\n-<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder-2\">\n-<h2>disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>disk_buffer_holder</strong> () noexcept = default;\n-</pre>\n-<p>default construct a holder that does not own any buffer</p>\n-<a name=\"~disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder-3\">\n-<h2>~disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>~disk_buffer_holder</strong> ();\n-</pre>\n-<p>frees disk buffer held by this object</p>\n-<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"data\">\n-<h2>data()</h2>\n-<pre class=\"literal-block\">\n-char* <strong>data</strong> () const noexcept;\n-</pre>\n-<p>return a pointer to the held buffer, if any. Otherwise returns nullptr.</p>\n-<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reset\">\n-<h2>reset()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reset</strong> ();\n-</pre>\n-<p>free the held disk buffer, if any, and clear the holder. This sets the\n-holder object to a default-constructed state</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n-</pre>\n-<p>swap pointers of two disk buffer holders.</p>\n-<a name=\"is_mutable()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-mutable\">\n-<h2>is_mutable()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_mutable</strong> () const noexcept;\n-</pre>\n-<p>if this returns true, the buffer may not be modified in place</p>\n-<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bool\">\n-<h2>bool()</h2>\n+<a name=\"on_disk()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_observer%3A%3A%5Bon_disk%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_observer%3A%3A%5Bon_disk%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"on-disk\">\n+<h2>on_disk()</h2>\n <pre class=\"literal-block\">\n-explicit operator <strong>bool</strong> () const noexcept;\n+virtual void <strong>on_disk</strong> () = 0;\n </pre>\n-<p>implicitly convertible to true if the object is currently holding a\n-buffer</p>\n+<p>called when the disk cache size has dropped\n+below the low watermark again and we can\n+resume downloading from peers</p>\n <a name=\"file_open_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_open_mode_t&labels=documentation&body=Documentation+under+heading+%22file_open_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n <div class=\"section\" id=\"file-open-mode-t\">\n <h1>file_open_mode_t</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n <a name=\"file_open_mode_t::read_only\"></a><dl class=\"docutils\">\n <dt>read_only</dt>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,14 +1,23 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n- o _\bo_\bn_\b__\bd_\bi_\bs_\bk_\b(_\b)\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ * _\bb_\bu_\bf_\bf_\be_\br_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ * _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br\n+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\b~_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\bi_\bs_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b(_\b)\n+ o _\bb_\bo_\bo_\bl_\b(_\b)\n * _\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@@ -22,50 +31,393 @@\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- * _\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 * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\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+The disk I/O can be customized in libtorrent. In previous versions, the\n+customization was at the level of each torrent. Now, the customization point is\n+at the _\bs_\be_\bs_\bs_\bi_\bo_\bn level. All torrents added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn will use the same disk I/\n+O subsystem, as determined by the disk_io_constructor (in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n+This allows the disk subsystem to also customize threading and disk job\n+management.\n+To customize the disk subsystem, implement _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be and provide a factory\n+function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor (via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n+Example use:\n+struct temp_storage\n+{\n+ explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {}\n+\n+ lt::span<char const> readv(lt::peer_request const r, lt::storage_error& ec)\n+const\n+ {\n+ auto const i = m_file_data.find(r.piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ if (int(i->second.size()) <= r.start)\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ return { i->second.data() + r.start, std::min(r.length, int(i->second.size\n+()) - r.start) };\n+ }\n+ void writev(lt::span<char const> const b, lt::piece_index_t const piece, int\n+const offset)\n+ {\n+ auto& data = m_file_data[piece];\n+ if (data.empty())\n+ {\n+ // allocate the whole piece, otherwise we'll invalidate the pointers\n+ // we have returned back to libtorrent\n+ int const size = piece_size(piece);\n+ data.resize(std::size_t(size));\n+ }\n+ TORRENT_ASSERT(offset + b.size() <= int(data.size()));\n+ std::memcpy(data.data() + offset, b.data(), std::size_t(b.size()));\n+ }\n+ lt::sha1_hash hash(lt::piece_index_t const piece\n+ , lt::span<lt::sha256_hash> const block_hashes, lt::storage_error& ec)\n+const\n+ {\n+ auto const i = m_file_data.find(piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ if (!block_hashes.empty())\n+ {\n+ int const piece_size2 = m_files.piece_size2(piece);\n+ int const blocks_in_piece2 = m_files.blocks_in_piece2(piece);\n+ char const* buf = i->second.data();\n+ std::int64_t offset = 0;\n+ for (int k = 0; k < blocks_in_piece2; ++k)\n+ {\n+ lt::hasher256 h2;\n+ std::ptrdiff_t const len2 = std::min(lt::default_block_size, int\n+(piece_size2 - offset));\n+ h2.update({ buf, len2 });\n+ buf += len2;\n+ offset += len2;\n+ block_hashes[k] = h2.final();\n+ }\n+ }\n+ return lt::hasher(i->second).final();\n+ }\n+ lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt::\n+storage_error& ec)\n+ {\n+ auto const i = m_file_data.find(piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+\n+ int const piece_size = m_files.piece_size2(piece);\n+\n+ std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size -\n+offset);\n+\n+ lt::span<char const> b = {i->second.data() + offset, len};\n+ return lt::hasher256(b).final();\n+ }\n+\n+private:\n+ int piece_size(lt::piece_index_t piece) const\n+ {\n+ int const num_pieces = static_cast<int>((m_files.total_size() +\n+m_files.piece_length() - 1) / m_files.piece_length());\n+ return static_cast<int>(piece) < num_pieces - 1\n+ ? m_files.piece_length() : static_cast<int>(m_files.total_size() - std::\n+int64_t(num_pieces - 1) * m_files.piece_length());\n+ }\n+\n+ lt::file_storage const& m_files;\n+ std::map<lt::piece_index_t, std::vector<char>> m_file_data;\n+};\n+\n+lt::storage_index_t pop(std::vector<lt::storage_index_t>& q)\n+{\n+ TORRENT_ASSERT(!q.empty());\n+ lt::storage_index_t const ret = q.back();\n+ q.pop_back();\n+ return ret;\n+}\n+\n+struct temp_disk_io final : lt::disk_interface\n+ , lt::buffer_allocator_interface\n+{\n+ explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {}\n+\n+ void settings_updated() override {}\n+\n+ lt::storage_holder new_torrent(lt::storage_params const& params\n+ , std::shared_ptr<void> const&) override\n+ {\n+ lt::storage_index_t const idx = m_free_slots.empty()\n+ ? m_torrents.end_index()\n+ : pop(m_free_slots);\n+ auto storage = std::make_unique<temp_storage>(params.files);\n+ if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move\n+(storage));\n+ else m_torrents[idx] = std::move(storage);\n+ return lt::storage_holder(idx, *this);\n+ }\n+\n+ void remove_torrent(lt::storage_index_t const idx) override\n+ {\n+ m_torrents[idx].reset();\n+ m_free_slots.push_back(idx);\n+ }\n+\n+ void abort(bool) override {}\n+\n+ void async_read(lt::storage_index_t storage, lt::peer_request const& r\n+ , std::function<void(lt::disk_buffer_holder block, lt::storage_error const&\n+se)> handler\n+ , lt::disk_job_flags_t) override\n+ {\n+ // this buffer is owned by the storage. It will remain valid for as\n+ // long as the torrent remains in the session. We don't need any lifetime\n+ // management of it.\n+ lt::storage_error error;\n+ lt::span<char const> b = m_torrents[storage]->readv(r, error);\n+\n+ post(m_ioc, [handler, error, b, this]\n+ { handler(lt::disk_buffer_holder(*this, const_cast<char*>(b.data()), int\n+(b.size())), error); });\n+ }\n+\n+ bool async_write(lt::storage_index_t storage, lt::peer_request const& r\n+ , char const* buf, std::shared_ptr<lt::disk_observer>\n+ , std::function<void(lt::storage_error const&)> handler\n+ , lt::disk_job_flags_t) override\n+ {\n+ lt::span<char const> const b = { buf, r.length };\n+\n+ m_torrents[storage]->writev(b, r.piece, r.start);\n+\n+ post(m_ioc, [=]{ handler(lt::storage_error()); });\n+ return false;\n+ }\n+\n+ void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece\n+ , lt::span<lt::sha256_hash> block_hashes, lt::disk_job_flags_t\n+ , std::function<void(lt::piece_index_t, lt::sha1_hash const&, lt::\n+storage_error const&)> handler) override\n+ {\n+ lt::storage_error error;\n+ lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes,\n+error);\n+ post(m_ioc, [=]{ handler(piece, hash, error); });\n+ }\n+\n+ void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece\n+ , int const offset, lt::disk_job_flags_t\n+ , std::function<void(lt::piece_index_t, lt::sha256_hash const&, lt::\n+storage_error const&)> handler) override\n+ {\n+ lt::storage_error error;\n+ lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset,\n+error);\n+ post(m_ioc, [=]{ handler(piece, hash, error); });\n+ }\n+\n+ void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t\n+ , std::function<void(lt::status_t, std::string const&, lt::storage_error\n+const&)> handler) override\n+ {\n+ post(m_ioc, [=]{\n+ handler(lt::status_t::fatal_disk_error, p\n+ , lt::storage_error(lt::error_code(boost::system::errc::\n+operation_not_supported, lt::system_category())));\n+ });\n+ }\n+\n+ void async_release_files(lt::storage_index_t, std::function<void()>) override\n+{}\n+\n+ void async_delete_files(lt::storage_index_t, lt::remove_flags_t\n+ , std::function<void(lt::storage_error const&)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(lt::storage_error()); });\n+ }\n+\n+ void async_check_files(lt::storage_index_t\n+ , lt::add_torrent_params const*\n+ , lt::aux::vector<std::string, lt::file_index_t>\n+ , std::function<void(lt::status_t, lt::storage_error const&)> handler)\n+override\n+ {\n+ post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); });\n+ }\n+\n+ void async_rename_file(lt::storage_index_t\n+ , lt::file_index_t const idx\n+ , std::string const name\n+ , std::function<void(std::string const&, lt::file_index_t, lt::\n+storage_error const&)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); });\n+ }\n+\n+ void async_stop_torrent(lt::storage_index_t, std::function<void()> handler)\n+override\n+ {\n+ post(m_ioc, handler);\n+ }\n+\n+ void async_set_file_priority(lt::storage_index_t\n+ , lt::aux::vector<lt::download_priority_t, lt::file_index_t> prio\n+ , std::function<void(lt::storage_error const&\n+ , lt::aux::vector<lt::download_priority_t, lt::file_index_t>)> handler)\n+override\n+ {\n+ post(m_ioc, [=]{\n+ handler(lt::storage_error(lt::error_code(\n+ boost::system::errc::operation_not_supported, lt::system_category())),\n+std::move(prio));\n+ });\n+ }\n+\n+ void async_clear_piece(lt::storage_index_t, lt::piece_index_t index\n+ , std::function<void(lt::piece_index_t)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(index); });\n+ }\n+\n+ // implements buffer_allocator_interface\n+ void free_disk_buffer(char*) override\n+ {\n+ // never free any buffer. We only return buffers owned by the storage\n+ // object\n+ }\n+\n+ void update_stats_counters(lt::counters&) const override {}\n+\n+ std::vector<lt::open_file_state> get_status(lt::storage_index_t) const\n+override\n+ { return {}; }\n+\n+ void submit_jobs() override {}\n+\n+private:\n+\n+ lt::aux::vector<std::shared_ptr<temp_storage>, lt::storage_index_t>\n+m_torrents;\n+\n+ // slots that are unused in the m_torrents vector\n+ std::vector<lt::storage_index_t> m_free_slots;\n+\n+ // callbacks are posted on this\n+ lt::io_context& m_ioc;\n+};\n+\n+std::unique_ptr<lt::disk_interface> temp_disk_constructor(\n+ lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n+{\n+ return std::make_unique<temp_disk_io>(ioc);\n+}\n [_\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+*\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 o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n+ virtual void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n+ virtual void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) = 0;\n+ virtual 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 [_\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**\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+ d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (disk_buffer_holder&&) noexcept;\n+ disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder&&) & noexcept;\n+ d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (disk_buffer_holder const&) = delete;\n+ disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder const&) = delete;\n+ d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n+ d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br () noexcept = default;\n+ ~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n+ char* d\bda\bat\bta\ba () const noexcept;\n+ void r\bre\bes\bse\bet\bt ();\n+ void s\bsw\bwa\bap\bp (disk_buffer_holder& h) noexcept;\n+ bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n+ explicit operator b\bbo\boo\bol\bl () const noexcept;\n+ std::ptrdiff_t s\bsi\biz\bze\be () const;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n+construct a buffer holder that will free the held buffer using a disk buffer\n+pool directly (there's only one disk_buffer_pool per _\bs_\be_\bs_\bs_\bi_\bo_\bn)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br () noexcept = default;\n+default construct a holder that does not own any buffer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n+frees disk buffer held by this object\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n+char* d\bda\bat\bta\ba () const noexcept;\n+return a pointer to the held buffer, if any. Otherwise returns nullptr.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+free the held disk buffer, if any, and clear the holder. This sets the holder\n+object to a default-constructed state\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (disk_buffer_holder& h) noexcept;\n+swap pointers of two disk buffer holders.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n+if this returns true, the buffer may not be modified in place\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n+explicit operator b\bbo\boo\bol\bl () const noexcept;\n+implicitly convertible to true if the object is currently holding a buffer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* o\bop\bpe\ben\bn_\b_f\bfi\bil\ble\be_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n this contains information about a file that's currently open by the libtorrent\n disk I/O subsystem. It's associated with a single torrent.\n struct open_file_state\n {\n@@ -102,21 +454,21 @@\n thread via the io_context object passed into the constructor. The callbacks\n will be run in the network thread.\n struct disk_interface\n {\n virtual storage_holder n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_params const& p\n , std::shared_ptr<void> 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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n , std::function<void(storage_error const&)> handler\n , disk_job_flags_t flags = {}) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function<void(disk_buffer_holder, storage_error const&)> 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<sha256_hash> v2\n , disk_job_flags_t flags\n , std::function<void(piece_index_t, sha1_hash const&, storage_error\n const&)> 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@@ -172,21 +524,21 @@\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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n , std::function<void(storage_error const&)> handler\n , disk_job_flags_t flags = {}) = 0;\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function<void(disk_buffer_holder, storage_error const&)> 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@@ -374,108 +726,36 @@\n (class that implements _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be). This is held by the internal libtorrent\n torrent object to tie the storage object allocated for a torrent to the\n lifetime of the internal torrent object. When a torrent is removed from the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn, this holder is destructed and will inform the disk object.\n struct storage_holder\n {\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n- ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n+ ~\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+ storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder&& rhs) noexcept;\n storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder&& rhs) noexcept;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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_i\bin\bnt\bt (int name, int val) = 0;\n- virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n- virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n- virtual void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n- virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const = 0;\n- virtual std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const = 0;\n- virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbu\buf\bff\bfe\ber\br_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n-the interface for freeing disk buffers, used by the _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br. when\n-implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be, this must also be implemented in order to return\n-disk buffers back to libtorrent\n-struct buffer_allocator_interface\n-{\n- virtual void f\bfr\bre\bee\be_\b_d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br (char* b) = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n-The disk buffer holder acts like a unique_ptr that frees a disk buffer when\n-it's destructed\n-If this buffer holder is moved-from, default constructed or reset, data() will\n-return nullptr.\n-struct disk_buffer_holder\n+*\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- 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+ 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* 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+*\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* 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html", "unified_diff": "@@ -28,39 +28,65 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#dht-storage-counters\" id=\"toc-entry-1\">dht_storage_counters</a><ul>\n-<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-2\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-state\" id=\"toc-entry-1\">dht_state</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-storage-counters\" id=\"toc-entry-2\">dht_storage_counters</a><ul>\n+<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-3\">reset()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-storage-interface\" id=\"toc-entry-3\">dht_storage_interface</a><ul>\n-<li><a class=\"reference internal\" href=\"#update-node-ids\" id=\"toc-entry-4\">update_node_ids()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-peers\" id=\"toc-entry-5\">get_peers()</a></li>\n-<li><a class=\"reference internal\" href=\"#announce-peer\" id=\"toc-entry-6\">announce_peer()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-immutable-item\" id=\"toc-entry-7\">get_immutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#put-immutable-item\" id=\"toc-entry-8\">put_immutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-mutable-item-seq\" id=\"toc-entry-9\">get_mutable_item_seq()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-mutable-item\" id=\"toc-entry-10\">get_mutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#put-mutable-item\" id=\"toc-entry-11\">put_mutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-infohashes-sample\" id=\"toc-entry-12\">get_infohashes_sample()</a></li>\n-<li><a class=\"reference internal\" href=\"#tick\" id=\"toc-entry-13\">tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-14\">counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-storage-interface\" id=\"toc-entry-4\">dht_storage_interface</a><ul>\n+<li><a class=\"reference internal\" href=\"#update-node-ids\" id=\"toc-entry-5\">update_node_ids()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-peers\" id=\"toc-entry-6\">get_peers()</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-peer\" id=\"toc-entry-7\">announce_peer()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-immutable-item\" id=\"toc-entry-8\">get_immutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#put-immutable-item\" id=\"toc-entry-9\">put_immutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-mutable-item-seq\" id=\"toc-entry-10\">get_mutable_item_seq()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-mutable-item\" id=\"toc-entry-11\">get_mutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#put-mutable-item\" id=\"toc-entry-12\">put_mutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-infohashes-sample\" id=\"toc-entry-13\">get_infohashes_sample()</a></li>\n+<li><a class=\"reference internal\" href=\"#tick\" id=\"toc-entry-14\">tick()</a></li>\n+<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-15\">counters()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-state\" id=\"toc-entry-15\">dht_state</a></li>\n <li><a class=\"reference internal\" href=\"#dht-default-storage-constructor\" id=\"toc-entry-16\">dht_default_storage_constructor()</a></li>\n <li><a class=\"reference internal\" href=\"#sign-mutable-item\" id=\"toc-entry-17\">sign_mutable_item()</a></li>\n <li><a class=\"reference internal\" href=\"#announce-flags-t\" id=\"toc-entry-18\">announce_flags_t</a></li>\n </ul>\n </div>\n-<a name=\"dht_storage_counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_storage_counters&labels=documentation&body=Documentation+under+heading+%22class+dht_storage_counters%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"dht-storage-counters\">\n+<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_state&labels=documentation&body=Documentation+under+heading+%22class+dht_state%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"dht-state\">\n+<h1>dht_state</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_state.hpp\">libtorrent/kademlia/dht_state.hpp</a>"</p>\n+<p>This structure helps to store and load the state\n+of the <tt class=\"docutils literal\">dht_tracker</tt>.\n+At this moment the library is only a dual stack\n+implementation of the DHT. See <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0032.html\">BEP 32</a></p>\n+<pre class=\"literal-block\">\n+struct dht_state\n+{\n+ void <strong>clear</strong> ();\n+\n+ node_ids_t nids;\n+ std::vector<udp::endpoint> nodes;\n+ std::vector<udp::endpoint> nodes6;\n+};\n+</pre>\n+<a name=\"nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nodes</dt>\n+<dd>the bootstrap nodes saved from the buckets node</dd>\n+</dl>\n+<a name=\"nodes6\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes6%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes6%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nodes6</dt>\n+<dd>the bootstrap nodes saved from the IPv6 buckets node</dd>\n+</dl>\n+<a name=\"dht_storage_counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_storage_counters&labels=documentation&body=Documentation+under+heading+%22class+dht_storage_counters%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-storage-counters\">\n <h1>dht_storage_counters</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_storage.hpp\">libtorrent/kademlia/dht_storage.hpp</a>"</p>\n <p>This structure hold the relevant <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the storage</p>\n <pre class=\"literal-block\">\n struct dht_storage_counters\n {\n void <strong>reset</strong> ();\n@@ -282,42 +308,16 @@\n <a name=\"counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_storage_interface%3A%3A%5Bcounters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_storage_interface%3A%3A%5Bcounters%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"counters\">\n <h2>counters()</h2>\n <pre class=\"literal-block\">\n virtual dht_storage_counters <strong>counters</strong> () const = 0;\n </pre>\n <p>return stats <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the store</p>\n-<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_state&labels=documentation&body=Documentation+under+heading+%22class+dht_state%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-state\">\n-<h1>dht_state</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_state.hpp\">libtorrent/kademlia/dht_state.hpp</a>"</p>\n-<p>This structure helps to store and load the state\n-of the <tt class=\"docutils literal\">dht_tracker</tt>.\n-At this moment the library is only a dual stack\n-implementation of the DHT. See <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0032.html\">BEP 32</a></p>\n-<pre class=\"literal-block\">\n-struct dht_state\n-{\n- void <strong>clear</strong> ();\n-\n- node_ids_t nids;\n- std::vector<udp::endpoint> nodes;\n- std::vector<udp::endpoint> nodes6;\n-};\n-</pre>\n-<a name=\"nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nodes</dt>\n-<dd>the bootstrap nodes saved from the buckets node</dd>\n-</dl>\n-<a name=\"nodes6\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes6%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes6%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nodes6</dt>\n-<dd>the bootstrap nodes saved from the IPv6 buckets node</dd>\n-</dl>\n <a name=\"dht_default_storage_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_default_storage_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22dht_default_storage_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n <div class=\"section\" id=\"dht-default-storage-constructor\">\n <h1>dht_default_storage_constructor()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_storage.hpp\">libtorrent/kademlia/dht_storage.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::unique_ptr<dht_storage_interface> <strong>dht_default_storage_constructor</strong> (\n settings_interface const& settings);\n </pre>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,31 +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.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n o _\br_\be_\bs_\be_\bt_\b(_\b)\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\bs_\b(_\b)\n 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 o _\bp_\bu_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n- * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n+This structure helps to store and load the state of the dht_tracker. At this\n+moment the library is only a dual stack implementation of the DHT. See _\bB_\bE_\bP_\b _\b3_\b2\n+struct dht_state\n+{\n+ void c\bcl\ble\bea\bar\br ();\n+\n+ node_ids_t nids;\n+ std::vector<udp::endpoint> nodes;\n+ std::vector<udp::endpoint> nodes6;\n+};\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_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 \n@@ -191,33 +210,14 @@\n For implementers: Use this functions for expire peers or items or any other\n storage cleanup.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual dht_storage_counters c\bco\bou\bun\bnt\bte\ber\brs\bs () const = 0;\n return stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the store\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n-This structure helps to store and load the state of the dht_tracker. At this\n-moment the library is only a dual stack implementation of the DHT. See _\bB_\bE_\bP_\b _\b3_\b2\n-struct dht_state\n-{\n- void c\bcl\ble\bea\bar\br ();\n-\n- node_ids_t nids;\n- std::vector<udp::endpoint> nodes;\n- std::vector<udp::endpoint> nodes6;\n-};\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<dht_storage_interface> 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"}]}, {"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,30 +33,30 @@\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#storage-error\" id=\"toc-entry-1\">storage_error</a><ul>\n <li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-2\">bool()</a></li>\n <li><a class=\"reference internal\" href=\"#file\" id=\"toc-entry-3\">file()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#libtorrent-category\" id=\"toc-entry-4\">libtorrent_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#http-category\" id=\"toc-entry-5\">http_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#i2p-category\" id=\"toc-entry-6\">i2p_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#bdecode-category\" id=\"toc-entry-7\">bdecode_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#pcp-category\" id=\"toc-entry-8\">pcp_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#socks-category\" id=\"toc-entry-9\">socks_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#gzip-category\" id=\"toc-entry-10\">gzip_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#upnp-category\" id=\"toc-entry-11\">upnp_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#gzip-category\" id=\"toc-entry-4\">gzip_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#upnp-category\" id=\"toc-entry-5\">upnp_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#bdecode-category\" id=\"toc-entry-6\">bdecode_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#pcp-category\" id=\"toc-entry-7\">pcp_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#i2p-category\" id=\"toc-entry-8\">i2p_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#libtorrent-category\" id=\"toc-entry-9\">libtorrent_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#http-category\" id=\"toc-entry-10\">http_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#socks-category\" id=\"toc-entry-11\">socks_category()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-error-code-enum\" id=\"toc-entry-12\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-http-errors\" id=\"toc-entry-13\">enum http_errors</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-i2p-error-code\" id=\"toc-entry-14\">enum i2p_error_code</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-1\" id=\"toc-entry-15\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-pcp-errors\" id=\"toc-entry-16\">enum pcp_errors</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-socks-error-code\" id=\"toc-entry-17\">enum socks_error_code</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-2\" id=\"toc-entry-18\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-3\" id=\"toc-entry-19\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-1\" id=\"toc-entry-13\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-2\" id=\"toc-entry-14\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-pcp-errors\" id=\"toc-entry-15\">enum pcp_errors</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-i2p-error-code\" id=\"toc-entry-16\">enum i2p_error_code</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-3\" id=\"toc-entry-17\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-http-errors\" id=\"toc-entry-18\">enum http_errors</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-socks-error-code\" id=\"toc-entry-19\">enum socks_error_code</a></li>\n </ul>\n </div>\n <a name=\"storage_error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_error&labels=documentation&body=Documentation+under+heading+%22class+storage_error%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"storage-error\">\n <h1>storage_error</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n <p>used by storage to return errors\n also includes which underlying file the\n@@ -94,80 +94,426 @@\n <dd>the error that occurred</dd>\n </dl>\n <a name=\"operation\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Boperation%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Boperation%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>operation</dt>\n <dd>A code from <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> enum, indicating what\n kind of operation failed.</dd>\n </dl>\n-<a name=\"libtorrent_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:libtorrent_category%28%29&labels=documentation&body=Documentation+under+heading+%22libtorrent_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"gzip_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:gzip_category%28%29&labels=documentation&body=Documentation+under+heading+%22gzip_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"libtorrent-category\">\n-<h1>libtorrent_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>libtorrent_category</strong> ();\n-</pre>\n-<p>return the instance of the libtorrent_error_category which\n-maps libtorrent error codes to human readable error messages.</p>\n-<a name=\"http_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:http_category%28%29&labels=documentation&body=Documentation+under+heading+%22http_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"http-category\">\n-<h1>http_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<div class=\"section\" id=\"gzip-category\">\n+<h1>gzip_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n <pre class=\"literal-block\">\n-boost::system::error_category& <strong>http_category</strong> ();\n+boost::system::error_category& <strong>gzip_category</strong> ();\n </pre>\n-<p>returns the error_category for HTTP errors</p>\n-<a name=\"i2p_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_category%28%29&labels=documentation&body=Documentation+under+heading+%22i2p_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"i2p-category\">\n-<h1>i2p_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<p>get the <tt class=\"docutils literal\">error_category</tt> for zip errors</p>\n+<a name=\"upnp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:upnp_category%28%29&labels=documentation&body=Documentation+under+heading+%22upnp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"upnp-category\">\n+<h1>upnp_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n <pre class=\"literal-block\">\n-boost::system::error_category& <strong>i2p_category</strong> ();\n+boost::system::error_category& <strong>upnp_category</strong> ();\n </pre>\n-<p>returns the error category for I2P errors</p>\n+<p>the boost.system error category for UPnP errors</p>\n <a name=\"bdecode_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_category%28%29&labels=documentation&body=Documentation+under+heading+%22bdecode_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"bdecode-category\">\n <h1>bdecode_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>bdecode_category</strong> ();\n </pre>\n <a name=\"pcp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:pcp_category%28%29&labels=documentation&body=Documentation+under+heading+%22pcp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"pcp-category\">\n <h1>pcp_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>pcp_category</strong> ();\n </pre>\n+<a name=\"i2p_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_category%28%29&labels=documentation&body=Documentation+under+heading+%22i2p_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"i2p-category\">\n+<h1>i2p_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>i2p_category</strong> ();\n+</pre>\n+<p>returns the error category for I2P errors</p>\n+<a name=\"libtorrent_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:libtorrent_category%28%29&labels=documentation&body=Documentation+under+heading+%22libtorrent_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"libtorrent-category\">\n+<h1>libtorrent_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>libtorrent_category</strong> ();\n+</pre>\n+<p>return the instance of the libtorrent_error_category which\n+maps libtorrent error codes to human readable error messages.</p>\n+<a name=\"http_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:http_category%28%29&labels=documentation&body=Documentation+under+heading+%22http_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"http-category\">\n+<h1>http_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>http_category</strong> ();\n+</pre>\n+<p>returns the error_category for HTTP errors</p>\n <a name=\"socks_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks_category%28%29&labels=documentation&body=Documentation+under+heading+%22socks_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"socks-category\">\n <h1>socks_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socks5_stream.hpp\">libtorrent/socks5_stream.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>socks_category</strong> ();\n </pre>\n <p>returns the error_category for SOCKS5 errors</p>\n-<a name=\"gzip_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:gzip_category%28%29&labels=documentation&body=Documentation+under+heading+%22gzip_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"gzip-category\">\n-<h1>gzip_category()</h1>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum\">\n+<h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>gzip_category</strong> ();\n-</pre>\n-<p>get the <tt class=\"docutils literal\">error_category</tt> for zip errors</p>\n-<a name=\"upnp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:upnp_category%28%29&labels=documentation&body=Documentation+under+heading+%22upnp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"upnp-category\">\n-<h1>upnp_category()</h1>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"33%\" />\n+<col width=\"6%\" />\n+<col width=\"61%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>Not an error</td>\n+</tr>\n+<tr><td>invalid_gzip_header</td>\n+<td>1</td>\n+<td>the supplied gzip buffer has invalid header</td>\n+</tr>\n+<tr><td>inflated_data_too_large</td>\n+<td>2</td>\n+<td>the gzip buffer would inflate to more bytes than the specified\n+maximum size, and was rejected.</td>\n+</tr>\n+<tr><td>data_did_not_terminate</td>\n+<td>3</td>\n+<td>available inflate data did not terminate</td>\n+</tr>\n+<tr><td>space_exhausted</td>\n+<td>4</td>\n+<td>output space exhausted before completing inflate</td>\n+</tr>\n+<tr><td>invalid_block_type</td>\n+<td>5</td>\n+<td>invalid block type (type == 3)</td>\n+</tr>\n+<tr><td>invalid_stored_block_length</td>\n+<td>6</td>\n+<td>stored block length did not match one's complement</td>\n+</tr>\n+<tr><td>too_many_length_or_distance_codes</td>\n+<td>7</td>\n+<td>dynamic block code description: too many length or distance codes</td>\n+</tr>\n+<tr><td>code_lengths_codes_incomplete</td>\n+<td>8</td>\n+<td>dynamic block code description: code lengths codes incomplete</td>\n+</tr>\n+<tr><td>repeat_lengths_with_no_first_length</td>\n+<td>9</td>\n+<td>dynamic block code description: repeat lengths with no first length</td>\n+</tr>\n+<tr><td>repeat_more_than_specified_lengths</td>\n+<td>10</td>\n+<td>dynamic block code description: repeat more than specified lengths</td>\n+</tr>\n+<tr><td>invalid_literal_length_code_lengths</td>\n+<td>11</td>\n+<td>dynamic block code description: invalid literal/length code lengths</td>\n+</tr>\n+<tr><td>invalid_distance_code_lengths</td>\n+<td>12</td>\n+<td>dynamic block code description: invalid distance code lengths</td>\n+</tr>\n+<tr><td>invalid_literal_code_in_block</td>\n+<td>13</td>\n+<td>invalid literal/length or distance code in fixed or dynamic block</td>\n+</tr>\n+<tr><td>distance_too_far_back_in_block</td>\n+<td>14</td>\n+<td>distance is too far back in fixed or dynamic block</td>\n+</tr>\n+<tr><td>unknown_gzip_error</td>\n+<td>15</td>\n+<td>an unknown error occurred during gzip inflation</td>\n+</tr>\n+<tr><td>error_code_max</td>\n+<td>16</td>\n+<td>the number of error codes</td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum-1\">\n+<h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>upnp_category</strong> ();\n-</pre>\n-<p>the boost.system error category for UPnP errors</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"37%\" />\n+<col width=\"7%\" />\n+<col width=\"56%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>No error</td>\n+</tr>\n+<tr><td>invalid_argument</td>\n+<td>402</td>\n+<td>One of the arguments in the request is invalid</td>\n+</tr>\n+<tr><td>action_failed</td>\n+<td>501</td>\n+<td>The request failed</td>\n+</tr>\n+<tr><td>value_not_in_array</td>\n+<td>714</td>\n+<td>The specified value does not exist in the array</td>\n+</tr>\n+<tr><td>source_ip_cannot_be_wildcarded</td>\n+<td>715</td>\n+<td>The source IP address cannot be wild-carded, but\n+must be fully specified</td>\n+</tr>\n+<tr><td>external_port_cannot_be_wildcarded</td>\n+<td>716</td>\n+<td>The external port cannot be a wildcard, but must\n+be specified</td>\n+</tr>\n+<tr><td>port_mapping_conflict</td>\n+<td>718</td>\n+<td>The port mapping <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> specified conflicts with a\n+mapping assigned previously to another client</td>\n+</tr>\n+<tr><td>internal_port_must_match_external</td>\n+<td>724</td>\n+<td>Internal and external port value must be the same</td>\n+</tr>\n+<tr><td>only_permanent_leases_supported</td>\n+<td>725</td>\n+<td>The NAT implementation only supports permanent\n+lease times on port mappings</td>\n+</tr>\n+<tr><td>remote_host_must_be_wildcard</td>\n+<td>726</td>\n+<td>RemoteHost must be a wildcard and cannot be a\n+specific IP address or DNS name</td>\n+</tr>\n+<tr><td>external_port_must_be_wildcard</td>\n+<td>727</td>\n+<td>ExternalPort must be a wildcard and cannot be a\n+specific port</td>\n+</tr>\n+</tbody>\n+</table>\n <a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum\">\n+<div class=\"section\" id=\"enum-error-code-enum-2\">\n+<h1>enum error_code_enum</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"18%\" />\n+<col width=\"8%\" />\n+<col width=\"74%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>Not an error</td>\n+</tr>\n+<tr><td>expected_digit</td>\n+<td>1</td>\n+<td>expected digit in bencoded string</td>\n+</tr>\n+<tr><td>expected_colon</td>\n+<td>2</td>\n+<td>expected colon in bencoded string</td>\n+</tr>\n+<tr><td>unexpected_eof</td>\n+<td>3</td>\n+<td>unexpected end of file in bencoded string</td>\n+</tr>\n+<tr><td>expected_value</td>\n+<td>4</td>\n+<td>expected value (list, dict, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> or string) in bencoded string</td>\n+</tr>\n+<tr><td>depth_exceeded</td>\n+<td>5</td>\n+<td>bencoded recursion depth limit exceeded</td>\n+</tr>\n+<tr><td>limit_exceeded</td>\n+<td>6</td>\n+<td>bencoded item count limit exceeded</td>\n+</tr>\n+<tr><td>overflow</td>\n+<td>7</td>\n+<td>integer overflow</td>\n+</tr>\n+<tr><td>error_code_max</td>\n+<td>8</td>\n+<td>the number of error codes</td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"pcp_errors\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+pcp_errors&labels=documentation&body=Documentation+under+heading+%22enum+pcp_errors%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-pcp-errors\">\n+<h1>enum pcp_errors</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"14%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>pcp_success</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_version</td>\n+<td>1</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_not_authorized</td>\n+<td>2</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_malformed_request</td>\n+<td>3</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_opcode</td>\n+<td>4</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_option</td>\n+<td>5</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_malformed_option</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_network_failure</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_no_resources</td>\n+<td>8</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_protocol</td>\n+<td>9</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_user_ex_quota</td>\n+<td>10</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_cannot_provide_external</td>\n+<td>11</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_address_mismatch</td>\n+<td>12</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_excessive_remote_peers</td>\n+<td>13</td>\n+<td> </td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"i2p_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+i2p_error_code&labels=documentation&body=Documentation+under+heading+%22enum+i2p_error_code%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-i2p-error-code\">\n+<h1>enum i2p_error_code</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"19%\" />\n+<col width=\"35%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>parse_failed</td>\n+<td>1</td>\n+<td> </td>\n+</tr>\n+<tr><td>cant_reach_peer</td>\n+<td>2</td>\n+<td> </td>\n+</tr>\n+<tr><td>i2p_error</td>\n+<td>3</td>\n+<td> </td>\n+</tr>\n+<tr><td>invalid_key</td>\n+<td>4</td>\n+<td> </td>\n+</tr>\n+<tr><td>invalid_id</td>\n+<td>5</td>\n+<td> </td>\n+</tr>\n+<tr><td>timeout</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>key_not_found</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>duplicated_id</td>\n+<td>8</td>\n+<td> </td>\n+</tr>\n+<tr><td>num_errors</td>\n+<td>9</td>\n+<td> </td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum-3\">\n <h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"32%\" />\n <col width=\"6%\" />\n <col width=\"63%\" />\n@@ -991,203 +1337,14 @@\n </tr>\n <tr><td>service_unavailable</td>\n <td>503</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"i2p_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+i2p_error_code&labels=documentation&body=Documentation+under+heading+%22enum+i2p_error_code%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-i2p-error-code\">\n-<h1>enum i2p_error_code</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"46%\" />\n-<col width=\"19%\" />\n-<col width=\"35%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>parse_failed</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>cant_reach_peer</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>i2p_error</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>invalid_key</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>invalid_id</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>timeout</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>key_not_found</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>duplicated_id</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-<tr><td>num_errors</td>\n-<td>9</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-1\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"18%\" />\n-<col width=\"8%\" />\n-<col width=\"74%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>Not an error</td>\n-</tr>\n-<tr><td>expected_digit</td>\n-<td>1</td>\n-<td>expected digit in bencoded string</td>\n-</tr>\n-<tr><td>expected_colon</td>\n-<td>2</td>\n-<td>expected colon in bencoded string</td>\n-</tr>\n-<tr><td>unexpected_eof</td>\n-<td>3</td>\n-<td>unexpected end of file in bencoded string</td>\n-</tr>\n-<tr><td>expected_value</td>\n-<td>4</td>\n-<td>expected value (list, dict, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> or string) in bencoded string</td>\n-</tr>\n-<tr><td>depth_exceeded</td>\n-<td>5</td>\n-<td>bencoded recursion depth limit exceeded</td>\n-</tr>\n-<tr><td>limit_exceeded</td>\n-<td>6</td>\n-<td>bencoded item count limit exceeded</td>\n-</tr>\n-<tr><td>overflow</td>\n-<td>7</td>\n-<td>integer overflow</td>\n-</tr>\n-<tr><td>error_code_max</td>\n-<td>8</td>\n-<td>the number of error codes</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"pcp_errors\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+pcp_errors&labels=documentation&body=Documentation+under+heading+%22enum+pcp_errors%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-pcp-errors\">\n-<h1>enum pcp_errors</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"14%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>pcp_success</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_version</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_not_authorized</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_malformed_request</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_opcode</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_option</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_malformed_option</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_network_failure</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_no_resources</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_protocol</td>\n-<td>9</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_user_ex_quota</td>\n-<td>10</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_cannot_provide_external</td>\n-<td>11</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_address_mismatch</td>\n-<td>12</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_excessive_remote_peers</td>\n-<td>13</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n <a name=\"socks_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socks_error_code&labels=documentation&body=Documentation+under+heading+%22enum+socks_error_code%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-socks-error-code\">\n <h1>enum socks_error_code</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socks5_stream.hpp\">libtorrent/socks5_stream.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"64%\" />\n@@ -1243,171 +1400,14 @@\n </tr>\n <tr><td>num_errors</td>\n <td>10</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-2\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"33%\" />\n-<col width=\"6%\" />\n-<col width=\"61%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>Not an error</td>\n-</tr>\n-<tr><td>invalid_gzip_header</td>\n-<td>1</td>\n-<td>the supplied gzip buffer has invalid header</td>\n-</tr>\n-<tr><td>inflated_data_too_large</td>\n-<td>2</td>\n-<td>the gzip buffer would inflate to more bytes than the specified\n-maximum size, and was rejected.</td>\n-</tr>\n-<tr><td>data_did_not_terminate</td>\n-<td>3</td>\n-<td>available inflate data did not terminate</td>\n-</tr>\n-<tr><td>space_exhausted</td>\n-<td>4</td>\n-<td>output space exhausted before completing inflate</td>\n-</tr>\n-<tr><td>invalid_block_type</td>\n-<td>5</td>\n-<td>invalid block type (type == 3)</td>\n-</tr>\n-<tr><td>invalid_stored_block_length</td>\n-<td>6</td>\n-<td>stored block length did not match one's complement</td>\n-</tr>\n-<tr><td>too_many_length_or_distance_codes</td>\n-<td>7</td>\n-<td>dynamic block code description: too many length or distance codes</td>\n-</tr>\n-<tr><td>code_lengths_codes_incomplete</td>\n-<td>8</td>\n-<td>dynamic block code description: code lengths codes incomplete</td>\n-</tr>\n-<tr><td>repeat_lengths_with_no_first_length</td>\n-<td>9</td>\n-<td>dynamic block code description: repeat lengths with no first length</td>\n-</tr>\n-<tr><td>repeat_more_than_specified_lengths</td>\n-<td>10</td>\n-<td>dynamic block code description: repeat more than specified lengths</td>\n-</tr>\n-<tr><td>invalid_literal_length_code_lengths</td>\n-<td>11</td>\n-<td>dynamic block code description: invalid literal/length code lengths</td>\n-</tr>\n-<tr><td>invalid_distance_code_lengths</td>\n-<td>12</td>\n-<td>dynamic block code description: invalid distance code lengths</td>\n-</tr>\n-<tr><td>invalid_literal_code_in_block</td>\n-<td>13</td>\n-<td>invalid literal/length or distance code in fixed or dynamic block</td>\n-</tr>\n-<tr><td>distance_too_far_back_in_block</td>\n-<td>14</td>\n-<td>distance is too far back in fixed or dynamic block</td>\n-</tr>\n-<tr><td>unknown_gzip_error</td>\n-<td>15</td>\n-<td>an unknown error occurred during gzip inflation</td>\n-</tr>\n-<tr><td>error_code_max</td>\n-<td>16</td>\n-<td>the number of error codes</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-3\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"37%\" />\n-<col width=\"7%\" />\n-<col width=\"56%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>No error</td>\n-</tr>\n-<tr><td>invalid_argument</td>\n-<td>402</td>\n-<td>One of the arguments in the request is invalid</td>\n-</tr>\n-<tr><td>action_failed</td>\n-<td>501</td>\n-<td>The request failed</td>\n-</tr>\n-<tr><td>value_not_in_array</td>\n-<td>714</td>\n-<td>The specified value does not exist in the array</td>\n-</tr>\n-<tr><td>source_ip_cannot_be_wildcarded</td>\n-<td>715</td>\n-<td>The source IP address cannot be wild-carded, but\n-must be fully specified</td>\n-</tr>\n-<tr><td>external_port_cannot_be_wildcarded</td>\n-<td>716</td>\n-<td>The external port cannot be a wildcard, but must\n-be specified</td>\n-</tr>\n-<tr><td>port_mapping_conflict</td>\n-<td>718</td>\n-<td>The port mapping <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> specified conflicts with a\n-mapping assigned previously to another client</td>\n-</tr>\n-<tr><td>internal_port_must_match_external</td>\n-<td>724</td>\n-<td>Internal and external port value must be the same</td>\n-</tr>\n-<tr><td>only_permanent_leases_supported</td>\n-<td>725</td>\n-<td>The NAT implementation only supports permanent\n-lease times on port mappings</td>\n-</tr>\n-<tr><td>remote_host_must_be_wildcard</td>\n-<td>726</td>\n-<td>RemoteHost must be a wildcard and cannot be a\n-specific IP address or DNS name</td>\n-</tr>\n-<tr><td>external_port_must_be_wildcard</td>\n-<td>727</td>\n-<td>ExternalPort must be a wildcard and cannot be a\n-specific port</td>\n-</tr>\n-</tbody>\n-</table>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n <div id=\"footer\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,30 +2,30 @@\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bf_\bi_\bl_\be_\b(_\b)\n- * _\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- * _\bi_\b2_\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+ * _\bu_\bp_\bn_\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 * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bs_\bo_\bc_\bk_\bs_\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- * _\bu_\bp_\bn_\bp_\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 _\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 _\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 _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\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 _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\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@@ -50,52 +50,167 @@\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* 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* 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* 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* 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* i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+boost::system::error_category& i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+returns the error category for I2P errors\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n return the instance of the libtorrent_error_category which maps libtorrent\n error codes to human readable error messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n returns the error_category for HTTP errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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* 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* 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* g\bgz\bzi\bip\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 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-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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_gzip_header |1 |the supplied gzip buffer has |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |the gzip buffer would inflate to |\n+|inflated_data_too_large |2 |more bytes than the specified |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n+|data_did_not_terminate |3 |available inflate data did not |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|space_exhausted |4 |output space exhausted before |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n+|invalid_stored_block_length |6 |stored block length did not match |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bn_\be_\b'_\bs_\b _\bc_\bo_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n+|code_lengths_codes_incomplete |8 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n+|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n+|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n+|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n+|invalid_distance_code_lengths |12 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n+|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n+|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|unknown_gzip_error |15 |an unknown error occurred during |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* u\bup\bpn\bnp\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 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-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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_argument |402 |One of the arguments in the request |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|value_not_in_array |714 |The specified value does not exist |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The source IP address cannot be |\n+|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|external_port_cannot_be_wildcarded|716 |The external port cannot be a |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n+| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n+|port_mapping_conflict |718 |conflicts with a mapping assigned |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|internal_port_must_match_external |724 |Internal and external port value |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The NAT implementation only supports|\n+|only_permanent_leases_supported |725 |permanent lease times on port |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |RemoteHost must be a wildcard and |\n+|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bD_\bN_\bS_\b _\bn_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\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 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 i\bi2\b2p\bp_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\br_\bs_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\ba_\bn_\bt_\b__\br_\be_\ba_\bc_\bh_\b__\bp_\be_\be_\br_\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bk_\be_\by_\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bd_\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bk_\be_\by_\b__\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b__\bi_\bd_\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_collision |1 |Two torrents has files which end |\n@@ -492,63 +607,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 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 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 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@@ -556,80 +622,14 @@\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/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_gzip_header |1 |the supplied gzip buffer has |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |the gzip buffer would inflate to |\n-|inflated_data_too_large |2 |more bytes than the specified |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n-|data_did_not_terminate |3 |available inflate data did not |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|space_exhausted |4 |output space exhausted before |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n-|invalid_stored_block_length |6 |stored block length did not match |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bn_\be_\b'_\bs_\b _\bc_\bo_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n-|code_lengths_codes_incomplete |8 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n-|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n-|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n-|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n-|invalid_distance_code_lengths |12 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n-|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n-|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|unknown_gzip_error |15 |an unknown error occurred during |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm 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 _\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,19 +56,19 @@\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).</p>\n <p>A default constructed <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a> does not filter any address.</p>\n <pre class=\"literal-block\">\n struct ip_filter\n {\n+ <strong>ip_filter</strong> (ip_filter const&);\n <strong>ip_filter</strong> (ip_filter&&);\n <strong>~ip_filter</strong> ();\n- <strong>ip_filter</strong> (ip_filter const&);\n- ip_filter& <strong>operator=</strong> (ip_filter&&);\n <strong>ip_filter</strong> ();\n+ ip_filter& <strong>operator=</strong> (ip_filter&&);\n ip_filter& <strong>operator=</strong> (ip_filter const&);\n bool <strong>empty</strong> () const;\n void <strong>add_rule</strong> (address const& first, address const& last, std::uint32_t flags);\n std::uint32_t <strong>access</strong> (address const& addr) const;\n filter_tuple_t <strong>export_filter</strong> () const;\n \n enum access_flags\n@@ -153,20 +153,20 @@\n <p>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.</p>\n <pre class=\"literal-block\">\n class port_filter\n {\n+ port_filter& <strong>operator=</strong> (port_filter&&);\n+ <strong>port_filter</strong> (port_filter&&);\n <strong>port_filter</strong> (port_filter const&);\n port_filter& <strong>operator=</strong> (port_filter const&);\n <strong>port_filter</strong> ();\n <strong>~port_filter</strong> ();\n- <strong>port_filter</strong> (port_filter&&);\n- port_filter& <strong>operator=</strong> (port_filter&&);\n void <strong>add_rule</strong> (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n std::uint32_t <strong>access</strong> (std::uint16_t port) const;\n \n enum access_flags\n {\n blocked,\n };\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -19,19 +19,19 @@\n The ip_filter class is a set of rules that uniquely categorizes all ip\n addresses as allowed or disallowed. The default constructor creates a single\n rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n and the equivalent range covering all addresses for the IPv6 range).\n A default constructed _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br does not filter any address.\n struct ip_filter\n {\n+ i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter&&);\n ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n- ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+ ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter const&);\n 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@@ -81,20 +81,20 @@\n *\b**\b**\b**\b**\b**\b* p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n the port filter maps non-overlapping port ranges to flags. This is primarily\n used to indicate whether a range of ports should be connected to or not. The\n default is to have the full port range (0-65535) set to flag 0.\n class port_filter\n {\n+ port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\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 port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\n p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n ~\b~p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n- p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n- port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\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 </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#peer-class-info\" id=\"toc-entry-1\">peer_class_info</a></li>\n <li><a class=\"reference internal\" href=\"#peer-class-type-filter\" id=\"toc-entry-2\">peer_class_type_filter</a><ul>\n-<li><a class=\"reference internal\" href=\"#remove-add\" id=\"toc-entry-3\">remove() add()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-remove\" id=\"toc-entry-3\">add() remove()</a></li>\n <li><a class=\"reference internal\" href=\"#allow-disallow\" id=\"toc-entry-4\">allow() disallow()</a></li>\n <li><a class=\"reference internal\" href=\"#apply\" id=\"toc-entry-5\">apply()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-socket-type-t\" id=\"toc-entry-6\">enum socket_type_t</a></li>\n </ul>\n </li>\n </ul>\n </div>\n@@ -106,16 +106,16 @@\n peer-classes from peers. It is applied <em>after</em> the peer class filter is applied (which\n is based on the peer's IP address).</p>\n <pre class=\"literal-block\">\n struct peer_class_type_filter\n {\n void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n- void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+ void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n std::uint32_t <strong>apply</strong> (socket_type_t const st, std::uint32_t peer_class_mask);\n friend bool <strong>operator==</strong> (peer_class_type_filter const& lhs\n , peer_class_type_filter const& rhs);\n \n enum socket_type_t\n {\n tcp_socket,\n@@ -123,30 +123,30 @@\n ssl_tcp_socket,\n ssl_utp_socket,\n i2p_socket,\n num_socket_types,\n };\n };\n </pre>\n-<a name=\"remove()\"></a>\n-<a name=\"add()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"remove-add\">\n-<h2>remove() add()</h2>\n+<a name=\"add()\"></a>\n+<a name=\"remove()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Badd%28%29+remove%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Badd%28%29+remove%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"add-remove\">\n+<h2>add() remove()</h2>\n <pre class=\"literal-block\">\n void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n </pre>\n <p><tt class=\"docutils literal\">add()</tt> and <tt class=\"docutils literal\">remove()</tt> adds and removes a peer class to be added\n to new peers based on socket type.</p>\n <a name=\"allow()\"></a>\n <a name=\"disallow()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Ballow%28%29+disallow%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Ballow%28%29+disallow%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"allow-disallow\">\n <h2>allow() disallow()</h2>\n <pre class=\"literal-block\">\n-void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n </pre>\n <p><tt class=\"docutils literal\">disallow()</tt> and <tt class=\"docutils literal\">allow()</tt> adds and removes a peer class to be\n removed from new peers based on socket type.</p>\n <p>The <tt class=\"docutils literal\">peer_class</tt> argument cannot be greater than 31. The bitmasks representing\n peer classes in the <tt class=\"docutils literal\">peer_class_type_filter</tt> are 32 bits.</p>\n <a name=\"apply()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bapply%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bapply%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"apply\">\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.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\br_\be_\bm_\bo_\bv_\be_\b(_\b)_\b _\ba_\bd_\bd_\b(_\b)\n+ o _\ba_\bd_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b(_\b)\n o _\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)\n o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n@@ -61,16 +61,16 @@\n peer_class_type_filter is a simple container for rules for adding and\n subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n is applied (which is based on the peer's IP address).\n struct peer_class_type_filter\n {\n void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n- void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n , peer_class_type_filter const& rhs);\n \n enum socket_type_t\n {\n tcp_socket,\n@@ -78,23 +78,23 @@\n ssl_tcp_socket,\n ssl_utp_socket,\n i2p_socket,\n num_socket_types,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd(\b()\b) r\bre\bem\bmo\bov\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n add() and remove() adds and removes a peer class to be added to new peers based\n on socket type.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bal\bll\blo\bow\bw(\b()\b) d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n disallow() and allow() adds and removes a peer class to be removed from new\n peers based on socket type.\n The peer_class argument cannot be greater than 31. The bitmasks representing\n peer classes in the peer_class_type_filter are 32 bits.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "unified_diff": "@@ -48,47 +48,47 @@\n <li><a class=\"reference internal\" href=\"#on-tick\" id=\"toc-entry-14\">on_tick()</a></li>\n <li><a class=\"reference internal\" href=\"#get-unchoke-priority\" id=\"toc-entry-15\">get_unchoke_priority()</a></li>\n <li><a class=\"reference internal\" href=\"#load-state\" id=\"toc-entry-16\">load_state()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#torrent-plugin\" id=\"toc-entry-17\">torrent_plugin</a><ul>\n <li><a class=\"reference internal\" href=\"#new-connection\" id=\"toc-entry-18\">new_connection()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-piece-pass-on-piece-failed\" id=\"toc-entry-19\">on_piece_pass() on_piece_failed()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-piece-failed-on-piece-pass\" id=\"toc-entry-19\">on_piece_failed() on_piece_pass()</a></li>\n <li><a class=\"reference internal\" href=\"#tick\" id=\"toc-entry-20\">tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-resume-on-pause\" id=\"toc-entry-21\">on_resume() on_pause()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-pause-on-resume\" id=\"toc-entry-21\">on_pause() on_resume()</a></li>\n <li><a class=\"reference internal\" href=\"#on-files-checked\" id=\"toc-entry-22\">on_files_checked()</a></li>\n <li><a class=\"reference internal\" href=\"#on-state\" id=\"toc-entry-23\">on_state()</a></li>\n <li><a class=\"reference internal\" href=\"#on-add-peer\" id=\"toc-entry-24\">on_add_peer()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#peer-plugin\" id=\"toc-entry-25\">peer_plugin</a><ul>\n <li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-26\">type()</a></li>\n <li><a class=\"reference internal\" href=\"#add-handshake\" id=\"toc-entry-27\">add_handshake()</a></li>\n <li><a class=\"reference internal\" href=\"#on-disconnect\" id=\"toc-entry-28\">on_disconnect()</a></li>\n <li><a class=\"reference internal\" href=\"#on-connected\" id=\"toc-entry-29\">on_connected()</a></li>\n <li><a class=\"reference internal\" href=\"#on-handshake\" id=\"toc-entry-30\">on_handshake()</a></li>\n <li><a class=\"reference internal\" href=\"#on-extension-handshake\" id=\"toc-entry-31\">on_extension_handshake()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-request-on-bitfield-on-allowed-fast-on-unchoke-on-have-on-interested-on-have-none-on-not-interested-on-dont-have-on-choke-on-have-all\" id=\"toc-entry-32\">on_request() on_bitfield() on_allowed_fast() on_unchoke() on_have() on_interested() on_have_none() on_not_interested() on_dont_have() on_choke() on_have_all()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-unchoke-on-bitfield-on-not-interested-on-have-on-dont-have-on-have-none-on-request-on-allowed-fast-on-choke-on-have-all-on-interested\" id=\"toc-entry-32\">on_unchoke() on_bitfield() on_not_interested() on_have() on_dont_have() on_have_none() on_request() on_allowed_fast() on_choke() on_have_all() on_interested()</a></li>\n <li><a class=\"reference internal\" href=\"#on-piece\" id=\"toc-entry-33\">on_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#sent-interested-sent-not-interested-sent-piece-sent-unchoke-sent-have\" id=\"toc-entry-34\">sent_interested() sent_not_interested() sent_piece() sent_unchoke() sent_have()</a></li>\n+<li><a class=\"reference internal\" href=\"#sent-unchoke-sent-interested-sent-not-interested-sent-have-sent-piece\" id=\"toc-entry-34\">sent_unchoke() sent_interested() sent_not_interested() sent_have() sent_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#sent-payload\" id=\"toc-entry-35\">sent_payload()</a></li>\n <li><a class=\"reference internal\" href=\"#can-disconnect\" id=\"toc-entry-36\">can_disconnect()</a></li>\n <li><a class=\"reference internal\" href=\"#on-extended\" id=\"toc-entry-37\">on_extended()</a></li>\n <li><a class=\"reference internal\" href=\"#on-unknown-message\" id=\"toc-entry-38\">on_unknown_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-piece-pass-on-piece-failed-1\" id=\"toc-entry-39\">on_piece_pass() on_piece_failed()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-piece-failed-on-piece-pass-1\" id=\"toc-entry-39\">on_piece_failed() on_piece_pass()</a></li>\n <li><a class=\"reference internal\" href=\"#tick-1\" id=\"toc-entry-40\">tick()</a></li>\n <li><a class=\"reference internal\" href=\"#write-request\" id=\"toc-entry-41\">write_request()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#crypto-plugin\" id=\"toc-entry-42\">crypto_plugin</a><ul>\n <li><a class=\"reference internal\" href=\"#decrypt\" id=\"toc-entry-43\">decrypt()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#create-smart-ban-plugin\" id=\"toc-entry-44\">create_smart_ban_plugin()</a></li>\n-<li><a class=\"reference internal\" href=\"#create-ut-pex-plugin\" id=\"toc-entry-45\">create_ut_pex_plugin()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-ut-pex-plugin\" id=\"toc-entry-44\">create_ut_pex_plugin()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-smart-ban-plugin\" id=\"toc-entry-45\">create_smart_ban_plugin()</a></li>\n <li><a class=\"reference internal\" href=\"#create-ut-metadata-plugin\" id=\"toc-entry-46\">create_ut_metadata_plugin()</a></li>\n </ul>\n </div>\n <p>libtorrent has a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n@@ -190,69 +190,69 @@\n connection object, to be used by plugins. This is a low level interface that\n may not be stable across libtorrent versions</p>\n <pre class=\"literal-block\">\n struct peer_connection_handle\n {\n explicit <strong>peer_connection_handle</strong> (std::weak_ptr<peer_connection> impl);\n connection_type <strong>type</strong> () const;\n- peer_plugin const* <strong>find_plugin</strong> (string_view type) const;\n void <strong>add_extension</strong> (std::shared_ptr<peer_plugin>);\n+ peer_plugin const* <strong>find_plugin</strong> (string_view type) const;\n bool <strong>is_seed</strong> () const;\n bool <strong>upload_only</strong> () const;\n- bool <strong>has_piece</strong> (piece_index_t i) const;\n peer_id const& <strong>pid</strong> () const;\n- bool <strong>is_choked</strong> () const;\n+ bool <strong>has_piece</strong> (piece_index_t i) const;\n bool <strong>is_interesting</strong> () const;\n+ bool <strong>is_choked</strong> () const;\n bool <strong>has_peer_choked</strong> () const;\n bool <strong>is_peer_interested</strong> () const;\n void <strong>choke_this_peer</strong> ();\n void <strong>maybe_unchoke_this_peer</strong> ();\n void <strong>get_peer_info</strong> (peer_info& p) const;\n torrent_handle <strong>associated_torrent</strong> () const;\n <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> const& <strong>remote</strong> () const;\n <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>local_endpoint</strong> () const;\n- bool <strong>is_disconnecting</strong> () const;\n- bool <strong>is_outgoing</strong> () const;\n- bool <strong>is_connecting</strong> () const;\n void <strong>disconnect</strong> (error_code const& ec, operation_t op\n , disconnect_severity_t = peer_connection_interface::normal);\n+ bool <strong>is_connecting</strong> () const;\n+ bool <strong>is_outgoing</strong> () const;\n+ bool <strong>is_disconnecting</strong> () const;\n bool <strong>ignore_unchoke_slots</strong> () const;\n bool <strong>on_local_network</strong> () const;\n bool <strong>failed</strong> () const;\n bool <strong>should_log</strong> (peer_log_alert::direction_t direction) const;\n void <strong>peer_log</strong> (peer_log_alert::direction_t direction\n , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n bool <strong>can_disconnect</strong> (error_code const& ec) const;\n bool <strong>has_metadata</strong> () const;\n bool <strong>in_handshake</strong> () const;\n void <strong>send_buffer</strong> (char const* begin, int size);\n time_point <strong>time_of_last_unchoke</strong> () const;\n std::time_t <strong>last_seen_complete</strong> () const;\n- bool <strong>operator==</strong> (peer_connection_handle const& o) const;\n- bool <strong>operator<</strong> (peer_connection_handle const& o) const;\n bool <strong>operator!=</strong> (peer_connection_handle const& o) const;\n+ bool <strong>operator<</strong> (peer_connection_handle const& o) const;\n+ bool <strong>operator==</strong> (peer_connection_handle const& o) const;\n std::shared_ptr<peer_connection> <strong>native_handle</strong> () const;\n };\n </pre>\n <a name=\"bt_peer_connection_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bt_peer_connection_handle&labels=documentation&body=Documentation+under+heading+%22class+bt_peer_connection_handle%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"bt-peer-connection-handle\">\n <h1>bt_peer_connection_handle</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection_handle.hpp\">libtorrent/peer_connection_handle.hpp</a>"</p>\n <p>The <a class=\"reference external\" href=\"reference-Plugins.html#bt_peer_connection_handle\">bt_peer_connection_handle</a> 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.</p>\n <pre class=\"literal-block\">\n struct bt_peer_connection_handle : peer_connection_handle\n {\n explicit <strong>bt_peer_connection_handle</strong> (peer_connection_handle pc);\n- bool <strong>support_extensions</strong> () const;\n bool <strong>packet_finished</strong> () const;\n+ bool <strong>support_extensions</strong> () const;\n bool <strong>supports_encryption</strong> () const;\n- void <strong>switch_send_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n void <strong>switch_recv_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n+ void <strong>switch_send_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n std::shared_ptr<bt_peer_connection> <strong>native_handle</strong> () const;\n };\n </pre>\n <a name=\"plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+plugin&labels=documentation&body=Documentation+under+heading+%22class+plugin%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"plugin\">\n <h1>plugin</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n@@ -415,19 +415,19 @@\n <p>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.</p>\n <pre class=\"literal-block\">\n struct torrent_plugin\n {\n virtual std::shared_ptr<peer_plugin> <strong>new_connection</strong> (peer_connection_handle const&);\n- virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+ virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>tick</strong> ();\n- virtual bool <strong>on_pause</strong> ();\n virtual bool <strong>on_resume</strong> ();\n+ virtual bool <strong>on_pause</strong> ();\n virtual void <strong>on_files_checked</strong> ();\n virtual void <strong>on_state</strong> (torrent_status::state_t);\n virtual void <strong>on_add_peer</strong> (tcp::endpoint const&,\n peer_source_flags_t, add_peer_flags_t);\n \n static constexpr add_peer_flags_t <strong>first_time</strong> = 1_bit;\n static constexpr add_peer_flags_t <strong>filtered</strong> = 2_bit;\n@@ -446,41 +446,41 @@\n are supposed to return an instance of your <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a> class. Which in\n turn will have its hook functions called on event specific to that peer.</p>\n <p>The <tt class=\"docutils literal\">peer_connection_handle</tt> will be valid as long as the <tt class=\"docutils literal\">shared_ptr</tt>\n is being held by the torrent object. So, it is generally a good idea to not\n keep a <tt class=\"docutils literal\">shared_ptr</tt> to your own <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>. If you want to keep references\n to it, use <tt class=\"docutils literal\">weak_ptr</tt>.</p>\n <p>If this function throws an exception, the connection will be closed.</p>\n-<a name=\"on_piece_pass()\"></a>\n-<a name=\"on_piece_failed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-piece-pass-on-piece-failed\">\n-<h2>on_piece_pass() on_piece_failed()</h2>\n+<a name=\"on_piece_failed()\"></a>\n+<a name=\"on_piece_pass()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-piece-failed-on-piece-pass\">\n+<h2>on_piece_failed() on_piece_pass()</h2>\n <pre class=\"literal-block\">\n-virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+virtual void <strong>on_piece_failed</strong> (piece_index_t);\n </pre>\n <p>These hooks are called when a piece passes the hash check or fails the hash\n check, respectively. The <tt class=\"docutils literal\">index</tt> 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 <tt class=\"docutils literal\">torrent</tt> and the <tt class=\"docutils literal\">piece_picker</tt>.</p>\n <a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"tick\">\n <h2>tick()</h2>\n <pre class=\"literal-block\">\n virtual void <strong>tick</strong> ();\n </pre>\n <p>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.</p>\n-<a name=\"on_resume()\"></a>\n-<a name=\"on_pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-resume-on-pause\">\n-<h2>on_resume() on_pause()</h2>\n+<a name=\"on_pause()\"></a>\n+<a name=\"on_resume()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_pause%28%29+on_resume%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_pause%28%29+on_resume%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-pause-on-resume\">\n+<h2>on_pause() on_resume()</h2>\n <pre class=\"literal-block\">\n-virtual bool <strong>on_pause</strong> ();\n virtual bool <strong>on_resume</strong> ();\n+virtual bool <strong>on_pause</strong> ();\n </pre>\n <p>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 <tt class=\"docutils literal\">true</tt> indicates that it was handled, and no other <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n@@ -545,51 +545,51 @@\n {\n virtual string_view <strong>type</strong> () const;\n virtual void <strong>add_handshake</strong> (entry&);\n virtual void <strong>on_disconnect</strong> (error_code const&);\n virtual void <strong>on_connected</strong> ();\n virtual bool <strong>on_handshake</strong> (span<char const>);\n virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n+ virtual bool <strong>on_have_all</strong> ();\n+ virtual bool <strong>on_dont_have</strong> (piece_index_t);\n virtual bool <strong>on_have_none</strong> ();\n- virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n+ virtual bool <strong>on_interested</strong> ();\n+ virtual bool <strong>on_request</strong> (peer_request const&);\n virtual bool <strong>on_not_interested</strong> ();\n virtual bool <strong>on_choke</strong> ();\n+ virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n- virtual bool <strong>on_dont_have</strong> (piece_index_t);\n- virtual bool <strong>on_request</strong> (peer_request const&);\n- virtual bool <strong>on_have_all</strong> ();\n- virtual bool <strong>on_unchoke</strong> ();\n- virtual bool <strong>on_interested</strong> ();\n virtual bool <strong>on_have</strong> (piece_index_t);\n+ virtual bool <strong>on_unchoke</strong> ();\n virtual bool <strong>on_piece</strong> (peer_request const& <em>/*piece*/</em>\n , span<char const> <em>/*buf*/</em>);\n- virtual bool <strong>on_suggest</strong> (piece_index_t);\n virtual bool <strong>on_reject</strong> (peer_request const&);\n virtual bool <strong>on_cancel</strong> (peer_request const&);\n- virtual void <strong>sent_have_all</strong> ();\n- virtual void <strong>sent_allow_fast</strong> (piece_index_t);\n- virtual void <strong>sent_have_none</strong> ();\n+ virtual bool <strong>on_suggest</strong> (piece_index_t);\n virtual void <strong>sent_suggest</strong> (piece_index_t);\n virtual void <strong>sent_choke</strong> ();\n+ virtual void <strong>sent_have_none</strong> ();\n virtual void <strong>sent_cancel</strong> (peer_request const&);\n+ virtual void <strong>sent_allow_fast</strong> (piece_index_t);\n virtual void <strong>sent_request</strong> (peer_request const&);\n virtual void <strong>sent_reject_request</strong> (peer_request const&);\n- virtual void <strong>sent_interested</strong> ();\n- virtual void <strong>sent_unchoke</strong> ();\n+ virtual void <strong>sent_have_all</strong> ();\n virtual void <strong>sent_piece</strong> (peer_request const&);\n- virtual void <strong>sent_have</strong> (piece_index_t);\n+ virtual void <strong>sent_unchoke</strong> ();\n+ virtual void <strong>sent_interested</strong> ();\n virtual void <strong>sent_not_interested</strong> ();\n+ virtual void <strong>sent_have</strong> (piece_index_t);\n virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n virtual bool <strong>can_disconnect</strong> (error_code const& <em>/*ec*/</em>);\n virtual bool <strong>on_extended</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n span<char const> <em>/*body*/</em>);\n virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n span<char const> <em>/*body*/</em>);\n- virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+ virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>tick</strong> ();\n virtual bool <strong>write_request</strong> (peer_request const&);\n };\n </pre>\n <a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"type\">\n <h2>type()</h2>\n <pre class=\"literal-block\">\n@@ -639,39 +639,39 @@\n virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>\n being removed from the peer_connection and destructed.\n this is not called for web seeds</p>\n-<a name=\"on_request()\"></a>\n-<a name=\"on_bitfield()\"></a>\n-<a name=\"on_allowed_fast()\"></a>\n <a name=\"on_unchoke()\"></a>\n-<a name=\"on_have()\"></a>\n-<a name=\"on_interested()\"></a>\n-<a name=\"on_have_none()\"></a>\n+<a name=\"on_bitfield()\"></a>\n <a name=\"on_not_interested()\"></a>\n+<a name=\"on_have()\"></a>\n <a name=\"on_dont_have()\"></a>\n+<a name=\"on_have_none()\"></a>\n+<a name=\"on_request()\"></a>\n+<a name=\"on_allowed_fast()\"></a>\n <a name=\"on_choke()\"></a>\n-<a name=\"on_have_all()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_request%28%29+on_bitfield%28%29+on_allowed_fast%28%29+on_unchoke%28%29+on_have%28%29+on_interested%28%29+on_have_none%28%29+on_not_interested%28%29+on_dont_have%28%29+on_choke%28%29+on_have_all%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_request%28%29+on_bitfield%28%29+on_allowed_fast%28%29+on_unchoke%28%29+on_have%28%29+on_interested%28%29+on_have_none%28%29+on_not_interested%28%29+on_dont_have%28%29+on_choke%28%29+on_have_all%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-request-on-bitfield-on-allowed-fast-on-unchoke-on-have-on-interested-on-have-none-on-not-interested-on-dont-have-on-choke-on-have-all\">\n-<h2>on_request() on_bitfield() on_allowed_fast() on_unchoke() on_have() on_interested() on_have_none() on_not_interested() on_dont_have() on_choke() on_have_all()</h2>\n+<a name=\"on_have_all()\"></a>\n+<a name=\"on_interested()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_unchoke%28%29+on_bitfield%28%29+on_not_interested%28%29+on_have%28%29+on_dont_have%28%29+on_have_none%28%29+on_request%28%29+on_allowed_fast%28%29+on_choke%28%29+on_have_all%28%29+on_interested%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_unchoke%28%29+on_bitfield%28%29+on_not_interested%28%29+on_have%28%29+on_dont_have%28%29+on_have_none%28%29+on_request%28%29+on_allowed_fast%28%29+on_choke%28%29+on_have_all%28%29+on_interested%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-unchoke-on-bitfield-on-not-interested-on-have-on-dont-have-on-have-none-on-request-on-allowed-fast-on-choke-on-have-all-on-interested\">\n+<h2>on_unchoke() on_bitfield() on_not_interested() on_have() on_dont_have() on_have_none() on_request() on_allowed_fast() on_choke() on_have_all() on_interested()</h2>\n <pre class=\"literal-block\">\n+virtual bool <strong>on_have_all</strong> ();\n+virtual bool <strong>on_dont_have</strong> (piece_index_t);\n virtual bool <strong>on_have_none</strong> ();\n-virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n+virtual bool <strong>on_interested</strong> ();\n+virtual bool <strong>on_request</strong> (peer_request const&);\n virtual bool <strong>on_not_interested</strong> ();\n virtual bool <strong>on_choke</strong> ();\n+virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n-virtual bool <strong>on_dont_have</strong> (piece_index_t);\n-virtual bool <strong>on_request</strong> (peer_request const&);\n-virtual bool <strong>on_have_all</strong> ();\n-virtual bool <strong>on_unchoke</strong> ();\n-virtual bool <strong>on_interested</strong> ();\n virtual bool <strong>on_have</strong> (piece_index_t);\n+virtual bool <strong>on_unchoke</strong> ();\n </pre>\n <p>returning true from any of the message handlers\n indicates that the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has handled the message.\n it will break the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> chain traversing and not let\n anyone else handle the message, including the default\n handler.</p>\n <a name=\"on_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n@@ -683,27 +683,27 @@\n </pre>\n <p>This function is called when the peer connection is receiving\n a piece. <tt class=\"docutils literal\">buf</tt> points (non-owning pointer) to the data in an\n internal immutable disk buffer. The length of the data is specified\n in the <tt class=\"docutils literal\">length</tt> member of the <tt class=\"docutils literal\">piece</tt> parameter.\n returns true to indicate that the piece is handled and the\n rest of the logic should be ignored.</p>\n+<a name=\"sent_unchoke()\"></a>\n <a name=\"sent_interested()\"></a>\n <a name=\"sent_not_interested()\"></a>\n-<a name=\"sent_piece()\"></a>\n-<a name=\"sent_unchoke()\"></a>\n-<a name=\"sent_have()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_interested%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29+sent_have%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_interested%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29+sent_have%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"sent-interested-sent-not-interested-sent-piece-sent-unchoke-sent-have\">\n-<h2>sent_interested() sent_not_interested() sent_piece() sent_unchoke() sent_have()</h2>\n+<a name=\"sent_have()\"></a>\n+<a name=\"sent_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_unchoke%28%29+sent_interested%28%29+sent_not_interested%28%29+sent_have%28%29+sent_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_unchoke%28%29+sent_interested%28%29+sent_not_interested%28%29+sent_have%28%29+sent_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"sent-unchoke-sent-interested-sent-not-interested-sent-have-sent-piece\">\n+<h2>sent_unchoke() sent_interested() sent_not_interested() sent_have() sent_piece()</h2>\n <pre class=\"literal-block\">\n-virtual void <strong>sent_interested</strong> ();\n-virtual void <strong>sent_unchoke</strong> ();\n virtual void <strong>sent_piece</strong> (peer_request const&);\n-virtual void <strong>sent_have</strong> (piece_index_t);\n+virtual void <strong>sent_unchoke</strong> ();\n+virtual void <strong>sent_interested</strong> ();\n virtual void <strong>sent_not_interested</strong> ();\n+virtual void <strong>sent_have</strong> (piece_index_t);\n </pre>\n <p>called after a choke message has been sent to the peer</p>\n <a name=\"sent_payload()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_payload%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_payload%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"sent-payload\">\n <h2>sent_payload()</h2>\n <pre class=\"literal-block\">\n virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n@@ -739,21 +739,21 @@\n <div class=\"section\" id=\"on-unknown-message\">\n <h2>on_unknown_message()</h2>\n <pre class=\"literal-block\">\n virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n span<char const> <em>/*body*/</em>);\n </pre>\n <p>this is not called for web seeds</p>\n-<a name=\"on_piece_pass()\"></a>\n-<a name=\"on_piece_failed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-piece-pass-on-piece-failed-1\">\n-<h2>on_piece_pass() on_piece_failed()</h2>\n+<a name=\"on_piece_failed()\"></a>\n+<a name=\"on_piece_pass()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-piece-failed-on-piece-pass-1\">\n+<h2>on_piece_failed() on_piece_pass()</h2>\n <pre class=\"literal-block\">\n-virtual void <strong>on_piece_failed</strong> (piece_index_t);\n virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+virtual void <strong>on_piece_failed</strong> (piece_index_t);\n </pre>\n <p>called when a piece that this peer participated in either\n fails or passes the hash_check</p>\n <a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"tick-1\">\n <h2>tick()</h2>\n <pre class=\"literal-block\">\n@@ -773,16 +773,16 @@\n </div>\n <div class=\"section\" id=\"crypto-plugin\">\n <h1>crypto_plugin</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n <pre class=\"literal-block\">\n struct crypto_plugin\n {\n- virtual void <strong>set_outgoing_key</strong> (span<char const> key) = 0;\n virtual void <strong>set_incoming_key</strong> (span<char const> key) = 0;\n+ virtual void <strong>set_outgoing_key</strong> (span<char const> key) = 0;\n <strong>encrypt</strong> (span<span<char>> <em>/*send_vec*/</em>) = 0;\n virtual std::tuple<int, int, int> <strong>decrypt</strong> (span<span<char>> <em>/*receive_vec*/</em>) = 0;\n };\n </pre>\n <a name=\"decrypt()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:crypto_plugin%3A%3A%5Bdecrypt%28%29%5D&labels=documentation&body=Documentation+under+heading+%22crypto_plugin%3A%3A%5Bdecrypt%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"decrypt\">\n <h2>decrypt()</h2>\n <pre class=\"literal-block\">\n@@ -793,42 +793,42 @@\n (consume, produce, packet_size)</p>\n <p>consume is set to the number of bytes which should be trimmed from the\n head of the buffers, default is 0</p>\n <p>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</p>\n <p>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</p>\n-<a name=\"create_smart_ban_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_smart_ban_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_smart_ban_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"create-smart-ban-plugin\">\n-<h1>create_smart_ban_plugin()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/smart_ban.hpp\">libtorrent/extensions/smart_ban.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::shared_ptr<torrent_plugin> <strong>create_smart_ban_plugin</strong> (torrent_handle const&, client_data_t);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n <a name=\"create_ut_pex_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_pex_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_pex_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n <div class=\"section\" id=\"create-ut-pex-plugin\">\n <h1>create_ut_pex_plugin()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_pex.hpp\">libtorrent/extensions/ut_pex.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::shared_ptr<torrent_plugin> <strong>create_ut_pex_plugin</strong> (torrent_handle const&, client_data_t);\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor.</p>\n <p>This can either be passed in the add_torrent_params::extensions field, or\n via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n+<a name=\"create_smart_ban_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_smart_ban_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_smart_ban_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"create-smart-ban-plugin\">\n+<h1>create_smart_ban_plugin()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/smart_ban.hpp\">libtorrent/extensions/smart_ban.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::shared_ptr<torrent_plugin> <strong>create_smart_ban_plugin</strong> (torrent_handle const&, client_data_t);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n <a name=\"create_ut_metadata_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_metadata_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_metadata_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"create-ut-metadata-plugin\">\n <h1>create_ut_metadata_plugin()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_metadata.hpp\">libtorrent/extensions/ut_metadata.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::shared_ptr<torrent_plugin> <strong>create_ut_metadata_plugin</strong> (torrent_handle const&, client_data_t);\n </pre>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -17,44 +17,44 @@\n o _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b)\n o _\bg_\be_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n o _\bl_\bo_\ba_\bd_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bn_\be_\bw_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n- o _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)\n+ o _\bo_\bn_\b__\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__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\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__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n- _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)\n+ o _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\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(_\b)\n+ _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)\n+ _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\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__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)\n- _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n+ o _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\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__\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 _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n * _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\b)\n- * _\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+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n 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@@ -140,67 +140,67 @@\n the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n connection object, to be used by plugins. This is a low level interface that\n may not be stable across libtorrent versions\n struct peer_connection_handle\n {\n explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr<peer_connection> impl);\n connection_type t\bty\byp\bpe\be () const;\n- peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr<peer_plugin>);\n+ peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n- bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n peer_id const& p\bpi\bid\bd () const;\n- bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n void 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 void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n , disconnect_severity_t = peer_connection_interface::normal);\n+ bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n+ bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\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- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (peer_connection_handle const& o) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (peer_connection_handle const& o) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (peer_connection_handle const& o) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n std::shared_ptr<peer_connection> 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\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_plugin> 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_plugin> 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_plugin> crypto);\n std::shared_ptr<bt_peer_connection> 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* p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n this is the base class for a _\bs_\be_\bs_\bs_\bi_\bo_\bn _\bp_\bl_\bu_\bg_\bi_\bn. One primary feature is that it is\n notified of all torrents that are added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, and can add its own\n@@ -321,19 +321,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<peer_plugin> 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@@ -350,30 +350,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_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n These hooks are called when a piece passes the hash check or fails the hash\n check, respectively. The index is the piece index that was downloaded. It is\n possible to access the list of peers that participated in sending the piece\n through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n virtual void t\bti\bic\bck\bk ();\n 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_p\bpa\bau\bus\bse\be ();\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n These hooks are called when the torrent is paused and resumed respectively. The\n return value indicates if the event was handled. A return value of true\n indicates that it was handled, and no other _\bp_\bl_\bu_\bg_\bi_\bn after this one will have\n this hook function called, and the standard handler will also not be invoked.\n So, returning true effectively overrides the standard behavior of pause or\n resume.\n Note that if you call pause() or resume() on the torrent from your handler it\n@@ -419,51 +419,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<char const>);\n virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual bool o\bon\bn_\b_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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_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_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_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n- virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_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_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n , span<char const> /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n- virtual bool o\bon\bn_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n virtual bool o\bon\bn_\b_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 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_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\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_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_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\beq\bqu\bue\bes\bst\bt (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_r\bre\bej\bje\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\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_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_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_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<char const> /\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<char const> /\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@@ -491,48 +491,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_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b)\n-o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b)\n-o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_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()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b)\n+o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b)\n+o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n-virtual bool o\bon\bn_\b_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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_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_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_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n-virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\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<char const> /\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_p\bpi\bie\bec\bce\be(\b()\b) s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b)\n-s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_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_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_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_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 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@@ -555,17 +555,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<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n called when a piece that this peer participated in either fails or passes the\n hash_check\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n virtual void t\bti\bic\bck\bk ();\n called approximately once every second\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -575,16 +575,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_o\bou\but\btg\bgo\boi\bin\bng\bg_\b_k\bke\bey\by (span<char const> 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<char const> 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<char const> key) = 0;\n e\ben\bnc\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n virtual std::tuple<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\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<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n@@ -594,35 +594,35 @@\n consume is set to the number of bytes which should be trimmed from the head of\n the buffers, default is 0\n produce is set to the number of bytes of payload which are now ready to be sent\n to the upper layer. default is the number of bytes passed in receive_vec\n packet_size is set to the minimum number of bytes which must be read to advance\n the next step of decryption. default is 0\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n-std::shared_ptr<torrent_plugin> 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<torrent_plugin> c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n client_data_t);\n constructor function for the ut_pex extension. The ut_pex extension allows\n peers to gossip about their connections, allowing the swarm stay well connected\n and peers aware of more peers in the swarm. This extension is enabled by\n default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n This can either be passed in the add_torrent_params::extensions field, or via\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n+std::shared_ptr<torrent_plugin> 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_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<torrent_plugin> 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"}]}, {"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": "@@ -30,30 +30,30 @@\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#read-resume-data\" id=\"toc-entry-1\">read_resume_data()</a></li>\n <li><a class=\"reference internal\" href=\"#write-resume-data-buf-write-resume-data\" id=\"toc-entry-2\">write_resume_data_buf() write_resume_data()</a></li>\n-<li><a class=\"reference internal\" href=\"#write-torrent-file-write-torrent-file-buf\" id=\"toc-entry-3\">write_torrent_file() write_torrent_file_buf()</a></li>\n+<li><a class=\"reference internal\" href=\"#write-torrent-file-buf-write-torrent-file\" id=\"toc-entry-3\">write_torrent_file_buf() write_torrent_file()</a></li>\n <li><a class=\"reference internal\" href=\"#write-torrent-flags-t\" id=\"toc-entry-4\">write_torrent_flags_t</a></li>\n </ul>\n </div>\n <a name=\"read_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:read_resume_data%28%29&labels=documentation&body=Documentation+under+heading+%22read_resume_data%28%29%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"read-resume-data\">\n <h1>read_resume_data()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/read_resume_data.hpp\">libtorrent/read_resume_data.hpp</a>"</p>\n <pre class=\"literal-block\">\n-add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n- , error_code& ec, int piece_limit = 0x200000);\n-add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n- , int piece_limit = 0x200000);\n add_torrent_params <strong>read_resume_data</strong> (span<char const> buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\n add_torrent_params <strong>read_resume_data</strong> (span<char const> buffer\n , load_torrent_limits const& cfg = {});\n+add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n+ , int piece_limit = 0x200000);\n+add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n+ , error_code& ec, int piece_limit = 0x200000);\n </pre>\n <p>these functions are used to parse resume data and populate the appropriate\n fields in an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. This object can then be used to add\n the actual <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object to and pass to session::add_torrent() or\n session::async_add_torrent().</p>\n <p>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@@ -72,24 +72,24 @@\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/write_resume_data.hpp\">libtorrent/write_resume_data.hpp</a>"</p>\n <pre class=\"literal-block\">\n entry <strong>write_resume_data</strong> (add_torrent_params const& atp);\n std::vector<char> <strong>write_resume_data_buf</strong> (add_torrent_params const& atp);\n </pre>\n <p>this function turns the resume data in an <tt class=\"docutils literal\">add_torrent_params</tt> object\n into a bencoded structure</p>\n-<a name=\"write_torrent_file()\"></a>\n-<a name=\"write_torrent_file_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_torrent_file%28%29+write_torrent_file_buf%28%29&labels=documentation&body=Documentation+under+heading+%22write_torrent_file%28%29+write_torrent_file_buf%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"write-torrent-file-write-torrent-file-buf\">\n-<h1>write_torrent_file() write_torrent_file_buf()</h1>\n+<a name=\"write_torrent_file_buf()\"></a>\n+<a name=\"write_torrent_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_torrent_file_buf%28%29+write_torrent_file%28%29&labels=documentation&body=Documentation+under+heading+%22write_torrent_file_buf%28%29+write_torrent_file%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"write-torrent-file-buf-write-torrent-file\">\n+<h1>write_torrent_file_buf() write_torrent_file()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/write_resume_data.hpp\">libtorrent/write_resume_data.hpp</a>"</p>\n <pre class=\"literal-block\">\n-entry <strong>write_torrent_file</strong> (add_torrent_params const& atp);\n-entry <strong>write_torrent_file</strong> (add_torrent_params const& atp, write_torrent_flags_t flags);\n std::vector<char> <strong>write_torrent_file_buf</strong> (add_torrent_params const& atp\n , write_torrent_flags_t flags);\n+entry <strong>write_torrent_file</strong> (add_torrent_params const& atp);\n+entry <strong>write_torrent_file</strong> (add_torrent_params const& atp, write_torrent_flags_t flags);\n </pre>\n <p>writes only the fields to create a .torrent file. This function may fail\n with a <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> exception if:</p>\n <ul class=\"simple\">\n <li>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object passed to this function does not contain the\n info dictionary (the <tt class=\"docutils literal\">ti</tt> field)</li>\n <li>The piece layers are not complete for all files that need them</li>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,27 +1,27 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)\n+ * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\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 (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<char const> 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<char const> buffer\n , load_torrent_limits const& cfg = {});\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n+ , int piece_limit = 0x200000);\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n+ , error_code& ec, int piece_limit = 0x200000);\n 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@@ -36,21 +36,21 @@\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n std::vector<char> w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n this function turns the resume data in an add_torrent_params object into a\n bencoded structure\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n+*\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<char> w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n+ , write_torrent_flags_t flags);\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n flags);\n-std::vector<char> 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "unified_diff": "@@ -29,15 +29,15 @@\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#session-proxy\" id=\"toc-entry-1\">session_proxy</a><ul>\n-<li><a class=\"reference internal\" href=\"#session-proxy-operator-session-proxy\" id=\"toc-entry-2\">session_proxy() operator=() ~session_proxy()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-session-proxy-session-proxy\" id=\"toc-entry-2\">operator=() ~session_proxy() session_proxy()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#session\" id=\"toc-entry-3\">session</a><ul>\n <li><a class=\"reference internal\" href=\"#session-1\" id=\"toc-entry-4\">session()</a></li>\n <li><a class=\"reference internal\" href=\"#session-2\" id=\"toc-entry-5\">session()</a></li>\n <li><a class=\"reference internal\" href=\"#session-3\" id=\"toc-entry-6\">~session()</a></li>\n <li><a class=\"reference internal\" href=\"#abort\" id=\"toc-entry-7\">abort()</a></li>\n@@ -47,30 +47,30 @@\n <li><a class=\"reference internal\" href=\"#session-params-1\" id=\"toc-entry-9\">session_params()</a></li>\n <li><a class=\"reference internal\" href=\"#session-params-2\" id=\"toc-entry-10\">session_params()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#session-handle\" id=\"toc-entry-11\">session_handle</a><ul>\n <li><a class=\"reference internal\" href=\"#is-valid\" id=\"toc-entry-12\">is_valid()</a></li>\n <li><a class=\"reference internal\" href=\"#session-state\" id=\"toc-entry-13\">session_state()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-torrent-status-refresh-torrent-status\" id=\"toc-entry-14\">get_torrent_status() refresh_torrent_status()</a></li>\n+<li><a class=\"reference internal\" href=\"#refresh-torrent-status-get-torrent-status\" id=\"toc-entry-14\">refresh_torrent_status() get_torrent_status()</a></li>\n <li><a class=\"reference internal\" href=\"#post-torrent-updates\" id=\"toc-entry-15\">post_torrent_updates()</a></li>\n <li><a class=\"reference internal\" href=\"#post-session-stats\" id=\"toc-entry-16\">post_session_stats()</a></li>\n <li><a class=\"reference internal\" href=\"#post-dht-stats\" id=\"toc-entry-17\">post_dht_stats()</a></li>\n <li><a class=\"reference internal\" href=\"#set-dht-state\" id=\"toc-entry-18\">set_dht_state()</a></li>\n <li><a class=\"reference internal\" href=\"#get-torrents-find-torrent\" id=\"toc-entry-19\">get_torrents() find_torrent()</a></li>\n <li><a class=\"reference internal\" href=\"#async-add-torrent-add-torrent\" id=\"toc-entry-20\">async_add_torrent() add_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#resume-is-paused-pause\" id=\"toc-entry-21\">resume() is_paused() pause()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-paused-pause-resume\" id=\"toc-entry-21\">is_paused() pause() resume()</a></li>\n <li><a class=\"reference internal\" href=\"#is-dht-running\" id=\"toc-entry-22\">is_dht_running()</a></li>\n <li><a class=\"reference internal\" href=\"#set-dht-storage\" id=\"toc-entry-23\">set_dht_storage()</a></li>\n <li><a class=\"reference internal\" href=\"#add-dht-node\" id=\"toc-entry-24\">add_dht_node()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-get-item\" id=\"toc-entry-25\">dht_get_item()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-get-item-1\" id=\"toc-entry-26\">dht_get_item()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-put-item\" id=\"toc-entry-27\">dht_put_item()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-put-item-1\" id=\"toc-entry-28\">dht_put_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-dht-announce\" id=\"toc-entry-29\">dht_get_peers() dht_announce()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-announce-dht-get-peers\" id=\"toc-entry-29\">dht_announce() dht_get_peers()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-live-nodes\" id=\"toc-entry-30\">dht_live_nodes()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-sample-infohashes\" id=\"toc-entry-31\">dht_sample_infohashes()</a></li>\n <li><a class=\"reference internal\" href=\"#dht-direct-request\" id=\"toc-entry-32\">dht_direct_request()</a></li>\n <li><a class=\"reference internal\" href=\"#add-extension\" id=\"toc-entry-33\">add_extension()</a></li>\n <li><a class=\"reference internal\" href=\"#set-ip-filter-get-ip-filter\" id=\"toc-entry-34\">set_ip_filter() get_ip_filter()</a></li>\n <li><a class=\"reference internal\" href=\"#set-port-filter\" id=\"toc-entry-35\">set_port_filter()</a></li>\n <li><a class=\"reference internal\" href=\"#is-listening-listen-port-ssl-listen-port\" id=\"toc-entry-36\">is_listening() listen_port() ssl_listen_port()</a></li>\n@@ -98,33 +98,33 @@\n synchronize the completion of the shutdown. The lifetime of this object\n may outlive <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, causing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destructor to not block. The\n <a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> destructor will block however, until the underlying <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n is done shutting down.</p>\n <pre class=\"literal-block\">\n struct session_proxy\n {\n- <strong>~session_proxy</strong> ();\n- <strong>session_proxy</strong> ();\n- <strong>session_proxy</strong> (session_proxy&&) noexcept;\n session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n- <strong>session_proxy</strong> (session_proxy const&);\n+ <strong>session_proxy</strong> (session_proxy&&) noexcept;\n+ <strong>session_proxy</strong> ();\n+ <strong>~session_proxy</strong> ();\n session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n+ <strong>session_proxy</strong> (session_proxy const&);\n };\n </pre>\n-<a name=\"session_proxy()\"></a>\n <a name=\"operator=()\"></a>\n-<a name=\"~session_proxy()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_proxy%3A%3A%5Bsession_proxy%28%29+operator%3D%28%29+~session_proxy%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_proxy%3A%3A%5Bsession_proxy%28%29+operator%3D%28%29+~session_proxy%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-proxy-operator-session-proxy\">\n-<h2>session_proxy() operator=() ~session_proxy()</h2>\n+<a name=\"~session_proxy()\"></a>\n+<a name=\"session_proxy()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_proxy%3A%3A%5Boperator%3D%28%29+~session_proxy%28%29+session_proxy%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_proxy%3A%3A%5Boperator%3D%28%29+~session_proxy%28%29+session_proxy%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-session-proxy-session-proxy\">\n+<h2>operator=() ~session_proxy() session_proxy()</h2>\n <pre class=\"literal-block\">\n-<strong>~session_proxy</strong> ();\n-<strong>session_proxy</strong> ();\n-<strong>session_proxy</strong> (session_proxy&&) noexcept;\n session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n-<strong>session_proxy</strong> (session_proxy const&);\n+<strong>session_proxy</strong> (session_proxy&&) noexcept;\n+<strong>session_proxy</strong> ();\n+<strong>~session_proxy</strong> ();\n session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n+<strong>session_proxy</strong> (session_proxy const&);\n </pre>\n <p>default constructor, does not refer to any <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n implementation object.</p>\n <a name=\"session\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session&labels=documentation&body=Documentation+under+heading+%22class+session%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n <div class=\"section\" id=\"session\">\n <h1>session</h1>\n@@ -141,49 +141,49 @@\n <p>see <a class=\"reference external\" href=\"reference-Session.html#apply_settings()\">apply_settings()</a>.</p>\n <pre class=\"literal-block\">\n struct session : session_handle\n {\n <strong>session</strong> ();\n <strong>session</strong> (session_params&& params, session_flags_t flags);\n <strong>session</strong> (session_params const& params, session_flags_t flags);\n- explicit <strong>session</strong> (session_params&& params);\n explicit <strong>session</strong> (session_params const& params);\n- <strong>session</strong> (session_params&& params, io_context& ios);\n- <strong>session</strong> (session_params const& params, io_context& ios);\n+ explicit <strong>session</strong> (session_params&& params);\n <strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n <strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n+ <strong>session</strong> (session_params&& params, io_context& ios);\n+ <strong>session</strong> (session_params const& params, io_context& ios);\n <strong>~session</strong> ();\n session_proxy <strong>abort</strong> ();\n };\n </pre>\n <a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-1\">\n <h2>session()</h2>\n <pre class=\"literal-block\">\n <strong>session</strong> ();\n <strong>session</strong> (session_params&& params, session_flags_t flags);\n <strong>session</strong> (session_params const& params, session_flags_t flags);\n-explicit <strong>session</strong> (session_params&& params);\n explicit <strong>session</strong> (session_params const& params);\n+explicit <strong>session</strong> (session_params&& params);\n </pre>\n <p>Constructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> objects which acts as the container of torrents.\n In order to avoid a race condition between starting the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> and\n configuring it, you can pass in a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. Its settings\n will take effect before the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts up.</p>\n <p>The overloads taking <tt class=\"docutils literal\">flags</tt> can be used to start a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> in\n paused mode (by passing in <tt class=\"docutils literal\"><span class=\"pre\">session::paused</span></tt>). Note that\n <tt class=\"docutils literal\">add_default_plugins</tt> do not have an affect on constructors that\n take a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. It already contains the plugins to use.</p>\n <a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"session-2\">\n <h2>session()</h2>\n <pre class=\"literal-block\">\n-<strong>session</strong> (session_params&& params, io_context& ios);\n-<strong>session</strong> (session_params const& params, io_context& ios);\n <strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n <strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n+<strong>session</strong> (session_params&& params, io_context& ios);\n+<strong>session</strong> (session_params const& params, io_context& ios);\n </pre>\n <p>Overload of the constructor that takes an external io_context to run\n the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n <div class=\"admonition warning\">\n@@ -234,16 +234,16 @@\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n <p>The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> is a parameters pack for configuring the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n before it's started.</p>\n <pre class=\"literal-block\">\n struct session_params\n {\n <strong>session_params</strong> ();\n- <strong>session_params</strong> (settings_pack&& sp);\n <strong>session_params</strong> (settings_pack const& sp);\n+ <strong>session_params</strong> (settings_pack&& sp);\n <strong>session_params</strong> (settings_pack const& sp\n , std::vector<std::shared_ptr<plugin>> exts);\n <strong>session_params</strong> (settings_pack&& sp\n , std::vector<std::shared_ptr<plugin>> exts);\n \n settings_pack settings;\n std::vector<std::shared_ptr<plugin>> extensions;\n@@ -254,16 +254,16 @@\n libtorrent::ip_filter ip_filter;\n };\n </pre>\n <a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-params-1\">\n <h2>session_params()</h2>\n <pre class=\"literal-block\">\n <strong>session_params</strong> ();\n-<strong>session_params</strong> (settings_pack&& sp);\n <strong>session_params</strong> (settings_pack const& sp);\n+<strong>session_params</strong> (settings_pack&& sp);\n </pre>\n <p>This constructor can be used to start with the default plugins\n (ut_metadata, ut_pex and smart_ban). Pass a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> to set the\n initial settings when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts.</p>\n <a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"session-params-2\">\n <h2>session_params()</h2>\n@@ -318,77 +318,77 @@\n any operation on it will throw a system_error exception, with error code\n invalid_session_handle.</p>\n <pre class=\"literal-block\">\n struct session_handle\n {\n bool <strong>is_valid</strong> () const;\n session_params <strong>session_state</strong> (save_state_flags_t flags = save_state_flags_t::all()) const;\n+ void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n std::vector<torrent_status> <strong>get_torrent_status</strong> (\n std::function<bool(torrent_status const&)> const& pred\n , status_flags_t flags = {}) const;\n- void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n- , status_flags_t flags = {}) const;\n void <strong>post_torrent_updates</strong> (status_flags_t flags = status_flags_t::all());\n void <strong>post_session_stats</strong> ();\n void <strong>post_dht_stats</strong> ();\n- void <strong>set_dht_state</strong> (dht::dht_state&& st);\n void <strong>set_dht_state</strong> (dht::dht_state const& st);\n+ void <strong>set_dht_state</strong> (dht::dht_state&& st);\n torrent_handle <strong>find_torrent</strong> (sha1_hash const& info_hash) const;\n std::vector<torrent_handle> <strong>get_torrents</strong> () const;\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n void <strong>resume</strong> ();\n void <strong>pause</strong> ();\n bool <strong>is_paused</strong> () const;\n bool <strong>is_dht_running</strong> () const;\n void <strong>set_dht_storage</strong> (dht::dht_storage_constructor_type sc);\n void <strong>add_dht_node</strong> (std::pair<std::string, int> const& node);\n void <strong>dht_get_item</strong> (sha1_hash const& target);\n void <strong>dht_get_item</strong> (std::array<char, 32> key\n , std::string salt = std::string());\n sha1_hash <strong>dht_put_item</strong> (entry data);\n void <strong>dht_put_item</strong> (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 <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n void <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n+ void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n void <strong>dht_live_nodes</strong> (sha1_hash const& nid);\n void <strong>dht_sample_infohashes</strong> (udp::endpoint const& ep, sha1_hash const& target);\n void <strong>dht_direct_request</strong> (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n void <strong>add_extension</strong> (std::shared_ptr<plugin> ext);\n void <strong>add_extension</strong> (std::function<std::shared_ptr<torrent_plugin>(\n torrent_handle const&, client_data_t)> ext);\n- ip_filter <strong>get_ip_filter</strong> () const;\n void <strong>set_ip_filter</strong> (ip_filter f);\n+ ip_filter <strong>get_ip_filter</strong> () const;\n void <strong>set_port_filter</strong> (port_filter const& f);\n+ bool <strong>is_listening</strong> () const;\n unsigned short <strong>ssl_listen_port</strong> () const;\n unsigned short <strong>listen_port</strong> () const;\n- bool <strong>is_listening</strong> () const;\n ip_filter <strong>get_peer_class_filter</strong> () const;\n void <strong>set_peer_class_filter</strong> (ip_filter const& f);\n- void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n+ void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n peer_class_t <strong>create_peer_class</strong> (char const* name);\n void <strong>delete_peer_class</strong> (peer_class_t cid);\n peer_class_info <strong>get_peer_class</strong> (peer_class_t cid) const;\n void <strong>set_peer_class</strong> (peer_class_t cid, peer_class_info const& pci);\n void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n+ settings_pack <strong>get_settings</strong> () const;\n void <strong>apply_settings</strong> (settings_pack const&);\n void <strong>apply_settings</strong> (settings_pack&&);\n- settings_pack <strong>get_settings</strong> () const;\n- void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n- void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n- void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n+ void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n+ void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n+ void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n void <strong>reopen_network_sockets</strong> (reopen_network_flags_t options = reopen_map_ports);\n std::shared_ptr<aux::session_impl> <strong>native_handle</strong> () const;\n \n static constexpr save_state_flags_t <strong>save_settings</strong> = 0_bit;\n static constexpr save_state_flags_t <strong>save_dht_state</strong> = 2_bit;\n static constexpr save_state_flags_t <strong>save_extension_state</strong> = 11_bit;\n static constexpr save_state_flags_t <strong>save_ip_filter</strong> = 12_bit;\n@@ -420,24 +420,24 @@\n <p>returns the current <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state. This can be passed to\n <a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a> to save the state to disk and restored using\n <a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a> when constructing a new <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state</p>\n-<a name=\"get_torrent_status()\"></a>\n-<a name=\"refresh_torrent_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_torrent_status%28%29+refresh_torrent_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_torrent_status%28%29+refresh_torrent_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-torrent-status-refresh-torrent-status\">\n-<h2>get_torrent_status() refresh_torrent_status()</h2>\n+<a name=\"refresh_torrent_status()\"></a>\n+<a name=\"get_torrent_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Brefresh_torrent_status%28%29+get_torrent_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Brefresh_torrent_status%28%29+get_torrent_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"refresh-torrent-status-get-torrent-status\">\n+<h2>refresh_torrent_status() get_torrent_status()</h2>\n <pre class=\"literal-block\">\n+void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n std::vector<torrent_status> <strong>get_torrent_status</strong> (\n std::function<bool(torrent_status const&)> const& pred\n , status_flags_t flags = {}) const;\n-void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n- , status_flags_t flags = {}) const;\n </pre>\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n <p class=\"last\">these calls are potentially expensive and won't scale well with\n lots of torrents. If you're concerned about performance, consider\n using <tt class=\"docutils literal\">post_torrent_updates()</tt> instead.</p>\n </div>\n@@ -501,16 +501,16 @@\n void <strong>post_dht_stats</strong> ();\n </pre>\n <p>This will cause a <a class=\"reference external\" href=\"reference-Alerts.html#dht_stats_alert\">dht_stats_alert</a> to be posted.</p>\n <a name=\"set_dht_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_dht_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_dht_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-dht-state\">\n <h2>set_dht_state()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_dht_state</strong> (dht::dht_state&& st);\n void <strong>set_dht_state</strong> (dht::dht_state const& st);\n+void <strong>set_dht_state</strong> (dht::dht_state&& st);\n </pre>\n <p>set the DHT state for the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. This will be taken into account the\n next time the DHT is started, as if it had been passed in via the\n <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> on startup.</p>\n <a name=\"get_torrents()\"></a>\n <a name=\"find_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_torrents%28%29+find_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_torrents%28%29+find_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"get-torrents-find-torrent\">\n@@ -528,20 +528,20 @@\n <p><tt class=\"docutils literal\">get_torrents()</tt> returns a vector of torrent_handles to all the\n torrents currently in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n <a name=\"async_add_torrent()\"></a>\n <a name=\"add_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Basync_add_torrent%28%29+add_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Basync_add_torrent%28%29+add_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"async-add-torrent-add-torrent\">\n <h2>async_add_torrent() add_torrent()</h2>\n <pre class=\"literal-block\">\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n </pre>\n <p>You add torrents through the <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> function where you give an\n object with all the parameters. The <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> overloads will block\n until the torrent has been added (or failed to be added) and returns\n an error code and a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>. In order to add torrents more\n efficiently, consider using <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a> which returns\n immediately, without waiting for the torrent to add. Notification of\n@@ -566,19 +566,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.</p>\n <p>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 <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.</p>\n-<a name=\"resume()\"></a>\n <a name=\"is_paused()\"></a>\n-<a name=\"pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bresume%28%29+is_paused%28%29+pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bresume%28%29+is_paused%28%29+pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"resume-is-paused-pause\">\n-<h2>resume() is_paused() pause()</h2>\n+<a name=\"pause()\"></a>\n+<a name=\"resume()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_paused%28%29+pause%28%29+resume%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_paused%28%29+pause%28%29+resume%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-paused-pause-resume\">\n+<h2>is_paused() pause() resume()</h2>\n <pre class=\"literal-block\">\n void <strong>resume</strong> ();\n void <strong>pause</strong> ();\n bool <strong>is_paused</strong> () const;\n </pre>\n <p>Pausing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> has the same effect as pausing every torrent in\n it, except that torrents will not be resumed by the auto-manage\n@@ -690,21 +690,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 <em>update</em> 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.</p>\n-<a name=\"dht_get_peers()\"></a>\n-<a name=\"dht_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_peers%28%29+dht_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_peers%28%29+dht_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-get-peers-dht-announce\">\n-<h2>dht_get_peers() dht_announce()</h2>\n+<a name=\"dht_announce()\"></a>\n+<a name=\"dht_get_peers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_announce%28%29+dht_get_peers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_announce%28%29+dht_get_peers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-announce-dht-get-peers\">\n+<h2>dht_announce() dht_get_peers()</h2>\n <pre class=\"literal-block\">\n-void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n void <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n+void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n </pre>\n <p><tt class=\"docutils literal\">dht_get_peers()</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#dht_get_peers_reply_alert\">dht_get_peers_reply_alert</a>.</p>\n <p><tt class=\"docutils literal\">dht_announce()</tt> 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@@ -792,16 +792,16 @@\n </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_smart_ban_plugin</span><span class=\"punctuation\">);</span>\n </pre>\n <a name=\"set_ip_filter()\"></a>\n <a name=\"get_ip_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-ip-filter-get-ip-filter\">\n <h2>set_ip_filter() get_ip_filter()</h2>\n <pre class=\"literal-block\">\n-ip_filter <strong>get_ip_filter</strong> () const;\n void <strong>set_ip_filter</strong> (ip_filter f);\n+ip_filter <strong>get_ip_filter</strong> () const;\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n <p>Each time a peer is blocked because of the IP filter, a\n <a class=\"reference external\" href=\"reference-Alerts.html#peer_blocked_alert\">peer_blocked_alert</a> is generated. <tt class=\"docutils literal\">get_ip_filter()</tt> Returns the\n@@ -818,17 +818,17 @@\n anti-virus software by connecting to SMTP, FTP ports.</p>\n <a name=\"is_listening()\"></a>\n <a name=\"listen_port()\"></a>\n <a name=\"ssl_listen_port()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_listening%28%29+listen_port%28%29+ssl_listen_port%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_listening%28%29+listen_port%28%29+ssl_listen_port%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"is-listening-listen-port-ssl-listen-port\">\n <h2>is_listening() listen_port() ssl_listen_port()</h2>\n <pre class=\"literal-block\">\n+bool <strong>is_listening</strong> () const;\n unsigned short <strong>ssl_listen_port</strong> () const;\n unsigned short <strong>listen_port</strong> () const;\n-bool <strong>is_listening</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">is_listening()</tt> will tell you whether or not the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Settings.html#listen_interfaces\">settings_pack::listen_interfaces</a> to try another interface and port to\n bind to.</p>\n <p><tt class=\"docutils literal\">listen_port()</tt> returns the port we ended up listening on.</p>\n@@ -867,16 +867,16 @@\n <p>The <tt class=\"docutils literal\">get_peer_class_filter()</tt> function returns the current filter.</p>\n <p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n <a name=\"set_peer_class_type_filter()\"></a>\n <a name=\"get_peer_class_type_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-peer-class-type-filter-get-peer-class-type-filter\">\n <h2>set_peer_class_type_filter() get_peer_class_type_filter()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n+void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n </pre>\n <p>Sets and gets the <em>peer class type filter</em>. This is controls automatic\n peer class assignments to peers based on what kind of socket it is.</p>\n <p>It does not only support assigning peer classes, it also supports\n removing peer classes based on socket type.</p>\n <p>The order of these rules being applied are:</p>\n <ol class=\"arabic simple\">\n@@ -944,28 +944,28 @@\n <pre class=\"literal-block\">\n void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n </pre>\n <p><tt class=\"docutils literal\">remove_torrent()</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a>.</p>\n-<p><a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> is non-blocking, but will remove the torrent from the\n+<p><a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> is non-blocking, but will remove the torrent from the\n <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> synchronously. Calling <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">session_handle::add_torrent()</a> 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.</p>\n <p>The optional second argument <tt class=\"docutils literal\">options</tt> can be used to delete all the\n files downloaded by this torrent. To do so, pass in the value\n <tt class=\"docutils literal\"><span class=\"pre\">session_handle::delete_files</span></tt>. Once the torrent is deleted, a\n <a class=\"reference external\" href=\"reference-Alerts.html#torrent_deleted_alert\">torrent_deleted_alert</a> is posted.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> remains valid for some time after <a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> is\n+<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> remains valid for some time after <a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#is_valid()\">torrent_handle::is_valid()</a> will return true, and other calls such\n as <a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a> will succeed. Because of this, and because\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> is non-blocking, the following sequence usually\n+<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> is non-blocking, the following sequence usually\n succeeds (does not throw system_error):\n .. code:: c++</p>\n <blockquote>\n session.remove_handle(handle);\n handle.save_resume_data();</blockquote>\n <p>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@@ -974,30 +974,30 @@\n advised to remove them from the back of the queue, to minimize the\n shifting.</p>\n <a name=\"get_settings()\"></a>\n <a name=\"apply_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_settings%28%29+apply_settings%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_settings%28%29+apply_settings%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"get-settings-apply-settings\">\n <h2>get_settings() apply_settings()</h2>\n <pre class=\"literal-block\">\n+settings_pack <strong>get_settings</strong> () const;\n void <strong>apply_settings</strong> (settings_pack const&);\n void <strong>apply_settings</strong> (settings_pack&&);\n-settings_pack <strong>get_settings</strong> () const;\n </pre>\n <p>Applies the settings specified by the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> <tt class=\"docutils literal\">s</tt>. 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.</p>\n <a name=\"set_alert_notify()\"></a>\n <a name=\"pop_alerts()\"></a>\n <a name=\"wait_for_alert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_alert_notify%28%29+pop_alerts%28%29+wait_for_alert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_alert_notify%28%29+pop_alerts%28%29+wait_for_alert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-alert-notify-pop-alerts-wait-for-alert\">\n <h2>set_alert_notify() pop_alerts() wait_for_alert()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n-void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n+void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n+void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n </pre>\n <p>Alerts is the main mechanism for libtorrent to report errors and\n events. <tt class=\"docutils literal\">pop_alerts</tt> fills in the vector passed to it with pointers\n to new alerts. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> still owns these alerts and they will stay\n valid until the next time <tt class=\"docutils literal\">pop_alerts</tt> is called. You may not delete\n the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> objects.</p>\n <p>It is safe to call <tt class=\"docutils literal\">pop_alerts</tt> from multiple different threads, as\n@@ -1048,16 +1048,16 @@\n <tt class=\"docutils literal\"><span class=\"pre\">alert::type()</span></tt> but can also be queries from a concrete type via\n <tt class=\"docutils literal\"><span class=\"pre\">T::alert_type</span></tt>, as a static constant.</p>\n <a name=\"add_port_mapping()\"></a>\n <a name=\"delete_port_mapping()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"add-port-mapping-delete-port-mapping\">\n <h2>add_port_mapping() delete_port_mapping()</h2>\n <pre class=\"literal-block\">\n-void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n+void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The return values are all handles referring to the\n port mappings that were just created. Pass them to <a class=\"reference external\" href=\"reference-Session.html#delete_port_mapping()\">delete_port_mapping()</a>\n to remove them.</p>\n <a name=\"reopen_network_sockets()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Breopen_network_sockets%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Breopen_network_sockets%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n@@ -1131,22 +1131,22 @@\n <a name=\"write_session_params_buf()\"></a>\n <a name=\"write_session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:read_session_params%28%29+write_session_params_buf%28%29+write_session_params%28%29&labels=documentation&body=Documentation+under+heading+%22read_session_params%28%29+write_session_params_buf%28%29+write_session_params%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n <div class=\"section\" id=\"read-session-params-write-session-params-buf-write-session-params\">\n <h1>read_session_params() write_session_params_buf() write_session_params()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n <pre class=\"literal-block\">\n-entry <strong>write_session_params</strong> (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n std::vector<char> <strong>write_session_params_buf</strong> (session_params const& sp\n , save_state_flags_t flags = save_state_flags_t::all());\n-session_params <strong>read_session_params</strong> (bdecode_node const& e\n- , save_state_flags_t flags = save_state_flags_t::all());\n session_params <strong>read_session_params</strong> (span<char const> buf\n , save_state_flags_t flags = save_state_flags_t::all());\n+entry <strong>write_session_params</strong> (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params <strong>read_session_params</strong> (bdecode_node const& e\n+ , save_state_flags_t flags = save_state_flags_t::all());\n </pre>\n <p>These functions serialize and de-serialize a <tt class=\"docutils literal\">session_params</tt> object to and\n from bencoded form. The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object is used to initialize a new\n <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> using the state from a previous one (or by programmatically configure\n the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> up-front).\n The flags parameter can be used to only save and load certain aspects of the\n session's state.\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,41 +1,41 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n+ o _\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 _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)_\b _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n+ o _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\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 _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\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@@ -58,29 +58,29 @@\n _\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n the completion of the shutdown. The lifetime of this object may outlive\n _\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n down.\n struct session_proxy\n {\n- ~\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&&) & noexcept;\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy 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-~\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+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy 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@@ -91,44 +91,44 @@\n it in to session::apply_settings().\n see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n struct session : session_handle\n {\n s\bse\bes\bss\bsi\bio\bon\bn ();\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n 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, io_context& ios);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\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 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, session_flags_t flags);\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n passing in session::paused). Note that add_default_plugins do not have an\n affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n the plugins to use.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n 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@@ -163,16 +163,16 @@\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n started.\n struct session_params\n {\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n , std::vector<std::shared_ptr<plugin>> exts);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n , std::vector<std::shared_ptr<plugin>> exts);\n \n settings_pack settings;\n std::vector<std::shared_ptr<plugin>> extensions;\n@@ -181,16 +181,16 @@\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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n This constructor can be used to start with the default plugins (ut_metadata,\n ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n , std::vector<std::shared_ptr<plugin>> exts);\n@@ -232,82 +232,82 @@\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<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n std::vector<torrent_status> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n std::function<bool(torrent_status const&)> 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<torrent_status>* 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+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n std::vector<torrent_handle> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params 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- 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&& params, error_code& ec);\n- void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n void r\bre\bes\bsu\bum\bme\be ();\n void p\bpa\bau\bus\bse\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<std::string, int> 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<char, 32> 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<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 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::shared_ptr<plugin> ext);\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function<std::shared_ptr<torrent_plugin>(\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+ 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- bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n+ 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- settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n- void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function<void()> const& fun);\n- void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector<alert*>* alerts);\n alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n+ void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector<alert*>* alerts);\n+ void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function<void()> const& fun);\n std::vector<port_mapping_t> 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<aux::session_impl> 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@@ -333,20 +333,20 @@\n all()) const;\n returns the current _\bs_\be_\bs_\bs_\bi_\bo_\bn state. This can be passed to _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n to save the state to disk and restored using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) when\n constructing a new _\bs_\be_\bs_\bs_\bi_\bo_\bn. The kind of state that's included is all settings,\n the DHT routing table, possibly plugin-specific state. the flags parameter can\n be used to only save certain parts of the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n std::vector<torrent_status> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n std::function<bool(torrent_status const&)> 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<torrent_status>* 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@@ -391,16 +391,16 @@\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 torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n std::vector<torrent_handle> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n@@ -408,20 +408,20 @@\n such a torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be to that torrent is returned. In\n case the torrent cannot be found, an invalid _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is returned.\n See torrent_handle::is_valid() to know if the torrent was found or not.\n get_torrents() returns a vector of torrent_handles to all the torrents\n currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& 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&& 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 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 You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n torrent has been added (or failed to be added) and returns an error code and a\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n The save_path field in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs must be set to a valid path where the\n@@ -442,15 +442,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* i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\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 ();\n void p\bpa\bau\bus\bse\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@@ -529,18 +529,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). dht_announce() is not affected by the\n@@ -598,16 +598,16 @@\n A _\bp_\bl_\bu_\bg_\bi_\bn that, with a small overhead, can ban peers that sends bad data\n with very high accuracy. Should eliminate most problems on poisoned\n torrents.\n #include <libtorrent/extensions/smart_ban.hpp>\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-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+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@@ -616,17 +616,17 @@\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+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-bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n is_listening() will tell you whether or not the _\bs_\be_\bs_\bs_\bi_\bo_\bn has successfully opened\n a listening port. If it hasn't, this function will return false, and then you\n can set a new _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs to try another interface and\n port to bind to.\n listen_port() returns the port we ended up listening on.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\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@@ -653,16 +653,16 @@\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+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n assignments to peers based on what kind of socket it is.\n It does not only support assigning peer classes, it also supports removing peer\n classes based on socket type.\n The order of these rules being applied are:\n 1. peer-class IP filter\n 2. peer-class type filter, removing classes\n@@ -731,25 +731,25 @@\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-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* 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<void()> const& fun);\n-void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector<alert*>* alerts);\n alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n+void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector<alert*>* alerts);\n+void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function<void()> const& fun);\n Alerts is the main mechanism for libtorrent to report errors and events.\n pop_alerts fills in the vector passed to it with pointers to new alerts. The\n _\bs_\be_\bs_\bs_\bi_\bo_\bn still owns these alerts and they will stay valid until the next time\n pop_alerts is called. You may not delete the _\ba_\bl_\be_\br_\bt objects.\n It is safe to call pop_alerts from multiple different threads, as long as the\n alerts themselves are not accessed once another thread calls pop_alerts. Doing\n this requires manual synchronization between the popping threads.\n@@ -789,17 +789,17 @@\n block. It should not perform any expensive work. It really should just notify\n the main application thread.\n The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n can also be queries from a concrete type via T::alert_type, as a static\n constant.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n std::vector<port_mapping_t> 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@@ -848,22 +848,22 @@\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\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 std::vector<char> w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf (session_params const& sp\n , save_state_flags_t flags = save_state_flags_t::all());\n-session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n- , save_state_flags_t flags = save_state_flags_t::all());\n 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<char const> 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+session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n+ , save_state_flags_t flags = save_state_flags_t::all());\n These functions serialize and de-serialize a session_params object to and from\n bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n using the state from a previous one (or by programmatically configure the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n certain aspects of the session's state. The _buf suffix indicates the function\n operates on buffer rather than the bencoded structure. The torrents in a\n _\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "unified_diff": "@@ -29,35 +29,35 @@\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#settings-pack\" id=\"toc-entry-1\">settings_pack</a><ul>\n-<li><a class=\"reference internal\" href=\"#set-int-set-bool-set-str\" id=\"toc-entry-2\">set_int() set_bool() set_str()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-bool-set-int-set-str\" id=\"toc-entry-2\">set_bool() set_int() set_str()</a></li>\n <li><a class=\"reference internal\" href=\"#has-val\" id=\"toc-entry-3\">has_val()</a></li>\n <li><a class=\"reference internal\" href=\"#clear\" id=\"toc-entry-4\">clear()</a></li>\n <li><a class=\"reference internal\" href=\"#clear-1\" id=\"toc-entry-5\">clear()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-int-get-str-get-bool\" id=\"toc-entry-6\">get_int() get_str() get_bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-bool-get-str-get-int\" id=\"toc-entry-6\">get_bool() get_str() get_int()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-type-bases\" id=\"toc-entry-7\">enum type_bases</a></li>\n <li><a class=\"reference internal\" href=\"#enum-mmap-write-mode-t\" id=\"toc-entry-8\">enum mmap_write_mode_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-suggest-mode-t\" id=\"toc-entry-9\">enum suggest_mode_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-choking-algorithm-t\" id=\"toc-entry-10\">enum choking_algorithm_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-seed-choking-algorithm-t\" id=\"toc-entry-11\">enum seed_choking_algorithm_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-io-buffer-mode-t\" id=\"toc-entry-12\">enum io_buffer_mode_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-bandwidth-mixed-algo-t\" id=\"toc-entry-13\">enum bandwidth_mixed_algo_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-enc-policy\" id=\"toc-entry-14\">enum enc_policy</a></li>\n <li><a class=\"reference internal\" href=\"#enum-enc-level\" id=\"toc-entry-15\">enum enc_level</a></li>\n <li><a class=\"reference internal\" href=\"#enum-proxy-type-t\" id=\"toc-entry-16\">enum proxy_type_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#min-memory-usage-high-performance-seed\" id=\"toc-entry-17\">min_memory_usage() high_performance_seed()</a></li>\n-<li><a class=\"reference internal\" href=\"#generate-fingerprint\" id=\"toc-entry-18\">generate_fingerprint()</a></li>\n-<li><a class=\"reference internal\" href=\"#setting-by-name-name-for-setting\" id=\"toc-entry-19\">setting_by_name() name_for_setting()</a></li>\n-<li><a class=\"reference internal\" href=\"#default-settings\" id=\"toc-entry-20\">default_settings()</a></li>\n+<li><a class=\"reference internal\" href=\"#setting-by-name-name-for-setting\" id=\"toc-entry-17\">setting_by_name() name_for_setting()</a></li>\n+<li><a class=\"reference internal\" href=\"#default-settings\" id=\"toc-entry-18\">default_settings()</a></li>\n+<li><a class=\"reference internal\" href=\"#high-performance-seed-min-memory-usage\" id=\"toc-entry-19\">high_performance_seed() min_memory_usage()</a></li>\n+<li><a class=\"reference internal\" href=\"#generate-fingerprint\" id=\"toc-entry-20\">generate_fingerprint()</a></li>\n </ul>\n </div>\n <p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the session::apply_settings()\n member function. To change one or more configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>\n object and fill it with the settings to be set and pass it in to session::apply_settings().</p>\n <p>The <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> object is a collection of settings updates that are applied\n to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when passed to session::apply_settings(). It's empty when\n@@ -4598,18 +4598,18 @@\n </div>\n <pre class=\"literal-block\">\n struct settings_pack final : settings_interface\n {\n friend void <strong>apply_pack_impl</strong> (settings_pack const*\n , aux::session_settings_single_thread&\n , std::vector<void(aux::session_impl::*)()>*);\n- void <strong>set_int</strong> (int name, int val) override;\n void <strong>set_str</strong> (int name, std::string val) override;\n- void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n void <strong>set_bool</strong> (int name, bool val) override;\n+ void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n+ void <strong>set_int</strong> (int name, int val) override;\n bool <strong>has_val</strong> (int name) const override;\n void <strong>clear</strong> ();\n void <strong>clear</strong> (int name);\n int <strong>get_int</strong> (int name) const override;\n std::string const& <strong>get_str</strong> (int name) const override;\n bool <strong>get_bool</strong> (int name) const override;\n void <strong>for_each</strong> (Fun&& f) const;\n@@ -4685,23 +4685,23 @@\n socks5,\n socks5_pw,\n http,\n http_pw,\n };\n };\n </pre>\n-<a name=\"set_int()\"></a>\n <a name=\"set_bool()\"></a>\n-<a name=\"set_str()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bset_int%28%29+set_bool%28%29+set_str%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bset_int%28%29+set_bool%28%29+set_str%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"set-int-set-bool-set-str\">\n-<h2>set_int() set_bool() set_str()</h2>\n+<a name=\"set_int()\"></a>\n+<a name=\"set_str()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bset_bool%28%29+set_int%28%29+set_str%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bset_bool%28%29+set_int%28%29+set_str%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"set-bool-set-int-set-str\">\n+<h2>set_bool() set_int() set_str()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_int</strong> (int name, int val) override;\n void <strong>set_str</strong> (int name, std::string val) override;\n-void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n void <strong>set_bool</strong> (int name, bool val) override;\n+void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n+void <strong>set_int</strong> (int name, int val) override;\n </pre>\n <p>set a configuration option in the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>. <tt class=\"docutils literal\">name</tt> 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.</p>\n <a name=\"has_val()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bhas_val%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bhas_val%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"has-val\">\n <h2>has_val()</h2>\n@@ -4721,19 +4721,19 @@\n <a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"clear-1\">\n <h2>clear()</h2>\n <pre class=\"literal-block\">\n void <strong>clear</strong> (int name);\n </pre>\n <p>clear a specific setting from the pack</p>\n-<a name=\"get_int()\"></a>\n+<a name=\"get_bool()\"></a>\n <a name=\"get_str()\"></a>\n-<a name=\"get_bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bget_int%28%29+get_str%28%29+get_bool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bget_int%28%29+get_str%28%29+get_bool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-int-get-str-get-bool\">\n-<h2>get_int() get_str() get_bool()</h2>\n+<a name=\"get_int()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bget_bool%28%29+get_str%28%29+get_int%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bget_bool%28%29+get_str%28%29+get_int%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-bool-get-str-get-int\">\n+<h2>get_bool() get_str() get_int()</h2>\n <pre class=\"literal-block\">\n int <strong>get_int</strong> (int name) const override;\n std::string const& <strong>get_str</strong> (int name) const override;\n bool <strong>get_bool</strong> (int name) const override;\n </pre>\n <p>queries the current configuration option from the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.\n <tt class=\"docutils literal\">name</tt> is one of the enumeration values from string_types, int_types\n@@ -5096,19 +5096,38 @@\n <tr><td>http_pw</td>\n <td>5</td>\n <td>The server is assumed to be an HTTP proxy that requires user\n authorization. The username and password will be sent to the proxy.</td>\n </tr>\n </tbody>\n </table>\n-<a name=\"min_memory_usage()\"></a>\n-<a name=\"high_performance_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:min_memory_usage%28%29+high_performance_seed%28%29&labels=documentation&body=Documentation+under+heading+%22min_memory_usage%28%29+high_performance_seed%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"setting_by_name()\"></a>\n+<a name=\"name_for_setting()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:setting_by_name%28%29+name_for_setting%28%29&labels=documentation&body=Documentation+under+heading+%22setting_by_name%28%29+name_for_setting%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"min-memory-usage-high-performance-seed\">\n-<h1>min_memory_usage() high_performance_seed()</h1>\n+<div class=\"section\" id=\"setting-by-name-name-for-setting\">\n+<h1>setting_by_name() name_for_setting()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+char const* <strong>name_for_setting</strong> (int s);\n+int <strong>setting_by_name</strong> (string_view name);\n+</pre>\n+<p>converts a setting integer (from the enums string_types, int_types or\n+bool_types) to a string, and vice versa.</p>\n+<a name=\"default_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_settings%28%29&labels=documentation&body=Documentation+under+heading+%22default_settings%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"default-settings\">\n+<h1>default_settings()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+settings_pack <strong>default_settings</strong> ();\n+</pre>\n+<p>returns a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> with every setting set to its default value</p>\n+<a name=\"high_performance_seed()\"></a>\n+<a name=\"min_memory_usage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:high_performance_seed%28%29+min_memory_usage%28%29&labels=documentation&body=Documentation+under+heading+%22high_performance_seed%28%29+min_memory_usage%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"high-performance-seed-min-memory-usage\">\n+<h1>high_performance_seed() min_memory_usage()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n <pre class=\"literal-block\">\n settings_pack <strong>high_performance_seed</strong> ();\n settings_pack <strong>min_memory_usage</strong> ();\n </pre>\n <p>The default values of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> settings are set for a regular\n bittorrent client running on a desktop system. There are functions that\n@@ -5183,33 +5202,14 @@\n <td>Tribler</td>\n </tr>\n </tbody>\n </table>\n <p>There's an informal directory of client id's <a class=\"reference external\" href=\"http://wiki.theory.org/BitTorrentSpecification#peer_id\">here</a>.</p>\n <p>The <tt class=\"docutils literal\">major</tt>, <tt class=\"docutils literal\">minor</tt>, <tt class=\"docutils literal\">revision</tt> and <tt class=\"docutils literal\">tag</tt> parameters are used to\n identify the version of your client.</p>\n-<a name=\"setting_by_name()\"></a>\n-<a name=\"name_for_setting()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:setting_by_name%28%29+name_for_setting%28%29&labels=documentation&body=Documentation+under+heading+%22setting_by_name%28%29+name_for_setting%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"setting-by-name-name-for-setting\">\n-<h1>setting_by_name() name_for_setting()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-int <strong>setting_by_name</strong> (string_view name);\n-char const* <strong>name_for_setting</strong> (int s);\n-</pre>\n-<p>converts a setting integer (from the enums string_types, int_types or\n-bool_types) to a string, and vice versa.</p>\n-<a name=\"default_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_settings%28%29&labels=documentation&body=Documentation+under+heading+%22default_settings%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"default-settings\">\n-<h1>default_settings()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-settings_pack <strong>default_settings</strong> ();\n-</pre>\n-<p>returns a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> with every setting set to its default value</p>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n <div id=\"footer\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,32 +1,32 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n- o _\bs_\be_\bt_\b__\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 _\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__\bs_\bt_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)_\b _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n- * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n+ * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+ * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session::\n apply_settings() member function. To change one or more configuration options,\n create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object and fill it with the settings to be set and pass\n it in to session::apply_settings().\n The _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object is a collection of settings updates that are applied\n to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when passed to session::apply_settings(). It's empty when\n constructed.\n@@ -1435,18 +1435,18 @@\n connect to the external NAT-PMP port (configured using announce_port) instead\n of the actual local listening port.\n struct settings_pack final : settings_interface\n {\n friend void a\bap\bpp\bpl\bly\by_\b_p\bpa\bac\bck\bk_\b_i\bim\bmp\bpl\bl (settings_pack const*\n , aux::session_settings_single_thread&\n , std::vector<void(aux::session_impl::*)()>*);\n- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> const val);\n void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n+ void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> 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@@ -1522,19 +1522,19 @@\n socks5,\n socks5_pw,\n http,\n http_pw,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_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_i\bin\bnt\bt (int name, int val) override;\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_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<Type, Tag> const val);\n void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> 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@@ -1545,15 +1545,15 @@\n void c\bcl\ble\bea\bar\br ();\n clear the settings pack from all settings\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br (int name);\n clear a specific setting from the pack\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\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@@ -1683,15 +1683,27 @@\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* 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* 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@@ -1731,26 +1743,14 @@\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* 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 _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "unified_diff": "@@ -28,25 +28,50 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#stats-metric\" id=\"toc-entry-1\">stats_metric</a></li>\n-<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-2\">counters</a><ul>\n-<li><a class=\"reference internal\" href=\"#inc-stats-counter-operator\" id=\"toc-entry-3\">inc_stats_counter() operator[]()</a></li>\n+<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-1\">counters</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-inc-stats-counter\" id=\"toc-entry-2\">operator[]() inc_stats_counter()</a></li>\n </ul>\n </li>\n+<li><a class=\"reference internal\" href=\"#stats-metric\" id=\"toc-entry-3\">stats_metric</a></li>\n <li><a class=\"reference internal\" href=\"#session-stats-metrics\" id=\"toc-entry-4\">session_stats_metrics()</a></li>\n <li><a class=\"reference internal\" href=\"#find-metric-idx\" id=\"toc-entry-5\">find_metric_idx()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-metric-type-t\" id=\"toc-entry-6\">enum metric_type_t</a></li>\n </ul>\n </div>\n-<a name=\"stats_metric\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+stats_metric&labels=documentation&body=Documentation+under+heading+%22class+stats_metric%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"stats-metric\">\n+<a name=\"counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+counters&labels=documentation&body=Documentation+under+heading+%22class+counters%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"counters\">\n+<h1>counters</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/performance_counters.hpp\">libtorrent/performance_counters.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+struct counters\n+{\n+ <strong>counters</strong> () ;\n+ <strong>counters</strong> (counters const&) ;\n+ counters& <strong>operator=</strong> (counters const&) & ;\n+ std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n+ std::int64_t <strong>operator[]</strong> (int i) const ;\n+ void <strong>blend_stats_counter</strong> (int c, std::int64_t value, int ratio) ;\n+ void <strong>set_value</strong> (int c, std::int64_t value) ;\n+};\n+</pre>\n+<a name=\"operator[]()\"></a>\n+<a name=\"inc_stats_counter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-inc-stats-counter\">\n+<h2>operator[]() inc_stats_counter()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n+std::int64_t <strong>operator[]</strong> (int i) const ;\n+</pre>\n+<p>returns the new value</p>\n+<a name=\"stats_metric\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+stats_metric&labels=documentation&body=Documentation+under+heading+%22class+stats_metric%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"stats-metric\">\n <h1>stats_metric</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n <p>describes one statistics metric from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information,\n see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n <pre class=\"literal-block\">\n struct stats_metric\n {\n@@ -62,40 +87,15 @@\n <a name=\"value_index\"></a>\n <a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:stats_metric%3A%3A%5Bvalue_index+type%5D&labels=documentation&body=Documentation+under+heading+%22stats_metric%3A%3A%5Bvalue_index+type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>value_index type</dt>\n <dd>the index into the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array, where the underlying value of\n this counter or gauge is found. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array is part of the\n <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> object.</dd>\n </dl>\n-<a name=\"counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+counters&labels=documentation&body=Documentation+under+heading+%22class+counters%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"counters\">\n-<h1>counters</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/performance_counters.hpp\">libtorrent/performance_counters.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-struct counters\n-{\n- <strong>counters</strong> () ;\n- <strong>counters</strong> (counters const&) ;\n- counters& <strong>operator=</strong> (counters const&) & ;\n- std::int64_t <strong>operator[]</strong> (int i) const ;\n- std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n- void <strong>blend_stats_counter</strong> (int c, std::int64_t value, int ratio) ;\n- void <strong>set_value</strong> (int c, std::int64_t value) ;\n-};\n-</pre>\n-<a name=\"inc_stats_counter()\"></a>\n-<a name=\"operator[]()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:counters%3A%3A%5Binc_stats_counter%28%29+operator%5B%5D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22counters%3A%3A%5Binc_stats_counter%28%29+operator%5B%5D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"inc-stats-counter-operator\">\n-<h2>inc_stats_counter() operator[]()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>operator[]</strong> (int i) const ;\n-std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n-</pre>\n-<p>returns the new value</p>\n <a name=\"session_stats_metrics()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_metrics%28%29&labels=documentation&body=Documentation+under+heading+%22session_stats_metrics%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n <div class=\"section\" id=\"session-stats-metrics\">\n <h1>session_stats_metrics()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::vector<stats_metric> <strong>session_stats_metrics</strong> ();\n </pre>\n <p>This free function returns the list of available metrics exposed by\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,19 +1,37 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n- o _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)\n+ * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n * _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n+struct counters\n+{\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n+ counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n+ std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+ std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+ void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n+ void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+returns the new value\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n struct stats_metric\n {\n char const* name;\n@@ -25,32 +43,14 @@\n the name of the counter or gauge\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n value_index type\n the index into the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array, where the underlying value of\n this counter or gauge is found. The _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array is part of the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n-struct counters\n-{\n- c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n- c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n- counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n- std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n- std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n- void 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 o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n-std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n-returns the new value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n std::vector<stats_metric> s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs ();\n This free function returns the list of available metrics exposed by\n libtorrent's statistics API. Each metric has a name and a v\bva\bal\blu\bue\be i\bin\bnd\bde\bex\bx. The\n value index is the index into the array in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt where this\n metric's value can be found when the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats is sampled (by calling\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "unified_diff": "@@ -45,40 +45,40 @@\n <li><a class=\"reference internal\" href=\"#end-file\" id=\"toc-entry-11\">end_file()</a></li>\n <li><a class=\"reference internal\" href=\"#file-range\" id=\"toc-entry-12\">file_range()</a></li>\n <li><a class=\"reference internal\" href=\"#total-size\" id=\"toc-entry-13\">total_size()</a></li>\n <li><a class=\"reference internal\" href=\"#num-pieces-set-num-pieces\" id=\"toc-entry-14\">num_pieces() set_num_pieces()</a></li>\n <li><a class=\"reference internal\" href=\"#end-piece\" id=\"toc-entry-15\">end_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#last-piece\" id=\"toc-entry-16\">last_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-range\" id=\"toc-entry-17\">piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-piece-length-piece-length\" id=\"toc-entry-18\">set_piece_length() piece_length()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-length-set-piece-length\" id=\"toc-entry-18\">piece_length() set_piece_length()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-size\" id=\"toc-entry-19\">piece_size()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-size2\" id=\"toc-entry-20\">piece_size2()</a></li>\n <li><a class=\"reference internal\" href=\"#blocks-in-piece2\" id=\"toc-entry-21\">blocks_in_piece2()</a></li>\n <li><a class=\"reference internal\" href=\"#blocks-per-piece\" id=\"toc-entry-22\">blocks_per_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-name-name\" id=\"toc-entry-23\">set_name() name()</a></li>\n+<li><a class=\"reference internal\" href=\"#name-set-name\" id=\"toc-entry-23\">name() set_name()</a></li>\n <li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-24\">swap()</a></li>\n <li><a class=\"reference internal\" href=\"#canonicalize\" id=\"toc-entry-25\">canonicalize()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-size-hash-root-file-offset-pad-file-at-file-path-file-name-symlink-root-ptr-mtime\" id=\"toc-entry-26\">file_size() hash() root() file_offset() pad_file_at() file_path() file_name() symlink() root_ptr() mtime()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-num-pieces-file-num-blocks-file-piece-range\" id=\"toc-entry-27\">file_num_pieces() file_num_blocks() file_piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-first-piece-node-file-first-block-node\" id=\"toc-entry-28\">file_first_piece_node() file_first_block_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-path-pad-file-at-hash-symlink-file-name-root-root-ptr-file-size-mtime-file-offset\" id=\"toc-entry-26\">file_path() pad_file_at() hash() symlink() file_name() root() root_ptr() file_size() mtime() file_offset()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-num-blocks-file-piece-range-file-num-pieces\" id=\"toc-entry-27\">file_num_blocks() file_piece_range() file_num_pieces()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-first-block-node-file-first-piece-node\" id=\"toc-entry-28\">file_first_block_node() file_first_piece_node()</a></li>\n <li><a class=\"reference internal\" href=\"#file-path-hash\" id=\"toc-entry-29\">file_path_hash()</a></li>\n <li><a class=\"reference internal\" href=\"#all-path-hashes\" id=\"toc-entry-30\">all_path_hashes()</a></li>\n <li><a class=\"reference internal\" href=\"#file-flags\" id=\"toc-entry-31\">file_flags()</a></li>\n <li><a class=\"reference internal\" href=\"#file-absolute-path\" id=\"toc-entry-32\">file_absolute_path()</a></li>\n <li><a class=\"reference internal\" href=\"#file-index-at-piece-file-index-at-offset\" id=\"toc-entry-33\">file_index_at_piece() file_index_at_offset()</a></li>\n <li><a class=\"reference internal\" href=\"#file-index-for-root\" id=\"toc-entry-34\">file_index_for_root()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-index-at-file\" id=\"toc-entry-35\">piece_index_at_file()</a></li>\n <li><a class=\"reference internal\" href=\"#sanitize-symlinks\" id=\"toc-entry-36\">sanitize_symlinks()</a></li>\n <li><a class=\"reference internal\" href=\"#v2\" id=\"toc-entry-37\">v2()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#default-disk-io-constructor\" id=\"toc-entry-38\">default_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#posix-disk-io-constructor\" id=\"toc-entry-39\">posix_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#mmap-disk-io-constructor\" id=\"toc-entry-38\">mmap_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#default-disk-io-constructor\" id=\"toc-entry-39\">default_disk_io_constructor()</a></li>\n <li><a class=\"reference internal\" href=\"#disabled-disk-io-constructor\" id=\"toc-entry-40\">disabled_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#mmap-disk-io-constructor\" id=\"toc-entry-41\">mmap_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#posix-disk-io-constructor\" id=\"toc-entry-41\">posix_disk_io_constructor()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-storage-mode-t\" id=\"toc-entry-42\">enum storage_mode_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-status-t\" id=\"toc-entry-43\">enum status_t</a></li>\n <li><a class=\"reference internal\" href=\"#enum-move-flags-t\" id=\"toc-entry-44\">enum move_flags_t</a></li>\n </ul>\n </div>\n <a name=\"storage_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_params&labels=documentation&body=Documentation+under+heading+%22class+storage_params%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"storage-params\">\n <h1>storage_params</h1>\n@@ -139,65 +139,65 @@\n size. Everything necessary to interpret a regular bittorrent storage\n file structure.</p>\n <pre class=\"literal-block\">\n class file_storage\n {\n bool <strong>is_valid</strong> () const;\n void <strong>reserve</strong> (int num_files);\n- void <strong>add_file_borrow</strong> (error_code& ec, string_view filename\n+ void <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (std::string const& path, std::int64_t file_size\n+ void <strong>add_file</strong> (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 <strong>add_file</strong> (error_code& ec, std::string const& path, std::int64_t file_size\n+ void <strong>add_file</strong> (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 <strong>add_file_borrow</strong> (string_view filename\n+ void <strong>add_file_borrow</strong> (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 <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n std::vector<file_slice> <strong>map_block</strong> (piece_index_t piece, std::int64_t offset\n , std::int64_t size) const;\n peer_request <strong>map_file</strong> (file_index_t file, std::int64_t offset, int size) const;\n int <strong>num_files</strong> () const noexcept;\n file_index_t <strong>end_file</strong> () const noexcept;\n index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n std::int64_t <strong>total_size</strong> () const;\n- void <strong>set_num_pieces</strong> (int n);\n int <strong>num_pieces</strong> () const;\n+ void <strong>set_num_pieces</strong> (int n);\n piece_index_t <strong>end_piece</strong> () const;\n piece_index_t <strong>last_piece</strong> () const;\n index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n- void <strong>set_piece_length</strong> (int l);\n int <strong>piece_length</strong> () const;\n+ void <strong>set_piece_length</strong> (int l);\n int <strong>piece_size</strong> (piece_index_t index) const;\n int <strong>piece_size2</strong> (piece_index_t index) const;\n int <strong>blocks_in_piece2</strong> (piece_index_t index) const;\n int <strong>blocks_per_piece</strong> () const;\n- void <strong>set_name</strong> (std::string const& n);\n std::string const& <strong>name</strong> () const;\n+ void <strong>set_name</strong> (std::string const& n);\n void <strong>swap</strong> (file_storage& ti) noexcept;\n void <strong>canonicalize</strong> ();\n- bool <strong>pad_file_at</strong> (file_index_t index) const;\n- std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n- sha256_hash <strong>root</strong> (file_index_t index) const;\n- sha1_hash <strong>hash</strong> (file_index_t index) const;\n+ std::string <strong>symlink</strong> (file_index_t index) const;\n std::int64_t <strong>file_size</strong> (file_index_t index) const;\n- string_view <strong>file_name</strong> (file_index_t index) const;\n+ sha256_hash <strong>root</strong> (file_index_t index) const;\n+ bool <strong>pad_file_at</strong> (file_index_t index) const;\n std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n- std::string <strong>symlink</strong> (file_index_t index) const;\n- std::time_t <strong>mtime</strong> (file_index_t index) const;\n+ sha1_hash <strong>hash</strong> (file_index_t index) const;\n char const* <strong>root_ptr</strong> (file_index_t const index) const;\n+ std::time_t <strong>mtime</strong> (file_index_t index) const;\n+ string_view <strong>file_name</strong> (file_index_t index) const;\n+ std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n int <strong>file_num_blocks</strong> (file_index_t index) const;\n int <strong>file_num_pieces</strong> (file_index_t index) const;\n index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n int <strong>file_first_block_node</strong> (file_index_t index) const;\n int <strong>file_first_piece_node</strong> (file_index_t index) const;\n std::uint32_t <strong>file_path_hash</strong> (file_index_t index, std::string const& save_path) const;\n void <strong>all_path_hashes</strong> (std::unordered_set<std::uint32_t>& table) const;\n@@ -235,28 +235,28 @@\n be used to avoid reallocating the internal file list when the number\n of files to be added is known up-front.</p>\n <a name=\"add_file_borrow()\"></a>\n <a name=\"add_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Badd_file_borrow%28%29+add_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Badd_file_borrow%28%29+add_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"add-file-borrow-add-file\">\n <h2>add_file_borrow() add_file()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_file_borrow</strong> (error_code& ec, string_view filename\n+void <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (std::string const& path, std::int64_t file_size\n+void <strong>add_file</strong> (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 <strong>add_file</strong> (error_code& ec, std::string const& path, std::int64_t file_size\n+void <strong>add_file</strong> (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 <strong>add_file_borrow</strong> (string_view filename\n+void <strong>add_file_borrow</strong> (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 </pre>\n <p>Adds a file to the file storage. The <tt class=\"docutils literal\">add_file_borrow</tt> version\n expects that <tt class=\"docutils literal\">filename</tt> is the file name (without a path) of\n@@ -363,16 +363,16 @@\n </pre>\n <p>returns the total number of bytes all the files in this torrent spans</p>\n <a name=\"num_pieces()\"></a>\n <a name=\"set_num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bnum_pieces%28%29+set_num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bnum_pieces%28%29+set_num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"num-pieces-set-num-pieces\">\n <h2>num_pieces() set_num_pieces()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_num_pieces</strong> (int n);\n int <strong>num_pieces</strong> () const;\n+void <strong>set_num_pieces</strong> (int n);\n </pre>\n <p>set and get the number of pieces in the torrent</p>\n <a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bend_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bend_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"end-piece\">\n <h2>end_piece()</h2>\n <pre class=\"literal-block\">\n piece_index_t <strong>end_piece</strong> () const;\n@@ -392,31 +392,31 @@\n <h2>piece_range()</h2>\n <pre class=\"literal-block\">\n index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"set_piece_length()\"></a>\n-<a name=\"piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bset_piece_length%28%29+piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bset_piece_length%28%29+piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-piece-length-piece-length\">\n-<h2>set_piece_length() piece_length()</h2>\n+<a name=\"piece_length()\"></a>\n+<a name=\"set_piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_length%28%29+set_piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_length%28%29+set_piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-length-set-piece-length\">\n+<h2>piece_length() set_piece_length()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_piece_length</strong> (int l);\n int <strong>piece_length</strong> () const;\n+void <strong>set_piece_length</strong> (int l);\n </pre>\n <p>set and get the size of each piece in this torrent. It must be a power of two\n and at least 16 kiB.</p>\n <a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"piece-size\">\n <h2>piece_size()</h2>\n <pre class=\"literal-block\">\n int <strong>piece_size</strong> (piece_index_t index) const;\n </pre>\n-<p>returns the piece size of <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Create_Torrents.html#piece_length()\">piece_length()</a>, except\n+<p>returns the piece size of <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Storage.html#piece_length()\">piece_length()</a>, except\n for the last piece, which may be shorter.</p>\n <a name=\"piece_size2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"piece-size2\">\n <h2>piece_size2()</h2>\n <pre class=\"literal-block\">\n int <strong>piece_size2</strong> (piece_index_t index) const;\n </pre>\n@@ -435,21 +435,21 @@\n <div class=\"section\" id=\"blocks-per-piece\">\n <h2>blocks_per_piece()</h2>\n <pre class=\"literal-block\">\n int <strong>blocks_per_piece</strong> () const;\n </pre>\n <p>returns the number of blocks there are in the typical piece. There\n may be fewer in the last piece)</p>\n-<a name=\"set_name()\"></a>\n-<a name=\"name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bset_name%28%29+name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bset_name%28%29+name%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-name-name\">\n-<h2>set_name() name()</h2>\n+<a name=\"name()\"></a>\n+<a name=\"set_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"name-set-name\">\n+<h2>name() set_name()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_name</strong> (std::string const& n);\n std::string const& <strong>name</strong> () const;\n+void <strong>set_name</strong> (std::string const& n);\n </pre>\n <p>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.</p>\n <a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"swap\">\n <h2>swap()</h2>\n <pre class=\"literal-block\">\n@@ -460,37 +460,37 @@\n <div class=\"section\" id=\"canonicalize\">\n <h2>canonicalize()</h2>\n <pre class=\"literal-block\">\n void <strong>canonicalize</strong> ();\n </pre>\n <p>arrange files and padding to match the canonical form required\n by BEP 52</p>\n-<a name=\"file_size()\"></a>\n-<a name=\"hash()\"></a>\n-<a name=\"root()\"></a>\n-<a name=\"file_offset()\"></a>\n-<a name=\"pad_file_at()\"></a>\n <a name=\"file_path()\"></a>\n-<a name=\"file_name()\"></a>\n+<a name=\"pad_file_at()\"></a>\n+<a name=\"hash()\"></a>\n <a name=\"symlink()\"></a>\n+<a name=\"file_name()\"></a>\n+<a name=\"root()\"></a>\n <a name=\"root_ptr()\"></a>\n-<a name=\"mtime()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_size%28%29+hash%28%29+root%28%29+file_offset%28%29+pad_file_at%28%29+file_path%28%29+file_name%28%29+symlink%28%29+root_ptr%28%29+mtime%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_size%28%29+hash%28%29+root%28%29+file_offset%28%29+pad_file_at%28%29+file_path%28%29+file_name%28%29+symlink%28%29+root_ptr%28%29+mtime%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-size-hash-root-file-offset-pad-file-at-file-path-file-name-symlink-root-ptr-mtime\">\n-<h2>file_size() hash() root() file_offset() pad_file_at() file_path() file_name() symlink() root_ptr() mtime()</h2>\n+<a name=\"file_size()\"></a>\n+<a name=\"mtime()\"></a>\n+<a name=\"file_offset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_path%28%29+pad_file_at%28%29+hash%28%29+symlink%28%29+file_name%28%29+root%28%29+root_ptr%28%29+file_size%28%29+mtime%28%29+file_offset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_path%28%29+pad_file_at%28%29+hash%28%29+symlink%28%29+file_name%28%29+root%28%29+root_ptr%28%29+file_size%28%29+mtime%28%29+file_offset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-path-pad-file-at-hash-symlink-file-name-root-root-ptr-file-size-mtime-file-offset\">\n+<h2>file_path() pad_file_at() hash() symlink() file_name() root() root_ptr() file_size() mtime() file_offset()</h2>\n <pre class=\"literal-block\">\n-bool <strong>pad_file_at</strong> (file_index_t index) const;\n-std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n-sha256_hash <strong>root</strong> (file_index_t index) const;\n-sha1_hash <strong>hash</strong> (file_index_t index) const;\n+std::string <strong>symlink</strong> (file_index_t index) const;\n std::int64_t <strong>file_size</strong> (file_index_t index) const;\n-string_view <strong>file_name</strong> (file_index_t index) const;\n+sha256_hash <strong>root</strong> (file_index_t index) const;\n+bool <strong>pad_file_at</strong> (file_index_t index) const;\n std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n-std::string <strong>symlink</strong> (file_index_t index) const;\n-std::time_t <strong>mtime</strong> (file_index_t index) const;\n+sha1_hash <strong>hash</strong> (file_index_t index) const;\n char const* <strong>root_ptr</strong> (file_index_t const index) const;\n+std::time_t <strong>mtime</strong> (file_index_t index) const;\n+string_view <strong>file_name</strong> (file_index_t index) const;\n+std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n </pre>\n <p>These functions are used to query attributes of files at\n a given index.</p>\n <p>The <tt class=\"docutils literal\">hash()</tt> 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.</p>\n <p><tt class=\"docutils literal\">root()</tt> returns the SHA-256 merkle tree root of the specified file,\n@@ -508,34 +508,34 @@\n index is a pad-file.</p>\n <p><tt class=\"docutils literal\">file_name()</tt> returns <em>just</em> the name of the file, whereas\n <tt class=\"docutils literal\">file_path()</tt> returns the path (inside the torrent file) with\n the filename appended.</p>\n <p><tt class=\"docutils literal\">file_offset()</tt> 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).</p>\n-<a name=\"file_num_pieces()\"></a>\n <a name=\"file_num_blocks()\"></a>\n-<a name=\"file_piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_num_pieces%28%29+file_num_blocks%28%29+file_piece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_num_pieces%28%29+file_num_blocks%28%29+file_piece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-num-pieces-file-num-blocks-file-piece-range\">\n-<h2>file_num_pieces() file_num_blocks() file_piece_range()</h2>\n+<a name=\"file_piece_range()\"></a>\n+<a name=\"file_num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_num_blocks%28%29+file_piece_range%28%29+file_num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_num_blocks%28%29+file_piece_range%28%29+file_num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-num-blocks-file-piece-range-file-num-pieces\">\n+<h2>file_num_blocks() file_piece_range() file_num_pieces()</h2>\n <pre class=\"literal-block\">\n int <strong>file_num_blocks</strong> (file_index_t index) const;\n int <strong>file_num_pieces</strong> (file_index_t index) const;\n index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n </pre>\n <p>Returns the number of pieces or blocks the file at <cite>index</cite> 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.</p>\n-<a name=\"file_first_piece_node()\"></a>\n-<a name=\"file_first_block_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_first_piece_node%28%29+file_first_block_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_first_piece_node%28%29+file_first_block_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-first-piece-node-file-first-block-node\">\n-<h2>file_first_piece_node() file_first_block_node()</h2>\n+<a name=\"file_first_block_node()\"></a>\n+<a name=\"file_first_piece_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_first_block_node%28%29+file_first_piece_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_first_block_node%28%29+file_first_piece_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-first-block-node-file-first-piece-node\">\n+<h2>file_first_block_node() file_first_piece_node()</h2>\n <pre class=\"literal-block\">\n int <strong>file_first_block_node</strong> (file_index_t index) const;\n int <strong>file_first_piece_node</strong> (file_index_t index) const;\n </pre>\n <p>index of first piece node in the merkle tree</p>\n <a name=\"file_path_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_path_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_path_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"file-path-hash\">\n@@ -629,57 +629,57 @@\n <dd>this file has the executable attribute set.</dd>\n </dl>\n <a name=\"flag_symlink\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_symlink%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_symlink%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>flag_symlink</dt>\n <dd>this file is a symbolic link. It should have a link\n target string associated with it.</dd>\n </dl>\n-<a name=\"default_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22default_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"mmap_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:mmap_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22mmap_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n+<div class=\"section\" id=\"mmap-disk-io-constructor\">\n+<h1>mmap_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/mmap_disk_io.hpp\">libtorrent/mmap_disk_io.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::unique_ptr<disk_interface> <strong>mmap_disk_io_constructor</strong> (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+</pre>\n+<p>constructs a memory mapped file disk I/O object.</p>\n+<a name=\"default_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22default_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"default-disk-io-constructor\">\n <h1>default_disk_io_constructor()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::unique_ptr<disk_interface> <strong>default_disk_io_constructor</strong> (\n io_context& ios, settings_interface const&, counters& cnt);\n </pre>\n <p>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.</p>\n-<a name=\"posix_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:posix_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22posix_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"posix-disk-io-constructor\">\n-<h1>posix_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/posix_disk_io.hpp\">libtorrent/posix_disk_io.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>posix_disk_io_constructor</strong> (\n- io_context& ios, settings_interface const&, counters& cnt);\n-</pre>\n-<p>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.</p>\n <a name=\"disabled_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disabled_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22disabled_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"disabled-disk-io-constructor\">\n <h1>disabled_disk_io_constructor()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disabled_disk_io.hpp\">libtorrent/disabled_disk_io.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::unique_ptr<disk_interface> <strong>disabled_disk_io_constructor</strong> (\n io_context& ios, settings_interface const&, counters& cnt);\n </pre>\n <p>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.</p>\n-<a name=\"mmap_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:mmap_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22mmap_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"mmap-disk-io-constructor\">\n-<h1>mmap_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/mmap_disk_io.hpp\">libtorrent/mmap_disk_io.hpp</a>"</p>\n+<a name=\"posix_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:posix_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22posix_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"posix-disk-io-constructor\">\n+<h1>posix_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/posix_disk_io.hpp\">libtorrent/posix_disk_io.hpp</a>"</p>\n <pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>mmap_disk_io_constructor</strong> (\n+std::unique_ptr<disk_interface> <strong>posix_disk_io_constructor</strong> (\n io_context& ios, settings_interface const&, counters& cnt);\n </pre>\n-<p>constructs a memory mapped file disk I/O object.</p>\n+<p>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.</p>\n <a name=\"storage_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+storage_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+storage_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-storage-mode-t\">\n <h1>enum storage_mode_t</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"22%\" />\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -16,39 +16,39 @@\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 _\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)\n- o _\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)_\b _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\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(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)\n+ _\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 _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bf_\bo_\br_\b__\br_\bo_\bo_\bt_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\ba_\bn_\bi_\bt_\bi_\bz_\be_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk_\bs_\b(_\b)\n o _\bv_\b2_\b(_\b)\n+ * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n a parameter pack used to construct the storage for a torrent, used in\n@@ -96,68 +96,68 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n The file_storage class represents a file list and the piece size. Everything\n necessary to interpret a regular bittorrent storage file structure.\n class file_storage\n {\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n , std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}, char const* filehash = nullptr\n , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n+ 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 (error_code& ec, std::string const& path, std::int64_t\n-file_size\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n+ 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<file_slice> 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<file_index_t> 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<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n- void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n- 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- bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n- std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n-\"\") const;\n- sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n- 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::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (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+ sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+ bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n- std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n- std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+ std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+ string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+ std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n+\"\") const;\n 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<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n save_path) const;\n@@ -186,28 +186,28 @@\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_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n , std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}, char const* filehash = nullptr\n , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n+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 (error_code& ec, std::string const& path, std::int64_t file_size\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n+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@@ -281,16 +281,16 @@\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n returns the total number of bytes all the files in this torrent spans\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+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@@ -301,17 +301,17 @@\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<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n returns an implementation-defined type that can be used as the container in a\n range-for loop. Where the values are the indices of all pieces in the\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n+*\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 returns the piece size of index. This will be the same as _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b),\n except for the last piece, which may be shorter.\n@@ -328,41 +328,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* 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+*\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 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_s\bsi\biz\bze\be(\b()\b) h\bha\bas\bsh\bh(\b()\b) r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b)\n-f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n-std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n-const;\n-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+*\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) h\bha\bas\bsh\bh(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) r\bro\boo\bot\bt(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b)\n+f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+std::string s\bsy\bym\bml\bli\bin\bnk\bk (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-string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n-std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n+const;\n These functions are used to query attributes of files at a given index.\n The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n torrent file. This can potentially be used to join a bittorrent network with\n other file sharing networks.\n root() returns the SHA-256 merkle tree root of the specified file, in case this\n is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n SHA-256 merkle tree root hash for the specified file. The pointer points into\n@@ -375,24 +375,24 @@\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_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) f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_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<piece_index_t::diff_type> 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+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n index of first piece node in the merkle tree\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const& save_path)\n const;\n@@ -450,42 +450,42 @@\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* 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<disk_interface> m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+constructs a memory mapped file disk I/O object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n std::unique_ptr<disk_interface> d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n the constructor function for the default storage. On systems that support\n memory mapped files (and a 64 bit address space) the memory mapped storage will\n be constructed, otherwise the portable posix storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr<disk_interface> p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-this is a simple posix disk I/O back-end, used for systems that don't have a 64\n-bit virtual address space or don't support memory mapped files. It's\n-implemented using portable C file functions and is single-threaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr<disk_interface> d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n creates a disk io object that discards all data written to it, and only returns\n zero-buffers when read from. May be useful for testing and benchmarking.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr<disk_interface> 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* 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<disk_interface> 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-constructs a memory mapped file disk I/O object.\n+this is a simple posix disk I/O back-end, used for systems that don't have a 64\n+bit virtual address space or don't support memory mapped files. It's\n+implemented using portable C file functions and is single-threaded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |All pieces will be written to their final |\n | | |position, all files will be allocated in full |\n"}]}, {"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": "@@ -40,51 +40,51 @@\n <li><a class=\"reference internal\" href=\"#partial-piece-info\" id=\"toc-entry-4\">partial_piece_info</a></li>\n <li><a class=\"reference internal\" href=\"#torrent-handle\" id=\"toc-entry-5\">torrent_handle</a><ul>\n <li><a class=\"reference internal\" href=\"#torrent-handle-1\" id=\"toc-entry-6\">torrent_handle()</a></li>\n <li><a class=\"reference internal\" href=\"#add-piece\" id=\"toc-entry-7\">add_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#read-piece\" id=\"toc-entry-8\">read_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#have-piece\" id=\"toc-entry-9\">have_piece()</a></li>\n <li><a class=\"reference internal\" href=\"#post-peer-info-get-peer-info\" id=\"toc-entry-10\">post_peer_info() get_peer_info()</a></li>\n-<li><a class=\"reference internal\" href=\"#post-status-status\" id=\"toc-entry-11\">post_status() status()</a></li>\n+<li><a class=\"reference internal\" href=\"#status-post-status\" id=\"toc-entry-11\">status() post_status()</a></li>\n <li><a class=\"reference internal\" href=\"#post-download-queue-get-download-queue\" id=\"toc-entry-12\">post_download_queue() get_download_queue()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-piece-deadline-reset-piece-deadline-clear-piece-deadlines\" id=\"toc-entry-13\">set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-progress-post-file-progress\" id=\"toc-entry-14\">file_progress() post_file_progress()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-piece-deadlines-set-piece-deadline-reset-piece-deadline\" id=\"toc-entry-13\">clear_piece_deadlines() set_piece_deadline() reset_piece_deadline()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-file-progress-file-progress\" id=\"toc-entry-14\">post_file_progress() file_progress()</a></li>\n <li><a class=\"reference internal\" href=\"#file-status\" id=\"toc-entry-15\">file_status()</a></li>\n <li><a class=\"reference internal\" href=\"#clear-error\" id=\"toc-entry-16\">clear_error()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-tracker-replace-trackers-trackers-post-trackers\" id=\"toc-entry-17\">add_tracker() replace_trackers() trackers() post_trackers()</a></li>\n-<li><a class=\"reference internal\" href=\"#remove-url-seed-add-url-seed-url-seeds\" id=\"toc-entry-18\">remove_url_seed() add_url_seed() url_seeds()</a></li>\n-<li><a class=\"reference internal\" href=\"#http-seeds-add-http-seed-remove-http-seed\" id=\"toc-entry-19\">http_seeds() add_http_seed() remove_http_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-tracker-post-trackers-replace-trackers-trackers\" id=\"toc-entry-17\">add_tracker() post_trackers() replace_trackers() trackers()</a></li>\n+<li><a class=\"reference internal\" href=\"#remove-url-seed-url-seeds-add-url-seed\" id=\"toc-entry-18\">remove_url_seed() url_seeds() add_url_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#http-seeds-remove-http-seed-add-http-seed\" id=\"toc-entry-19\">http_seeds() remove_http_seed() add_http_seed()</a></li>\n <li><a class=\"reference internal\" href=\"#add-extension\" id=\"toc-entry-20\">add_extension()</a></li>\n <li><a class=\"reference internal\" href=\"#set-metadata\" id=\"toc-entry-21\">set_metadata()</a></li>\n <li><a class=\"reference internal\" href=\"#is-valid\" id=\"toc-entry-22\">is_valid()</a></li>\n-<li><a class=\"reference internal\" href=\"#resume-pause\" id=\"toc-entry-23\">resume() pause()</a></li>\n-<li><a class=\"reference internal\" href=\"#flags-unset-flags-set-flags\" id=\"toc-entry-24\">flags() unset_flags() set_flags()</a></li>\n+<li><a class=\"reference internal\" href=\"#pause-resume\" id=\"toc-entry-23\">pause() resume()</a></li>\n+<li><a class=\"reference internal\" href=\"#unset-flags-set-flags-flags\" id=\"toc-entry-24\">unset_flags() set_flags() flags()</a></li>\n <li><a class=\"reference internal\" href=\"#flush-cache\" id=\"toc-entry-25\">flush_cache()</a></li>\n <li><a class=\"reference internal\" href=\"#force-recheck\" id=\"toc-entry-26\">force_recheck()</a></li>\n <li><a class=\"reference internal\" href=\"#save-resume-data\" id=\"toc-entry-27\">save_resume_data()</a></li>\n <li><a class=\"reference internal\" href=\"#need-save-resume-data\" id=\"toc-entry-28\">need_save_resume_data()</a></li>\n-<li><a class=\"reference internal\" href=\"#queue-position-down-queue-position-queue-position-top-queue-position-bottom-queue-position-up\" id=\"toc-entry-29\">queue_position_down() queue_position() queue_position_top() queue_position_bottom() queue_position_up()</a></li>\n+<li><a class=\"reference internal\" href=\"#queue-position-down-queue-position-bottom-queue-position-queue-position-top-queue-position-up\" id=\"toc-entry-29\">queue_position_down() queue_position_bottom() queue_position() queue_position_top() queue_position_up()</a></li>\n <li><a class=\"reference internal\" href=\"#queue-position-set\" id=\"toc-entry-30\">queue_position_set()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-ssl-certificate-set-ssl-certificate-buffer\" id=\"toc-entry-31\">set_ssl_certificate() set_ssl_certificate_buffer()</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-file-torrent-file-with-hashes\" id=\"toc-entry-32\">torrent_file() torrent_file_with_hashes()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-ssl-certificate-buffer-set-ssl-certificate\" id=\"toc-entry-31\">set_ssl_certificate_buffer() set_ssl_certificate()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-file-with-hashes-torrent-file\" id=\"toc-entry-32\">torrent_file_with_hashes() torrent_file()</a></li>\n <li><a class=\"reference internal\" href=\"#piece-layers\" id=\"toc-entry-33\">piece_layers()</a></li>\n <li><a class=\"reference internal\" href=\"#post-piece-availability-piece-availability\" id=\"toc-entry-34\">post_piece_availability() piece_availability()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-priority-prioritize-pieces-get-piece-priorities\" id=\"toc-entry-35\">piece_priority() prioritize_pieces() get_piece_priorities()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-priority-prioritize-files-get-file-priorities\" id=\"toc-entry-36\">file_priority() prioritize_files() get_file_priorities()</a></li>\n-<li><a class=\"reference internal\" href=\"#force-reannounce-force-dht-announce-force-lsd-announce\" id=\"toc-entry-37\">force_reannounce() force_dht_announce() force_lsd_announce()</a></li>\n+<li><a class=\"reference internal\" href=\"#prioritize-pieces-piece-priority-get-piece-priorities\" id=\"toc-entry-35\">prioritize_pieces() piece_priority() get_piece_priorities()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-priority-get-file-priorities-prioritize-files\" id=\"toc-entry-36\">file_priority() get_file_priorities() prioritize_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#force-dht-announce-force-reannounce-force-lsd-announce\" id=\"toc-entry-37\">force_dht_announce() force_reannounce() force_lsd_announce()</a></li>\n <li><a class=\"reference internal\" href=\"#scrape-tracker\" id=\"toc-entry-38\">scrape_tracker()</a></li>\n-<li><a class=\"reference internal\" href=\"#download-limit-set-upload-limit-upload-limit-set-download-limit\" id=\"toc-entry-39\">download_limit() set_upload_limit() upload_limit() set_download_limit()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-upload-limit-upload-limit-download-limit-set-download-limit\" id=\"toc-entry-39\">set_upload_limit() upload_limit() download_limit() set_download_limit()</a></li>\n <li><a class=\"reference internal\" href=\"#connect-peer\" id=\"toc-entry-40\">connect_peer()</a></li>\n <li><a class=\"reference internal\" href=\"#clear-peers\" id=\"toc-entry-41\">clear_peers()</a></li>\n <li><a class=\"reference internal\" href=\"#set-max-uploads-max-uploads\" id=\"toc-entry-42\">set_max_uploads() max_uploads()</a></li>\n <li><a class=\"reference internal\" href=\"#set-max-connections-max-connections\" id=\"toc-entry-43\">set_max_connections() max_connections()</a></li>\n <li><a class=\"reference internal\" href=\"#move-storage\" id=\"toc-entry-44\">move_storage()</a></li>\n <li><a class=\"reference internal\" href=\"#rename-file\" id=\"toc-entry-45\">rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hash-info-hashes\" id=\"toc-entry-46\">info_hash() info_hashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-operator-operator\" id=\"toc-entry-47\">operator<() operator!=() operator==()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hashes-info-hash\" id=\"toc-entry-46\">info_hashes() info_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-operator-operator\" id=\"toc-entry-47\">operator!=() operator<() operator==()</a></li>\n <li><a class=\"reference internal\" href=\"#id\" id=\"toc-entry-48\">id()</a></li>\n <li><a class=\"reference internal\" href=\"#native-handle\" id=\"toc-entry-49\">native_handle()</a></li>\n <li><a class=\"reference internal\" href=\"#userdata\" id=\"toc-entry-50\">userdata()</a></li>\n <li><a class=\"reference internal\" href=\"#in-session\" id=\"toc-entry-51\">in_session()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#hash-value\" id=\"toc-entry-52\">hash_value()</a></li>\n@@ -94,16 +94,16 @@\n <h1>block_info</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n <p>holds the state of a block in a piece. Who we requested\n it from and how far along we are at downloading it.</p>\n <pre class=\"literal-block\">\n struct block_info\n {\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n void <strong>set_peer</strong> (tcp::endpoint const& ep);\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\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 </pre>\n <a name=\"peer()\"></a>\n <a name=\"set_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bpeer%28%29+set_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bpeer%28%29+set_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"peer-set-peer\">\n <h2>peer() set_peer()</h2>\n <pre class=\"literal-block\">\n-<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n void <strong>set_peer</strong> (tcp::endpoint const& ep);\n+<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n </pre>\n <p>The peer is the ip address of the peer this block was downloaded from.</p>\n <a name=\"block_state_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+block_state_t&labels=documentation&body=Documentation+under+heading+%22enum+block_state_t%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-block-state-t\">\n <h2>enum block_state_t</h2>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n@@ -267,106 +267,106 @@\n {\n friend std::size_t <strong>hash_value</strong> (torrent_handle const& th);\n <strong>torrent_handle</strong> () noexcept = default;\n void <strong>add_piece</strong> (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n void <strong>add_piece</strong> (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n void <strong>read_piece</strong> (piece_index_t piece) const;\n bool <strong>have_piece</strong> (piece_index_t piece) const;\n- void <strong>post_peer_info</strong> () const;\n void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n+ void <strong>post_peer_info</strong> () const;\n torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n void <strong>get_download_queue</strong> (std::vector<partial_piece_info>& queue) const;\n void <strong>post_download_queue</strong> () const;\n std::vector<partial_piece_info> <strong>get_download_queue</strong> () const;\n- void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n- void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n void <strong>clear_piece_deadlines</strong> () const;\n+ void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n+ void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n std::vector<open_file_state> <strong>file_status</strong> () const;\n void <strong>clear_error</strong> () const;\n+ void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n void <strong>add_tracker</strong> (announce_entry const&) const;\n std::vector<announce_entry> <strong>trackers</strong> () const;\n- void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n void <strong>post_trackers</strong> () const;\n+ void <strong>add_url_seed</strong> (std::string const& url) const;\n void <strong>remove_url_seed</strong> (std::string const& url) const;\n std::set<std::string> <strong>url_seeds</strong> () const;\n- void <strong>add_url_seed</strong> (std::string const& url) const;\n- std::set<std::string> <strong>http_seeds</strong> () const;\n void <strong>remove_http_seed</strong> (std::string const& url) const;\n void <strong>add_http_seed</strong> (std::string const& url) const;\n+ std::set<std::string> <strong>http_seeds</strong> () const;\n void <strong>add_extension</strong> (\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 <strong>set_metadata</strong> (span<char const> metadata) const;\n bool <strong>is_valid</strong> () const;\n void <strong>pause</strong> (pause_flags_t flags = {}) const;\n void <strong>resume</strong> () const;\n- void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n- void <strong>set_flags</strong> (torrent_flags_t flags) const;\n- torrent_flags_t <strong>flags</strong> () const;\n void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n+ torrent_flags_t <strong>flags</strong> () const;\n+ void <strong>set_flags</strong> (torrent_flags_t flags) const;\n+ void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n void <strong>flush_cache</strong> () const;\n void <strong>force_recheck</strong> () const;\n void <strong>save_resume_data</strong> (resume_data_flags_t flags = {}) const;\n bool <strong>need_save_resume_data</strong> (resume_data_flags_t flags) const;\n bool <strong>need_save_resume_data</strong> () const;\n- void <strong>queue_position_bottom</strong> () const;\n- void <strong>queue_position_top</strong> () const;\n void <strong>queue_position_up</strong> () const;\n+ void <strong>queue_position_bottom</strong> () const;\n queue_position_t <strong>queue_position</strong> () const;\n void <strong>queue_position_down</strong> () const;\n+ void <strong>queue_position_top</strong> () const;\n void <strong>queue_position_set</strong> (queue_position_t p) const;\n- void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n void <strong>set_ssl_certificate</strong> (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = "");\n- std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n+ void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n+ std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n std::vector<std::vector<sha256_hash>> <strong>piece_layers</strong> () const;\n- void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n void <strong>post_piece_availability</strong> () const;\n- void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n- std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n- void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+ void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n+ void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n+ void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+ std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n- void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n+ void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n+ void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n void <strong>force_dht_announce</strong> () const;\n void <strong>force_lsd_announce</strong> () const;\n- void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n void <strong>scrape_tracker</strong> (int idx = -1) const;\n- int <strong>upload_limit</strong> () const;\n void <strong>set_download_limit</strong> (int limit) const;\n- int <strong>download_limit</strong> () const;\n+ int <strong>upload_limit</strong> () const;\n void <strong>set_upload_limit</strong> (int limit) const;\n+ int <strong>download_limit</strong> () const;\n void <strong>connect_peer</strong> (tcp::endpoint const& adr, peer_source_flags_t source = {}\n , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n void <strong>clear_peers</strong> ();\n int <strong>max_uploads</strong> () const;\n void <strong>set_max_uploads</strong> (int max_uploads) const;\n- int <strong>max_connections</strong> () const;\n void <strong>set_max_connections</strong> (int max_connections) const;\n+ int <strong>max_connections</strong> () const;\n void <strong>move_storage</strong> (std::string const& save_path\n , move_flags_t flags = move_flags_t::always_replace_files\n ) const;\n void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n sha1_hash <strong>info_hash</strong> () const;\n info_hash_t <strong>info_hashes</strong> () const;\n+ bool <strong>operator==</strong> (const torrent_handle& h) const;\n bool <strong>operator!=</strong> (const torrent_handle& h) const;\n bool <strong>operator<</strong> (const torrent_handle& h) const;\n- bool <strong>operator==</strong> (const torrent_handle& h) const;\n std::uint32_t <strong>id</strong> () const;\n std::shared_ptr<torrent> <strong>native_handle</strong> () const;\n client_data_t <strong>userdata</strong> () const;\n bool <strong>in_session</strong> () const;\n \n static constexpr add_piece_flags_t <strong>overwrite_existing</strong> = 0_bit;\n static constexpr status_flags_t <strong>query_distributed_copies</strong> = 0_bit;\n@@ -449,31 +449,31 @@\n <p>Returns true if this piece has been completely downloaded and written\n to disk, and false otherwise.</p>\n <a name=\"post_peer_info()\"></a>\n <a name=\"get_peer_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_peer_info%28%29+get_peer_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_peer_info%28%29+get_peer_info%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"post-peer-info-get-peer-info\">\n <h2>post_peer_info() get_peer_info()</h2>\n <pre class=\"literal-block\">\n-void <strong>post_peer_info</strong> () const;\n void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n+void <strong>post_peer_info</strong> () const;\n </pre>\n <p>Query information about connected peers for this torrent. If the\n <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw a system_error exception.</p>\n <p><tt class=\"docutils literal\">post_peer_info()</tt> is asynchronous and will trigger the posting of\n a <a class=\"reference external\" href=\"reference-Alerts.html#peer_info_alert\">peer_info_alert</a>. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> contain a list of <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a> objects, one\n for each connected peer.</p>\n <p><tt class=\"docutils literal\">get_peer_info()</tt> is synchronous and takes a reference to a vector\n that will be cleared and filled with one <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> for each peer\n connected to this torrent, given the handle is valid. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in\n the vector contains information about that particular peer. See\n <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a>.</p>\n-<a name=\"post_status()\"></a>\n-<a name=\"status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"post-status-status\">\n-<h2>post_status() status()</h2>\n+<a name=\"status()\"></a>\n+<a name=\"post_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bstatus%28%29+post_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bstatus%28%29+post_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"status-post-status\">\n+<h2>status() post_status()</h2>\n <pre class=\"literal-block\">\n torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n </pre>\n <p><tt class=\"docutils literal\">status()</tt> will return a structure with information about the status\n of this torrent. If the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw\n system_error exception. See <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>. The <tt class=\"docutils literal\">flags</tt>\n@@ -501,23 +501,23 @@\n </pre>\n <p><tt class=\"docutils literal\">post_download_queue()</tt> triggers a download_queue_alert to be\n posted.\n <tt class=\"docutils literal\">get_download_queue()</tt> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a> for the\n fields in the returned vector.</p>\n+<a name=\"clear_piece_deadlines()\"></a>\n <a name=\"set_piece_deadline()\"></a>\n-<a name=\"reset_piece_deadline()\"></a>\n-<a name=\"clear_piece_deadlines()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_piece_deadline%28%29+reset_piece_deadline%28%29+clear_piece_deadlines%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_piece_deadline%28%29+reset_piece_deadline%28%29+clear_piece_deadlines%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-piece-deadline-reset-piece-deadline-clear-piece-deadlines\">\n-<h2>set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()</h2>\n+<a name=\"reset_piece_deadline()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_piece_deadlines%28%29+set_piece_deadline%28%29+reset_piece_deadline%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_piece_deadlines%28%29+set_piece_deadline%28%29+reset_piece_deadline%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-piece-deadlines-set-piece-deadline-reset-piece-deadline\">\n+<h2>clear_piece_deadlines() set_piece_deadline() reset_piece_deadline()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n-void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n void <strong>clear_piece_deadlines</strong> () const;\n+void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n+void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n </pre>\n <p>This function sets or resets the deadline associated with a specific\n piece index (<tt class=\"docutils literal\">index</tt>). libtorrent will attempt to download this\n entire piece before the deadline expires. This is not necessarily\n possible, but pieces with a more recent deadline will always be\n prioritized over pieces with a deadline further ahead in time. The\n deadline (and flags) of a piece can be changed by calling this\n@@ -528,18 +528,18 @@\n <p><tt class=\"docutils literal\">deadline</tt> is the number of milliseconds until this piece should be\n completed.</p>\n <p><tt class=\"docutils literal\">reset_piece_deadline</tt> removes the deadline from the piece. If it\n hasn't already been downloaded, it will no longer be considered a\n priority.</p>\n <p><tt class=\"docutils literal\">clear_piece_deadlines()</tt> removes deadlines on all pieces in\n the torrent. As if <a class=\"reference external\" href=\"reference-Torrent_Handle.html#reset_piece_deadline()\">reset_piece_deadline()</a> was called on all pieces.</p>\n-<a name=\"file_progress()\"></a>\n-<a name=\"post_file_progress()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-progress-post-file-progress\">\n-<h2>file_progress() post_file_progress()</h2>\n+<a name=\"post_file_progress()\"></a>\n+<a name=\"file_progress()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_file_progress%28%29+file_progress%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_file_progress%28%29+file_progress%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-file-progress-file-progress\">\n+<h2>post_file_progress() file_progress()</h2>\n <pre class=\"literal-block\">\n void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n </pre>\n <p>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@@ -573,23 +573,23 @@\n <h2>clear_error()</h2>\n <pre class=\"literal-block\">\n void <strong>clear_error</strong> () const;\n </pre>\n <p>If the torrent is in an error state (i.e. <tt class=\"docutils literal\"><span class=\"pre\">torrent_status::error</span></tt> is\n non-empty), this will clear the error and start the torrent again.</p>\n <a name=\"add_tracker()\"></a>\n+<a name=\"post_trackers()\"></a>\n <a name=\"replace_trackers()\"></a>\n-<a name=\"trackers()\"></a>\n-<a name=\"post_trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-tracker-replace-trackers-trackers-post-trackers\">\n-<h2>add_tracker() replace_trackers() trackers() post_trackers()</h2>\n+<a name=\"trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_tracker%28%29+post_trackers%28%29+replace_trackers%28%29+trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_tracker%28%29+post_trackers%28%29+replace_trackers%28%29+trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-tracker-post-trackers-replace-trackers-trackers\">\n+<h2>add_tracker() post_trackers() replace_trackers() trackers()</h2>\n <pre class=\"literal-block\">\n+void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n void <strong>add_tracker</strong> (announce_entry const&) const;\n std::vector<announce_entry> <strong>trackers</strong> () const;\n-void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n void <strong>post_trackers</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">trackers()</tt> returns the list of trackers for this torrent. The\n announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> contains both a string <tt class=\"docutils literal\">url</tt> which specify the\n announce url for the tracker as well as an <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> <tt class=\"docutils literal\">tier</tt>, 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@@ -603,41 +603,41 @@\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 <a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n <p>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.</p>\n <a name=\"remove_url_seed()\"></a>\n-<a name=\"add_url_seed()\"></a>\n-<a name=\"url_seeds()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bremove_url_seed%28%29+add_url_seed%28%29+url_seeds%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bremove_url_seed%28%29+add_url_seed%28%29+url_seeds%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"remove-url-seed-add-url-seed-url-seeds\">\n-<h2>remove_url_seed() add_url_seed() url_seeds()</h2>\n+<a name=\"url_seeds()\"></a>\n+<a name=\"add_url_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bremove_url_seed%28%29+url_seeds%28%29+add_url_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bremove_url_seed%28%29+url_seeds%28%29+add_url_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"remove-url-seed-url-seeds-add-url-seed\">\n+<h2>remove_url_seed() url_seeds() add_url_seed()</h2>\n <pre class=\"literal-block\">\n+void <strong>add_url_seed</strong> (std::string const& url) const;\n void <strong>remove_url_seed</strong> (std::string const& url) const;\n std::set<std::string> <strong>url_seeds</strong> () const;\n-void <strong>add_url_seed</strong> (std::string const& url) const;\n </pre>\n <p><tt class=\"docutils literal\">add_url_seed()</tt> 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 <tt class=\"docutils literal\">remove_url_seed()</tt> removes the given url if it exists already.\n <tt class=\"docutils literal\">url_seeds()</tt> 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.</p>\n <p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n <a name=\"http_seeds()\"></a>\n-<a name=\"add_http_seed()\"></a>\n-<a name=\"remove_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bhttp_seeds%28%29+add_http_seed%28%29+remove_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bhttp_seeds%28%29+add_http_seed%28%29+remove_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"http-seeds-add-http-seed-remove-http-seed\">\n-<h2>http_seeds() add_http_seed() remove_http_seed()</h2>\n+<a name=\"remove_http_seed()\"></a>\n+<a name=\"add_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bhttp_seeds%28%29+remove_http_seed%28%29+add_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bhttp_seeds%28%29+remove_http_seed%28%29+add_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"http-seeds-remove-http-seed-add-http-seed\">\n+<h2>http_seeds() remove_http_seed() add_http_seed()</h2>\n <pre class=\"literal-block\">\n-std::set<std::string> <strong>http_seeds</strong> () const;\n void <strong>remove_http_seed</strong> (std::string const& url) const;\n void <strong>add_http_seed</strong> (std::string const& url) const;\n+std::set<std::string> <strong>http_seeds</strong> () const;\n </pre>\n <p>These functions are identical as the <tt class=\"docutils literal\">*_url_seed()</tt> variants, but\n they operate on <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> web seeds instead of <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n <p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n <a name=\"add_extension()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_extension%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_extension%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"add-extension\">\n <h2>add_extension()</h2>\n@@ -679,18 +679,18 @@\n afterward.</p>\n <p>Clients should only use <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> to determine if the result of\n session::find_torrent() was successful.</p>\n <p>Unlike other member functions which return a value, <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a>\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.</p>\n-<a name=\"resume()\"></a>\n-<a name=\"pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bresume%28%29+pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bresume%28%29+pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"resume-pause\">\n-<h2>resume() pause()</h2>\n+<a name=\"pause()\"></a>\n+<a name=\"resume()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpause%28%29+resume%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpause%28%29+resume%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"pause-resume\">\n+<h2>pause() resume()</h2>\n <pre class=\"literal-block\">\n void <strong>pause</strong> (pause_flags_t flags = {}) const;\n void <strong>resume</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">pause()</tt>, and <tt class=\"docutils literal\">resume()</tt> 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@@ -704,24 +704,24 @@\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n <p class=\"last\">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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information, see <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n </div>\n-<a name=\"flags()\"></a>\n <a name=\"unset_flags()\"></a>\n-<a name=\"set_flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflags%28%29+unset_flags%28%29+set_flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflags%28%29+unset_flags%28%29+set_flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"flags-unset-flags-set-flags\">\n-<h2>flags() unset_flags() set_flags()</h2>\n+<a name=\"set_flags()\"></a>\n+<a name=\"flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bunset_flags%28%29+set_flags%28%29+flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bunset_flags%28%29+set_flags%28%29+flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"unset-flags-set-flags-flags\">\n+<h2>unset_flags() set_flags() flags()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n-void <strong>set_flags</strong> (torrent_flags_t flags) const;\n-torrent_flags_t <strong>flags</strong> () const;\n void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n+torrent_flags_t <strong>flags</strong> () const;\n+void <strong>set_flags</strong> (torrent_flags_t flags) const;\n+void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n </pre>\n <p>sets and gets the torrent state flags. See <a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a>.\n The <tt class=\"docutils literal\">set_flags</tt> overload that take a mask will affect all\n flags part of the mask, and set their values to what the\n <tt class=\"docutils literal\">flags</tt> argument is set to. This allows clearing and\n setting flags in a single function call.\n The <tt class=\"docutils literal\">set_flags</tt> overload that just takes flags, sets all\n@@ -780,15 +780,15 @@\n <li>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 <a class=\"reference external\" href=\"manual-ref.html#metadata-from-peers\">metadata from peers</a> extension)</li>\n </ol>\n </blockquote>\n <p>Note that some <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> may be outdated by the time you receive the fast resume data</p>\n <p>When saving resume data because of shutting down, make sure not to\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> before you receive the <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.\n+<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> before you receive the <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.\n There's no need to pause the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> or torrent when saving resume\n data.</p>\n <p>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.</p>\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n@@ -878,26 +878,26 @@\n <p class=\"first admonition-title\">Note</p>\n <p class=\"last\">A torrent's resume data is considered saved as soon as the\n <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> is posted. It is important to make sure this\n <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is received and handled in order for this function to be\n meaningful.</p>\n </div>\n <a name=\"queue_position_down()\"></a>\n+<a name=\"queue_position_bottom()\"></a>\n <a name=\"queue_position()\"></a>\n <a name=\"queue_position_top()\"></a>\n-<a name=\"queue_position_bottom()\"></a>\n-<a name=\"queue_position_up()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_down%28%29+queue_position%28%29+queue_position_top%28%29+queue_position_bottom%28%29+queue_position_up%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_down%28%29+queue_position%28%29+queue_position_top%28%29+queue_position_bottom%28%29+queue_position_up%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"queue-position-down-queue-position-queue-position-top-queue-position-bottom-queue-position-up\">\n-<h2>queue_position_down() queue_position() queue_position_top() queue_position_bottom() queue_position_up()</h2>\n+<a name=\"queue_position_up()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_down%28%29+queue_position_bottom%28%29+queue_position%28%29+queue_position_top%28%29+queue_position_up%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_down%28%29+queue_position_bottom%28%29+queue_position%28%29+queue_position_top%28%29+queue_position_up%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"queue-position-down-queue-position-bottom-queue-position-queue-position-top-queue-position-up\">\n+<h2>queue_position_down() queue_position_bottom() queue_position() queue_position_top() queue_position_up()</h2>\n <pre class=\"literal-block\">\n-void <strong>queue_position_bottom</strong> () const;\n-void <strong>queue_position_top</strong> () const;\n void <strong>queue_position_up</strong> () const;\n+void <strong>queue_position_bottom</strong> () const;\n queue_position_t <strong>queue_position</strong> () const;\n void <strong>queue_position_down</strong> () const;\n+void <strong>queue_position_top</strong> () const;\n </pre>\n <p>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.</p>\n <p>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 <h2>queue_position_set()</h2>\n <pre class=\"literal-block\">\n void <strong>queue_position_set</strong> (queue_position_t p) const;\n </pre>\n <p>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</p>\n-<a name=\"set_ssl_certificate()\"></a>\n-<a name=\"set_ssl_certificate_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_ssl_certificate%28%29+set_ssl_certificate_buffer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_ssl_certificate%28%29+set_ssl_certificate_buffer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-ssl-certificate-set-ssl-certificate-buffer\">\n-<h2>set_ssl_certificate() set_ssl_certificate_buffer()</h2>\n+<a name=\"set_ssl_certificate_buffer()\"></a>\n+<a name=\"set_ssl_certificate()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_ssl_certificate_buffer%28%29+set_ssl_certificate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_ssl_certificate_buffer%28%29+set_ssl_certificate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-ssl-certificate-buffer-set-ssl-certificate\">\n+<h2>set_ssl_certificate_buffer() set_ssl_certificate()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n void <strong>set_ssl_certificate</strong> (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = "");\n+void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n </pre>\n <p>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.</p>\n <p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_ssl_certificate_buffer()\">set_ssl_certificate_buffer()</a> overload takes the actual certificate,\n private key and DH params as strings, rather than paths to files.</p>\n <p><tt class=\"docutils literal\">cert</tt> is a path to the (signed) certificate in .pem format\n@@ -951,21 +951,21 @@\n <p>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.</p>\n <p>If you receive a <a class=\"reference external\" href=\"reference-Alerts.html#torrent_need_cert_alert\">torrent_need_cert_alert</a>, 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.</p>\n-<a name=\"torrent_file()\"></a>\n-<a name=\"torrent_file_with_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_file%28%29+torrent_file_with_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_file%28%29+torrent_file_with_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-file-torrent-file-with-hashes\">\n-<h2>torrent_file() torrent_file_with_hashes()</h2>\n+<a name=\"torrent_file_with_hashes()\"></a>\n+<a name=\"torrent_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_file_with_hashes%28%29+torrent_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_file_with_hashes%28%29+torrent_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-file-with-hashes-torrent-file\">\n+<h2>torrent_file_with_hashes() torrent_file()</h2>\n <pre class=\"literal-block\">\n-std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n+std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n </pre>\n <p><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file()\">torrent_file()</a> returns a pointer to the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object\n associated with this torrent. The <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n@@ -1002,37 +1002,37 @@\n vector. This is a blocking call that will synchronize with the\n libtorrent network thread.</p>\n <a name=\"post_piece_availability()\"></a>\n <a name=\"piece_availability()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_piece_availability%28%29+piece_availability%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_piece_availability%28%29+piece_availability%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"post-piece-availability-piece-availability\">\n <h2>post_piece_availability() piece_availability()</h2>\n <pre class=\"literal-block\">\n-void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n void <strong>post_piece_availability</strong> () const;\n+void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n </pre>\n <p>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.</p>\n <p><tt class=\"docutils literal\">post_piece_availability()</tt> will trigger a <a class=\"reference external\" href=\"reference-Alerts.html#piece_availability_alert\">piece_availability_alert</a>\n to be posted.</p>\n <p><tt class=\"docutils literal\">piece_availability()</tt> fills the specified <tt class=\"docutils literal\"><span class=\"pre\">std::vector<int></span></tt>\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.</p>\n-<a name=\"piece_priority()\"></a>\n <a name=\"prioritize_pieces()\"></a>\n-<a name=\"get_piece_priorities()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_priority%28%29+prioritize_pieces%28%29+get_piece_priorities%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_priority%28%29+prioritize_pieces%28%29+get_piece_priorities%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-priority-prioritize-pieces-get-piece-priorities\">\n-<h2>piece_priority() prioritize_pieces() get_piece_priorities()</h2>\n+<a name=\"piece_priority()\"></a>\n+<a name=\"get_piece_priorities()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bprioritize_pieces%28%29+piece_priority%28%29+get_piece_priorities%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bprioritize_pieces%28%29+piece_priority%28%29+get_piece_priorities%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"prioritize-pieces-piece-priority-get-piece-priorities\">\n+<h2>prioritize_pieces() piece_priority() get_piece_priorities()</h2>\n <pre class=\"literal-block\">\n-void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n-std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n-void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n+void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n+void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n </pre>\n <p>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@@ -1055,23 +1055,23 @@\n not allowed.</p>\n <p><tt class=\"docutils literal\">get_piece_priorities</tt> returns a vector with one element for each piece\n in the torrent. Each element is the current priority of that piece.</p>\n <p>It's possible to cancel the effect of <em>file</em> priorities by setting the\n priorities for the affected pieces. Care has to be taken when mixing\n usage of file- and piece priorities.</p>\n <a name=\"file_priority()\"></a>\n-<a name=\"prioritize_files()\"></a>\n-<a name=\"get_file_priorities()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_priority%28%29+prioritize_files%28%29+get_file_priorities%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_priority%28%29+prioritize_files%28%29+get_file_priorities%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-priority-prioritize-files-get-file-priorities\">\n-<h2>file_priority() prioritize_files() get_file_priorities()</h2>\n+<a name=\"get_file_priorities()\"></a>\n+<a name=\"prioritize_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_priority%28%29+get_file_priorities%28%29+prioritize_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_priority%28%29+get_file_priorities%28%29+prioritize_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-priority-get-file-priorities-prioritize-files\">\n+<h2>file_priority() get_file_priorities() prioritize_files()</h2>\n <pre class=\"literal-block\">\n std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n-void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n+void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n </pre>\n <p><tt class=\"docutils literal\">index</tt> must be in the range [0, number_of_files).</p>\n <p><tt class=\"docutils literal\">file_priority()</tt> queries or sets the priority of file <tt class=\"docutils literal\">index</tt>.</p>\n <p><tt class=\"docutils literal\">prioritize_files()</tt> takes a vector that has at as many elements as\n there are files in the torrent. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is the priority of that\n file. The function sets the priorities of all the pieces in the\n torrent based on the vector.</p>\n@@ -1094,23 +1094,23 @@\n <a class=\"reference external\" href=\"reference-Alerts.html#file_prio_alert\">file_prio_alert</a>.</p>\n <p>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.</p>\n <p>Moving data from a file into the part file is currently not\n supported. If a file has its priority set to 0 <em>after</em> it has already\n been created, it will not be moved into the partfile.</p>\n-<a name=\"force_reannounce()\"></a>\n <a name=\"force_dht_announce()\"></a>\n-<a name=\"force_lsd_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_reannounce%28%29+force_dht_announce%28%29+force_lsd_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_reannounce%28%29+force_dht_announce%28%29+force_lsd_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"force-reannounce-force-dht-announce-force-lsd-announce\">\n-<h2>force_reannounce() force_dht_announce() force_lsd_announce()</h2>\n+<a name=\"force_reannounce()\"></a>\n+<a name=\"force_lsd_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_dht_announce%28%29+force_reannounce%28%29+force_lsd_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_dht_announce%28%29+force_reannounce%28%29+force_lsd_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"force-dht-announce-force-reannounce-force-lsd-announce\">\n+<h2>force_dht_announce() force_reannounce() force_lsd_announce()</h2>\n <pre class=\"literal-block\">\n+void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n void <strong>force_dht_announce</strong> () const;\n void <strong>force_lsd_announce</strong> () const;\n-void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n </pre>\n <p><tt class=\"docutils literal\">force_reannounce()</tt> will force this torrent to do another tracker\n request, to receive new peers. The <tt class=\"docutils literal\">seconds</tt> argument specifies how\n many seconds from now to issue the tracker announces.</p>\n <p>If the tracker's <tt class=\"docutils literal\">min_interval</tt> has not passed since the last\n announce, the forced announce will be scheduled to happen immediately\n as the <tt class=\"docutils literal\">min_interval</tt> expires. This is to honor trackers minimum\n@@ -1134,25 +1134,25 @@\n <tt class=\"docutils literal\">idx</tt> is >= 0, the tracker with the specified index will scraped.</p>\n <p>A scrape request queries the tracker for statistics such as total\n number of incomplete peers, complete peers, number of downloads etc.</p>\n <p>This request will specifically update the <tt class=\"docutils literal\">num_complete</tt> and\n <tt class=\"docutils literal\">num_incomplete</tt> fields in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> struct once it\n completes. When it completes, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_reply_alert\">scrape_reply_alert</a>.\n If it fails, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_failed_alert\">scrape_failed_alert</a>.</p>\n-<a name=\"download_limit()\"></a>\n <a name=\"set_upload_limit()\"></a>\n <a name=\"upload_limit()\"></a>\n-<a name=\"set_download_limit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bdownload_limit%28%29+set_upload_limit%28%29+upload_limit%28%29+set_download_limit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bdownload_limit%28%29+set_upload_limit%28%29+upload_limit%28%29+set_download_limit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"download-limit-set-upload-limit-upload-limit-set-download-limit\">\n-<h2>download_limit() set_upload_limit() upload_limit() set_download_limit()</h2>\n+<a name=\"download_limit()\"></a>\n+<a name=\"set_download_limit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_upload_limit%28%29+upload_limit%28%29+download_limit%28%29+set_download_limit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_upload_limit%28%29+upload_limit%28%29+download_limit%28%29+set_download_limit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-upload-limit-upload-limit-download-limit-set-download-limit\">\n+<h2>set_upload_limit() upload_limit() download_limit() set_download_limit()</h2>\n <pre class=\"literal-block\">\n-int <strong>upload_limit</strong> () const;\n void <strong>set_download_limit</strong> (int limit) const;\n-int <strong>download_limit</strong> () const;\n+int <strong>upload_limit</strong> () const;\n void <strong>set_upload_limit</strong> (int limit) const;\n+int <strong>download_limit</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">set_upload_limit</tt> 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 <tt class=\"docutils literal\">set_download_limit</tt> 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@@ -1203,16 +1203,16 @@\n <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n <p><tt class=\"docutils literal\">max_uploads()</tt> returns the current settings.</p>\n <a name=\"set_max_connections()\"></a>\n <a name=\"max_connections()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_max_connections%28%29+max_connections%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_max_connections%28%29+max_connections%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"set-max-connections-max-connections\">\n <h2>set_max_connections() max_connections()</h2>\n <pre class=\"literal-block\">\n-int <strong>max_connections</strong> () const;\n void <strong>set_max_connections</strong> (int max_connections) const;\n+int <strong>max_connections</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">set_max_connections()</tt> sets the maximum number of connection this\n torrent will open. If all connections are used up, incoming\n connections may be refused or poor connections may be closed. This\n must be at least 2. The default is unlimited number of connections. If\n -1 is given to the function, it means unlimited. There is also a\n global limit of the number of connections, set by\n@@ -1275,37 +1275,37 @@\n <h2>rename_file()</h2>\n <pre class=\"literal-block\">\n void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n </pre>\n <p>Renames the file with the given index asynchronously. The rename\n operation is complete when either a <a class=\"reference external\" href=\"reference-Alerts.html#file_renamed_alert\">file_renamed_alert</a> or\n <a class=\"reference external\" href=\"reference-Alerts.html#file_rename_failed_alert\">file_rename_failed_alert</a> is posted.</p>\n-<a name=\"info_hash()\"></a>\n-<a name=\"info_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Binfo_hash%28%29+info_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Binfo_hash%28%29+info_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hash-info-hashes\">\n-<h2>info_hash() info_hashes()</h2>\n+<a name=\"info_hashes()\"></a>\n+<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info-hashes-info-hash\">\n+<h2>info_hashes() info_hash()</h2>\n <pre class=\"literal-block\">\n sha1_hash <strong>info_hash</strong> () const;\n info_hash_t <strong>info_hashes</strong> () const;\n </pre>\n <p>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 <tt class=\"docutils literal\">info_hash()</tt> 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 <tt class=\"docutils literal\">info_hashes()</tt> instead.</p>\n-<a name=\"operator<()\"></a>\n <a name=\"operator!=()\"></a>\n-<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boperator%3C%28%29+operator%21%3D%28%29+operator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boperator%3C%28%29+operator%21%3D%28%29+operator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"operator<()\"></a>\n+<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3C%28%29+operator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3C%28%29+operator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"operator-operator-operator\">\n-<h2>operator<() operator!=() operator==()</h2>\n+<h2>operator!=() operator<() operator==()</h2>\n <pre class=\"literal-block\">\n+bool <strong>operator==</strong> (const torrent_handle& h) const;\n bool <strong>operator!=</strong> (const torrent_handle& h) const;\n bool <strong>operator<</strong> (const torrent_handle& h) const;\n-bool <strong>operator==</strong> (const torrent_handle& h) const;\n </pre>\n <p>comparison operators. The order of the torrents is unspecified\n but stable.</p>\n <a name=\"id()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"id\">\n <h2>id()</h2>\n <pre class=\"literal-block\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -9,67 +9,67 @@\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 _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\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__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\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 _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n- o _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+ o _\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(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)\n- _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)\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__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)\n+ _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)\n o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bs_\be_\bt_\b(_\b)\n- o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\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 _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)\n+ o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n- o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n+ o _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n- o _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\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__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\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 _\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_\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 [_\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- _\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+ _\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@@ -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-_\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+_\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@@ -181,114 +181,114 @@\n t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be () noexcept = default;\n void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, std::vector<char> data,\n add_piece_flags_t flags = {}) const;\n void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t\n flags = {}) const;\n void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n- void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector<peer_info>& v) const;\n+ void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector<partial_piece_info>& 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<partial_piece_info> g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n+ void 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 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 f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector<std::int64_t>& 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<std::int64_t> 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<open_file_state> 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 r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector<announce_entry> const&) const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n std::vector<announce_entry> 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<announce_entry> const&) const;\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ void a\bad\bdd\bd_\b_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<std::string> 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- std::set<std::string> 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+ std::set<std::string> h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n std::function<std::shared_ptr<torrent_plugin>(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<char const> metadata) const;\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n void r\bre\bes\bsu\bum\bme\be () const;\n- void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) 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+ torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n void s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags = {}) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n- void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n- void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_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_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n- std::shared_ptr<const torrent_info> t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () 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 std::shared_ptr<torrent_info> 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<const torrent_info> t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n std::vector<std::vector<sha256_hash>> 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<int>& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+ void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector<int>& 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+ 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<download_priority_t> const& pieces)\n const;\n- std::vector<download_priority_t> 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<std::pair<piece_index_t,\n download_priority_t>> const& pieces) const;\n- void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority)\n-const;\n- download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n+ std::vector<download_priority_t> 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<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n- void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector<download_priority_t> 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_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+ void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n+ void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+ void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n- int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n+ int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+ int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void c\bco\bon\bnn\bne\bec\bct\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& adr, peer_source_flags_t source = {}\n , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n void c\bcl\ble\bea\bar\br_\b_p\bpe\bee\ber\brs\bs ();\n int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs (int max_uploads) const;\n- int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+ int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n void m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (std::string const& save_path\n , move_flags_t flags = move_flags_t::always_replace_files\n ) const;\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n 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<torrent> 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@@ -355,27 +355,27 @@\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-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<peer_info>& v) const;\n+void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n Query information about connected peers for this torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n is invalid, it will throw a system_error exception.\n post_peer_info() is asynchronous and will trigger the posting of a\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt. The _\ba_\bl_\be_\br_\bt contain a list of _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo objects, one for each\n connected peer.\n get_peer_info() is synchronous and takes a reference to a vector that will be\n cleared and filled with one _\be_\bn_\bt_\br_\by for each peer connected to this torrent,\n given the handle is valid. Each _\be_\bn_\bt_\br_\by in the vector contains information about\n that particular peer. See _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bst\bta\bat\btu\bus\bs(\b()\b) p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n status() will return a structure with information about the status of this\n torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is invalid, it will throw system_error\n exception. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. The flags argument filters what information is\n returned in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. Some information in there is relatively\n expensive to calculate, and if you're not interested in it (and see performance\n@@ -395,19 +395,19 @@\n std::vector<partial_piece_info> g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n post_download_queue() triggers a download_queue_alert to be posted.\n get_download_queue() is a synchronous call and returns a vector with\n information about pieces that are partially downloaded or not downloaded but\n partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n vector.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n+void 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 r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n-void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n This function sets or resets the deadline associated with a specific piece\n index (index). libtorrent will attempt to download this entire piece before the\n deadline expires. This is not necessarily possible, but pieces with a more\n recent deadline will always be prioritized over pieces with a deadline further\n ahead in time. The deadline (and flags) of a piece can be changed by calling\n this function again.\n If the piece is already downloaded when this call is made, nothing happens,\n@@ -415,15 +415,15 @@\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* 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+*\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<std::int64_t>& progress, file_progress_flags_t\n flags = {}) const;\n void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n std::vector<std::int64_t> 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@@ -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* 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) p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector<announce_entry> const&) const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n std::vector<announce_entry> 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<announce_entry> const&) const;\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n trackers() returns the list of trackers for this torrent. The announce _\be_\bn_\bt_\br_\by\n contains both a string url which specify the announce url for the tracker as\n well as an _\bi_\bn_\bt tier, which is specifies the order in which this tracker is\n tried. If you want libtorrent to use another list of trackers for this torrent,\n you can use replace_trackers() which takes a list of the same form as the one\n returned from trackers() and will replace it. If you want an immediate effect,\n@@ -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* 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+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n std::set<std::string> 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* 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<std::string> h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n+*\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) 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 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<std::string> h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n These functions are identical as the *_url_seed() variants, but they operate on\n _\bB_\bE_\bP_\b _\b1_\b7 web seeds instead of _\bB_\bE_\bP_\b _\b1_\b9.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n std::function<std::shared_ptr<torrent_plugin>(torrent_handle const&,\n@@ -524,15 +524,15 @@\n and false afterward.\n Clients should only use _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) to determine if the result of session::\n find_torrent() was successful.\n Unlike other member functions which return a value, _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) completes\n immediately, without blocking on a result from the network thread. Also unlike\n other functions, it never throws the system_error exception.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n void 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@@ -541,19 +541,19 @@\n for the torrent_status::paused flag.\n Note\n Torrents that are auto-managed may be automatically resumed again. It does not\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more\n information, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n-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+*\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 u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n+void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n sets and gets the torrent state flags. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt. The set_flags\n overload that take a mask will affect all flags part of the mask, and set their\n values to what the flags argument is set to. This allows clearing and setting\n flags in a single function call. The set_flags overload that just takes flags,\n sets all the specified flags and leave any other flags unchanged. unset_flags\n clears the specified flags, while leaving any other flags unchanged.\n Theseed_modeflag is special, it can only be cleared once the torrent has been\n@@ -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_d\bdo\bow\bwn\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b)\n-q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n-void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n+*\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_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b)\n+q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n+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@@ -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,17 +734,17 @@\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()\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<const torrent_info> t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n std::shared_ptr<torrent_info> 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<const torrent_info> 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@@ -771,32 +771,32 @@\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector<std::vector<sha256_hash>> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n returns the piece layers for all files in the torrent. If this is a v1 torrent\n (and doesn't have any piece layers) it returns an empty vector. This is a\n blocking call that will synchronize with the libtorrent network thread.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector<int>& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector<int>& 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<int> with the availability\n for each piece in this torrent. libtorrent does not keep track of availability\n for seeds, so if the torrent is seeding the availability for all pieces is\n reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n+download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector<download_priority_t> const& pieces) const;\n-std::vector<download_priority_t> 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<std::pair<piece_index_t,\n download_priority_t>> const& pieces) const;\n-void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n-download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n+std::vector<download_priority_t> 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@@ -816,19 +816,19 @@\n where the piece index or priority is out of range, are not allowed.\n get_piece_priorities returns a vector with one element for each piece in the\n torrent. Each element is the current priority of that piece.\n It's possible to cancel the effect of f\bfi\bil\ble\be priorities by setting the priorities\n for the affected pieces. Care has to be taken when mixing usage of file- and\n piece priorities.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector<download_priority_t> 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\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_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_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n-void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t = {})\n const;\n+void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n force_reannounce() will force this torrent to do another tracker request, to\n receive new peers. The seconds argument specifies how many seconds from now to\n issue the tracker announces.\n If the tracker's min_interval has not passed since the last announce, the\n forced announce will be scheduled to happen immediately as the min_interval\n expires. This is to honor trackers minimum re-announce interval settings.\n The tracker_index argument specifies which tracker to re-announce. If set to -\n@@ -877,20 +877,20 @@\n A scrape request queries the tracker for statistics such as total number of\n incomplete peers, complete peers, number of downloads etc.\n This request will specifically update the num_complete and num_incomplete\n fields in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs struct once it completes. When it completes, it\n will generate a _\bs_\bc_\br_\ba_\bp_\be_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt. If it fails, it will generate a\n _\bs_\bc_\br_\ba_\bp_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) 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)\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+int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n 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@@ -923,16 +923,16 @@\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 void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n set_max_connections() sets the maximum number of connection this torrent will\n open. If all connections are used up, incoming connections may be refused or\n poor connections may be closed. This must be at least 2. The default is\n unlimited number of connections. If -1 is given to the function, it means\n unlimited. There is also a global limit of the number of connections, set by\n connections_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n max_connections() returns the current settings.\n@@ -982,27 +982,27 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n Renames the file with the given index asynchronously. The rename operation is\n complete when either a _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\bd_\b__\ba_\bl_\be_\br_\bt or _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n posted.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n returns the info-hash(es) of the torrent. If this handle is to a torrent that\n hasn't loaded yet (for instance by being added) by a URL, the returned value is\n undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes()\n instead.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+*\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-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n comparison operators. The order of the torrents is unspecified but stable.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n std::uint32_t i\bid\bd () const;\n returns a unique identifier for this torrent. It's not a dense index. It's not\n preserved across sessions.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html", "unified_diff": "@@ -41,23 +41,23 @@\n <li><a class=\"reference internal\" href=\"#load-torrent-limits\" id=\"toc-entry-5\">load_torrent_limits</a></li>\n <li><a class=\"reference internal\" href=\"#torrent-info\" id=\"toc-entry-6\">torrent_info</a><ul>\n <li><a class=\"reference internal\" href=\"#torrent-info-1\" id=\"toc-entry-7\">torrent_info()</a></li>\n <li><a class=\"reference internal\" href=\"#torrent-info-2\" id=\"toc-entry-8\">~torrent_info()</a></li>\n <li><a class=\"reference internal\" href=\"#files-orig-files\" id=\"toc-entry-9\">files() orig_files()</a></li>\n <li><a class=\"reference internal\" href=\"#rename-file\" id=\"toc-entry-10\">rename_file()</a></li>\n <li><a class=\"reference internal\" href=\"#remap-files\" id=\"toc-entry-11\">remap_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-tracker-clear-trackers-trackers\" id=\"toc-entry-12\">add_tracker() clear_trackers() trackers()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-trackers-add-tracker-trackers\" id=\"toc-entry-12\">clear_trackers() add_tracker() trackers()</a></li>\n <li><a class=\"reference internal\" href=\"#similar-torrents-collections\" id=\"toc-entry-13\">similar_torrents() collections()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-url-seed-add-http-seed-web-seeds-set-web-seeds\" id=\"toc-entry-14\">add_url_seed() add_http_seed() web_seeds() set_web_seeds()</a></li>\n+<li><a class=\"reference internal\" href=\"#web-seeds-set-web-seeds-add-http-seed-add-url-seed\" id=\"toc-entry-14\">web_seeds() set_web_seeds() add_http_seed() add_url_seed()</a></li>\n <li><a class=\"reference internal\" href=\"#total-size\" id=\"toc-entry-15\">total_size()</a></li>\n <li><a class=\"reference internal\" href=\"#num-pieces-piece-length\" id=\"toc-entry-16\">num_pieces() piece_length()</a></li>\n <li><a class=\"reference internal\" href=\"#blocks-per-piece\" id=\"toc-entry-17\">blocks_per_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#last-piece-piece-range-end-piece\" id=\"toc-entry-18\">last_piece() piece_range() end_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hash-info-hashes\" id=\"toc-entry-19\">info_hash() info_hashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#v2-v1\" id=\"toc-entry-20\">v2() v1()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-range-last-piece-end-piece\" id=\"toc-entry-18\">piece_range() last_piece() end_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hashes-info-hash\" id=\"toc-entry-19\">info_hashes() info_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#v1-v2\" id=\"toc-entry-20\">v1() v2()</a></li>\n <li><a class=\"reference internal\" href=\"#num-files\" id=\"toc-entry-21\">num_files()</a></li>\n <li><a class=\"reference internal\" href=\"#map-block\" id=\"toc-entry-22\">map_block()</a></li>\n <li><a class=\"reference internal\" href=\"#map-file\" id=\"toc-entry-23\">map_file()</a></li>\n <li><a class=\"reference internal\" href=\"#ssl-cert\" id=\"toc-entry-24\">ssl_cert()</a></li>\n <li><a class=\"reference internal\" href=\"#is-valid\" id=\"toc-entry-25\">is_valid()</a></li>\n <li><a class=\"reference internal\" href=\"#priv\" id=\"toc-entry-26\">priv()</a></li>\n <li><a class=\"reference internal\" href=\"#is-i2p\" id=\"toc-entry-27\">is_i2p()</a></li>\n@@ -197,69 +197,69 @@\n <div class=\"section\" id=\"torrent-info\">\n <h1>torrent_info</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n <p>the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> class holds the information found in a .torrent file.</p>\n <pre class=\"literal-block\">\n class torrent_info\n {\n- explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n- <strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n- <strong>torrent_info</strong> (torrent_info const& t);\n- <strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n+ <strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n <strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n- explicit <strong>torrent_info</strong> (std::string const& filename);\n <strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n- explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n- <strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n- <strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+ explicit <strong>torrent_info</strong> (std::string const& filename);\n+ <strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n <strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+ <strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n <strong>torrent_info</strong> (char const* buffer, int size);\n+ explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n+ <strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+ explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n+ <strong>torrent_info</strong> (torrent_info const& t);\n <strong>~torrent_info</strong> ();\n file_storage const& <strong>files</strong> () const;\n file_storage const& <strong>orig_files</strong> () const;\n void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n void <strong>remap_files</strong> (file_storage const& f);\n- void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n std::vector<announce_entry> const& <strong>trackers</strong> () const;\n+ void <strong>clear_trackers</strong> ();\n void <strong>add_tracker</strong> (std::string const& url, int tier\n , announce_entry::tracker_source source);\n- void <strong>clear_trackers</strong> ();\n- std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n+ void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n std::vector<std::string> <strong>collections</strong> () const;\n+ std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n+ std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n void <strong>add_http_seed</strong> (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n void <strong>add_url_seed</strong> (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n- std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n std::int64_t <strong>total_size</strong> () const;\n- int <strong>piece_length</strong> () const;\n int <strong>num_pieces</strong> () const;\n+ int <strong>piece_length</strong> () const;\n int <strong>blocks_per_piece</strong> () const;\n- piece_index_t <strong>end_piece</strong> () const;\n index_range<piece_index_t> <strong>piece_range</strong> () const;\n piece_index_t <strong>last_piece</strong> () const;\n- info_hash_t const& <strong>info_hashes</strong> () const;\n+ piece_index_t <strong>end_piece</strong> () const;\n sha1_hash <strong>info_hash</strong> () const noexcept;\n- bool <strong>v1</strong> () const;\n+ info_hash_t const& <strong>info_hashes</strong> () const;\n bool <strong>v2</strong> () const;\n+ bool <strong>v1</strong> () const;\n int <strong>num_files</strong> () const;\n std::vector<file_slice> <strong>map_block</strong> (piece_index_t const piece\n , std::int64_t offset, int size) const;\n peer_request <strong>map_file</strong> (file_index_t const file, std::int64_t offset, int size) const;\n string_view <strong>ssl_cert</strong> () const;\n bool <strong>is_valid</strong> () const;\n bool <strong>priv</strong> () const;\n bool <strong>is_i2p</strong> () const;\n int <strong>piece_size</strong> (piece_index_t index) const;\n- char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n+ char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n bool <strong>is_loaded</strong> () const;\n const std::string& <strong>name</strong> () const;\n std::time_t <strong>creation_date</strong> () const;\n const std::string& <strong>creator</strong> () const;\n const std::string& <strong>comment</strong> () const;\n std::vector<std::pair<std::string, int>> const& <strong>nodes</strong> () const;\n void <strong>add_node</strong> (std::pair<std::string, int> const& node);\n@@ -269,27 +269,27 @@\n span<char const> <strong>piece_layer</strong> (file_index_t) const;\n void <strong>free_piece_layers</strong> ();\n };\n </pre>\n <a name=\"torrent_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Btorrent_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Btorrent_info%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"torrent-info-1\">\n <h2>torrent_info()</h2>\n <pre class=\"literal-block\">\n-explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n-<strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n-<strong>torrent_info</strong> (torrent_info const& t);\n-<strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n+<strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n <strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n-explicit <strong>torrent_info</strong> (std::string const& filename);\n <strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n-explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n-<strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n-<strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+explicit <strong>torrent_info</strong> (std::string const& filename);\n+<strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n <strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+<strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n <strong>torrent_info</strong> (char const* buffer, int size);\n+explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n+<strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n+<strong>torrent_info</strong> (torrent_info const& t);\n </pre>\n <p>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.</p>\n <p>The constructor that takes a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> will create a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n@@ -348,15 +348,15 @@\n <pre class=\"literal-block\">\n void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n </pre>\n <p>Renames the file with the specified index to the new name. The new\n filename is reflected by the <tt class=\"docutils literal\">file_storage</tt> returned by <tt class=\"docutils literal\">files()</tt>\n but not by the one returned by <tt class=\"docutils literal\">orig_files()</tt>.</p>\n <p>If you want to rename the base name of the torrent (for a multi file\n-torrent), you can copy the <tt class=\"docutils literal\">file_storage</tt> (see <a class=\"reference external\" href=\"reference-Create_Torrents.html#files()\">files()</a> and\n+torrent), you can copy the <tt class=\"docutils literal\">file_storage</tt> (see <a class=\"reference external\" href=\"reference-Torrent_Info.html#files()\">files()</a> and\n <a class=\"reference external\" href=\"reference-Torrent_Info.html#orig_files()\">orig_files()</a> ), change the name, and then use <a class=\"reference internal\" href=\"#remap-files\">remap_files()</a>.</p>\n <p>The <tt class=\"docutils literal\">new_filename</tt> can both be a relative path, in which case the\n file name is relative to the <tt class=\"docutils literal\">save_path</tt> of the torrent. If the\n <tt class=\"docutils literal\">new_filename</tt> is an absolute path (i.e. <tt class=\"docutils literal\">is_complete(new_filename)\n == true</tt>), then the file is detached from the <tt class=\"docutils literal\">save_path</tt> of the\n torrent. In this case the file is not moved when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#move_storage()\">move_storage()</a> is\n invoked.</p>\n@@ -376,25 +376,25 @@\n </div>\n <p>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.</p>\n <p>The new specified <tt class=\"docutils literal\">file_storage</tt> must have the exact same size as\n the current one.</p>\n-<a name=\"add_tracker()\"></a>\n <a name=\"clear_trackers()\"></a>\n-<a name=\"trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_tracker%28%29+clear_trackers%28%29+trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_tracker%28%29+clear_trackers%28%29+trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-tracker-clear-trackers-trackers\">\n-<h2>add_tracker() clear_trackers() trackers()</h2>\n+<a name=\"add_tracker()\"></a>\n+<a name=\"trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bclear_trackers%28%29+add_tracker%28%29+trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bclear_trackers%28%29+add_tracker%28%29+trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-trackers-add-tracker-trackers\">\n+<h2>clear_trackers() add_tracker() trackers()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n std::vector<announce_entry> const& <strong>trackers</strong> () const;\n+void <strong>clear_trackers</strong> ();\n void <strong>add_tracker</strong> (std::string const& url, int tier\n , announce_entry::tracker_source source);\n-void <strong>clear_trackers</strong> ();\n+void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n </pre>\n <p><tt class=\"docutils literal\">add_tracker()</tt> adds a tracker to the announce-list. The <tt class=\"docutils literal\">tier</tt>\n determines the order in which the trackers are to be tried.\n The <tt class=\"docutils literal\">trackers()</tt> function will return a sorted vector of\n <a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>. Each announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> contains a string, which is\n the tracker url, and a tier index. The tier index is the high-level\n priority. No matter which trackers that works or not, the ones with\n@@ -403,37 +403,37 @@\n <p><tt class=\"docutils literal\">trackers()</tt> returns all entries from announce-list.</p>\n <p><tt class=\"docutils literal\">clear_trackers()</tt> removes all trackers from announce-list.</p>\n <a name=\"similar_torrents()\"></a>\n <a name=\"collections()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bsimilar_torrents%28%29+collections%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bsimilar_torrents%28%29+collections%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"similar-torrents-collections\">\n <h2>similar_torrents() collections()</h2>\n <pre class=\"literal-block\">\n-std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n std::vector<std::string> <strong>collections</strong> () const;\n+std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n </pre>\n <p>These two functions are related to <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a> (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.</p>\n-<a name=\"add_url_seed()\"></a>\n-<a name=\"add_http_seed()\"></a>\n <a name=\"web_seeds()\"></a>\n-<a name=\"set_web_seeds()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29+web_seeds%28%29+set_web_seeds%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29+web_seeds%28%29+set_web_seeds%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-url-seed-add-http-seed-web-seeds-set-web-seeds\">\n-<h2>add_url_seed() add_http_seed() web_seeds() set_web_seeds()</h2>\n+<a name=\"set_web_seeds()\"></a>\n+<a name=\"add_http_seed()\"></a>\n+<a name=\"add_url_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bweb_seeds%28%29+set_web_seeds%28%29+add_http_seed%28%29+add_url_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bweb_seeds%28%29+set_web_seeds%28%29+add_http_seed%28%29+add_url_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"web-seeds-set-web-seeds-add-http-seed-add-url-seed\">\n+<h2>web_seeds() set_web_seeds() add_http_seed() add_url_seed()</h2>\n <pre class=\"literal-block\">\n+std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n void <strong>add_http_seed</strong> (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n void <strong>add_url_seed</strong> (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">web_seeds()</tt> returns all url seeds and http seeds in the torrent.\n Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is a <tt class=\"docutils literal\">web_seed_entry</tt> and may refer to either a url seed\n or http seed.</p>\n <p><tt class=\"docutils literal\">add_url_seed()</tt> and <tt class=\"docutils literal\">add_http_seed()</tt> adds one url to the list of\n url/http seeds.</p>\n <p><tt class=\"docutils literal\">set_web_seeds()</tt> replaces all web seeds with the ones specified in\n@@ -458,16 +458,16 @@\n the total size will be larger than the sum of all (regular) file\n sizes.</p>\n <a name=\"num_pieces()\"></a>\n <a name=\"piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnum_pieces%28%29+piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnum_pieces%28%29+piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"num-pieces-piece-length\">\n <h2>num_pieces() piece_length()</h2>\n <pre class=\"literal-block\">\n-int <strong>piece_length</strong> () const;\n int <strong>num_pieces</strong> () const;\n+int <strong>piece_length</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">piece_length()</tt> and <tt class=\"docutils literal\">num_pieces()</tt> returns the number of byte\n for each piece and the total number of pieces, respectively. The\n difference between <tt class=\"docutils literal\">piece_size()</tt> and <tt class=\"docutils literal\">piece_length()</tt> is that\n <tt class=\"docutils literal\">piece_size()</tt> takes the piece index as argument and gives you the\n exact size of that piece. It will always be the same as\n <tt class=\"docutils literal\">piece_length()</tt> except in the case of the last piece, which may be\n@@ -476,48 +476,48 @@\n <div class=\"section\" id=\"blocks-per-piece\">\n <h2>blocks_per_piece()</h2>\n <pre class=\"literal-block\">\n int <strong>blocks_per_piece</strong> () const;\n </pre>\n <p>returns the number of blocks there are in the typical piece. There\n may be fewer in the last piece)</p>\n-<a name=\"last_piece()\"></a>\n <a name=\"piece_range()\"></a>\n-<a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Blast_piece%28%29+piece_range%28%29+end_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Blast_piece%28%29+piece_range%28%29+end_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"last-piece-piece-range-end-piece\">\n-<h2>last_piece() piece_range() end_piece()</h2>\n+<a name=\"last_piece()\"></a>\n+<a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_range%28%29+last_piece%28%29+end_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_range%28%29+last_piece%28%29+end_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-range-last-piece-end-piece\">\n+<h2>piece_range() last_piece() end_piece()</h2>\n <pre class=\"literal-block\">\n-piece_index_t <strong>end_piece</strong> () const;\n index_range<piece_index_t> <strong>piece_range</strong> () const;\n piece_index_t <strong>last_piece</strong> () const;\n+piece_index_t <strong>end_piece</strong> () const;\n </pre>\n <p><tt class=\"docutils literal\">last_piece()</tt> returns the index to the last piece in the torrent and\n <tt class=\"docutils literal\">end_piece()</tt> returns the index to the one-past-end piece in the\n torrent\n <tt class=\"docutils literal\">piece_range()</tt> 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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"info_hash()\"></a>\n-<a name=\"info_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_hash%28%29+info_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_hash%28%29+info_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hash-info-hashes\">\n-<h2>info_hash() info_hashes()</h2>\n+<a name=\"info_hashes()\"></a>\n+<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info-hashes-info-hash\">\n+<h2>info_hashes() info_hash()</h2>\n <pre class=\"literal-block\">\n-info_hash_t const& <strong>info_hashes</strong> () const;\n sha1_hash <strong>info_hash</strong> () const noexcept;\n+info_hash_t const& <strong>info_hashes</strong> () const;\n </pre>\n <p>returns the info-hash of the torrent. For BitTorrent v2 support, use\n <tt class=\"docutils literal\">info_hashes()</tt> to get an object that may hold both a v1 and v2\n info-hash</p>\n-<a name=\"v2()\"></a>\n-<a name=\"v1()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bv2%28%29+v1%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bv2%28%29+v1%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"v2-v1\">\n-<h2>v2() v1()</h2>\n+<a name=\"v1()\"></a>\n+<a name=\"v2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"v1-v2\">\n+<h2>v1() v2()</h2>\n <pre class=\"literal-block\">\n-bool <strong>v1</strong> () const;\n bool <strong>v2</strong> () const;\n+bool <strong>v1</strong> () const;\n </pre>\n <p>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.</p>\n <a name=\"num_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnum_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnum_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"num-files\">\n <h2>num_files()</h2>\n@@ -588,23 +588,23 @@\n to peers over anything other than the i2p network.</p>\n <a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"piece-size\">\n <h2>piece_size()</h2>\n <pre class=\"literal-block\">\n int <strong>piece_size</strong> (piece_index_t index) const;\n </pre>\n-<p>returns the piece size of file with <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Create_Torrents.html#piece_length()\">piece_length()</a>,\n+<p>returns the piece size of file with <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Storage.html#piece_length()\">piece_length()</a>,\n except for the last piece, which may be shorter.</p>\n <a name=\"hash_for_piece()\"></a>\n <a name=\"hash_for_piece_ptr()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bhash_for_piece%28%29+hash_for_piece_ptr%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bhash_for_piece%28%29+hash_for_piece_ptr%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"hash-for-piece-hash-for-piece-ptr\">\n <h2>hash_for_piece() hash_for_piece_ptr()</h2>\n <pre class=\"literal-block\">\n-char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n+char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n </pre>\n <p><tt class=\"docutils literal\">hash_for_piece()</tt> takes a piece-index and returns the 20-bytes\n sha1-hash for that piece and <tt class=\"docutils literal\">info_hash()</tt> returns the 20-bytes\n sha1-hash for the info-section of the torrent file.\n <tt class=\"docutils literal\">hash_for_piece_ptr()</tt> returns a pointer to the 20 byte sha1 digest\n for the piece. Note that the string is not 0-terminated.</p>\n <a name=\"name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bname%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bname%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -10,23 +10,23 @@\n * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\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_\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 _\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)_\b _\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n+ o _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bv_\b2_\b(_\b)_\b _\bv_\b1_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\bv_\b1_\b(_\b)_\b _\bv_\b2_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bp_\br_\bi_\bv_\b(_\b)\n o _\bi_\bs_\b__\bi_\b2_\bp_\b(_\b)\n@@ -120,74 +120,74 @@\n the max number of bdecode tokens\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n class torrent_info\n {\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, error_code& ec, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, 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 (bdecode_node const& torrent_file, load_torrent_limits const&\n cfg);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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- 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 (char const* buffer, int size, error_code& ec);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (span<char const> 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 (bdecode_node const& torrent_file);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\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& f\bfi\bil\ble\bes\bs () const;\n file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n std::vector<announce_entry> const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\n- void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n- std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n std::vector<std::string> c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+ std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ std::vector<web_seed_entry> 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<web_seed_entry> seeds);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n headers_t());\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n- std::vector<web_seed_entry> const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n- piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n index_range<piece_index_t> 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+ piece_index_t e\ben\bnd\bd_\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<file_slice> 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+ 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<std::pair<std::string, int>> const& n\bno\bod\bde\bes\bs () const;\n void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> const& node);\n@@ -196,29 +196,29 @@\n bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n span<char const> i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n span<char const> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, error_code& ec, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, 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 (bdecode_node const& torrent_file, load_torrent_limits const&\n cfg);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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-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 (char const* buffer, int size, error_code& ec);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (span<char const> 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 (bdecode_node const& torrent_file);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\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@@ -284,49 +284,49 @@\n Remaps the file storage to a new file layout. This can be used to, for\n instance, download all data in a torrent to a single file, or to a number of\n fixed size sector aligned files, regardless of the number and sizes of the\n files in the torrent.\n The new specified file_storage must have the exact same size as the current\n one.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) 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+*\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 std::vector<announce_entry> const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\n-void 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 add_tracker() adds a tracker to the announce-list. The tier determines the\n order in which the trackers are to be tried. The trackers() function will\n return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n string, which is the tracker url, and a tier index. The tier index is the high-\n level priority. No matter which trackers that works or not, the ones with lower\n tier will always be tried before the one with higher tier number. For more\n information, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n trackers() returns all entries from announce-list.\n clear_trackers() removes all trackers from announce-list.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n std::vector<std::string> c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n returned from these correspond to the \"similar\" and \"collections\" keys in the\n .torrent file. Both info-hashes and collections from within the info-dict and\n from outside of it are included.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) 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+*\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector<web_seed_entry> 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<web_seed_entry> seeds);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& extern_auth = std::string()\n , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n headers_t());\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n-std::vector<web_seed_entry> const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n a web_seed_entry and may refer to either a url seed or http seed.\n add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n set_web_seeds() replaces all web seeds with the ones specified in the seeds\n vector.\n The extern_auth argument can be used for other authorization schemes than basic\n HTTP authorization. If set, it will override any username and password found in\n@@ -340,46 +340,46 @@\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n total_size() returns the total number of bytes the torrent-file represents.\n Note that this is the number of pieces times the piece size (modulo the last\n piece possibly being smaller). With pad files, the total size will be larger\n than the sum of all (regular) file sizes.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n piece_length() and num_pieces() returns the number of byte for each piece and\n the total number of pieces, respectively. The difference between piece_size()\n and piece_length() is that piece_size() takes the piece index as argument and\n gives you the exact size of that piece. It will always be the same as\n piece_length() except in the case of the last piece, which may be smaller.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n returns the number of blocks there are in the typical piece. There may be fewer\n in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+*\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 index_range<piece_index_t> 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 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+*\b**\b**\b**\b**\b* v\bv1\b1(\b()\b) v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n bool v\bv2\b2 () const;\n+bool v\bv1\b1 () const;\n returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n torrents have both. These are shortcuts for info_hashes().has_v1() and\n info_hashes().has_v2() calls.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n If you need index-access to files you can use the num_files() along with the\n@@ -428,16 +428,16 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n returns the piece size of file with index. This will be the same as\n _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n-char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n+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"}]}, {"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.</dd>\n </dl>\n <a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>num_peers</dt>\n <dd>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 <a class=\"reference external\" href=\"reference-Plugins.html#get_peer_info()\">get_peer_info()</a>.</dd>\n+are visible in the peer list when you call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_peer_info()\">get_peer_info()</a>.</dd>\n </dl>\n <a name=\"num_complete\"></a>\n <a name=\"num_incomplete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>num_complete num_incomplete</dt>\n <dd>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 <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#announce-infohash\" id=\"toc-entry-1\">announce_infohash</a></li>\n <li><a class=\"reference internal\" href=\"#announce-endpoint\" id=\"toc-entry-2\">announce_endpoint</a></li>\n <li><a class=\"reference internal\" href=\"#announce-entry\" id=\"toc-entry-3\">announce_entry</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-announce-entry-announce-entry\" id=\"toc-entry-4\">operator=() announce_entry() ~announce_entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-entry-operator-announce-entry\" id=\"toc-entry-4\">~announce_entry() operator=() announce_entry()</a></li>\n <li><a class=\"reference internal\" href=\"#enum-tracker-source\" id=\"toc-entry-5\">enum tracker_source</a></li>\n </ul>\n </li>\n </ul>\n </div>\n <a name=\"announce_infohash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_infohash&labels=documentation&body=Documentation+under+heading+%22class+announce_infohash%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"announce-infohash\">\n <h1>announce_infohash</h1>\n@@ -131,19 +131,19 @@\n <h1>announce_entry</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n <p>this class holds information about one bittorrent tracker, as it\n relates to a specific torrent.</p>\n <pre class=\"literal-block\">\n struct announce_entry\n {\n- <strong>~announce_entry</strong> ();\n announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n- <strong>announce_entry</strong> (announce_entry const&);\n explicit <strong>announce_entry</strong> (string_view u);\n+ <strong>~announce_entry</strong> ();\n <strong>announce_entry</strong> ();\n+ <strong>announce_entry</strong> (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 <strong>tier</strong> = 0;\n std::uint8_t <strong>fail_limit</strong> = 0;\n std::uint8_t source:4;\n bool verified:1;\n };\n </pre>\n+<a name=\"~announce_entry()\"></a>\n <a name=\"operator=()\"></a>\n-<a name=\"announce_entry()\"></a>\n-<a name=\"~announce_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Boperator%3D%28%29+announce_entry%28%29+~announce_entry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Boperator%3D%28%29+announce_entry%28%29+~announce_entry%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-announce-entry-announce-entry\">\n-<h2>operator=() announce_entry() ~announce_entry()</h2>\n+<a name=\"announce_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5B~announce_entry%28%29+operator%3D%28%29+announce_entry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5B~announce_entry%28%29+operator%3D%28%29+announce_entry%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"announce-entry-operator-announce-entry\">\n+<h2>~announce_entry() operator=() announce_entry()</h2>\n <pre class=\"literal-block\">\n-<strong>~announce_entry</strong> ();\n announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n-<strong>announce_entry</strong> (announce_entry const&);\n explicit <strong>announce_entry</strong> (string_view u);\n+<strong>~announce_entry</strong> ();\n <strong>announce_entry</strong> ();\n+<strong>announce_entry</strong> (announce_entry const&);\n </pre>\n <p>constructs a tracker announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> with <tt class=\"docutils literal\">u</tt> as the URL.</p>\n <a name=\"tracker_source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+tracker_source&labels=documentation&body=Documentation+under+heading+%22enum+tracker_source%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-tracker-source\">\n <h2>enum tracker_source</h2>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n@@ -189,15 +189,15 @@\n <tbody valign=\"top\">\n <tr><td>source_torrent</td>\n <td>1</td>\n <td>the tracker was part of the .torrent file</td>\n </tr>\n <tr><td>source_client</td>\n <td>2</td>\n-<td>the tracker was added programmatically via the <a class=\"reference external\" href=\"reference-Create_Torrents.html#add_tracker()\">add_tracker()</a> function</td>\n+<td>the tracker was added programmatically via the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_tracker()\">add_tracker()</a> function</td>\n </tr>\n <tr><td>source_magnet_link</td>\n <td>4</td>\n <td>the tracker was part of a magnet link</td>\n </tr>\n <tr><td>source_tex</td>\n <td>8</td>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,15 +2,15 @@\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\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 _\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)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n struct announce_infohash\n {\n std::string message;\n@@ -78,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- ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+ ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n \n enum tracker_source\n {\n source_torrent,\n source_client,\n source_magnet_link,\n source_tex,\n@@ -101,20 +101,20 @@\n std::vector<announce_endpoint> 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) 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-~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\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) 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**\b**\b**\b**\b*\n announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n constructs a tracker announce _\be_\bn_\bt_\br_\by with u as the URL.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\btr\bra\bac\bck\bke\ber\br_\b_s\bso\bou\bur\brc\bce\be *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bo_\bu_\br_\bc_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "unified_diff": "@@ -29,22 +29,22 @@\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n <li><a class=\"reference internal\" href=\"#hasher\" id=\"toc-entry-1\">hasher</a><ul>\n-<li><a class=\"reference internal\" href=\"#hasher-operator\" id=\"toc-entry-2\">hasher() operator=()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-hasher\" id=\"toc-entry-2\">operator=() hasher()</a></li>\n <li><a class=\"reference internal\" href=\"#update\" id=\"toc-entry-3\">update()</a></li>\n <li><a class=\"reference internal\" href=\"#final\" id=\"toc-entry-4\">final()</a></li>\n <li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-5\">reset()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#hasher256\" id=\"toc-entry-6\">hasher256</a><ul>\n-<li><a class=\"reference internal\" href=\"#hasher256-operator\" id=\"toc-entry-7\">hasher256() operator=()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-hasher256\" id=\"toc-entry-7\">operator=() hasher256()</a></li>\n <li><a class=\"reference internal\" href=\"#update-1\" id=\"toc-entry-8\">update()</a></li>\n <li><a class=\"reference internal\" href=\"#final-1\" id=\"toc-entry-9\">final()</a></li>\n <li><a class=\"reference internal\" href=\"#reset-1\" id=\"toc-entry-10\">reset()</a></li>\n </ul>\n </li>\n <li><a class=\"reference internal\" href=\"#bitfield\" id=\"toc-entry-11\">bitfield</a><ul>\n <li><a class=\"reference internal\" href=\"#bitfield-1\" id=\"toc-entry-12\">bitfield()</a></li>\n@@ -82,32 +82,32 @@\n <p>The built-in software version of sha1-algorithm was implemented\n by Steve Reid and released as public domain.\n For more info, see <tt class=\"docutils literal\">src/sha1.cpp</tt>.</p>\n <pre class=\"literal-block\">\n class hasher\n {\n <strong>hasher</strong> ();\n- hasher& <strong>operator=</strong> (hasher const&) &;\n <strong>hasher</strong> (char const* data, int len);\n- <strong>hasher</strong> (hasher const&);\n explicit <strong>hasher</strong> (span<char const> data);\n+ hasher& <strong>operator=</strong> (hasher const&) &;\n+ <strong>hasher</strong> (hasher const&);\n hasher& <strong>update</strong> (span<char const> data);\n hasher& <strong>update</strong> (char const* data, int len);\n sha1_hash <strong>final</strong> ();\n void <strong>reset</strong> ();\n };\n </pre>\n-<a name=\"hasher()\"></a>\n-<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bhasher%28%29+operator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bhasher%28%29+operator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"hasher-operator\">\n-<h2>hasher() operator=()</h2>\n+<a name=\"operator=()\"></a>\n+<a name=\"hasher()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher\">\n+<h2>operator=() hasher()</h2>\n <pre class=\"literal-block\">\n-hasher& <strong>operator=</strong> (hasher const&) &;\n <strong>hasher</strong> (char const* data, int len);\n-<strong>hasher</strong> (hasher const&);\n explicit <strong>hasher</strong> (span<char const> data);\n+hasher& <strong>operator=</strong> (hasher const&) &;\n+<strong>hasher</strong> (hasher const&);\n </pre>\n <p>this is the same as default constructing followed by a call to\n <tt class=\"docutils literal\">update(data, len)</tt>.</p>\n <a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"update\">\n <h2>update()</h2>\n <pre class=\"literal-block\">\n@@ -136,33 +136,33 @@\n <div class=\"section\" id=\"hasher256\">\n <h1>hasher256</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/hasher.hpp\">libtorrent/hasher.hpp</a>"</p>\n <pre class=\"literal-block\">\n class hasher256\n {\n <strong>hasher256</strong> ();\n+ <strong>hasher256</strong> (hasher256 const&);\n hasher256& <strong>operator=</strong> (hasher256 const&) &;\n <strong>hasher256</strong> (char const* data, int len);\n explicit <strong>hasher256</strong> (span<char const> data);\n- <strong>hasher256</strong> (hasher256 const&);\n hasher256& <strong>update</strong> (char const* data, int len);\n hasher256& <strong>update</strong> (span<char const> data);\n sha256_hash <strong>final</strong> ();\n void <strong>reset</strong> ();\n <strong>~hasher256</strong> ();\n };\n </pre>\n-<a name=\"hasher256()\"></a>\n-<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bhasher256%28%29+operator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bhasher256%28%29+operator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"hasher256-operator\">\n-<h2>hasher256() operator=()</h2>\n+<a name=\"operator=()\"></a>\n+<a name=\"hasher256()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher256\">\n+<h2>operator=() hasher256()</h2>\n <pre class=\"literal-block\">\n+<strong>hasher256</strong> (hasher256 const&);\n hasher256& <strong>operator=</strong> (hasher256 const&) &;\n <strong>hasher256</strong> (char const* data, int len);\n explicit <strong>hasher256</strong> (span<char const> data);\n-<strong>hasher256</strong> (hasher256 const&);\n </pre>\n <p>this is the same as default constructing followed by a call to\n <tt class=\"docutils literal\">update(data, len)</tt>.</p>\n <a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"update-1\">\n <h2>update()</h2>\n <pre class=\"literal-block\">\n@@ -192,23 +192,23 @@\n <h1>bitfield</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bitfield.hpp\">libtorrent/bitfield.hpp</a>"</p>\n <p>The <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> type stores any number of bits as a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n in a heap allocated array.</p>\n <pre class=\"literal-block\">\n struct bitfield\n {\n- explicit <strong>bitfield</strong> (int bits);\n <strong>bitfield</strong> () noexcept = default;\n- <strong>bitfield</strong> (char const* b, int bits);\n- <strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n- <strong>bitfield</strong> (bitfield const& rhs);\n <strong>bitfield</strong> (int bits, bool val);\n+ explicit <strong>bitfield</strong> (int bits);\n+ <strong>bitfield</strong> (bitfield const& rhs);\n+ <strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n+ <strong>bitfield</strong> (char const* b, int bits);\n void <strong>assign</strong> (char const* b, int const bits);\n- bool <strong>operator[]</strong> (int index) const noexcept;\n bool <strong>get_bit</strong> (int index) const noexcept;\n+ bool <strong>operator[]</strong> (int index) const noexcept;\n void <strong>clear_bit</strong> (int index) noexcept;\n void <strong>set_bit</strong> (int index) noexcept;\n bool <strong>all_set</strong> () const noexcept;\n bool <strong>none_set</strong> () const noexcept;\n int <strong>size</strong> () const noexcept;\n int <strong>num_words</strong> () const noexcept;\n int <strong>num_bytes</strong> () const noexcept;\n@@ -221,20 +221,20 @@\n int <strong>find_last_clear</strong> () const noexcept;\n bool <strong>operator==</strong> (lt::bitfield const& rhs) const;\n };\n </pre>\n <a name=\"bitfield()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bbitfield%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bbitfield%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bitfield-1\">\n <h2>bitfield()</h2>\n <pre class=\"literal-block\">\n-explicit <strong>bitfield</strong> (int bits);\n <strong>bitfield</strong> () noexcept = default;\n-<strong>bitfield</strong> (char const* b, int bits);\n-<strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n-<strong>bitfield</strong> (bitfield const& rhs);\n <strong>bitfield</strong> (int bits, bool val);\n+explicit <strong>bitfield</strong> (int bits);\n+<strong>bitfield</strong> (bitfield const& rhs);\n+<strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n+<strong>bitfield</strong> (char const* b, int bits);\n </pre>\n <p>constructs a new <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. The default constructor creates an empty\n <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. <tt class=\"docutils literal\">bits</tt> is the size of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> (specified in bits).\n <tt class=\"docutils literal\">val</tt> is the value to initialize the bits to. If not specified\n all bits are initialized to 0.</p>\n <p>The constructor taking a pointer <tt class=\"docutils literal\">b</tt> and <tt class=\"docutils literal\">bits</tt> copies a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n from the specified buffer, and <tt class=\"docutils literal\">bits</tt> number of bits (rounded up to\n@@ -248,16 +248,16 @@\n <p>copy <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> from buffer <tt class=\"docutils literal\">b</tt> of <tt class=\"docutils literal\">bits</tt> number of bits, rounded up to\n the nearest byte boundary.</p>\n <a name=\"get_bit()\"></a>\n <a name=\"operator[]()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bget_bit%28%29+operator%5B%5D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bget_bit%28%29+operator%5B%5D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"get-bit-operator\">\n <h2>get_bit() operator[]()</h2>\n <pre class=\"literal-block\">\n-bool <strong>operator[]</strong> (int index) const noexcept;\n bool <strong>get_bit</strong> (int index) const noexcept;\n+bool <strong>operator[]</strong> (int index) const noexcept;\n </pre>\n <p>query bit at <tt class=\"docutils literal\">index</tt>. Returns true if bit is 1, otherwise false.</p>\n <a name=\"clear_bit()\"></a>\n <a name=\"set_bit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bclear_bit%28%29+set_bit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bclear_bit%28%29+set_bit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"clear-bit-set-bit\">\n <h2>clear_bit() set_bit()</h2>\n <pre class=\"literal-block\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,19 +1,19 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\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 _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)\n o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n o _\br_\be_\bs_\be_\bt_\b(_\b)\n * _\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@@ -43,29 +43,29 @@\n If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n to call reset() to reinitialize it.\n The built-in software version of sha1-algorithm was implemented by Steve Reid\n and released as public domain. For more info, see src/sha1.cpp.\n class hasher\n {\n h\bha\bas\bsh\bhe\ber\br ();\n- hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n- h\bha\bas\bsh\bhe\ber\br (hasher const&);\n explicit h\bha\bas\bsh\bhe\ber\br (span<char const> data);\n+ hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+ h\bha\bas\bsh\bhe\ber\br (hasher const&);\n hasher& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n sha1_hash f\bfi\bin\bna\bal\bl ();\n void r\bre\bes\bse\bet\bt ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\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-h\bha\bas\bsh\bhe\ber\br (hasher const&);\n explicit h\bha\bas\bsh\bhe\ber\br (span<char const> data);\n+hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+h\bha\bas\bsh\bhe\ber\br (hasher const&);\n this is the same as default constructing followed by a call to update(data,\n len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n hasher& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n append the following bytes to what is being hashed\n@@ -81,30 +81,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+ 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 h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span<char const> data);\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n sha256_hash f\bfi\bin\bna\bal\bl ();\n void r\bre\bes\bse\bet\bt ();\n ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+*\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 hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span<char const> data);\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n this is the same as default constructing followed by a call to update(data,\n len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n append the following bytes to what is being hashed\n@@ -121,23 +121,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 () noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+ explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (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 (bitfield&& rhs) noexcept = default;\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 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+ bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n int s\bsi\biz\bze\be () const noexcept;\n int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n@@ -148,35 +148,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 () noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (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 (bitfield&& rhs) noexcept = default;\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 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+bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n query bit at index. Returns true if bit is 1, otherwise false.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n set bit at index to 0 (clear_bit) or 1 (set_bit).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n"}]}, {"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,229 +19,228 @@\n <img src=\"img/logo-color-text.png\" alt=\"libtorrent logo\"/>\n </a>\n <div>\n <h1 class=\"title\">reference documentation</h1>\n \n <p><a class=\"reference external\" href=\"single-page-ref.html\">single-page version</a></p>\n <div class=\"main-toc docutils container\">\n-<p class=\"rubric\">Core</p>\n+<p class=\"rubric\">Add Torrent</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#piece_block\">piece_block</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#info_hash_t\">info_hash_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#torrent_peer_equal()\">torrent_peer_equal()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#truncate_files()\">truncate_files()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#version()\">version()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_parsed()\">load_torrent_parsed()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_buffer()\">load_torrent_buffer()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_file()\">load_torrent_file()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#protocol_version\">protocol_version</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#socket_type_t\">socket_type_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#portmap_transport\">portmap_transport</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#portmap_protocol\">portmap_protocol</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#event_t\">event_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#connection_type\">connection_type</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#pex_flags_t\">pex_flags_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#download_priority_t\">download_priority_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#int\">int</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#charconst*\">char const*</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#std::uint64_t\">std::uint64_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Add_Torrent.html#client_data_t\">client_data_t</a></div>\n </div>\n-<p class=\"rubric\">Torrent Handle</p>\n+<p class=\"rubric\">Settings</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_info\">block_info</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#hash_value()\">hash_value()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#overview\">overview</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#setting_by_name()\">setting_by_name()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#name_for_setting()\">name_for_setting()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#default_settings()\">default_settings()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#high_performance_seed()\">high_performance_seed()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#min_memory_usage()\">min_memory_usage()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#generate_fingerprint()\">generate_fingerprint()</a></div>\n </div>\n <p class=\"rubric\">Torrent Info</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Info.html#web_seed_entry\">web_seed_entry</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Info.html#load_torrent_limits\">load_torrent_limits</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a></div>\n </div>\n+<p class=\"rubric\">Torrent Handle</p>\n+<div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_info\">block_info</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Handle.html#hash_value()\">hash_value()</a></div>\n+</div>\n <p class=\"rubric\">Session</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#session\">session</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#session_handle\">session_handle</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#write_session_params_buf()\">write_session_params_buf()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a></div>\n </div>\n <p class=\"rubric\">Stats</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#stats_metric\">stats_metric</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#stats_metric\">stats_metric</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#find_metric_idx()\">find_metric_idx()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Stats.html#metric_type_t\">metric_type_t</a></div>\n </div>\n-<p class=\"rubric\">Add Torrent</p>\n-<div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Add_Torrent.html#client_data_t\">client_data_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a></div>\n-</div>\n <p class=\"rubric\">Trackers</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Trackers.html#announce_infohash\">announce_infohash</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Trackers.html#announce_endpoint\">announce_endpoint</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a></div>\n </div>\n-<p class=\"rubric\">Torrent Status</p>\n+<p class=\"rubric\">Core</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#piece_block\">piece_block</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#info_hash_t\">info_hash_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_file()\">load_torrent_file()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_parsed()\">load_torrent_parsed()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#load_torrent_buffer()\">load_torrent_buffer()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#truncate_files()\">truncate_files()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#torrent_peer_equal()\">torrent_peer_equal()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#version()\">version()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#event_t\">event_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#portmap_transport\">portmap_transport</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#portmap_protocol\">portmap_protocol</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#protocol_version\">protocol_version</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#socket_type_t\">socket_type_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#connection_type\">connection_type</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#int\">int</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#pex_flags_t\">pex_flags_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#charconst*\">char const*</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#std::uint64_t\">std::uint64_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#download_priority_t\">download_priority_t</a></div>\n </div>\n-<p class=\"rubric\">Settings</p>\n+<p class=\"rubric\">Torrent Status</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#overview\">overview</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#min_memory_usage()\">min_memory_usage()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#high_performance_seed()\">high_performance_seed()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#generate_fingerprint()\">generate_fingerprint()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#setting_by_name()\">setting_by_name()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#name_for_setting()\">name_for_setting()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Settings.html#default_settings()\">default_settings()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a></div>\n </div>\n <p class=\"rubric\">DHT</p>\n <div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#dht_state\">dht_state</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#dht_storage_counters\">dht_storage_counters</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#dht_storage_interface\">dht_storage_interface</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#dht_state\">dht_state</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#dht_default_storage_constructor()\">dht_default_storage_constructor()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#sign_mutable_item()\">sign_mutable_item()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-DHT.html#announce_flags_t\">announce_flags_t</a></div>\n </div>\n <p class=\"rubric\">Resume Data</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data_buf()\">write_resume_data_buf()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file_buf()\">write_torrent_file_buf()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_flags_t\">write_torrent_flags_t</a></div>\n </div>\n </div>\n <div class=\"main-toc docutils container\">\n+<p class=\"rubric\">Create Torrents</p>\n+<div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#overview\">overview</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#add_files()\">add_files()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#set_piece_hashes()\">set_piece_hashes()</a></div>\n+</div>\n <p class=\"rubric\">Filter</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Filter.html#port_filter\">port_filter</a></div>\n </div>\n-<p class=\"rubric\">Error Codes</p>\n-<div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#storage_error\">storage_error</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#libtorrent_category()\">libtorrent_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#http_category()\">http_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#i2p_category()\">i2p_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#bdecode_category()\">bdecode_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#pcp_category()\">pcp_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#socks_category()\">socks_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#gzip_category()\">gzip_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#upnp_category()\">upnp_category()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#http_errors\">http_errors</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#i2p_error_code\">i2p_error_code</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#pcp_errors\">pcp_errors</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#socks_error_code\">socks_error_code</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n-</div>\n <p class=\"rubric\">Bdecoding</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bdecoding.html#print_entry()\">print_entry()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a></div>\n </div>\n <p class=\"rubric\">Bencoding</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bencoding.html#overview\">overview</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Bencoding.html#operator<<()\">operator<<()</a></div>\n </div>\n-<p class=\"rubric\">Create Torrents</p>\n+<p class=\"rubric\">Error Codes</p>\n <div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#overview\">overview</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#add_files()\">add_files()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Create_Torrents.html#set_piece_hashes()\">set_piece_hashes()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#storage_error\">storage_error</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#gzip_category()\">gzip_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#upnp_category()\">upnp_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#bdecode_category()\">bdecode_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#pcp_category()\">pcp_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#i2p_category()\">i2p_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#libtorrent_category()\">libtorrent_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#http_category()\">http_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#socks_category()\">socks_category()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#pcp_errors\">pcp_errors</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#i2p_error_code\">i2p_error_code</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#http_errors\">http_errors</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Error_Codes.html#socks_error_code\">socks_error_code</a></div>\n </div>\n </div>\n <div class=\"main-toc docutils container\">\n-<p class=\"rubric\">Utility</p>\n-<div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#hasher256\">hasher256</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a></div>\n-</div>\n-<p class=\"rubric\">Storage</p>\n-<div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#storage_params\">storage_params</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#default_disk_io_constructor()\">default_disk_io_constructor()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#posix_disk_io_constructor()\">posix_disk_io_constructor()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#disabled_disk_io_constructor()\">disabled_disk_io_constructor()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#mmap_disk_io_constructor()\">mmap_disk_io_constructor()</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#status_t\">status_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a></div>\n-</div>\n <p class=\"rubric\">Plugins</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#overview\">overview</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#peer_connection_handle\">peer_connection_handle</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#bt_peer_connection_handle\">bt_peer_connection_handle</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#crypto_plugin\">crypto_plugin</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#create_smart_ban_plugin()\">create_smart_ban_plugin()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#create_ut_pex_plugin()\">create_ut_pex_plugin()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#create_smart_ban_plugin()\">create_smart_ban_plugin()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Plugins.html#create_ut_metadata_plugin()\">create_ut_metadata_plugin()</a></div>\n </div>\n-<p class=\"rubric\">PeerClass</p>\n-<div class=\"line-block\">\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_info\">peer_class_info</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_type_filter\">peer_class_type_filter</a></div>\n-</div>\n <p class=\"rubric\">Custom Storage</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#overview\">overview</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_observer\">disk_observer</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#open_file_state\">open_file_state</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#storage_holder\">storage_holder</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#settings_interface\">settings_interface</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#buffer_allocator_interface\">buffer_allocator_interface</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#open_file_state\">open_file_state</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#storage_holder\">storage_holder</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_observer\">disk_observer</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Custom_Storage.html#file_open_mode_t\">file_open_mode_t</a></div>\n </div>\n+<p class=\"rubric\">PeerClass</p>\n+<div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_info\">peer_class_info</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_type_filter\">peer_class_type_filter</a></div>\n+</div>\n+<p class=\"rubric\">Storage</p>\n+<div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#storage_params\">storage_params</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#mmap_disk_io_constructor()\">mmap_disk_io_constructor()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#default_disk_io_constructor()\">default_disk_io_constructor()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#disabled_disk_io_constructor()\">disabled_disk_io_constructor()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#posix_disk_io_constructor()\">posix_disk_io_constructor()</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#status_t\">status_t</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a></div>\n+</div>\n+<p class=\"rubric\">Utility</p>\n+<div class=\"line-block\">\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#hasher256\">hasher256</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a></div>\n+</div>\n <p class=\"rubric\">ed25519</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_create_seed()\">ed25519_create_seed()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_create_keypair()\">ed25519_create_keypair()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_sign()\">ed25519_sign()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_verify()\">ed25519_verify()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_add_scalar()\">ed25519_add_scalar()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-ed25519.html#ed25519_key_exchange()\">ed25519_key_exchange()</a></div>\n </div>\n </div>\n <div class=\"main-toc docutils container\">\n <p class=\"rubric\">Alerts</p>\n <div class=\"line-block\">\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#overview\">overview</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#dht_routing_bucket\">dht_routing_bucket</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#peer_alert\">peer_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#tracker_alert\">tracker_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#read_piece_alert\">read_piece_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#file_completed_alert\">file_completed_alert</a></div>\n@@ -334,19 +333,20 @@\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#oversized_file_alert\">oversized_file_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#torrent_conflict_alert\">torrent_conflict_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#peer_info_alert\">peer_info_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#file_progress_alert\">file_progress_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#piece_info_alert\">piece_info_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#piece_availability_alert\">piece_availability_alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#tracker_list_alert\">tracker_list_alert</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#alert_cast()\">alert_cast()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#operation_name()\">operation_name()</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a></div>\n-<div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a></div>\n <div class=\"line\"><a class=\"reference external\" href=\"reference-Core.html#int\">int</a></div>\n+<div class=\"line\"><a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a></div>\n </div>\n </div>\n \n </div>\n </div>\n <div id=\"gradient\"></div>\n <div id=\"filler\">\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,175 +1,174 @@\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-Core\n-_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n-_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n-_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n-_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n-_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-_\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n-_\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n-_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n-_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n-_\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-_\be_\bv_\be_\bn_\bt_\b__\bt\n-_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\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-_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n-_\bi_\bn_\bt\n-_\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n-_\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+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+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+_\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+_\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n+_\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+Torrent Info\n+_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n Torrent 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 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 _\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-_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n+_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n-Add Torrent\n-_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n 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+Core\n+_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n+_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n+_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\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__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+_\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+_\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n+_\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+_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+_\bi_\bn_\bt\n+_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+_\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n+_\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n 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-_\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n-_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n-_\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n-_\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n-_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n DHT\n+_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n-_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n Resume Data\n _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\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__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\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 _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+Create Torrents\n+_\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n+_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n+_\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n Filter\n _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n-Error Codes\n-_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n-_\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-_\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-_\bp_\bc_\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-_\bg_\bz_\bi_\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-_\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-_\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-_\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-_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\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 _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n-Create Torrents\n-_\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n-_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n-_\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n-_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n-Utility\n-_\bh_\ba_\bs_\bh_\be_\br\n-_\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n-_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n-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-_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n-_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n-_\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+Error Codes\n+_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n+_\bg_\bz_\bi_\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+_\bb_\bd_\be_\bc_\bo_\bd_\be_\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+_\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+_\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+_\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n Plugins\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\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 _\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-_\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+_\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n-PeerClass\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n Custom Storage\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n-_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n-_\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 _\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+_\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+_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n+PeerClass\n+_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n+_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n+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+_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\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+Utility\n+_\bh_\ba_\bs_\bh_\be_\br\n+_\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n+_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n ed25519\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bk_\be_\by_\bp_\ba_\bi_\br_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bs_\bi_\bg_\bn_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bv_\be_\br_\bi_\bf_\by_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\ba_\bd_\bd_\b__\bs_\bc_\ba_\bl_\ba_\br_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bk_\be_\by_\b__\be_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b(_\b)\n Alerts\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n-_\ba_\bl_\be_\br_\bt\n _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n _\bf_\bi_\bl_\be_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n@@ -262,19 +261,20 @@\n _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n+_\ba_\bl_\be_\br_\bt\n _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n-_\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n _\bi_\bn_\bt\n+_\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "unified_diff": "@@ -28,12566 +28,2800 @@\n <td>2.0.11</td></tr>\n </tbody>\n </table>\n <p><a class=\"reference external\" href=\"reference.html\">home</a></p>\n <div class=\"contents topic\" id=\"table-of-contents\">\n <p class=\"topic-title\">Table of contents</p>\n <ul class=\"simple\">\n-<li><a class=\"reference internal\" href=\"#piece-block\" id=\"toc-entry-1\">piece_block</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hash-t\" id=\"toc-entry-2\">info_hash_t</a><ul>\n-<li><a class=\"reference internal\" href=\"#info-hash-t-1\" id=\"toc-entry-3\">info_hash_t()</a></li>\n-<li><a class=\"reference internal\" href=\"#has-v1-has-v2-has\" id=\"toc-entry-4\">has_v1() has_v2() has()</a></li>\n-<li><a class=\"reference internal\" href=\"#get\" id=\"toc-entry-5\">get()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-best\" id=\"toc-entry-6\">get_best()</a></li>\n-<li><a class=\"reference internal\" href=\"#for-each\" id=\"toc-entry-7\">for_each()</a></li>\n+<li><a class=\"reference internal\" href=\"#a-word-of-caution\" id=\"toc-entry-1\">a word of caution</a></li>\n+<li><a class=\"reference internal\" href=\"#plugin-interface\" id=\"toc-entry-2\">plugin-interface</a></li>\n+<li><a class=\"reference internal\" href=\"#custom-alerts\" id=\"toc-entry-3\">custom alerts</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-connection-handle\" id=\"toc-entry-4\">peer_connection_handle</a></li>\n+<li><a class=\"reference internal\" href=\"#bt-peer-connection-handle\" id=\"toc-entry-5\">bt_peer_connection_handle</a></li>\n+<li><a class=\"reference internal\" href=\"#plugin\" id=\"toc-entry-6\">plugin</a><ul>\n+<li><a class=\"reference internal\" href=\"#implemented-features\" id=\"toc-entry-7\">implemented_features()</a></li>\n+<li><a class=\"reference internal\" href=\"#new-torrent\" id=\"toc-entry-8\">new_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#added\" id=\"toc-entry-9\">added()</a></li>\n+<li><a class=\"reference internal\" href=\"#abort\" id=\"toc-entry-10\">abort()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-dht-request\" id=\"toc-entry-11\">on_dht_request()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-alert\" id=\"toc-entry-12\">on_alert()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-unknown-torrent\" id=\"toc-entry-13\">on_unknown_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-tick\" id=\"toc-entry-14\">on_tick()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-unchoke-priority\" id=\"toc-entry-15\">get_unchoke_priority()</a></li>\n+<li><a class=\"reference internal\" href=\"#load-state\" id=\"toc-entry-16\">load_state()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-info\" id=\"toc-entry-8\">peer_info</a><ul>\n-<li><a class=\"reference internal\" href=\"#i2p-destination\" id=\"toc-entry-9\">i2p_destination()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-plugin\" id=\"toc-entry-17\">torrent_plugin</a><ul>\n+<li><a class=\"reference internal\" href=\"#new-connection\" id=\"toc-entry-18\">new_connection()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-piece-pass-on-piece-failed\" id=\"toc-entry-19\">on_piece_pass() on_piece_failed()</a></li>\n+<li><a class=\"reference internal\" href=\"#tick\" id=\"toc-entry-20\">tick()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-resume-on-pause\" id=\"toc-entry-21\">on_resume() on_pause()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-files-checked\" id=\"toc-entry-22\">on_files_checked()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-state\" id=\"toc-entry-23\">on_state()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-add-peer\" id=\"toc-entry-24\">on_add_peer()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-request\" id=\"toc-entry-10\">peer_request</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator\" id=\"toc-entry-11\">operator==()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-plugin\" id=\"toc-entry-25\">peer_plugin</a><ul>\n+<li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-26\">type()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-handshake\" id=\"toc-entry-27\">add_handshake()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-disconnect\" id=\"toc-entry-28\">on_disconnect()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-connected\" id=\"toc-entry-29\">on_connected()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-handshake\" id=\"toc-entry-30\">on_handshake()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-extension-handshake\" id=\"toc-entry-31\">on_extension_handshake()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-have-on-have-all-on-request-on-bitfield-on-not-interested-on-choke-on-allowed-fast-on-have-none-on-unchoke-on-interested-on-dont-have\" id=\"toc-entry-32\">on_have() on_have_all() on_request() on_bitfield() on_not_interested() on_choke() on_allowed_fast() on_have_none() on_unchoke() on_interested() on_dont_have()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-piece\" id=\"toc-entry-33\">on_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#sent-have-sent-interested-sent-not-interested-sent-piece-sent-unchoke\" id=\"toc-entry-34\">sent_have() sent_interested() sent_not_interested() sent_piece() sent_unchoke()</a></li>\n+<li><a class=\"reference internal\" href=\"#sent-payload\" id=\"toc-entry-35\">sent_payload()</a></li>\n+<li><a class=\"reference internal\" href=\"#can-disconnect\" id=\"toc-entry-36\">can_disconnect()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-extended\" id=\"toc-entry-37\">on_extended()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-unknown-message\" id=\"toc-entry-38\">on_unknown_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#on-piece-pass-on-piece-failed-1\" id=\"toc-entry-39\">on_piece_pass() on_piece_failed()</a></li>\n+<li><a class=\"reference internal\" href=\"#tick-1\" id=\"toc-entry-40\">tick()</a></li>\n+<li><a class=\"reference internal\" href=\"#write-request\" id=\"toc-entry-41\">write_request()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-peer-equal\" id=\"toc-entry-12\">torrent_peer_equal()</a></li>\n-<li><a class=\"reference internal\" href=\"#make-magnet-uri\" id=\"toc-entry-13\">make_magnet_uri()</a></li>\n-<li><a class=\"reference internal\" href=\"#parse-magnet-uri\" id=\"toc-entry-14\">parse_magnet_uri()</a></li>\n-<li><a class=\"reference internal\" href=\"#truncate-files\" id=\"toc-entry-15\">truncate_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#version\" id=\"toc-entry-16\">version()</a></li>\n-<li><a class=\"reference internal\" href=\"#load-torrent-buffer-load-torrent-file-load-torrent-parsed\" id=\"toc-entry-17\">load_torrent_buffer() load_torrent_file() load_torrent_parsed()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-protocol-version\" id=\"toc-entry-18\">enum protocol_version</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-socket-type-t\" id=\"toc-entry-19\">enum socket_type_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-portmap-transport\" id=\"toc-entry-20\">enum portmap_transport</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-portmap-protocol\" id=\"toc-entry-21\">enum portmap_protocol</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-event-t\" id=\"toc-entry-22\">enum event_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-connection-type\" id=\"toc-entry-23\">enum connection_type</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-flags-t\" id=\"toc-entry-24\">torrent_flags_t</a></li>\n-<li><a class=\"reference internal\" href=\"#pex-flags-t\" id=\"toc-entry-25\">pex_flags_t</a></li>\n-<li><a class=\"reference internal\" href=\"#download-priority-t\" id=\"toc-entry-26\">download_priority_t</a></li>\n-<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-27\">int</a></li>\n-<li><a class=\"reference internal\" href=\"#char-const\" id=\"toc-entry-28\">char const*</a></li>\n-<li><a class=\"reference internal\" href=\"#std-uint64-t\" id=\"toc-entry-29\">std::uint64_t</a></li>\n-<li><a class=\"reference internal\" href=\"#block-info\" id=\"toc-entry-30\">block_info</a><ul>\n-<li><a class=\"reference internal\" href=\"#set-peer-peer\" id=\"toc-entry-31\">set_peer() peer()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-block-state-t\" id=\"toc-entry-32\">enum block_state_t</a></li>\n+<li><a class=\"reference internal\" href=\"#crypto-plugin\" id=\"toc-entry-42\">crypto_plugin</a><ul>\n+<li><a class=\"reference internal\" href=\"#decrypt\" id=\"toc-entry-43\">decrypt()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#partial-piece-info\" id=\"toc-entry-33\">partial_piece_info</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-handle\" id=\"toc-entry-34\">torrent_handle</a><ul>\n-<li><a class=\"reference internal\" href=\"#torrent-handle-1\" id=\"toc-entry-35\">torrent_handle()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-piece\" id=\"toc-entry-36\">add_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#read-piece\" id=\"toc-entry-37\">read_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#have-piece\" id=\"toc-entry-38\">have_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-peer-info-post-peer-info\" id=\"toc-entry-39\">get_peer_info() post_peer_info()</a></li>\n-<li><a class=\"reference internal\" href=\"#post-status-status\" id=\"toc-entry-40\">post_status() status()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-download-queue-post-download-queue\" id=\"toc-entry-41\">get_download_queue() post_download_queue()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-piece-deadlines-reset-piece-deadline-set-piece-deadline\" id=\"toc-entry-42\">clear_piece_deadlines() reset_piece_deadline() set_piece_deadline()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-progress-post-file-progress\" id=\"toc-entry-43\">file_progress() post_file_progress()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-status\" id=\"toc-entry-44\">file_status()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-error\" id=\"toc-entry-45\">clear_error()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-tracker-replace-trackers-trackers-post-trackers\" id=\"toc-entry-46\">add_tracker() replace_trackers() trackers() post_trackers()</a></li>\n-<li><a class=\"reference internal\" href=\"#url-seeds-remove-url-seed-add-url-seed\" id=\"toc-entry-47\">url_seeds() remove_url_seed() add_url_seed()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-http-seed-remove-http-seed-http-seeds\" id=\"toc-entry-48\">add_http_seed() remove_http_seed() http_seeds()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-extension\" id=\"toc-entry-49\">add_extension()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-metadata\" id=\"toc-entry-50\">set_metadata()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-valid\" id=\"toc-entry-51\">is_valid()</a></li>\n-<li><a class=\"reference internal\" href=\"#resume-pause\" id=\"toc-entry-52\">resume() pause()</a></li>\n-<li><a class=\"reference internal\" href=\"#flags-unset-flags-set-flags\" id=\"toc-entry-53\">flags() unset_flags() set_flags()</a></li>\n-<li><a class=\"reference internal\" href=\"#flush-cache\" id=\"toc-entry-54\">flush_cache()</a></li>\n-<li><a class=\"reference internal\" href=\"#force-recheck\" id=\"toc-entry-55\">force_recheck()</a></li>\n-<li><a class=\"reference internal\" href=\"#save-resume-data\" id=\"toc-entry-56\">save_resume_data()</a></li>\n-<li><a class=\"reference internal\" href=\"#need-save-resume-data\" id=\"toc-entry-57\">need_save_resume_data()</a></li>\n-<li><a class=\"reference internal\" href=\"#queue-position-bottom-queue-position-up-queue-position-top-queue-position-down-queue-position\" id=\"toc-entry-58\">queue_position_bottom() queue_position_up() queue_position_top() queue_position_down() queue_position()</a></li>\n-<li><a class=\"reference internal\" href=\"#queue-position-set\" id=\"toc-entry-59\">queue_position_set()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-ssl-certificate-buffer-set-ssl-certificate\" id=\"toc-entry-60\">set_ssl_certificate_buffer() set_ssl_certificate()</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-file-torrent-file-with-hashes\" id=\"toc-entry-61\">torrent_file() torrent_file_with_hashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-layers\" id=\"toc-entry-62\">piece_layers()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-availability-post-piece-availability\" id=\"toc-entry-63\">piece_availability() post_piece_availability()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-piece-priorities-piece-priority-prioritize-pieces\" id=\"toc-entry-64\">get_piece_priorities() piece_priority() prioritize_pieces()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-file-priorities-file-priority-prioritize-files\" id=\"toc-entry-65\">get_file_priorities() file_priority() prioritize_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#force-reannounce-force-dht-announce-force-lsd-announce\" id=\"toc-entry-66\">force_reannounce() force_dht_announce() force_lsd_announce()</a></li>\n-<li><a class=\"reference internal\" href=\"#scrape-tracker\" id=\"toc-entry-67\">scrape_tracker()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-download-limit-download-limit-upload-limit-set-upload-limit\" id=\"toc-entry-68\">set_download_limit() download_limit() upload_limit() set_upload_limit()</a></li>\n-<li><a class=\"reference internal\" href=\"#connect-peer\" id=\"toc-entry-69\">connect_peer()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-peers\" id=\"toc-entry-70\">clear_peers()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-max-uploads-max-uploads\" id=\"toc-entry-71\">set_max_uploads() max_uploads()</a></li>\n-<li><a class=\"reference internal\" href=\"#max-connections-set-max-connections\" id=\"toc-entry-72\">max_connections() set_max_connections()</a></li>\n-<li><a class=\"reference internal\" href=\"#move-storage\" id=\"toc-entry-73\">move_storage()</a></li>\n-<li><a class=\"reference internal\" href=\"#rename-file\" id=\"toc-entry-74\">rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hashes-info-hash\" id=\"toc-entry-75\">info_hashes() info_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-operator-operator\" id=\"toc-entry-76\">operator!=() operator==() operator<()</a></li>\n-<li><a class=\"reference internal\" href=\"#id\" id=\"toc-entry-77\">id()</a></li>\n-<li><a class=\"reference internal\" href=\"#native-handle\" id=\"toc-entry-78\">native_handle()</a></li>\n-<li><a class=\"reference internal\" href=\"#userdata\" id=\"toc-entry-79\">userdata()</a></li>\n-<li><a class=\"reference internal\" href=\"#in-session\" id=\"toc-entry-80\">in_session()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-ut-pex-plugin\" id=\"toc-entry-44\">create_ut_pex_plugin()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-smart-ban-plugin\" id=\"toc-entry-45\">create_smart_ban_plugin()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-ut-metadata-plugin\" id=\"toc-entry-46\">create_ut_metadata_plugin()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-torrent-params\" id=\"toc-entry-47\">add_torrent_params</a></li>\n+<li><a class=\"reference internal\" href=\"#client-data-t\" id=\"toc-entry-48\">client_data_t</a><ul>\n+<li><a class=\"reference internal\" href=\"#client-data-t-1\" id=\"toc-entry-49\">client_data_t()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-const-void\" id=\"toc-entry-50\">operator=() const*() void*()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#hash-value\" id=\"toc-entry-81\">hash_value()</a></li>\n-<li><a class=\"reference internal\" href=\"#web-seed-entry\" id=\"toc-entry-82\">web_seed_entry</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-1\" id=\"toc-entry-83\">operator==()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-2\" id=\"toc-entry-84\">operator<()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-type-t\" id=\"toc-entry-85\">enum type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#settings-interface\" id=\"toc-entry-51\">settings_interface</a></li>\n+<li><a class=\"reference internal\" href=\"#buffer-allocator-interface\" id=\"toc-entry-52\">buffer_allocator_interface</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder\" id=\"toc-entry-53\">disk_buffer_holder</a><ul>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-1\" id=\"toc-entry-54\">disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-2\" id=\"toc-entry-55\">disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-buffer-holder-3\" id=\"toc-entry-56\">~disk_buffer_holder()</a></li>\n+<li><a class=\"reference internal\" href=\"#data\" id=\"toc-entry-57\">data()</a></li>\n+<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-58\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-59\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-mutable\" id=\"toc-entry-60\">is_mutable()</a></li>\n+<li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-61\">bool()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#load-torrent-limits\" id=\"toc-entry-86\">load_torrent_limits</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-info\" id=\"toc-entry-87\">torrent_info</a><ul>\n-<li><a class=\"reference internal\" href=\"#torrent-info-1\" id=\"toc-entry-88\">torrent_info()</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-info-2\" id=\"toc-entry-89\">~torrent_info()</a></li>\n-<li><a class=\"reference internal\" href=\"#files-orig-files\" id=\"toc-entry-90\">files() orig_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#rename-file-1\" id=\"toc-entry-91\">rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#remap-files\" id=\"toc-entry-92\">remap_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-tracker-clear-trackers-trackers\" id=\"toc-entry-93\">add_tracker() clear_trackers() trackers()</a></li>\n-<li><a class=\"reference internal\" href=\"#collections-similar-torrents\" id=\"toc-entry-94\">collections() similar_torrents()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-http-seed-set-web-seeds-add-url-seed-web-seeds\" id=\"toc-entry-95\">add_http_seed() set_web_seeds() add_url_seed() web_seeds()</a></li>\n-<li><a class=\"reference internal\" href=\"#total-size\" id=\"toc-entry-96\">total_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-length-num-pieces\" id=\"toc-entry-97\">piece_length() num_pieces()</a></li>\n-<li><a class=\"reference internal\" href=\"#blocks-per-piece\" id=\"toc-entry-98\">blocks_per_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#last-piece-end-piece-piece-range\" id=\"toc-entry-99\">last_piece() end_piece() piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#info-hashes-info-hash-1\" id=\"toc-entry-100\">info_hashes() info_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#v1-v2\" id=\"toc-entry-101\">v1() v2()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-files\" id=\"toc-entry-102\">num_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#map-block\" id=\"toc-entry-103\">map_block()</a></li>\n-<li><a class=\"reference internal\" href=\"#map-file\" id=\"toc-entry-104\">map_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#ssl-cert\" id=\"toc-entry-105\">ssl_cert()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-valid-1\" id=\"toc-entry-106\">is_valid()</a></li>\n-<li><a class=\"reference internal\" href=\"#priv\" id=\"toc-entry-107\">priv()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-i2p\" id=\"toc-entry-108\">is_i2p()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-size\" id=\"toc-entry-109\">piece_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#hash-for-piece-ptr-hash-for-piece\" id=\"toc-entry-110\">hash_for_piece_ptr() hash_for_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#name\" id=\"toc-entry-111\">name()</a></li>\n-<li><a class=\"reference internal\" href=\"#creation-date\" id=\"toc-entry-112\">creation_date()</a></li>\n-<li><a class=\"reference internal\" href=\"#creator\" id=\"toc-entry-113\">creator()</a></li>\n-<li><a class=\"reference internal\" href=\"#comment\" id=\"toc-entry-114\">comment()</a></li>\n-<li><a class=\"reference internal\" href=\"#nodes\" id=\"toc-entry-115\">nodes()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-node\" id=\"toc-entry-116\">add_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#parse-info-section\" id=\"toc-entry-117\">parse_info_section()</a></li>\n-<li><a class=\"reference internal\" href=\"#info\" id=\"toc-entry-118\">info()</a></li>\n-<li><a class=\"reference internal\" href=\"#info-section\" id=\"toc-entry-119\">info_section()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-layer\" id=\"toc-entry-120\">piece_layer()</a></li>\n-<li><a class=\"reference internal\" href=\"#free-piece-layers\" id=\"toc-entry-121\">free_piece_layers()</a></li>\n+<li><a class=\"reference internal\" href=\"#open-file-state\" id=\"toc-entry-62\">open_file_state</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-interface\" id=\"toc-entry-63\">disk_interface</a><ul>\n+<li><a class=\"reference internal\" href=\"#new-torrent-1\" id=\"toc-entry-64\">new_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#remove-torrent\" id=\"toc-entry-65\">remove_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-read-async-write\" id=\"toc-entry-66\">async_read() async_write()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-hash\" id=\"toc-entry-67\">async_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-hash2\" id=\"toc-entry-68\">async_hash2()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-move-storage\" id=\"toc-entry-69\">async_move_storage()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-release-files\" id=\"toc-entry-70\">async_release_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-check-files\" id=\"toc-entry-71\">async_check_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-stop-torrent\" id=\"toc-entry-72\">async_stop_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-rename-file\" id=\"toc-entry-73\">async_rename_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-delete-files\" id=\"toc-entry-74\">async_delete_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-set-file-priority\" id=\"toc-entry-75\">async_set_file_priority()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-clear-piece\" id=\"toc-entry-76\">async_clear_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#update-stats-counters\" id=\"toc-entry-77\">update_stats_counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-status\" id=\"toc-entry-78\">get_status()</a></li>\n+<li><a class=\"reference internal\" href=\"#abort-1\" id=\"toc-entry-79\">abort()</a></li>\n+<li><a class=\"reference internal\" href=\"#submit-jobs\" id=\"toc-entry-80\">submit_jobs()</a></li>\n+<li><a class=\"reference internal\" href=\"#settings-updated\" id=\"toc-entry-81\">settings_updated()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#hasher\" id=\"toc-entry-122\">hasher</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-hasher\" id=\"toc-entry-123\">operator=() hasher()</a></li>\n-<li><a class=\"reference internal\" href=\"#update\" id=\"toc-entry-124\">update()</a></li>\n-<li><a class=\"reference internal\" href=\"#final\" id=\"toc-entry-125\">final()</a></li>\n-<li><a class=\"reference internal\" href=\"#reset\" id=\"toc-entry-126\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-holder\" id=\"toc-entry-82\">storage_holder</a></li>\n+<li><a class=\"reference internal\" href=\"#disk-observer\" id=\"toc-entry-83\">disk_observer</a><ul>\n+<li><a class=\"reference internal\" href=\"#on-disk\" id=\"toc-entry-84\">on_disk()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#hasher256\" id=\"toc-entry-127\">hasher256</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-hasher256\" id=\"toc-entry-128\">operator=() hasher256()</a></li>\n-<li><a class=\"reference internal\" href=\"#update-1\" id=\"toc-entry-129\">update()</a></li>\n-<li><a class=\"reference internal\" href=\"#final-1\" id=\"toc-entry-130\">final()</a></li>\n-<li><a class=\"reference internal\" href=\"#reset-1\" id=\"toc-entry-131\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-open-mode-t\" id=\"toc-entry-85\">file_open_mode_t</a></li>\n+<li><a class=\"reference internal\" href=\"#settings-pack\" id=\"toc-entry-86\">settings_pack</a><ul>\n+<li><a class=\"reference internal\" href=\"#set-str-set-int-set-bool\" id=\"toc-entry-87\">set_str() set_int() set_bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#has-val\" id=\"toc-entry-88\">has_val()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear\" id=\"toc-entry-89\">clear()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-1\" id=\"toc-entry-90\">clear()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-int-get-bool-get-str\" id=\"toc-entry-91\">get_int() get_bool() get_str()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-type-bases\" id=\"toc-entry-92\">enum type_bases</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-mmap-write-mode-t\" id=\"toc-entry-93\">enum mmap_write_mode_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-suggest-mode-t\" id=\"toc-entry-94\">enum suggest_mode_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-choking-algorithm-t\" id=\"toc-entry-95\">enum choking_algorithm_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-seed-choking-algorithm-t\" id=\"toc-entry-96\">enum seed_choking_algorithm_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-io-buffer-mode-t\" id=\"toc-entry-97\">enum io_buffer_mode_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-bandwidth-mixed-algo-t\" id=\"toc-entry-98\">enum bandwidth_mixed_algo_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-enc-policy\" id=\"toc-entry-99\">enum enc_policy</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-enc-level\" id=\"toc-entry-100\">enum enc_level</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-proxy-type-t\" id=\"toc-entry-101\">enum proxy_type_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#bitfield\" id=\"toc-entry-132\">bitfield</a><ul>\n-<li><a class=\"reference internal\" href=\"#bitfield-1\" id=\"toc-entry-133\">bitfield()</a></li>\n-<li><a class=\"reference internal\" href=\"#assign\" id=\"toc-entry-134\">assign()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-get-bit\" id=\"toc-entry-135\">operator[]() get_bit()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-bit-set-bit\" id=\"toc-entry-136\">clear_bit() set_bit()</a></li>\n-<li><a class=\"reference internal\" href=\"#all-set\" id=\"toc-entry-137\">all_set()</a></li>\n-<li><a class=\"reference internal\" href=\"#none-set\" id=\"toc-entry-138\">none_set()</a></li>\n-<li><a class=\"reference internal\" href=\"#size\" id=\"toc-entry-139\">size()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-words\" id=\"toc-entry-140\">num_words()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-bytes\" id=\"toc-entry-141\">num_bytes()</a></li>\n-<li><a class=\"reference internal\" href=\"#empty\" id=\"toc-entry-142\">empty()</a></li>\n-<li><a class=\"reference internal\" href=\"#data\" id=\"toc-entry-143\">data()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap\" id=\"toc-entry-144\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#count\" id=\"toc-entry-145\">count()</a></li>\n-<li><a class=\"reference internal\" href=\"#find-first-set\" id=\"toc-entry-146\">find_first_set()</a></li>\n-<li><a class=\"reference internal\" href=\"#find-last-clear\" id=\"toc-entry-147\">find_last_clear()</a></li>\n+<li><a class=\"reference internal\" href=\"#setting-by-name-name-for-setting\" id=\"toc-entry-102\">setting_by_name() name_for_setting()</a></li>\n+<li><a class=\"reference internal\" href=\"#default-settings\" id=\"toc-entry-103\">default_settings()</a></li>\n+<li><a class=\"reference internal\" href=\"#high-performance-seed-min-memory-usage\" id=\"toc-entry-104\">high_performance_seed() min_memory_usage()</a></li>\n+<li><a class=\"reference internal\" href=\"#generate-fingerprint\" id=\"toc-entry-105\">generate_fingerprint()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-torrent\" id=\"toc-entry-106\">create_torrent</a><ul>\n+<li><a class=\"reference internal\" href=\"#create-torrent-1\" id=\"toc-entry-107\">create_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#generate-generate-buf\" id=\"toc-entry-108\">generate() generate_buf()</a></li>\n+<li><a class=\"reference internal\" href=\"#files\" id=\"toc-entry-109\">files()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-comment\" id=\"toc-entry-110\">set_comment()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-creator\" id=\"toc-entry-111\">set_creator()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-creation-date\" id=\"toc-entry-112\">set_creation_date()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-hash\" id=\"toc-entry-113\">set_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-hash2\" id=\"toc-entry-114\">set_hash2()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-url-seed-add-http-seed\" id=\"toc-entry-115\">add_url_seed() add_http_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-node\" id=\"toc-entry-116\">add_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-tracker\" id=\"toc-entry-117\">add_tracker()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-root-cert\" id=\"toc-entry-118\">set_root_cert()</a></li>\n+<li><a class=\"reference internal\" href=\"#priv-set-priv\" id=\"toc-entry-119\">priv() set_priv()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-pieces\" id=\"toc-entry-120\">num_pieces()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-range\" id=\"toc-entry-121\">piece_range()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-range\" id=\"toc-entry-122\">file_range()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-piece-range\" id=\"toc-entry-123\">file_piece_range()</a></li>\n+<li><a class=\"reference internal\" href=\"#total-size\" id=\"toc-entry-124\">total_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-length-piece-size\" id=\"toc-entry-125\">piece_length() piece_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-collection-add-similar-torrent\" id=\"toc-entry-126\">add_collection() add_similar_torrent()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-proxy\" id=\"toc-entry-148\">session_proxy</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-session-proxy-session-proxy\" id=\"toc-entry-149\">operator=() session_proxy() ~session_proxy()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-files\" id=\"toc-entry-127\">add_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-piece-hashes\" id=\"toc-entry-128\">set_piece_hashes()</a></li>\n+<li><a class=\"reference internal\" href=\"#web-seed-entry\" id=\"toc-entry-129\">web_seed_entry</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator\" id=\"toc-entry-130\">operator==()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-1\" id=\"toc-entry-131\">operator<()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-type-t\" id=\"toc-entry-132\">enum type_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session\" id=\"toc-entry-150\">session</a><ul>\n-<li><a class=\"reference internal\" href=\"#session-1\" id=\"toc-entry-151\">session()</a></li>\n-<li><a class=\"reference internal\" href=\"#session-2\" id=\"toc-entry-152\">session()</a></li>\n-<li><a class=\"reference internal\" href=\"#session-3\" id=\"toc-entry-153\">~session()</a></li>\n-<li><a class=\"reference internal\" href=\"#abort\" id=\"toc-entry-154\">abort()</a></li>\n+<li><a class=\"reference internal\" href=\"#load-torrent-limits\" id=\"toc-entry-133\">load_torrent_limits</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-info\" id=\"toc-entry-134\">torrent_info</a><ul>\n+<li><a class=\"reference internal\" href=\"#torrent-info-1\" id=\"toc-entry-135\">torrent_info()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-info-2\" id=\"toc-entry-136\">~torrent_info()</a></li>\n+<li><a class=\"reference internal\" href=\"#files-orig-files\" id=\"toc-entry-137\">files() orig_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#rename-file\" id=\"toc-entry-138\">rename_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#remap-files\" id=\"toc-entry-139\">remap_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-trackers-add-tracker-trackers\" id=\"toc-entry-140\">clear_trackers() add_tracker() trackers()</a></li>\n+<li><a class=\"reference internal\" href=\"#collections-similar-torrents\" id=\"toc-entry-141\">collections() similar_torrents()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-url-seed-web-seeds-set-web-seeds-add-http-seed\" id=\"toc-entry-142\">add_url_seed() web_seeds() set_web_seeds() add_http_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#total-size-1\" id=\"toc-entry-143\">total_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-length-num-pieces\" id=\"toc-entry-144\">piece_length() num_pieces()</a></li>\n+<li><a class=\"reference internal\" href=\"#blocks-per-piece\" id=\"toc-entry-145\">blocks_per_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-range-last-piece-end-piece\" id=\"toc-entry-146\">piece_range() last_piece() end_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hashes-info-hash\" id=\"toc-entry-147\">info_hashes() info_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#v1-v2\" id=\"toc-entry-148\">v1() v2()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-files\" id=\"toc-entry-149\">num_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#map-block\" id=\"toc-entry-150\">map_block()</a></li>\n+<li><a class=\"reference internal\" href=\"#map-file\" id=\"toc-entry-151\">map_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#ssl-cert\" id=\"toc-entry-152\">ssl_cert()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-valid\" id=\"toc-entry-153\">is_valid()</a></li>\n+<li><a class=\"reference internal\" href=\"#priv\" id=\"toc-entry-154\">priv()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-i2p\" id=\"toc-entry-155\">is_i2p()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-size\" id=\"toc-entry-156\">piece_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#hash-for-piece-ptr-hash-for-piece\" id=\"toc-entry-157\">hash_for_piece_ptr() hash_for_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#name\" id=\"toc-entry-158\">name()</a></li>\n+<li><a class=\"reference internal\" href=\"#creation-date\" id=\"toc-entry-159\">creation_date()</a></li>\n+<li><a class=\"reference internal\" href=\"#creator\" id=\"toc-entry-160\">creator()</a></li>\n+<li><a class=\"reference internal\" href=\"#comment\" id=\"toc-entry-161\">comment()</a></li>\n+<li><a class=\"reference internal\" href=\"#nodes\" id=\"toc-entry-162\">nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-node-1\" id=\"toc-entry-163\">add_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#parse-info-section\" id=\"toc-entry-164\">parse_info_section()</a></li>\n+<li><a class=\"reference internal\" href=\"#info\" id=\"toc-entry-165\">info()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-section\" id=\"toc-entry-166\">info_section()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-layer\" id=\"toc-entry-167\">piece_layer()</a></li>\n+<li><a class=\"reference internal\" href=\"#free-piece-layers\" id=\"toc-entry-168\">free_piece_layers()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-params\" id=\"toc-entry-155\">session_params</a><ul>\n-<li><a class=\"reference internal\" href=\"#session-params-1\" id=\"toc-entry-156\">session_params()</a></li>\n-<li><a class=\"reference internal\" href=\"#session-params-2\" id=\"toc-entry-157\">session_params()</a></li>\n+<li><a class=\"reference internal\" href=\"#ip-filter\" id=\"toc-entry-169\">ip_filter</a><ul>\n+<li><a class=\"reference internal\" href=\"#empty\" id=\"toc-entry-170\">empty()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-rule\" id=\"toc-entry-171\">add_rule()</a></li>\n+<li><a class=\"reference internal\" href=\"#access\" id=\"toc-entry-172\">access()</a></li>\n+<li><a class=\"reference internal\" href=\"#export-filter\" id=\"toc-entry-173\">export_filter()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-access-flags\" id=\"toc-entry-174\">enum access_flags</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-handle\" id=\"toc-entry-158\">session_handle</a><ul>\n-<li><a class=\"reference internal\" href=\"#is-valid-2\" id=\"toc-entry-159\">is_valid()</a></li>\n-<li><a class=\"reference internal\" href=\"#session-state\" id=\"toc-entry-160\">session_state()</a></li>\n-<li><a class=\"reference internal\" href=\"#refresh-torrent-status-get-torrent-status\" id=\"toc-entry-161\">refresh_torrent_status() get_torrent_status()</a></li>\n-<li><a class=\"reference internal\" href=\"#post-torrent-updates\" id=\"toc-entry-162\">post_torrent_updates()</a></li>\n-<li><a class=\"reference internal\" href=\"#post-session-stats\" id=\"toc-entry-163\">post_session_stats()</a></li>\n-<li><a class=\"reference internal\" href=\"#post-dht-stats\" id=\"toc-entry-164\">post_dht_stats()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-dht-state\" id=\"toc-entry-165\">set_dht_state()</a></li>\n-<li><a class=\"reference internal\" href=\"#find-torrent-get-torrents\" id=\"toc-entry-166\">find_torrent() get_torrents()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-torrent-async-add-torrent\" id=\"toc-entry-167\">add_torrent() async_add_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-paused-resume-pause\" id=\"toc-entry-168\">is_paused() resume() pause()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-dht-running\" id=\"toc-entry-169\">is_dht_running()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-dht-storage\" id=\"toc-entry-170\">set_dht_storage()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-dht-node\" id=\"toc-entry-171\">add_dht_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-item\" id=\"toc-entry-172\">dht_get_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-item-1\" id=\"toc-entry-173\">dht_get_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-put-item\" id=\"toc-entry-174\">dht_put_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-put-item-1\" id=\"toc-entry-175\">dht_put_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-dht-announce\" id=\"toc-entry-176\">dht_get_peers() dht_announce()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-live-nodes\" id=\"toc-entry-177\">dht_live_nodes()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-sample-infohashes\" id=\"toc-entry-178\">dht_sample_infohashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-direct-request\" id=\"toc-entry-179\">dht_direct_request()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-extension-1\" id=\"toc-entry-180\">add_extension()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-ip-filter-get-ip-filter\" id=\"toc-entry-181\">set_ip_filter() get_ip_filter()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-port-filter\" id=\"toc-entry-182\">set_port_filter()</a></li>\n-<li><a class=\"reference internal\" href=\"#listen-port-is-listening-ssl-listen-port\" id=\"toc-entry-183\">listen_port() is_listening() ssl_listen_port()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-peer-class-filter-set-peer-class-filter\" id=\"toc-entry-184\">get_peer_class_filter() set_peer_class_filter()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-peer-class-type-filter-get-peer-class-type-filter\" id=\"toc-entry-185\">set_peer_class_type_filter() get_peer_class_type_filter()</a></li>\n-<li><a class=\"reference internal\" href=\"#create-peer-class\" id=\"toc-entry-186\">create_peer_class()</a></li>\n-<li><a class=\"reference internal\" href=\"#delete-peer-class\" id=\"toc-entry-187\">delete_peer_class()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-peer-class-set-peer-class\" id=\"toc-entry-188\">get_peer_class() set_peer_class()</a></li>\n-<li><a class=\"reference internal\" href=\"#remove-torrent\" id=\"toc-entry-189\">remove_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#apply-settings-get-settings\" id=\"toc-entry-190\">apply_settings() get_settings()</a></li>\n-<li><a class=\"reference internal\" href=\"#pop-alerts-wait-for-alert-set-alert-notify\" id=\"toc-entry-191\">pop_alerts() wait_for_alert() set_alert_notify()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-port-mapping-delete-port-mapping\" id=\"toc-entry-192\">add_port_mapping() delete_port_mapping()</a></li>\n-<li><a class=\"reference internal\" href=\"#reopen-network-sockets\" id=\"toc-entry-193\">reopen_network_sockets()</a></li>\n-<li><a class=\"reference internal\" href=\"#native-handle-1\" id=\"toc-entry-194\">native_handle()</a></li>\n+<li><a class=\"reference internal\" href=\"#port-filter\" id=\"toc-entry-175\">port_filter</a><ul>\n+<li><a class=\"reference internal\" href=\"#add-rule-1\" id=\"toc-entry-176\">add_rule()</a></li>\n+<li><a class=\"reference internal\" href=\"#access-1\" id=\"toc-entry-177\">access()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-access-flags-1\" id=\"toc-entry-178\">enum access_flags</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#write-session-params-buf-read-session-params-write-session-params\" id=\"toc-entry-195\">write_session_params_buf() read_session_params() write_session_params()</a></li>\n-<li><a class=\"reference internal\" href=\"#stats-metric\" id=\"toc-entry-196\">stats_metric</a></li>\n-<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-197\">counters</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-inc-stats-counter\" id=\"toc-entry-198\">operator[]() inc_stats_counter()</a></li>\n+<li><a class=\"reference internal\" href=\"#block-info\" id=\"toc-entry-179\">block_info</a><ul>\n+<li><a class=\"reference internal\" href=\"#peer-set-peer\" id=\"toc-entry-180\">peer() set_peer()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-block-state-t\" id=\"toc-entry-181\">enum block_state_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-stats-metrics\" id=\"toc-entry-199\">session_stats_metrics()</a></li>\n-<li><a class=\"reference internal\" href=\"#find-metric-idx\" id=\"toc-entry-200\">find_metric_idx()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-metric-type-t\" id=\"toc-entry-201\">enum metric_type_t</a></li>\n-<li><a class=\"reference internal\" href=\"#ip-filter\" id=\"toc-entry-202\">ip_filter</a><ul>\n-<li><a class=\"reference internal\" href=\"#empty-1\" id=\"toc-entry-203\">empty()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-rule\" id=\"toc-entry-204\">add_rule()</a></li>\n-<li><a class=\"reference internal\" href=\"#access\" id=\"toc-entry-205\">access()</a></li>\n-<li><a class=\"reference internal\" href=\"#export-filter\" id=\"toc-entry-206\">export_filter()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-access-flags\" id=\"toc-entry-207\">enum access_flags</a></li>\n+<li><a class=\"reference internal\" href=\"#partial-piece-info\" id=\"toc-entry-182\">partial_piece_info</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-handle\" id=\"toc-entry-183\">torrent_handle</a><ul>\n+<li><a class=\"reference internal\" href=\"#torrent-handle-1\" id=\"toc-entry-184\">torrent_handle()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-piece\" id=\"toc-entry-185\">add_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#read-piece\" id=\"toc-entry-186\">read_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#have-piece\" id=\"toc-entry-187\">have_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-peer-info-post-peer-info\" id=\"toc-entry-188\">get_peer_info() post_peer_info()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-status-status\" id=\"toc-entry-189\">post_status() status()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-download-queue-get-download-queue\" id=\"toc-entry-190\">post_download_queue() get_download_queue()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-piece-deadline-reset-piece-deadline-clear-piece-deadlines\" id=\"toc-entry-191\">set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-progress-post-file-progress\" id=\"toc-entry-192\">file_progress() post_file_progress()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-status\" id=\"toc-entry-193\">file_status()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-error\" id=\"toc-entry-194\">clear_error()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-tracker-replace-trackers-trackers-post-trackers\" id=\"toc-entry-195\">add_tracker() replace_trackers() trackers() post_trackers()</a></li>\n+<li><a class=\"reference internal\" href=\"#remove-url-seed-add-url-seed-url-seeds\" id=\"toc-entry-196\">remove_url_seed() add_url_seed() url_seeds()</a></li>\n+<li><a class=\"reference internal\" href=\"#http-seeds-remove-http-seed-add-http-seed\" id=\"toc-entry-197\">http_seeds() remove_http_seed() add_http_seed()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-extension\" id=\"toc-entry-198\">add_extension()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-metadata\" id=\"toc-entry-199\">set_metadata()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-valid-1\" id=\"toc-entry-200\">is_valid()</a></li>\n+<li><a class=\"reference internal\" href=\"#pause-resume\" id=\"toc-entry-201\">pause() resume()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-flags-unset-flags-flags\" id=\"toc-entry-202\">set_flags() unset_flags() flags()</a></li>\n+<li><a class=\"reference internal\" href=\"#flush-cache\" id=\"toc-entry-203\">flush_cache()</a></li>\n+<li><a class=\"reference internal\" href=\"#force-recheck\" id=\"toc-entry-204\">force_recheck()</a></li>\n+<li><a class=\"reference internal\" href=\"#save-resume-data\" id=\"toc-entry-205\">save_resume_data()</a></li>\n+<li><a class=\"reference internal\" href=\"#need-save-resume-data\" id=\"toc-entry-206\">need_save_resume_data()</a></li>\n+<li><a class=\"reference internal\" href=\"#queue-position-top-queue-position-down-queue-position-bottom-queue-position-up-queue-position\" id=\"toc-entry-207\">queue_position_top() queue_position_down() queue_position_bottom() queue_position_up() queue_position()</a></li>\n+<li><a class=\"reference internal\" href=\"#queue-position-set\" id=\"toc-entry-208\">queue_position_set()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-ssl-certificate-set-ssl-certificate-buffer\" id=\"toc-entry-209\">set_ssl_certificate() set_ssl_certificate_buffer()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-file-with-hashes-torrent-file\" id=\"toc-entry-210\">torrent_file_with_hashes() torrent_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-layers\" id=\"toc-entry-211\">piece_layers()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-piece-availability-piece-availability\" id=\"toc-entry-212\">post_piece_availability() piece_availability()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-priority-prioritize-pieces-get-piece-priorities\" id=\"toc-entry-213\">piece_priority() prioritize_pieces() get_piece_priorities()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-file-priorities-prioritize-files-file-priority\" id=\"toc-entry-214\">get_file_priorities() prioritize_files() file_priority()</a></li>\n+<li><a class=\"reference internal\" href=\"#force-lsd-announce-force-reannounce-force-dht-announce\" id=\"toc-entry-215\">force_lsd_announce() force_reannounce() force_dht_announce()</a></li>\n+<li><a class=\"reference internal\" href=\"#scrape-tracker\" id=\"toc-entry-216\">scrape_tracker()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-download-limit-set-upload-limit-upload-limit-download-limit\" id=\"toc-entry-217\">set_download_limit() set_upload_limit() upload_limit() download_limit()</a></li>\n+<li><a class=\"reference internal\" href=\"#connect-peer\" id=\"toc-entry-218\">connect_peer()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-peers\" id=\"toc-entry-219\">clear_peers()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-max-uploads-max-uploads\" id=\"toc-entry-220\">set_max_uploads() max_uploads()</a></li>\n+<li><a class=\"reference internal\" href=\"#max-connections-set-max-connections\" id=\"toc-entry-221\">max_connections() set_max_connections()</a></li>\n+<li><a class=\"reference internal\" href=\"#move-storage\" id=\"toc-entry-222\">move_storage()</a></li>\n+<li><a class=\"reference internal\" href=\"#rename-file-1\" id=\"toc-entry-223\">rename_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hashes-info-hash-1\" id=\"toc-entry-224\">info_hashes() info_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-operator-operator\" id=\"toc-entry-225\">operator!=() operator==() operator<()</a></li>\n+<li><a class=\"reference internal\" href=\"#id\" id=\"toc-entry-226\">id()</a></li>\n+<li><a class=\"reference internal\" href=\"#native-handle\" id=\"toc-entry-227\">native_handle()</a></li>\n+<li><a class=\"reference internal\" href=\"#userdata\" id=\"toc-entry-228\">userdata()</a></li>\n+<li><a class=\"reference internal\" href=\"#in-session\" id=\"toc-entry-229\">in_session()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#port-filter\" id=\"toc-entry-208\">port_filter</a><ul>\n-<li><a class=\"reference internal\" href=\"#add-rule-1\" id=\"toc-entry-209\">add_rule()</a></li>\n-<li><a class=\"reference internal\" href=\"#access-1\" id=\"toc-entry-210\">access()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-access-flags-1\" id=\"toc-entry-211\">enum access_flags</a></li>\n+<li><a class=\"reference internal\" href=\"#hash-value\" id=\"toc-entry-230\">hash_value()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-proxy\" id=\"toc-entry-231\">session_proxy</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-session-proxy-session-proxy\" id=\"toc-entry-232\">operator=() session_proxy() ~session_proxy()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#client-data-t\" id=\"toc-entry-212\">client_data_t</a><ul>\n-<li><a class=\"reference internal\" href=\"#client-data-t-1\" id=\"toc-entry-213\">client_data_t()</a></li>\n-<li><a class=\"reference internal\" href=\"#const-void-operator\" id=\"toc-entry-214\">const*() void*() operator=()</a></li>\n+<li><a class=\"reference internal\" href=\"#session\" id=\"toc-entry-233\">session</a><ul>\n+<li><a class=\"reference internal\" href=\"#session-1\" id=\"toc-entry-234\">session()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-2\" id=\"toc-entry-235\">session()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-3\" id=\"toc-entry-236\">~session()</a></li>\n+<li><a class=\"reference internal\" href=\"#abort-2\" id=\"toc-entry-237\">abort()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#add-torrent-params\" id=\"toc-entry-215\">add_torrent_params</a></li>\n-<li><a class=\"reference internal\" href=\"#announce-infohash\" id=\"toc-entry-216\">announce_infohash</a></li>\n-<li><a class=\"reference internal\" href=\"#announce-endpoint\" id=\"toc-entry-217\">announce_endpoint</a></li>\n-<li><a class=\"reference internal\" href=\"#announce-entry\" id=\"toc-entry-218\">announce_entry</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-announce-entry-announce-entry\" id=\"toc-entry-219\">operator=() ~announce_entry() announce_entry()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-tracker-source\" id=\"toc-entry-220\">enum tracker_source</a></li>\n+<li><a class=\"reference internal\" href=\"#session-params\" id=\"toc-entry-238\">session_params</a><ul>\n+<li><a class=\"reference internal\" href=\"#session-params-1\" id=\"toc-entry-239\">session_params()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-params-2\" id=\"toc-entry-240\">session_params()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#alert\" id=\"toc-entry-221\">alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#timestamp\" id=\"toc-entry-222\">timestamp()</a></li>\n-<li><a class=\"reference internal\" href=\"#type\" id=\"toc-entry-223\">type()</a></li>\n-<li><a class=\"reference internal\" href=\"#what\" id=\"toc-entry-224\">what()</a></li>\n-<li><a class=\"reference internal\" href=\"#message\" id=\"toc-entry-225\">message()</a></li>\n-<li><a class=\"reference internal\" href=\"#category\" id=\"toc-entry-226\">category()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-handle\" id=\"toc-entry-241\">session_handle</a><ul>\n+<li><a class=\"reference internal\" href=\"#is-valid-2\" id=\"toc-entry-242\">is_valid()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-state\" id=\"toc-entry-243\">session_state()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-torrent-status-refresh-torrent-status\" id=\"toc-entry-244\">get_torrent_status() refresh_torrent_status()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-torrent-updates\" id=\"toc-entry-245\">post_torrent_updates()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-session-stats\" id=\"toc-entry-246\">post_session_stats()</a></li>\n+<li><a class=\"reference internal\" href=\"#post-dht-stats\" id=\"toc-entry-247\">post_dht_stats()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-dht-state\" id=\"toc-entry-248\">set_dht_state()</a></li>\n+<li><a class=\"reference internal\" href=\"#find-torrent-get-torrents\" id=\"toc-entry-249\">find_torrent() get_torrents()</a></li>\n+<li><a class=\"reference internal\" href=\"#async-add-torrent-add-torrent\" id=\"toc-entry-250\">async_add_torrent() add_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-paused-pause-resume\" id=\"toc-entry-251\">is_paused() pause() resume()</a></li>\n+<li><a class=\"reference internal\" href=\"#is-dht-running\" id=\"toc-entry-252\">is_dht_running()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-dht-storage\" id=\"toc-entry-253\">set_dht_storage()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-dht-node\" id=\"toc-entry-254\">add_dht_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-item\" id=\"toc-entry-255\">dht_get_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-item-1\" id=\"toc-entry-256\">dht_get_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-put-item\" id=\"toc-entry-257\">dht_put_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-put-item-1\" id=\"toc-entry-258\">dht_put_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-announce-dht-get-peers\" id=\"toc-entry-259\">dht_announce() dht_get_peers()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-live-nodes\" id=\"toc-entry-260\">dht_live_nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-sample-infohashes\" id=\"toc-entry-261\">dht_sample_infohashes()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-direct-request\" id=\"toc-entry-262\">dht_direct_request()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-extension-1\" id=\"toc-entry-263\">add_extension()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-ip-filter-get-ip-filter\" id=\"toc-entry-264\">set_ip_filter() get_ip_filter()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-port-filter\" id=\"toc-entry-265\">set_port_filter()</a></li>\n+<li><a class=\"reference internal\" href=\"#ssl-listen-port-is-listening-listen-port\" id=\"toc-entry-266\">ssl_listen_port() is_listening() listen_port()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-peer-class-filter-set-peer-class-filter\" id=\"toc-entry-267\">get_peer_class_filter() set_peer_class_filter()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-peer-class-type-filter-get-peer-class-type-filter\" id=\"toc-entry-268\">set_peer_class_type_filter() get_peer_class_type_filter()</a></li>\n+<li><a class=\"reference internal\" href=\"#create-peer-class\" id=\"toc-entry-269\">create_peer_class()</a></li>\n+<li><a class=\"reference internal\" href=\"#delete-peer-class\" id=\"toc-entry-270\">delete_peer_class()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-peer-class-set-peer-class\" id=\"toc-entry-271\">get_peer_class() set_peer_class()</a></li>\n+<li><a class=\"reference internal\" href=\"#remove-torrent-1\" id=\"toc-entry-272\">remove_torrent()</a></li>\n+<li><a class=\"reference internal\" href=\"#apply-settings-get-settings\" id=\"toc-entry-273\">apply_settings() get_settings()</a></li>\n+<li><a class=\"reference internal\" href=\"#pop-alerts-set-alert-notify-wait-for-alert\" id=\"toc-entry-274\">pop_alerts() set_alert_notify() wait_for_alert()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-port-mapping-delete-port-mapping\" id=\"toc-entry-275\">add_port_mapping() delete_port_mapping()</a></li>\n+<li><a class=\"reference internal\" href=\"#reopen-network-sockets\" id=\"toc-entry-276\">reopen_network_sockets()</a></li>\n+<li><a class=\"reference internal\" href=\"#native-handle-1\" id=\"toc-entry-277\">native_handle()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-routing-bucket\" id=\"toc-entry-227\">dht_routing_bucket</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-alert\" id=\"toc-entry-228\">torrent_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#message-1\" id=\"toc-entry-229\">message()</a></li>\n+<li><a class=\"reference internal\" href=\"#read-session-params-write-session-params-buf-write-session-params\" id=\"toc-entry-278\">read_session_params() write_session_params_buf() write_session_params()</a></li>\n+<li><a class=\"reference internal\" href=\"#counters\" id=\"toc-entry-279\">counters</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-inc-stats-counter\" id=\"toc-entry-280\">operator[]() inc_stats_counter()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-alert\" id=\"toc-entry-230\">peer_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-alert\" id=\"toc-entry-231\">tracker_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#tracker-url\" id=\"toc-entry-232\">tracker_url()</a></li>\n+<li><a class=\"reference internal\" href=\"#stats-metric\" id=\"toc-entry-281\">stats_metric</a></li>\n+<li><a class=\"reference internal\" href=\"#session-stats-metrics\" id=\"toc-entry-282\">session_stats_metrics()</a></li>\n+<li><a class=\"reference internal\" href=\"#find-metric-idx\" id=\"toc-entry-283\">find_metric_idx()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-metric-type-t\" id=\"toc-entry-284\">enum metric_type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-infohash\" id=\"toc-entry-285\">announce_infohash</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-endpoint\" id=\"toc-entry-286\">announce_endpoint</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-entry\" id=\"toc-entry-287\">announce_entry</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-announce-entry-announce-entry\" id=\"toc-entry-288\">operator=() ~announce_entry() announce_entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-tracker-source\" id=\"toc-entry-289\">enum tracker_source</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-removed-alert\" id=\"toc-entry-233\">torrent_removed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#read-piece-alert\" id=\"toc-entry-234\">read_piece_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-completed-alert\" id=\"toc-entry-235\">file_completed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-renamed-alert\" id=\"toc-entry-236\">file_renamed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#new-name-old-name\" id=\"toc-entry-237\">new_name() old_name()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-class-info\" id=\"toc-entry-290\">peer_class_info</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-class-type-filter\" id=\"toc-entry-291\">peer_class_type_filter</a><ul>\n+<li><a class=\"reference internal\" href=\"#remove-add\" id=\"toc-entry-292\">remove() add()</a></li>\n+<li><a class=\"reference internal\" href=\"#allow-disallow\" id=\"toc-entry-293\">allow() disallow()</a></li>\n+<li><a class=\"reference internal\" href=\"#apply\" id=\"toc-entry-294\">apply()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-socket-type-t\" id=\"toc-entry-295\">enum socket_type_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#file-rename-failed-alert\" id=\"toc-entry-238\">file_rename_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#performance-alert\" id=\"toc-entry-239\">performance_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-performance-warning-t\" id=\"toc-entry-240\">enum performance_warning_t</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-params\" id=\"toc-entry-296\">storage_params</a></li>\n+<li><a class=\"reference internal\" href=\"#file-slice\" id=\"toc-entry-297\">file_slice</a></li>\n+<li><a class=\"reference internal\" href=\"#file-storage\" id=\"toc-entry-298\">file_storage</a><ul>\n+<li><a class=\"reference internal\" href=\"#is-valid-3\" id=\"toc-entry-299\">is_valid()</a></li>\n+<li><a class=\"reference internal\" href=\"#reserve\" id=\"toc-entry-300\">reserve()</a></li>\n+<li><a class=\"reference internal\" href=\"#add-file-borrow-add-file\" id=\"toc-entry-301\">add_file_borrow() add_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#rename-file-2\" id=\"toc-entry-302\">rename_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#map-block-1\" id=\"toc-entry-303\">map_block()</a></li>\n+<li><a class=\"reference internal\" href=\"#map-file-1\" id=\"toc-entry-304\">map_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-files-1\" id=\"toc-entry-305\">num_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#end-file\" id=\"toc-entry-306\">end_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-range-1\" id=\"toc-entry-307\">file_range()</a></li>\n+<li><a class=\"reference internal\" href=\"#total-size-2\" id=\"toc-entry-308\">total_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-num-pieces-num-pieces\" id=\"toc-entry-309\">set_num_pieces() num_pieces()</a></li>\n+<li><a class=\"reference internal\" href=\"#end-piece\" id=\"toc-entry-310\">end_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#last-piece\" id=\"toc-entry-311\">last_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-range-1\" id=\"toc-entry-312\">piece_range()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-length-set-piece-length\" id=\"toc-entry-313\">piece_length() set_piece_length()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-size-1\" id=\"toc-entry-314\">piece_size()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-size2\" id=\"toc-entry-315\">piece_size2()</a></li>\n+<li><a class=\"reference internal\" href=\"#blocks-in-piece2\" id=\"toc-entry-316\">blocks_in_piece2()</a></li>\n+<li><a class=\"reference internal\" href=\"#blocks-per-piece-1\" id=\"toc-entry-317\">blocks_per_piece()</a></li>\n+<li><a class=\"reference internal\" href=\"#name-set-name\" id=\"toc-entry-318\">name() set_name()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap-1\" id=\"toc-entry-319\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#canonicalize\" id=\"toc-entry-320\">canonicalize()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-offset-symlink-hash-file-name-file-size-root-ptr-root-file-path-pad-file-at-mtime\" id=\"toc-entry-321\">file_offset() symlink() hash() file_name() file_size() root_ptr() root() file_path() pad_file_at() mtime()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-num-pieces-file-piece-range-file-num-blocks\" id=\"toc-entry-322\">file_num_pieces() file_piece_range() file_num_blocks()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-first-block-node-file-first-piece-node\" id=\"toc-entry-323\">file_first_block_node() file_first_piece_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-path-hash\" id=\"toc-entry-324\">file_path_hash()</a></li>\n+<li><a class=\"reference internal\" href=\"#all-path-hashes\" id=\"toc-entry-325\">all_path_hashes()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-flags\" id=\"toc-entry-326\">file_flags()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-absolute-path\" id=\"toc-entry-327\">file_absolute_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-index-at-piece-file-index-at-offset\" id=\"toc-entry-328\">file_index_at_piece() file_index_at_offset()</a></li>\n+<li><a class=\"reference internal\" href=\"#file-index-for-root\" id=\"toc-entry-329\">file_index_for_root()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-index-at-file\" id=\"toc-entry-330\">piece_index_at_file()</a></li>\n+<li><a class=\"reference internal\" href=\"#sanitize-symlinks\" id=\"toc-entry-331\">sanitize_symlinks()</a></li>\n+<li><a class=\"reference internal\" href=\"#v2\" id=\"toc-entry-332\">v2()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#state-changed-alert\" id=\"toc-entry-241\">state_changed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-error-alert\" id=\"toc-entry-242\">tracker_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#failure-reason\" id=\"toc-entry-243\">failure_reason()</a></li>\n+<li><a class=\"reference internal\" href=\"#mmap-disk-io-constructor\" id=\"toc-entry-333\">mmap_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#default-disk-io-constructor\" id=\"toc-entry-334\">default_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#disabled-disk-io-constructor\" id=\"toc-entry-335\">disabled_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#posix-disk-io-constructor\" id=\"toc-entry-336\">posix_disk_io_constructor()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-storage-mode-t\" id=\"toc-entry-337\">enum storage_mode_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-status-t\" id=\"toc-entry-338\">enum status_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-move-flags-t\" id=\"toc-entry-339\">enum move_flags_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-routing-bucket\" id=\"toc-entry-340\">dht_routing_bucket</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-alert\" id=\"toc-entry-341\">torrent_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#message\" id=\"toc-entry-342\">message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#tracker-warning-alert\" id=\"toc-entry-244\">tracker_warning_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#warning-message\" id=\"toc-entry-245\">warning_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-alert\" id=\"toc-entry-343\">peer_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-alert\" id=\"toc-entry-344\">tracker_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#tracker-url\" id=\"toc-entry-345\">tracker_url()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#scrape-reply-alert\" id=\"toc-entry-246\">scrape_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#scrape-failed-alert\" id=\"toc-entry-247\">scrape_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#error-message\" id=\"toc-entry-248\">error_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-removed-alert\" id=\"toc-entry-346\">torrent_removed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#read-piece-alert\" id=\"toc-entry-347\">read_piece_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-completed-alert\" id=\"toc-entry-348\">file_completed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-renamed-alert\" id=\"toc-entry-349\">file_renamed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#new-name-old-name\" id=\"toc-entry-350\">new_name() old_name()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#tracker-reply-alert\" id=\"toc-entry-249\">tracker_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-reply-alert\" id=\"toc-entry-250\">dht_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-announce-alert\" id=\"toc-entry-251\">tracker_announce_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#hash-failed-alert\" id=\"toc-entry-252\">hash_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-ban-alert\" id=\"toc-entry-253\">peer_ban_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-unsnubbed-alert\" id=\"toc-entry-254\">peer_unsnubbed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-snubbed-alert\" id=\"toc-entry-255\">peer_snubbed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-error-alert\" id=\"toc-entry-256\">peer_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-connect-alert\" id=\"toc-entry-257\">peer_connect_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t\" id=\"toc-entry-258\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#file-rename-failed-alert\" id=\"toc-entry-351\">file_rename_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#performance-alert\" id=\"toc-entry-352\">performance_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-performance-warning-t\" id=\"toc-entry-353\">enum performance_warning_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-disconnected-alert\" id=\"toc-entry-259\">peer_disconnected_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#invalid-request-alert\" id=\"toc-entry-260\">invalid_request_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-finished-alert\" id=\"toc-entry-261\">torrent_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-finished-alert\" id=\"toc-entry-262\">piece_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#request-dropped-alert\" id=\"toc-entry-263\">request_dropped_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-timeout-alert\" id=\"toc-entry-264\">block_timeout_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-finished-alert\" id=\"toc-entry-265\">block_finished_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#block-downloading-alert\" id=\"toc-entry-266\">block_downloading_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#unwanted-block-alert\" id=\"toc-entry-267\">unwanted_block_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#storage-moved-alert\" id=\"toc-entry-268\">storage_moved_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#storage-path-old-path\" id=\"toc-entry-269\">storage_path() old_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#state-changed-alert\" id=\"toc-entry-354\">state_changed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-error-alert\" id=\"toc-entry-355\">tracker_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#failure-reason\" id=\"toc-entry-356\">failure_reason()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#storage-moved-failed-alert\" id=\"toc-entry-270\">storage_moved_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#file-path\" id=\"toc-entry-271\">file_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-warning-alert\" id=\"toc-entry-357\">tracker_warning_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#warning-message\" id=\"toc-entry-358\">warning_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-deleted-alert\" id=\"toc-entry-272\">torrent_deleted_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-delete-failed-alert\" id=\"toc-entry-273\">torrent_delete_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#save-resume-data-alert\" id=\"toc-entry-274\">save_resume_data_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#save-resume-data-failed-alert\" id=\"toc-entry-275\">save_resume_data_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-paused-alert\" id=\"toc-entry-276\">torrent_paused_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-resumed-alert\" id=\"toc-entry-277\">torrent_resumed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-checked-alert\" id=\"toc-entry-278\">torrent_checked_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#url-seed-alert\" id=\"toc-entry-279\">url_seed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#server-url\" id=\"toc-entry-280\">server_url()</a></li>\n-<li><a class=\"reference internal\" href=\"#error-message-1\" id=\"toc-entry-281\">error_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#scrape-reply-alert\" id=\"toc-entry-359\">scrape_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#scrape-failed-alert\" id=\"toc-entry-360\">scrape_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#error-message\" id=\"toc-entry-361\">error_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#file-error-alert\" id=\"toc-entry-282\">file_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#filename\" id=\"toc-entry-283\">filename()</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-reply-alert\" id=\"toc-entry-362\">tracker_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-reply-alert\" id=\"toc-entry-363\">dht_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-announce-alert\" id=\"toc-entry-364\">tracker_announce_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#hash-failed-alert\" id=\"toc-entry-365\">hash_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-ban-alert\" id=\"toc-entry-366\">peer_ban_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-unsnubbed-alert\" id=\"toc-entry-367\">peer_unsnubbed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-snubbed-alert\" id=\"toc-entry-368\">peer_snubbed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-error-alert\" id=\"toc-entry-369\">peer_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-connect-alert\" id=\"toc-entry-370\">peer_connect_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t\" id=\"toc-entry-371\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#metadata-failed-alert\" id=\"toc-entry-284\">metadata_failed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#metadata-received-alert\" id=\"toc-entry-285\">metadata_received_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#udp-error-alert\" id=\"toc-entry-286\">udp_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#external-ip-alert\" id=\"toc-entry-287\">external_ip_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#listen-failed-alert\" id=\"toc-entry-288\">listen_failed_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#listen-interface\" id=\"toc-entry-289\">listen_interface()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-disconnected-alert\" id=\"toc-entry-372\">peer_disconnected_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#invalid-request-alert\" id=\"toc-entry-373\">invalid_request_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-finished-alert\" id=\"toc-entry-374\">torrent_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-finished-alert\" id=\"toc-entry-375\">piece_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#request-dropped-alert\" id=\"toc-entry-376\">request_dropped_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-timeout-alert\" id=\"toc-entry-377\">block_timeout_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-finished-alert\" id=\"toc-entry-378\">block_finished_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#block-downloading-alert\" id=\"toc-entry-379\">block_downloading_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#unwanted-block-alert\" id=\"toc-entry-380\">unwanted_block_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-moved-alert\" id=\"toc-entry-381\">storage_moved_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#storage-path-old-path\" id=\"toc-entry-382\">storage_path() old_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#listen-succeeded-alert\" id=\"toc-entry-290\">listen_succeeded_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-error-alert\" id=\"toc-entry-291\">portmap_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-alert\" id=\"toc-entry-292\">portmap_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#portmap-log-alert\" id=\"toc-entry-293\">portmap_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message\" id=\"toc-entry-294\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-moved-failed-alert\" id=\"toc-entry-383\">storage_moved_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#file-path\" id=\"toc-entry-384\">file_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#fastresume-rejected-alert\" id=\"toc-entry-295\">fastresume_rejected_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#file-path-1\" id=\"toc-entry-296\">file_path()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-deleted-alert\" id=\"toc-entry-385\">torrent_deleted_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-delete-failed-alert\" id=\"toc-entry-386\">torrent_delete_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#save-resume-data-alert\" id=\"toc-entry-387\">save_resume_data_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#save-resume-data-failed-alert\" id=\"toc-entry-388\">save_resume_data_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-paused-alert\" id=\"toc-entry-389\">torrent_paused_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-resumed-alert\" id=\"toc-entry-390\">torrent_resumed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-checked-alert\" id=\"toc-entry-391\">torrent_checked_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#url-seed-alert\" id=\"toc-entry-392\">url_seed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#server-url\" id=\"toc-entry-393\">server_url()</a></li>\n+<li><a class=\"reference internal\" href=\"#error-message-1\" id=\"toc-entry-394\">error_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-blocked-alert\" id=\"toc-entry-297\">peer_blocked_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#enum-reason-t\" id=\"toc-entry-298\">enum reason_t</a></li>\n+<li><a class=\"reference internal\" href=\"#file-error-alert\" id=\"toc-entry-395\">file_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#filename\" id=\"toc-entry-396\">filename()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-announce-alert\" id=\"toc-entry-299\">dht_announce_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-alert\" id=\"toc-entry-300\">dht_get_peers_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#cache-flushed-alert\" id=\"toc-entry-301\">cache_flushed_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#lsd-peer-alert\" id=\"toc-entry-302\">lsd_peer_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#trackerid-alert\" id=\"toc-entry-303\">trackerid_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#tracker-id\" id=\"toc-entry-304\">tracker_id()</a></li>\n+<li><a class=\"reference internal\" href=\"#metadata-failed-alert\" id=\"toc-entry-397\">metadata_failed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#metadata-received-alert\" id=\"toc-entry-398\">metadata_received_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#udp-error-alert\" id=\"toc-entry-399\">udp_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#external-ip-alert\" id=\"toc-entry-400\">external_ip_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#listen-failed-alert\" id=\"toc-entry-401\">listen_failed_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#listen-interface\" id=\"toc-entry-402\">listen_interface()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-bootstrap-alert\" id=\"toc-entry-305\">dht_bootstrap_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-error-alert\" id=\"toc-entry-306\">torrent_error_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#filename-1\" id=\"toc-entry-307\">filename()</a></li>\n+<li><a class=\"reference internal\" href=\"#listen-succeeded-alert\" id=\"toc-entry-403\">listen_succeeded_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-error-alert\" id=\"toc-entry-404\">portmap_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-alert\" id=\"toc-entry-405\">portmap_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#portmap-log-alert\" id=\"toc-entry-406\">portmap_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message\" id=\"toc-entry-407\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-need-cert-alert\" id=\"toc-entry-308\">torrent_need_cert_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#incoming-connection-alert\" id=\"toc-entry-309\">incoming_connection_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#add-torrent-alert\" id=\"toc-entry-310\">add_torrent_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#state-update-alert\" id=\"toc-entry-311\">state_update_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#session-stats-alert\" id=\"toc-entry-312\">session_stats_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#counters-1\" id=\"toc-entry-313\">counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#fastresume-rejected-alert\" id=\"toc-entry-408\">fastresume_rejected_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#file-path-1\" id=\"toc-entry-409\">file_path()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-error-alert\" id=\"toc-entry-314\">dht_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-immutable-item-alert\" id=\"toc-entry-315\">dht_immutable_item_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-mutable-item-alert\" id=\"toc-entry-316\">dht_mutable_item_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-put-alert\" id=\"toc-entry-317\">dht_put_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#i2p-alert\" id=\"toc-entry-318\">i2p_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-outgoing-get-peers-alert\" id=\"toc-entry-319\">dht_outgoing_get_peers_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#log-alert\" id=\"toc-entry-320\">log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-1\" id=\"toc-entry-321\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-blocked-alert\" id=\"toc-entry-410\">peer_blocked_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#enum-reason-t\" id=\"toc-entry-411\">enum reason_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-log-alert\" id=\"toc-entry-322\">torrent_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-2\" id=\"toc-entry-323\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-announce-alert\" id=\"toc-entry-412\">dht_announce_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-peers-alert\" id=\"toc-entry-413\">dht_get_peers_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#cache-flushed-alert\" id=\"toc-entry-414\">cache_flushed_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#lsd-peer-alert\" id=\"toc-entry-415\">lsd_peer_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#trackerid-alert\" id=\"toc-entry-416\">trackerid_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#tracker-id\" id=\"toc-entry-417\">tracker_id()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-log-alert\" id=\"toc-entry-324\">peer_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-3\" id=\"toc-entry-325\">log_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t-1\" id=\"toc-entry-326\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-bootstrap-alert\" id=\"toc-entry-418\">dht_bootstrap_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-error-alert\" id=\"toc-entry-419\">torrent_error_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#filename-1\" id=\"toc-entry-420\">filename()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#lsd-error-alert\" id=\"toc-entry-327\">lsd_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-lookup\" id=\"toc-entry-328\">dht_lookup</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-stats-alert\" id=\"toc-entry-329\">dht_stats_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#incoming-request-alert\" id=\"toc-entry-330\">incoming_request_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-log-alert\" id=\"toc-entry-331\">dht_log_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#log-message-4\" id=\"toc-entry-332\">log_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-dht-module-t\" id=\"toc-entry-333\">enum dht_module_t</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-need-cert-alert\" id=\"toc-entry-421\">torrent_need_cert_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#incoming-connection-alert\" id=\"toc-entry-422\">incoming_connection_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#add-torrent-alert\" id=\"toc-entry-423\">add_torrent_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#state-update-alert\" id=\"toc-entry-424\">state_update_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#session-stats-alert\" id=\"toc-entry-425\">session_stats_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#counters-1\" id=\"toc-entry-426\">counters()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-pkt-alert\" id=\"toc-entry-334\">dht_pkt_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#pkt-buf\" id=\"toc-entry-335\">pkt_buf()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-direction-t-2\" id=\"toc-entry-336\">enum direction_t</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-error-alert\" id=\"toc-entry-427\">dht_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-immutable-item-alert\" id=\"toc-entry-428\">dht_immutable_item_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-mutable-item-alert\" id=\"toc-entry-429\">dht_mutable_item_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-put-alert\" id=\"toc-entry-430\">dht_put_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#i2p-alert\" id=\"toc-entry-431\">i2p_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-outgoing-get-peers-alert\" id=\"toc-entry-432\">dht_outgoing_get_peers_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#log-alert\" id=\"toc-entry-433\">log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-1\" id=\"toc-entry-434\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-get-peers-reply-alert\" id=\"toc-entry-337\">dht_get_peers_reply_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-direct-response-alert\" id=\"toc-entry-338\">dht_direct_response_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#picker-log-alert\" id=\"toc-entry-339\">picker_log_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#session-error-alert\" id=\"toc-entry-340\">session_error_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-live-nodes-alert\" id=\"toc-entry-341\">dht_live_nodes_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#num-nodes-nodes\" id=\"toc-entry-342\">num_nodes() nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-log-alert\" id=\"toc-entry-435\">torrent_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-2\" id=\"toc-entry-436\">log_message()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#session-stats-header-alert\" id=\"toc-entry-343\">session_stats_header_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-sample-infohashes-alert\" id=\"toc-entry-344\">dht_sample_infohashes_alert</a><ul>\n-<li><a class=\"reference internal\" href=\"#samples-num-samples\" id=\"toc-entry-345\">samples() num_samples()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-nodes\" id=\"toc-entry-346\">num_nodes()</a></li>\n-<li><a class=\"reference internal\" href=\"#nodes-1\" id=\"toc-entry-347\">nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-log-alert\" id=\"toc-entry-437\">peer_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-3\" id=\"toc-entry-438\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t-1\" id=\"toc-entry-439\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#block-uploaded-alert\" id=\"toc-entry-348\">block_uploaded_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#alerts-dropped-alert\" id=\"toc-entry-349\">alerts_dropped_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#socks5-alert\" id=\"toc-entry-350\">socks5_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-prio-alert\" id=\"toc-entry-351\">file_prio_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#oversized-file-alert\" id=\"toc-entry-352\">oversized_file_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-conflict-alert\" id=\"toc-entry-353\">torrent_conflict_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-info-alert\" id=\"toc-entry-354\">peer_info_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#file-progress-alert\" id=\"toc-entry-355\">file_progress_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-info-alert\" id=\"toc-entry-356\">piece_info_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-availability-alert\" id=\"toc-entry-357\">piece_availability_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#tracker-list-alert\" id=\"toc-entry-358\">tracker_list_alert</a></li>\n-<li><a class=\"reference internal\" href=\"#alert-cast\" id=\"toc-entry-359\">alert_cast()</a></li>\n-<li><a class=\"reference internal\" href=\"#operation-name\" id=\"toc-entry-360\">operation_name()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-operation-t\" id=\"toc-entry-361\">enum operation_t</a></li>\n-<li><a class=\"reference internal\" href=\"#alert-category-t\" id=\"toc-entry-362\">alert_category_t</a></li>\n-<li><a class=\"reference internal\" href=\"#int-1\" id=\"toc-entry-363\">int</a></li>\n-<li><a class=\"reference internal\" href=\"#storage-params\" id=\"toc-entry-364\">storage_params</a></li>\n-<li><a class=\"reference internal\" href=\"#file-slice\" id=\"toc-entry-365\">file_slice</a></li>\n-<li><a class=\"reference internal\" href=\"#file-storage\" id=\"toc-entry-366\">file_storage</a><ul>\n-<li><a class=\"reference internal\" href=\"#is-valid-3\" id=\"toc-entry-367\">is_valid()</a></li>\n-<li><a class=\"reference internal\" href=\"#reserve\" id=\"toc-entry-368\">reserve()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-file-add-file-borrow\" id=\"toc-entry-369\">add_file() add_file_borrow()</a></li>\n-<li><a class=\"reference internal\" href=\"#rename-file-2\" id=\"toc-entry-370\">rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#map-block-1\" id=\"toc-entry-371\">map_block()</a></li>\n-<li><a class=\"reference internal\" href=\"#map-file-1\" id=\"toc-entry-372\">map_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-files-1\" id=\"toc-entry-373\">num_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#end-file\" id=\"toc-entry-374\">end_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-range\" id=\"toc-entry-375\">file_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#total-size-1\" id=\"toc-entry-376\">total_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-pieces-set-num-pieces\" id=\"toc-entry-377\">num_pieces() set_num_pieces()</a></li>\n-<li><a class=\"reference internal\" href=\"#end-piece\" id=\"toc-entry-378\">end_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#last-piece\" id=\"toc-entry-379\">last_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-range\" id=\"toc-entry-380\">piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-piece-length-piece-length\" id=\"toc-entry-381\">set_piece_length() piece_length()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-size-1\" id=\"toc-entry-382\">piece_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-size2\" id=\"toc-entry-383\">piece_size2()</a></li>\n-<li><a class=\"reference internal\" href=\"#blocks-in-piece2\" id=\"toc-entry-384\">blocks_in_piece2()</a></li>\n-<li><a class=\"reference internal\" href=\"#blocks-per-piece-1\" id=\"toc-entry-385\">blocks_per_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#name-set-name\" id=\"toc-entry-386\">name() set_name()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap-1\" id=\"toc-entry-387\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#canonicalize\" id=\"toc-entry-388\">canonicalize()</a></li>\n-<li><a class=\"reference internal\" href=\"#root-mtime-symlink-file-offset-hash-pad-file-at-root-ptr-file-name-file-path-file-size\" id=\"toc-entry-389\">root() mtime() symlink() file_offset() hash() pad_file_at() root_ptr() file_name() file_path() file_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-piece-range-file-num-blocks-file-num-pieces\" id=\"toc-entry-390\">file_piece_range() file_num_blocks() file_num_pieces()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-first-piece-node-file-first-block-node\" id=\"toc-entry-391\">file_first_piece_node() file_first_block_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-path-hash\" id=\"toc-entry-392\">file_path_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#all-path-hashes\" id=\"toc-entry-393\">all_path_hashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-flags\" id=\"toc-entry-394\">file_flags()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-absolute-path\" id=\"toc-entry-395\">file_absolute_path()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-index-at-offset-file-index-at-piece\" id=\"toc-entry-396\">file_index_at_offset() file_index_at_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-index-for-root\" id=\"toc-entry-397\">file_index_for_root()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-index-at-file\" id=\"toc-entry-398\">piece_index_at_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#sanitize-symlinks\" id=\"toc-entry-399\">sanitize_symlinks()</a></li>\n-<li><a class=\"reference internal\" href=\"#v2\" id=\"toc-entry-400\">v2()</a></li>\n+<li><a class=\"reference internal\" href=\"#lsd-error-alert\" id=\"toc-entry-440\">lsd_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-lookup\" id=\"toc-entry-441\">dht_lookup</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-stats-alert\" id=\"toc-entry-442\">dht_stats_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#incoming-request-alert\" id=\"toc-entry-443\">incoming_request_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-log-alert\" id=\"toc-entry-444\">dht_log_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#log-message-4\" id=\"toc-entry-445\">log_message()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-dht-module-t\" id=\"toc-entry-446\">enum dht_module_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#default-disk-io-constructor\" id=\"toc-entry-401\">default_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#posix-disk-io-constructor\" id=\"toc-entry-402\">posix_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#disabled-disk-io-constructor\" id=\"toc-entry-403\">disabled_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#mmap-disk-io-constructor\" id=\"toc-entry-404\">mmap_disk_io_constructor()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-storage-mode-t\" id=\"toc-entry-405\">enum storage_mode_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-status-t\" id=\"toc-entry-406\">enum status_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-move-flags-t\" id=\"toc-entry-407\">enum move_flags_t</a></li>\n-<li><a class=\"reference internal\" href=\"#a-word-of-caution\" id=\"toc-entry-408\">a word of caution</a></li>\n-<li><a class=\"reference internal\" href=\"#plugin-interface\" id=\"toc-entry-409\">plugin-interface</a></li>\n-<li><a class=\"reference internal\" href=\"#custom-alerts\" id=\"toc-entry-410\">custom alerts</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-connection-handle\" id=\"toc-entry-411\">peer_connection_handle</a></li>\n-<li><a class=\"reference internal\" href=\"#bt-peer-connection-handle\" id=\"toc-entry-412\">bt_peer_connection_handle</a></li>\n-<li><a class=\"reference internal\" href=\"#plugin\" id=\"toc-entry-413\">plugin</a><ul>\n-<li><a class=\"reference internal\" href=\"#implemented-features\" id=\"toc-entry-414\">implemented_features()</a></li>\n-<li><a class=\"reference internal\" href=\"#new-torrent\" id=\"toc-entry-415\">new_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#added\" id=\"toc-entry-416\">added()</a></li>\n-<li><a class=\"reference internal\" href=\"#abort-1\" id=\"toc-entry-417\">abort()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-dht-request\" id=\"toc-entry-418\">on_dht_request()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-alert\" id=\"toc-entry-419\">on_alert()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-unknown-torrent\" id=\"toc-entry-420\">on_unknown_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-tick\" id=\"toc-entry-421\">on_tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-unchoke-priority\" id=\"toc-entry-422\">get_unchoke_priority()</a></li>\n-<li><a class=\"reference internal\" href=\"#load-state\" id=\"toc-entry-423\">load_state()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-pkt-alert\" id=\"toc-entry-447\">dht_pkt_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#pkt-buf\" id=\"toc-entry-448\">pkt_buf()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-direction-t-2\" id=\"toc-entry-449\">enum direction_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#torrent-plugin\" id=\"toc-entry-424\">torrent_plugin</a><ul>\n-<li><a class=\"reference internal\" href=\"#new-connection\" id=\"toc-entry-425\">new_connection()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-piece-failed-on-piece-pass\" id=\"toc-entry-426\">on_piece_failed() on_piece_pass()</a></li>\n-<li><a class=\"reference internal\" href=\"#tick\" id=\"toc-entry-427\">tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-resume-on-pause\" id=\"toc-entry-428\">on_resume() on_pause()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-files-checked\" id=\"toc-entry-429\">on_files_checked()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-state\" id=\"toc-entry-430\">on_state()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-add-peer\" id=\"toc-entry-431\">on_add_peer()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-get-peers-reply-alert\" id=\"toc-entry-450\">dht_get_peers_reply_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-direct-response-alert\" id=\"toc-entry-451\">dht_direct_response_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#picker-log-alert\" id=\"toc-entry-452\">picker_log_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#session-error-alert\" id=\"toc-entry-453\">session_error_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-live-nodes-alert\" id=\"toc-entry-454\">dht_live_nodes_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#num-nodes-nodes\" id=\"toc-entry-455\">num_nodes() nodes()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-plugin\" id=\"toc-entry-432\">peer_plugin</a><ul>\n-<li><a class=\"reference internal\" href=\"#type-1\" id=\"toc-entry-433\">type()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-handshake\" id=\"toc-entry-434\">add_handshake()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-disconnect\" id=\"toc-entry-435\">on_disconnect()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-connected\" id=\"toc-entry-436\">on_connected()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-handshake\" id=\"toc-entry-437\">on_handshake()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-extension-handshake\" id=\"toc-entry-438\">on_extension_handshake()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-choke-on-unchoke-on-have-all-on-have-none-on-bitfield-on-not-interested-on-request-on-have-on-dont-have-on-interested-on-allowed-fast\" id=\"toc-entry-439\">on_choke() on_unchoke() on_have_all() on_have_none() on_bitfield() on_not_interested() on_request() on_have() on_dont_have() on_interested() on_allowed_fast()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-piece\" id=\"toc-entry-440\">on_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#sent-interested-sent-have-sent-not-interested-sent-piece-sent-unchoke\" id=\"toc-entry-441\">sent_interested() sent_have() sent_not_interested() sent_piece() sent_unchoke()</a></li>\n-<li><a class=\"reference internal\" href=\"#sent-payload\" id=\"toc-entry-442\">sent_payload()</a></li>\n-<li><a class=\"reference internal\" href=\"#can-disconnect\" id=\"toc-entry-443\">can_disconnect()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-extended\" id=\"toc-entry-444\">on_extended()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-unknown-message\" id=\"toc-entry-445\">on_unknown_message()</a></li>\n-<li><a class=\"reference internal\" href=\"#on-piece-failed-on-piece-pass-1\" id=\"toc-entry-446\">on_piece_failed() on_piece_pass()</a></li>\n-<li><a class=\"reference internal\" href=\"#tick-1\" id=\"toc-entry-447\">tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#write-request\" id=\"toc-entry-448\">write_request()</a></li>\n+<li><a class=\"reference internal\" href=\"#session-stats-header-alert\" id=\"toc-entry-456\">session_stats_header_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-sample-infohashes-alert\" id=\"toc-entry-457\">dht_sample_infohashes_alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#samples-num-samples\" id=\"toc-entry-458\">samples() num_samples()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-nodes\" id=\"toc-entry-459\">num_nodes()</a></li>\n+<li><a class=\"reference internal\" href=\"#nodes-1\" id=\"toc-entry-460\">nodes()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#crypto-plugin\" id=\"toc-entry-449\">crypto_plugin</a><ul>\n-<li><a class=\"reference internal\" href=\"#decrypt\" id=\"toc-entry-450\">decrypt()</a></li>\n+<li><a class=\"reference internal\" href=\"#block-uploaded-alert\" id=\"toc-entry-461\">block_uploaded_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#alerts-dropped-alert\" id=\"toc-entry-462\">alerts_dropped_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#socks5-alert\" id=\"toc-entry-463\">socks5_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-prio-alert\" id=\"toc-entry-464\">file_prio_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#oversized-file-alert\" id=\"toc-entry-465\">oversized_file_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-conflict-alert\" id=\"toc-entry-466\">torrent_conflict_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-info-alert\" id=\"toc-entry-467\">peer_info_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#file-progress-alert\" id=\"toc-entry-468\">file_progress_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-info-alert\" id=\"toc-entry-469\">piece_info_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-availability-alert\" id=\"toc-entry-470\">piece_availability_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#tracker-list-alert\" id=\"toc-entry-471\">tracker_list_alert</a></li>\n+<li><a class=\"reference internal\" href=\"#alert\" id=\"toc-entry-472\">alert</a><ul>\n+<li><a class=\"reference internal\" href=\"#timestamp\" id=\"toc-entry-473\">timestamp()</a></li>\n+<li><a class=\"reference internal\" href=\"#type-1\" id=\"toc-entry-474\">type()</a></li>\n+<li><a class=\"reference internal\" href=\"#what\" id=\"toc-entry-475\">what()</a></li>\n+<li><a class=\"reference internal\" href=\"#message-1\" id=\"toc-entry-476\">message()</a></li>\n+<li><a class=\"reference internal\" href=\"#category\" id=\"toc-entry-477\">category()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#create-smart-ban-plugin\" id=\"toc-entry-451\">create_smart_ban_plugin()</a></li>\n-<li><a class=\"reference internal\" href=\"#create-ut-pex-plugin\" id=\"toc-entry-452\">create_ut_pex_plugin()</a></li>\n-<li><a class=\"reference internal\" href=\"#create-ut-metadata-plugin\" id=\"toc-entry-453\">create_ut_metadata_plugin()</a></li>\n-<li><a class=\"reference internal\" href=\"#torrent-status\" id=\"toc-entry-454\">torrent_status</a><ul>\n-<li><a class=\"reference internal\" href=\"#operator-3\" id=\"toc-entry-455\">operator==()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-state-t\" id=\"toc-entry-456\">enum state_t</a></li>\n+<li><a class=\"reference internal\" href=\"#alert-cast\" id=\"toc-entry-478\">alert_cast()</a></li>\n+<li><a class=\"reference internal\" href=\"#operation-name\" id=\"toc-entry-479\">operation_name()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-operation-t\" id=\"toc-entry-480\">enum operation_t</a></li>\n+<li><a class=\"reference internal\" href=\"#int\" id=\"toc-entry-481\">int</a></li>\n+<li><a class=\"reference internal\" href=\"#alert-category-t\" id=\"toc-entry-482\">alert_category_t</a></li>\n+<li><a class=\"reference internal\" href=\"#hasher\" id=\"toc-entry-483\">hasher</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-hasher\" id=\"toc-entry-484\">operator=() hasher()</a></li>\n+<li><a class=\"reference internal\" href=\"#update\" id=\"toc-entry-485\">update()</a></li>\n+<li><a class=\"reference internal\" href=\"#final\" id=\"toc-entry-486\">final()</a></li>\n+<li><a class=\"reference internal\" href=\"#reset-1\" id=\"toc-entry-487\">reset()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#peer-class-info\" id=\"toc-entry-457\">peer_class_info</a></li>\n-<li><a class=\"reference internal\" href=\"#peer-class-type-filter\" id=\"toc-entry-458\">peer_class_type_filter</a><ul>\n-<li><a class=\"reference internal\" href=\"#remove-add\" id=\"toc-entry-459\">remove() add()</a></li>\n-<li><a class=\"reference internal\" href=\"#disallow-allow\" id=\"toc-entry-460\">disallow() allow()</a></li>\n-<li><a class=\"reference internal\" href=\"#apply\" id=\"toc-entry-461\">apply()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-socket-type-t-1\" id=\"toc-entry-462\">enum socket_type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#hasher256\" id=\"toc-entry-488\">hasher256</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-hasher256\" id=\"toc-entry-489\">operator=() hasher256()</a></li>\n+<li><a class=\"reference internal\" href=\"#update-1\" id=\"toc-entry-490\">update()</a></li>\n+<li><a class=\"reference internal\" href=\"#final-1\" id=\"toc-entry-491\">final()</a></li>\n+<li><a class=\"reference internal\" href=\"#reset-2\" id=\"toc-entry-492\">reset()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#disk-observer\" id=\"toc-entry-463\">disk_observer</a><ul>\n-<li><a class=\"reference internal\" href=\"#on-disk\" id=\"toc-entry-464\">on_disk()</a></li>\n+<li><a class=\"reference internal\" href=\"#bitfield\" id=\"toc-entry-493\">bitfield</a><ul>\n+<li><a class=\"reference internal\" href=\"#bitfield-1\" id=\"toc-entry-494\">bitfield()</a></li>\n+<li><a class=\"reference internal\" href=\"#assign\" id=\"toc-entry-495\">assign()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-get-bit\" id=\"toc-entry-496\">operator[]() get_bit()</a></li>\n+<li><a class=\"reference internal\" href=\"#set-bit-clear-bit\" id=\"toc-entry-497\">set_bit() clear_bit()</a></li>\n+<li><a class=\"reference internal\" href=\"#all-set\" id=\"toc-entry-498\">all_set()</a></li>\n+<li><a class=\"reference internal\" href=\"#none-set\" id=\"toc-entry-499\">none_set()</a></li>\n+<li><a class=\"reference internal\" href=\"#size\" id=\"toc-entry-500\">size()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-words\" id=\"toc-entry-501\">num_words()</a></li>\n+<li><a class=\"reference internal\" href=\"#num-bytes\" id=\"toc-entry-502\">num_bytes()</a></li>\n+<li><a class=\"reference internal\" href=\"#empty-1\" id=\"toc-entry-503\">empty()</a></li>\n+<li><a class=\"reference internal\" href=\"#data-1\" id=\"toc-entry-504\">data()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap-2\" id=\"toc-entry-505\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#count\" id=\"toc-entry-506\">count()</a></li>\n+<li><a class=\"reference internal\" href=\"#find-first-set\" id=\"toc-entry-507\">find_first_set()</a></li>\n+<li><a class=\"reference internal\" href=\"#find-last-clear\" id=\"toc-entry-508\">find_last_clear()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#open-file-state\" id=\"toc-entry-465\">open_file_state</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-interface\" id=\"toc-entry-466\">disk_interface</a><ul>\n-<li><a class=\"reference internal\" href=\"#new-torrent-1\" id=\"toc-entry-467\">new_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#remove-torrent-1\" id=\"toc-entry-468\">remove_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-read-async-write\" id=\"toc-entry-469\">async_read() async_write()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-hash\" id=\"toc-entry-470\">async_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-hash2\" id=\"toc-entry-471\">async_hash2()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-move-storage\" id=\"toc-entry-472\">async_move_storage()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-release-files\" id=\"toc-entry-473\">async_release_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-check-files\" id=\"toc-entry-474\">async_check_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-stop-torrent\" id=\"toc-entry-475\">async_stop_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-rename-file\" id=\"toc-entry-476\">async_rename_file()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-delete-files\" id=\"toc-entry-477\">async_delete_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-set-file-priority\" id=\"toc-entry-478\">async_set_file_priority()</a></li>\n-<li><a class=\"reference internal\" href=\"#async-clear-piece\" id=\"toc-entry-479\">async_clear_piece()</a></li>\n-<li><a class=\"reference internal\" href=\"#update-stats-counters\" id=\"toc-entry-480\">update_stats_counters()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-status\" id=\"toc-entry-481\">get_status()</a></li>\n-<li><a class=\"reference internal\" href=\"#abort-2\" id=\"toc-entry-482\">abort()</a></li>\n-<li><a class=\"reference internal\" href=\"#submit-jobs\" id=\"toc-entry-483\">submit_jobs()</a></li>\n-<li><a class=\"reference internal\" href=\"#settings-updated\" id=\"toc-entry-484\">settings_updated()</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-request\" id=\"toc-entry-509\">peer_request</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-2\" id=\"toc-entry-510\">operator==()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#storage-holder\" id=\"toc-entry-485\">storage_holder</a></li>\n-<li><a class=\"reference internal\" href=\"#settings-interface\" id=\"toc-entry-486\">settings_interface</a></li>\n-<li><a class=\"reference internal\" href=\"#buffer-allocator-interface\" id=\"toc-entry-487\">buffer_allocator_interface</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder\" id=\"toc-entry-488\">disk_buffer_holder</a><ul>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-1\" id=\"toc-entry-489\">disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-2\" id=\"toc-entry-490\">disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#disk-buffer-holder-3\" id=\"toc-entry-491\">~disk_buffer_holder()</a></li>\n-<li><a class=\"reference internal\" href=\"#data-1\" id=\"toc-entry-492\">data()</a></li>\n-<li><a class=\"reference internal\" href=\"#reset-2\" id=\"toc-entry-493\">reset()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap-2\" id=\"toc-entry-494\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#is-mutable\" id=\"toc-entry-495\">is_mutable()</a></li>\n-<li><a class=\"reference internal\" href=\"#bool\" id=\"toc-entry-496\">bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#piece-block\" id=\"toc-entry-511\">piece_block</a></li>\n+<li><a class=\"reference internal\" href=\"#peer-info\" id=\"toc-entry-512\">peer_info</a><ul>\n+<li><a class=\"reference internal\" href=\"#i2p-destination\" id=\"toc-entry-513\">i2p_destination()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#file-open-mode-t\" id=\"toc-entry-497\">file_open_mode_t</a></li>\n-<li><a class=\"reference internal\" href=\"#settings-pack\" id=\"toc-entry-498\">settings_pack</a><ul>\n-<li><a class=\"reference internal\" href=\"#set-bool-set-int-set-str\" id=\"toc-entry-499\">set_bool() set_int() set_str()</a></li>\n-<li><a class=\"reference internal\" href=\"#has-val\" id=\"toc-entry-500\">has_val()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear\" id=\"toc-entry-501\">clear()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-1\" id=\"toc-entry-502\">clear()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-str-get-bool-get-int\" id=\"toc-entry-503\">get_str() get_bool() get_int()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-type-bases\" id=\"toc-entry-504\">enum type_bases</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-mmap-write-mode-t\" id=\"toc-entry-505\">enum mmap_write_mode_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-suggest-mode-t\" id=\"toc-entry-506\">enum suggest_mode_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-choking-algorithm-t\" id=\"toc-entry-507\">enum choking_algorithm_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-seed-choking-algorithm-t\" id=\"toc-entry-508\">enum seed_choking_algorithm_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-io-buffer-mode-t\" id=\"toc-entry-509\">enum io_buffer_mode_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-bandwidth-mixed-algo-t\" id=\"toc-entry-510\">enum bandwidth_mixed_algo_t</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-enc-policy\" id=\"toc-entry-511\">enum enc_policy</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-enc-level\" id=\"toc-entry-512\">enum enc_level</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-proxy-type-t\" id=\"toc-entry-513\">enum proxy_type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#info-hash-t\" id=\"toc-entry-514\">info_hash_t</a><ul>\n+<li><a class=\"reference internal\" href=\"#info-hash-t-1\" id=\"toc-entry-515\">info_hash_t()</a></li>\n+<li><a class=\"reference internal\" href=\"#has-v2-has-v1-has\" id=\"toc-entry-516\">has_v2() has_v1() has()</a></li>\n+<li><a class=\"reference internal\" href=\"#get\" id=\"toc-entry-517\">get()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-best\" id=\"toc-entry-518\">get_best()</a></li>\n+<li><a class=\"reference internal\" href=\"#for-each\" id=\"toc-entry-519\">for_each()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#min-memory-usage-high-performance-seed\" id=\"toc-entry-514\">min_memory_usage() high_performance_seed()</a></li>\n-<li><a class=\"reference internal\" href=\"#generate-fingerprint\" id=\"toc-entry-515\">generate_fingerprint()</a></li>\n-<li><a class=\"reference internal\" href=\"#name-for-setting-setting-by-name\" id=\"toc-entry-516\">name_for_setting() setting_by_name()</a></li>\n-<li><a class=\"reference internal\" href=\"#default-settings\" id=\"toc-entry-517\">default_settings()</a></li>\n-<li><a class=\"reference internal\" href=\"#storage-error\" id=\"toc-entry-518\">storage_error</a><ul>\n-<li><a class=\"reference internal\" href=\"#bool-1\" id=\"toc-entry-519\">bool()</a></li>\n-<li><a class=\"reference internal\" href=\"#file\" id=\"toc-entry-520\">file()</a></li>\n+<li><a class=\"reference internal\" href=\"#load-torrent-parsed-load-torrent-file-load-torrent-buffer\" id=\"toc-entry-520\">load_torrent_parsed() load_torrent_file() load_torrent_buffer()</a></li>\n+<li><a class=\"reference internal\" href=\"#truncate-files\" id=\"toc-entry-521\">truncate_files()</a></li>\n+<li><a class=\"reference internal\" href=\"#make-magnet-uri\" id=\"toc-entry-522\">make_magnet_uri()</a></li>\n+<li><a class=\"reference internal\" href=\"#parse-magnet-uri\" id=\"toc-entry-523\">parse_magnet_uri()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-peer-equal\" id=\"toc-entry-524\">torrent_peer_equal()</a></li>\n+<li><a class=\"reference internal\" href=\"#version\" id=\"toc-entry-525\">version()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-event-t\" id=\"toc-entry-526\">enum event_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-portmap-transport\" id=\"toc-entry-527\">enum portmap_transport</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-portmap-protocol\" id=\"toc-entry-528\">enum portmap_protocol</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-protocol-version\" id=\"toc-entry-529\">enum protocol_version</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-socket-type-t-1\" id=\"toc-entry-530\">enum socket_type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-connection-type\" id=\"toc-entry-531\">enum connection_type</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-flags-t\" id=\"toc-entry-532\">torrent_flags_t</a></li>\n+<li><a class=\"reference internal\" href=\"#int-1\" id=\"toc-entry-533\">int</a></li>\n+<li><a class=\"reference internal\" href=\"#pex-flags-t\" id=\"toc-entry-534\">pex_flags_t</a></li>\n+<li><a class=\"reference internal\" href=\"#char-const\" id=\"toc-entry-535\">char const*</a></li>\n+<li><a class=\"reference internal\" href=\"#std-uint64-t\" id=\"toc-entry-536\">std::uint64_t</a></li>\n+<li><a class=\"reference internal\" href=\"#download-priority-t\" id=\"toc-entry-537\">download_priority_t</a></li>\n+<li><a class=\"reference internal\" href=\"#bdecode-node\" id=\"toc-entry-538\">bdecode_node</a><ul>\n+<li><a class=\"reference internal\" href=\"#bdecode-node-1\" id=\"toc-entry-539\">bdecode_node()</a></li>\n+<li><a class=\"reference internal\" href=\"#bdecode-node-operator\" id=\"toc-entry-540\">bdecode_node() operator=()</a></li>\n+<li><a class=\"reference internal\" href=\"#type-2\" id=\"toc-entry-541\">type()</a></li>\n+<li><a class=\"reference internal\" href=\"#bool-1\" id=\"toc-entry-542\">bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#non-owning\" id=\"toc-entry-543\">non_owning()</a></li>\n+<li><a class=\"reference internal\" href=\"#data-section-data-offset\" id=\"toc-entry-544\">data_section() data_offset()</a></li>\n+<li><a class=\"reference internal\" href=\"#list-size-list-at-list-string-value-at-list-int-value-at\" id=\"toc-entry-545\">list_size() list_at() list_string_value_at() list_int_value_at()</a></li>\n+<li><a class=\"reference internal\" href=\"#dict-at-node-dict-find-int-dict-find-int-value-dict-find-list-dict-find-dict-at-dict-size-dict-find-string-dict-find-string-value-dict-find-dict\" id=\"toc-entry-546\">dict_at_node() dict_find_int() dict_find_int_value() dict_find_list() dict_find() dict_at() dict_size() dict_find_string() dict_find_string_value() dict_find_dict()</a></li>\n+<li><a class=\"reference internal\" href=\"#int-value\" id=\"toc-entry-547\">int_value()</a></li>\n+<li><a class=\"reference internal\" href=\"#string-offset-string-ptr-string-value-string-length\" id=\"toc-entry-548\">string_offset() string_ptr() string_value() string_length()</a></li>\n+<li><a class=\"reference internal\" href=\"#clear-2\" id=\"toc-entry-549\">clear()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap-3\" id=\"toc-entry-550\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#reserve-1\" id=\"toc-entry-551\">reserve()</a></li>\n+<li><a class=\"reference internal\" href=\"#switch-underlying-buffer\" id=\"toc-entry-552\">switch_underlying_buffer()</a></li>\n+<li><a class=\"reference internal\" href=\"#has-soft-error\" id=\"toc-entry-553\">has_soft_error()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-type-t-1\" id=\"toc-entry-554\">enum type_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#libtorrent-category\" id=\"toc-entry-521\">libtorrent_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#http-category\" id=\"toc-entry-522\">http_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#i2p-category\" id=\"toc-entry-523\">i2p_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#bdecode-category\" id=\"toc-entry-524\">bdecode_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#pcp-category\" id=\"toc-entry-525\">pcp_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#socks-category\" id=\"toc-entry-526\">socks_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#gzip-category\" id=\"toc-entry-527\">gzip_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#upnp-category\" id=\"toc-entry-528\">upnp_category()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum\" id=\"toc-entry-529\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-http-errors\" id=\"toc-entry-530\">enum http_errors</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-i2p-error-code\" id=\"toc-entry-531\">enum i2p_error_code</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-1\" id=\"toc-entry-532\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-pcp-errors\" id=\"toc-entry-533\">enum pcp_errors</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-socks-error-code\" id=\"toc-entry-534\">enum socks_error_code</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-2\" id=\"toc-entry-535\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-error-code-enum-3\" id=\"toc-entry-536\">enum error_code_enum</a></li>\n-<li><a class=\"reference internal\" href=\"#bdecode-node\" id=\"toc-entry-537\">bdecode_node</a><ul>\n-<li><a class=\"reference internal\" href=\"#bdecode-node-1\" id=\"toc-entry-538\">bdecode_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-bdecode-node\" id=\"toc-entry-539\">operator=() bdecode_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#type-2\" id=\"toc-entry-540\">type()</a></li>\n-<li><a class=\"reference internal\" href=\"#bool-2\" id=\"toc-entry-541\">bool()</a></li>\n-<li><a class=\"reference internal\" href=\"#non-owning\" id=\"toc-entry-542\">non_owning()</a></li>\n-<li><a class=\"reference internal\" href=\"#data-section-data-offset\" id=\"toc-entry-543\">data_section() data_offset()</a></li>\n-<li><a class=\"reference internal\" href=\"#list-string-value-at-list-int-value-at-list-size-list-at\" id=\"toc-entry-544\">list_string_value_at() list_int_value_at() list_size() list_at()</a></li>\n-<li><a class=\"reference internal\" href=\"#dict-find-int-dict-size-dict-at-node-dict-at-dict-find-string-dict-find-string-value-dict-find-dict-find-int-value-dict-find-list-dict-find-dict\" id=\"toc-entry-545\">dict_find_int() dict_size() dict_at_node() dict_at() dict_find_string() dict_find_string_value() dict_find() dict_find_int_value() dict_find_list() dict_find_dict()</a></li>\n-<li><a class=\"reference internal\" href=\"#int-value\" id=\"toc-entry-546\">int_value()</a></li>\n-<li><a class=\"reference internal\" href=\"#string-value-string-offset-string-length-string-ptr\" id=\"toc-entry-547\">string_value() string_offset() string_length() string_ptr()</a></li>\n-<li><a class=\"reference internal\" href=\"#clear-2\" id=\"toc-entry-548\">clear()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap-3\" id=\"toc-entry-549\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#reserve-1\" id=\"toc-entry-550\">reserve()</a></li>\n-<li><a class=\"reference internal\" href=\"#switch-underlying-buffer\" id=\"toc-entry-551\">switch_underlying_buffer()</a></li>\n-<li><a class=\"reference internal\" href=\"#has-soft-error\" id=\"toc-entry-552\">has_soft_error()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-type-t-1\" id=\"toc-entry-553\">enum type_t</a></li>\n+<li><a class=\"reference internal\" href=\"#print-entry\" id=\"toc-entry-555\">print_entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#bdecode\" id=\"toc-entry-556\">bdecode()</a></li>\n+<li><a class=\"reference internal\" href=\"#torrent-status\" id=\"toc-entry-557\">torrent_status</a><ul>\n+<li><a class=\"reference internal\" href=\"#operator-3\" id=\"toc-entry-558\">operator==()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-state-t\" id=\"toc-entry-559\">enum state_t</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#print-entry\" id=\"toc-entry-554\">print_entry()</a></li>\n-<li><a class=\"reference internal\" href=\"#bdecode\" id=\"toc-entry-555\">bdecode()</a></li>\n-<li><a class=\"reference internal\" href=\"#entry\" id=\"toc-entry-556\">entry</a><ul>\n-<li><a class=\"reference internal\" href=\"#type-3\" id=\"toc-entry-557\">type()</a></li>\n-<li><a class=\"reference internal\" href=\"#entry-1\" id=\"toc-entry-558\">entry()</a></li>\n-<li><a class=\"reference internal\" href=\"#entry-2\" id=\"toc-entry-559\">entry()</a></li>\n-<li><a class=\"reference internal\" href=\"#entry-3\" id=\"toc-entry-560\">entry()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-4\" id=\"toc-entry-561\">operator=()</a></li>\n-<li><a class=\"reference internal\" href=\"#preformatted-dict-list-string-integer\" id=\"toc-entry-562\">preformatted() dict() list() string() integer()</a></li>\n-<li><a class=\"reference internal\" href=\"#swap-4\" id=\"toc-entry-563\">swap()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-5\" id=\"toc-entry-564\">operator[]()</a></li>\n-<li><a class=\"reference internal\" href=\"#find-key\" id=\"toc-entry-565\">find_key()</a></li>\n-<li><a class=\"reference internal\" href=\"#to-string\" id=\"toc-entry-566\">to_string()</a></li>\n-<li><a class=\"reference internal\" href=\"#enum-data-type\" id=\"toc-entry-567\">enum data_type</a></li>\n+<li><a class=\"reference internal\" href=\"#entry\" id=\"toc-entry-560\">entry</a><ul>\n+<li><a class=\"reference internal\" href=\"#type-3\" id=\"toc-entry-561\">type()</a></li>\n+<li><a class=\"reference internal\" href=\"#entry-1\" id=\"toc-entry-562\">entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#entry-2\" id=\"toc-entry-563\">entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#entry-3\" id=\"toc-entry-564\">entry()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-4\" id=\"toc-entry-565\">operator=()</a></li>\n+<li><a class=\"reference internal\" href=\"#string-preformatted-list-integer-dict\" id=\"toc-entry-566\">string() preformatted() list() integer() dict()</a></li>\n+<li><a class=\"reference internal\" href=\"#swap-4\" id=\"toc-entry-567\">swap()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-5\" id=\"toc-entry-568\">operator[]()</a></li>\n+<li><a class=\"reference internal\" href=\"#find-key\" id=\"toc-entry-569\">find_key()</a></li>\n+<li><a class=\"reference internal\" href=\"#to-string\" id=\"toc-entry-570\">to_string()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-data-type\" id=\"toc-entry-571\">enum data_type</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#bencode\" id=\"toc-entry-568\">bencode()</a></li>\n-<li><a class=\"reference internal\" href=\"#operator-6\" id=\"toc-entry-569\">operator<<()</a></li>\n-<li><a class=\"reference internal\" href=\"#create-torrent\" id=\"toc-entry-570\">create_torrent</a><ul>\n-<li><a class=\"reference internal\" href=\"#create-torrent-1\" id=\"toc-entry-571\">create_torrent()</a></li>\n-<li><a class=\"reference internal\" href=\"#generate-generate-buf\" id=\"toc-entry-572\">generate() generate_buf()</a></li>\n-<li><a class=\"reference internal\" href=\"#files\" id=\"toc-entry-573\">files()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-comment\" id=\"toc-entry-574\">set_comment()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-creator\" id=\"toc-entry-575\">set_creator()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-creation-date\" id=\"toc-entry-576\">set_creation_date()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-hash\" id=\"toc-entry-577\">set_hash()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-hash2\" id=\"toc-entry-578\">set_hash2()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-http-seed-add-url-seed\" id=\"toc-entry-579\">add_http_seed() add_url_seed()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-node-1\" id=\"toc-entry-580\">add_node()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-tracker\" id=\"toc-entry-581\">add_tracker()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-root-cert\" id=\"toc-entry-582\">set_root_cert()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-priv-priv\" id=\"toc-entry-583\">set_priv() priv()</a></li>\n-<li><a class=\"reference internal\" href=\"#num-pieces\" id=\"toc-entry-584\">num_pieces()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-range-1\" id=\"toc-entry-585\">piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-range-1\" id=\"toc-entry-586\">file_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#file-piece-range\" id=\"toc-entry-587\">file_piece_range()</a></li>\n-<li><a class=\"reference internal\" href=\"#total-size-2\" id=\"toc-entry-588\">total_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#piece-length-piece-size\" id=\"toc-entry-589\">piece_length() piece_size()</a></li>\n-<li><a class=\"reference internal\" href=\"#add-similar-torrent-add-collection\" id=\"toc-entry-590\">add_similar_torrent() add_collection()</a></li>\n+<li><a class=\"reference internal\" href=\"#bencode\" id=\"toc-entry-572\">bencode()</a></li>\n+<li><a class=\"reference internal\" href=\"#operator-6\" id=\"toc-entry-573\">operator<<()</a></li>\n+<li><a class=\"reference internal\" href=\"#storage-error\" id=\"toc-entry-574\">storage_error</a><ul>\n+<li><a class=\"reference internal\" href=\"#bool-2\" id=\"toc-entry-575\">bool()</a></li>\n+<li><a class=\"reference internal\" href=\"#file\" id=\"toc-entry-576\">file()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#add-files\" id=\"toc-entry-591\">add_files()</a></li>\n-<li><a class=\"reference internal\" href=\"#set-piece-hashes\" id=\"toc-entry-592\">set_piece_hashes()</a></li>\n-<li><a class=\"reference internal\" href=\"#dht-storage-counters\" id=\"toc-entry-593\">dht_storage_counters</a><ul>\n-<li><a class=\"reference internal\" href=\"#reset-3\" id=\"toc-entry-594\">reset()</a></li>\n+<li><a class=\"reference internal\" href=\"#gzip-category\" id=\"toc-entry-577\">gzip_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#upnp-category\" id=\"toc-entry-578\">upnp_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#bdecode-category\" id=\"toc-entry-579\">bdecode_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#pcp-category\" id=\"toc-entry-580\">pcp_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#i2p-category\" id=\"toc-entry-581\">i2p_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#libtorrent-category\" id=\"toc-entry-582\">libtorrent_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#http-category\" id=\"toc-entry-583\">http_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#socks-category\" id=\"toc-entry-584\">socks_category()</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum\" id=\"toc-entry-585\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-1\" id=\"toc-entry-586\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-2\" id=\"toc-entry-587\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-pcp-errors\" id=\"toc-entry-588\">enum pcp_errors</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-i2p-error-code\" id=\"toc-entry-589\">enum i2p_error_code</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-error-code-enum-3\" id=\"toc-entry-590\">enum error_code_enum</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-http-errors\" id=\"toc-entry-591\">enum http_errors</a></li>\n+<li><a class=\"reference internal\" href=\"#enum-socks-error-code\" id=\"toc-entry-592\">enum socks_error_code</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-state\" id=\"toc-entry-593\">dht_state</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-storage-counters\" id=\"toc-entry-594\">dht_storage_counters</a><ul>\n+<li><a class=\"reference internal\" href=\"#reset-3\" id=\"toc-entry-595\">reset()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-storage-interface\" id=\"toc-entry-595\">dht_storage_interface</a><ul>\n-<li><a class=\"reference internal\" href=\"#update-node-ids\" id=\"toc-entry-596\">update_node_ids()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-peers\" id=\"toc-entry-597\">get_peers()</a></li>\n-<li><a class=\"reference internal\" href=\"#announce-peer\" id=\"toc-entry-598\">announce_peer()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-immutable-item\" id=\"toc-entry-599\">get_immutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#put-immutable-item\" id=\"toc-entry-600\">put_immutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-mutable-item-seq\" id=\"toc-entry-601\">get_mutable_item_seq()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-mutable-item\" id=\"toc-entry-602\">get_mutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#put-mutable-item\" id=\"toc-entry-603\">put_mutable_item()</a></li>\n-<li><a class=\"reference internal\" href=\"#get-infohashes-sample\" id=\"toc-entry-604\">get_infohashes_sample()</a></li>\n-<li><a class=\"reference internal\" href=\"#tick-2\" id=\"toc-entry-605\">tick()</a></li>\n-<li><a class=\"reference internal\" href=\"#counters-2\" id=\"toc-entry-606\">counters()</a></li>\n+<li><a class=\"reference internal\" href=\"#dht-storage-interface\" id=\"toc-entry-596\">dht_storage_interface</a><ul>\n+<li><a class=\"reference internal\" href=\"#update-node-ids\" id=\"toc-entry-597\">update_node_ids()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-peers\" id=\"toc-entry-598\">get_peers()</a></li>\n+<li><a class=\"reference internal\" href=\"#announce-peer\" id=\"toc-entry-599\">announce_peer()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-immutable-item\" id=\"toc-entry-600\">get_immutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#put-immutable-item\" id=\"toc-entry-601\">put_immutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-mutable-item-seq\" id=\"toc-entry-602\">get_mutable_item_seq()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-mutable-item\" id=\"toc-entry-603\">get_mutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#put-mutable-item\" id=\"toc-entry-604\">put_mutable_item()</a></li>\n+<li><a class=\"reference internal\" href=\"#get-infohashes-sample\" id=\"toc-entry-605\">get_infohashes_sample()</a></li>\n+<li><a class=\"reference internal\" href=\"#tick-2\" id=\"toc-entry-606\">tick()</a></li>\n+<li><a class=\"reference internal\" href=\"#counters-2\" id=\"toc-entry-607\">counters()</a></li>\n </ul>\n </li>\n-<li><a class=\"reference internal\" href=\"#dht-state\" id=\"toc-entry-607\">dht_state</a></li>\n <li><a class=\"reference internal\" href=\"#dht-default-storage-constructor\" id=\"toc-entry-608\">dht_default_storage_constructor()</a></li>\n <li><a class=\"reference internal\" href=\"#sign-mutable-item\" id=\"toc-entry-609\">sign_mutable_item()</a></li>\n <li><a class=\"reference internal\" href=\"#announce-flags-t\" id=\"toc-entry-610\">announce_flags_t</a></li>\n <li><a class=\"reference internal\" href=\"#read-resume-data\" id=\"toc-entry-611\">read_resume_data()</a></li>\n-<li><a class=\"reference internal\" href=\"#write-resume-data-buf-write-resume-data\" id=\"toc-entry-612\">write_resume_data_buf() write_resume_data()</a></li>\n+<li><a class=\"reference internal\" href=\"#write-resume-data-write-resume-data-buf\" id=\"toc-entry-612\">write_resume_data() write_resume_data_buf()</a></li>\n <li><a class=\"reference internal\" href=\"#write-torrent-file-buf-write-torrent-file\" id=\"toc-entry-613\">write_torrent_file_buf() write_torrent_file()</a></li>\n <li><a class=\"reference internal\" href=\"#write-torrent-flags-t\" id=\"toc-entry-614\">write_torrent_flags_t</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-create-seed\" id=\"toc-entry-615\">ed25519_create_seed()</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-create-keypair\" id=\"toc-entry-616\">ed25519_create_keypair()</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-sign\" id=\"toc-entry-617\">ed25519_sign()</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-verify\" id=\"toc-entry-618\">ed25519_verify()</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-add-scalar\" id=\"toc-entry-619\">ed25519_add_scalar()</a></li>\n <li><a class=\"reference internal\" href=\"#ed25519-key-exchange\" id=\"toc-entry-620\">ed25519_key_exchange()</a></li>\n </ul>\n </div>\n-<a name=\"piece_block\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_block&labels=documentation&body=Documentation+under+heading+%22class+piece_block%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"piece-block\">\n-<h1>piece_block</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/piece_block.hpp\">libtorrent/piece_block.hpp</a>"</p>\n+<p>libtorrent has a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n+<p>In short, the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> interface makes it possible to:</p>\n+<ul class=\"simple\">\n+<li>register extension messages (sent in the extension handshake), see\n+<a class=\"reference external\" href=\"manual-ref.html#extensions\">extensions</a>.</li>\n+<li>add data and parse data from the extension handshake.</li>\n+<li>send extension messages and standard bittorrent messages.</li>\n+<li>override or block the handling of standard bittorrent messages.</li>\n+<li>save and restore state via the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state</li>\n+<li>see all alerts that are posted</li>\n+</ul>\n+<div class=\"section\" id=\"a-word-of-caution\">\n+<h1>a word of caution</h1>\n+<p>Writing your own <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is a very easy way to introduce serious bugs such as\n+dead locks and race conditions. Since a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has access to internal\n+structures it is also quite easy to sabotage libtorrent's operation.</p>\n+<p>All the callbacks are always called from the libtorrent network thread. In\n+case portions of your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>, 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 <tt class=\"docutils literal\">tick()</tt>.</p>\n+<p>Since the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n+</div>\n+<div class=\"section\" id=\"plugin-interface\">\n+<h1>plugin-interface</h1>\n+<p>The <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> interface consists of three base classes that the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> may\n+implement. These are called <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>, <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> and <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>.\n+They are found in the <tt class=\"docutils literal\"><libtorrent/extensions.hpp></tt> header.</p>\n+<p>These plugins are instantiated for each <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, torrent and possibly each peer,\n+respectively.</p>\n+<p>For plugins that only need per torrent state, it is enough to only implement\n+<tt class=\"docutils literal\">torrent_plugin</tt> and pass a constructor function or function object to\n+<tt class=\"docutils literal\"><span class=\"pre\">session::add_extension()</span></tt> or <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::add_extension()</span></tt> (if the\n+torrent has already been started and you want to hook in the extension at\n+run-time).</p>\n+<p>The signature of the function is:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">torrent_plugin</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"punctuation\">)(</span><span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">client_data_t</span><span class=\"punctuation\">);</span>\n+</pre>\n+<p>The second argument is the userdata passed to <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent()</span></tt> or\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::add_extension()</span></tt>.</p>\n+<p>The function should return a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr<torrent_plugin></span></tt> 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+<tt class=\"docutils literal\">torrent_plugin</tt>), it will be associated with this torrent and callbacks\n+will be made on torrent events.</p>\n+<p>For more elaborate plugins which require <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide state, you would\n+implement <tt class=\"docutils literal\">plugin</tt>, construct an object (in a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr</span></tt>) and pass\n+it in to <tt class=\"docutils literal\"><span class=\"pre\">session::add_extension()</span></tt>.</p>\n+</div>\n+<div class=\"section\" id=\"custom-alerts\">\n+<h1>custom alerts</h1>\n+<p>Since plugins are running within internal libtorrent threads, one convenient\n+way to communicate with the client is to post custom alerts.</p>\n+<p>The expected interface of any <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, apart from deriving from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+base class, looks like this:</p>\n <pre class=\"literal-block\">\n-struct piece_block\n-{\n- <strong>piece_block</strong> () = default;\n- <strong>piece_block</strong> (piece_index_t p_index, int b_index);\n- bool <strong>operator<</strong> (piece_block const& b) const;\n- bool <strong>operator==</strong> (piece_block const& b) const;\n- bool <strong>operator!=</strong> (piece_block const& b) const;\n+static const int alert_type = <em><unique alert ID></em>;\n+virtual int type() const { return alert_type; }\n \n- static const piece_block invalid;\n- piece_index_t piece_index {0};\n- int <strong>block_index</strong> = 0;\n+virtual std::string message() const;\n+\n+static const alert_category_t static_category = <em><bitmask of alert::category_t flags></em>;\n+virtual alert_category_t category() const { return static_category; }\n+\n+virtual char const* what() const { return <em><string literal of the name of this alert></em>; }\n+</pre>\n+<p>The <tt class=\"docutils literal\">alert_type</tt> is used for the type-checking in <tt class=\"docutils literal\">alert_cast</tt>. It must\n+not collide with any other <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. The built-in alerts in libtorrent will\n+not use <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type IDs greater than <tt class=\"docutils literal\">user_alert_id</tt>. When defining your\n+own <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, make sure it's greater than this constant.</p>\n+<p><tt class=\"docutils literal\">type()</tt> is the run-time equivalence of the <tt class=\"docutils literal\">alert_type</tt>.</p>\n+<p>The <tt class=\"docutils literal\">message()</tt> virtual function is expected to construct a useful\n+string representation of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> and the event or data it represents.\n+Something convenient to put in a log file for instance.</p>\n+<p><tt class=\"docutils literal\">clone()</tt> is used internally to copy alerts. The suggested implementation\n+of simply allocating a new instance as a copy of <tt class=\"docutils literal\">*this</tt> is all that's\n+expected.</p>\n+<p>The static category is required for checking whether or not the category\n+for a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is enabled or not, without instantiating the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.\n+The <tt class=\"docutils literal\">category</tt> virtual function is the run-time equivalence.</p>\n+<p>The <tt class=\"docutils literal\">what()</tt> virtual function may simply be a string literal of the class\n+name of your <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<p>For more information, see the <a class=\"reference external\" href=\"reference-Alerts.html\">alert section</a>.</p>\n+<a name=\"peer_connection_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_connection_handle&labels=documentation&body=Documentation+under+heading+%22class+peer_connection_handle%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-connection-handle\">\n+<h1>peer_connection_handle</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection_handle.hpp\">libtorrent/peer_connection_handle.hpp</a>"</p>\n+<p>the <a class=\"reference external\" href=\"reference-Plugins.html#peer_connection_handle\">peer_connection_handle</a> 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</p>\n+<pre class=\"literal-block\">\n+struct peer_connection_handle\n+{\n+ explicit <strong>peer_connection_handle</strong> (std::weak_ptr<peer_connection> impl);\n+ connection_type <strong>type</strong> () const;\n+ void <strong>add_extension</strong> (std::shared_ptr<peer_plugin>);\n+ peer_plugin const* <strong>find_plugin</strong> (string_view type) const;\n+ bool <strong>is_seed</strong> () const;\n+ bool <strong>upload_only</strong> () const;\n+ bool <strong>has_piece</strong> (piece_index_t i) const;\n+ peer_id const& <strong>pid</strong> () const;\n+ bool <strong>is_choked</strong> () const;\n+ bool <strong>is_interesting</strong> () const;\n+ bool <strong>is_peer_interested</strong> () const;\n+ bool <strong>has_peer_choked</strong> () const;\n+ void <strong>maybe_unchoke_this_peer</strong> ();\n+ void <strong>choke_this_peer</strong> ();\n+ void <strong>get_peer_info</strong> (peer_info& p) const;\n+ torrent_handle <strong>associated_torrent</strong> () const;\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>local_endpoint</strong> () const;\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> const& <strong>remote</strong> () const;\n+ bool <strong>is_outgoing</strong> () const;\n+ void <strong>disconnect</strong> (error_code const& ec, operation_t op\n+ , disconnect_severity_t = peer_connection_interface::normal);\n+ bool <strong>is_connecting</strong> () const;\n+ bool <strong>is_disconnecting</strong> () const;\n+ bool <strong>ignore_unchoke_slots</strong> () const;\n+ bool <strong>on_local_network</strong> () const;\n+ bool <strong>failed</strong> () const;\n+ bool <strong>should_log</strong> (peer_log_alert::direction_t direction) const;\n+ void <strong>peer_log</strong> (peer_log_alert::direction_t direction\n+ , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n+ bool <strong>can_disconnect</strong> (error_code const& ec) const;\n+ bool <strong>has_metadata</strong> () const;\n+ bool <strong>in_handshake</strong> () const;\n+ void <strong>send_buffer</strong> (char const* begin, int size);\n+ std::time_t <strong>last_seen_complete</strong> () const;\n+ time_point <strong>time_of_last_unchoke</strong> () const;\n+ bool <strong>operator<</strong> (peer_connection_handle const& o) const;\n+ bool <strong>operator==</strong> (peer_connection_handle const& o) const;\n+ bool <strong>operator!=</strong> (peer_connection_handle const& o) const;\n+ std::shared_ptr<peer_connection> <strong>native_handle</strong> () const;\n };\n </pre>\n-<a name=\"info_hash_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+info_hash_t&labels=documentation&body=Documentation+under+heading+%22class+info_hash_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hash-t\">\n-<h1>info_hash_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n-<p>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.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">If <tt class=\"docutils literal\">has_v2()</tt> is false then the v1 hash might actually be a truncated\n-v2 hash</p>\n-</div>\n+<a name=\"bt_peer_connection_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bt_peer_connection_handle&labels=documentation&body=Documentation+under+heading+%22class+bt_peer_connection_handle%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bt-peer-connection-handle\">\n+<h1>bt_peer_connection_handle</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection_handle.hpp\">libtorrent/peer_connection_handle.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Plugins.html#bt_peer_connection_handle\">bt_peer_connection_handle</a> 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.</p>\n <pre class=\"literal-block\">\n-struct info_hash_t\n+struct bt_peer_connection_handle : peer_connection_handle\n {\n- <strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n- <strong>info_hash_t</strong> () noexcept = default;\n- explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n- explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n- bool <strong>has_v2</strong> () const;\n- bool <strong>has</strong> (protocol_version v) const;\n- bool <strong>has_v1</strong> () const;\n- sha1_hash <strong>get</strong> (protocol_version v) const;\n- sha1_hash <strong>get_best</strong> () const;\n- friend bool <strong>operator!=</strong> (info_hash_t const& lhs, info_hash_t const& rhs);\n- friend bool <strong>operator==</strong> (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n- template <typename F> void <strong>for_each</strong> (F f) const;\n- bool <strong>operator<</strong> (info_hash_t const& o) const;\n- friend std::ostream& <strong>operator<<</strong> (std::ostream& os, info_hash_t const& ih);\n+ explicit <strong>bt_peer_connection_handle</strong> (peer_connection_handle pc);\n+ bool <strong>packet_finished</strong> () const;\n+ bool <strong>support_extensions</strong> () const;\n+ bool <strong>supports_encryption</strong> () const;\n+ void <strong>switch_recv_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n+ void <strong>switch_send_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n+ std::shared_ptr<bt_peer_connection> <strong>native_handle</strong> () const;\n+};\n+</pre>\n+<a name=\"plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+plugin&labels=documentation&body=Documentation+under+heading+%22class+plugin%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"plugin\">\n+<h1>plugin</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n+<p>this is the base class for a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>. One primary feature\n+is that it is notified of all torrents that are added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>,\n+and can add its own torrent_plugins.</p>\n+<pre class=\"literal-block\">\n+struct plugin\n+{\n+ virtual feature_flags_t <strong>implemented_features</strong> ();\n+ virtual std::shared_ptr<torrent_plugin> <strong>new_torrent</strong> (torrent_handle const&, client_data_t);\n+ virtual void <strong>added</strong> (session_handle const&);\n+ virtual void <strong>abort</strong> ();\n+ virtual bool <strong>on_dht_request</strong> (string_view <em>/* query */</em>\n+ , udp::endpoint const& <em>/* source */</em>, bdecode_node const& <em>/* message */</em>\n+ , entry& <em>/* response */</em>);\n+ virtual void <strong>on_alert</strong> (alert const*);\n+ virtual bool <strong>on_unknown_torrent</strong> (info_hash_t const& <em>/* info_hash */</em>\n+ , peer_connection_handle const& <em>/* pc */</em>, add_torrent_params& <em>/* p */</em>);\n+ virtual void <strong>on_tick</strong> ();\n+ virtual uint64_t <strong>get_unchoke_priority</strong> (peer_connection_handle const& <em>/* peer */</em>);\n+ virtual std::map<std::string, std::string> <strong>save_state</strong> () const;\n+ virtual void <strong>load_state</strong> (std::map<std::string, std::string> const&);\n \n- sha1_hash v1;\n- sha256_hash v2;\n+ static constexpr feature_flags_t <strong>optimistic_unchoke_feature</strong> = 1_bit;\n+ static constexpr feature_flags_t <strong>tick_feature</strong> = 2_bit;\n+ static constexpr feature_flags_t <strong>dht_request_feature</strong> = 3_bit;\n+ static constexpr feature_flags_t <strong>alert_feature</strong> = 4_bit;\n+ static constexpr feature_flags_t <strong>unknown_torrent_feature</strong> = 5_bit;\n };\n </pre>\n-<a name=\"info_hash_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"info-hash-t-1\">\n-<h2>info_hash_t()</h2>\n+<a name=\"implemented_features()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bimplemented_features%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bimplemented_features%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"implemented-features\">\n+<h2>implemented_features()</h2>\n <pre class=\"literal-block\">\n-<strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n-<strong>info_hash_t</strong> () noexcept = default;\n-explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n-explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n+virtual feature_flags_t <strong>implemented_features</strong> ();\n </pre>\n-<p>The default constructor creates an object that has neither a v1 or v2\n-hash.</p>\n-<p>For backwards compatibility, make it possible to construct directly\n-from a v1 hash. This constructor allows <em>implicit</em> conversion from a\n-v1 hash, but the implicitness is deprecated.</p>\n-<a name=\"has_v1()\"></a>\n-<a name=\"has_v2()\"></a>\n-<a name=\"has()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bhas_v1%28%29+has_v2%28%29+has%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bhas_v1%28%29+has_v2%28%29+has%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"has-v1-has-v2-has\">\n-<h2>has_v1() has_v2() has()</h2>\n+<p>This function is expected to return a bitmask indicating which features\n+this <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n+<a name=\"new_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bnew_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bnew_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"new-torrent\">\n+<h2>new_torrent()</h2>\n <pre class=\"literal-block\">\n-bool <strong>has_v2</strong> () const;\n-bool <strong>has</strong> (protocol_version v) const;\n-bool <strong>has_v1</strong> () const;\n+virtual std::shared_ptr<torrent_plugin> <strong>new_torrent</strong> (torrent_handle const&, client_data_t);\n </pre>\n-<p>returns true if the corresponding info hash is present in this\n-object.</p>\n-<a name=\"get()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get\">\n-<h2>get()</h2>\n+<p>this is called by the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> every time a new torrent is added.\n+The <tt class=\"docutils literal\">torrent*</tt> points to the internal torrent object created\n+for the new torrent. The <a class=\"reference external\" href=\"reference-Add_Torrent.html#client_data_t\">client_data_t</a> is the userdata pointer as\n+passed in via <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.</p>\n+<p>If the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> returns a <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> instance, it will be added\n+to the new torrent. Otherwise, return an empty shared_ptr to a\n+<a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> (the default).</p>\n+<a name=\"added()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Badded%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Badded%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"added\">\n+<h2>added()</h2>\n <pre class=\"literal-block\">\n-sha1_hash <strong>get</strong> (protocol_version v) const;\n+virtual void <strong>added</strong> (session_handle const&);\n </pre>\n-<p>returns the has for the specified protocol version</p>\n-<a name=\"get_best()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget_best%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget_best%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-best\">\n-<h2>get_best()</h2>\n+<p>called when <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></p>\n+<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"abort\">\n+<h2>abort()</h2>\n <pre class=\"literal-block\">\n-sha1_hash <strong>get_best</strong> () const;\n+virtual void <strong>abort</strong> ();\n </pre>\n-<p>returns the v2 (truncated) info-hash, if there is one, otherwise\n-returns the v1 info-hash</p>\n-<a name=\"for_each()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bfor_each%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bfor_each%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"for-each\">\n-<h2>for_each()</h2>\n+<p>called when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is aborted\n+the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> should perform any cleanup necessary to allow the session's\n+destruction (e.g. cancel outstanding async operations)</p>\n+<a name=\"on_dht_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_dht_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_dht_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-dht-request\">\n+<h2>on_dht_request()</h2>\n <pre class=\"literal-block\">\n-template <typename F> void <strong>for_each</strong> (F f) const;\n+virtual bool <strong>on_dht_request</strong> (string_view <em>/* query */</em>\n+ , udp::endpoint const& <em>/* source */</em>, bdecode_node const& <em>/* message */</em>\n+ , entry& <em>/* response */</em>);\n </pre>\n-<p>calls the function object <tt class=\"docutils literal\">f</tt> for each hash that is available.\n-starting with v1. The signature of <tt class=\"docutils literal\">F</tt> is:</p>\n+<p>called when a dht request is received.\n+If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n+<tt class=\"docutils literal\">dht_request_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n+<a name=\"on_alert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_alert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_alert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-alert\">\n+<h2>on_alert()</h2>\n <pre class=\"literal-block\">\n-void(sha1_hash const&, protocol_version);\n+virtual void <strong>on_alert</strong> (alert const*);\n </pre>\n-<a name=\"peer_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_info&labels=documentation&body=Documentation+under+heading+%22class+peer_info%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-info\">\n-<h1>peer_info</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_info.hpp\">libtorrent/peer_info.hpp</a>"</p>\n-<p>holds information and statistics about one peer\n-that libtorrent is connected to</p>\n+<p>called when an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted alerts that are filtered are not posted.\n+If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n+<tt class=\"docutils literal\">alert_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n+<a name=\"on_unknown_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_unknown_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_unknown_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-unknown-torrent\">\n+<h2>on_unknown_torrent()</h2>\n <pre class=\"literal-block\">\n-struct peer_info\n-{\n- sha256_hash <strong>i2p_destination</strong> () 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 <strong>interesting</strong> = 0_bit;\n- static constexpr peer_flags_t <strong>choked</strong> = 1_bit;\n- static constexpr peer_flags_t <strong>remote_interested</strong> = 2_bit;\n- static constexpr peer_flags_t <strong>remote_choked</strong> = 3_bit;\n- static constexpr peer_flags_t <strong>supports_extensions</strong> = 4_bit;\n- static constexpr peer_flags_t <strong>outgoing_connection</strong> = 5_bit;\n- static constexpr peer_flags_t <strong>local_connection</strong> = 5_bit;\n- static constexpr peer_flags_t <strong>handshake</strong> = 6_bit;\n- static constexpr peer_flags_t <strong>connecting</strong> = 7_bit;\n- static constexpr peer_flags_t <strong>on_parole</strong> = 9_bit;\n- static constexpr peer_flags_t <strong>seed</strong> = 10_bit;\n- static constexpr peer_flags_t <strong>optimistic_unchoke</strong> = 11_bit;\n- static constexpr peer_flags_t <strong>snubbed</strong> = 12_bit;\n- static constexpr peer_flags_t <strong>upload_only</strong> = 13_bit;\n- static constexpr peer_flags_t <strong>endgame_mode</strong> = 14_bit;\n- static constexpr peer_flags_t <strong>holepunched</strong> = 15_bit;\n- static constexpr peer_flags_t <strong>i2p_socket</strong> = 16_bit;\n- static constexpr peer_flags_t <strong>utp_socket</strong> = 17_bit;\n- static constexpr peer_flags_t <strong>ssl_socket</strong> = 18_bit;\n- static constexpr peer_flags_t <strong>rc4_encrypted</strong> = 19_bit;\n- static constexpr peer_flags_t <strong>plaintext_encrypted</strong> = 20_bit;\n- peer_flags_t flags;\n- static constexpr peer_source_flags_t <strong>tracker</strong> = 0_bit;\n- static constexpr peer_source_flags_t <strong>dht</strong> = 1_bit;\n- static constexpr peer_source_flags_t <strong>pex</strong> = 2_bit;\n- static constexpr peer_source_flags_t <strong>lsd</strong> = 3_bit;\n- static constexpr peer_source_flags_t <strong>resume_data</strong> = 4_bit;\n- static constexpr peer_source_flags_t <strong>incoming</strong> = 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 <strong>standard_bittorrent</strong> = 0_bit;\n- static constexpr connection_type_t <strong>web_seed</strong> = 1_bit;\n- static constexpr connection_type_t <strong>http_seed</strong> = 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- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> ip;\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> local_endpoint;\n- static constexpr bandwidth_state_flags_t <strong>bw_idle</strong> = 0_bit;\n- static constexpr bandwidth_state_flags_t <strong>bw_limit</strong> = 1_bit;\n- static constexpr bandwidth_state_flags_t <strong>bw_network</strong> = 2_bit;\n- static constexpr bandwidth_state_flags_t <strong>bw_disk</strong> = 4_bit;\n- bandwidth_state_flags_t read_state;\n- bandwidth_state_flags_t write_state;\n-};\n+virtual bool <strong>on_unknown_torrent</strong> (info_hash_t const& <em>/* info_hash */</em>\n+ , peer_connection_handle const& <em>/* pc */</em>, add_torrent_params& <em>/* p */</em>);\n </pre>\n-<a name=\"i2p_destination()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bi2p_destination%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bi2p_destination%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"i2p-destination\">\n-<h2>i2p_destination()</h2>\n+<p>return true if the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> should be added</p>\n+<a name=\"on_tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_tick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_tick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-tick\">\n+<h2>on_tick()</h2>\n <pre class=\"literal-block\">\n-sha256_hash <strong>i2p_destination</strong> () const;\n+virtual void <strong>on_tick</strong> ();\n </pre>\n-<p>If this peer is an i2p peer, this function returns the destination\n-address of the peer</p>\n-<a name=\"client\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bclient%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bclient%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>client</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpieces%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pieces</dt>\n-<dd>a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, 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).</dd>\n-</dl>\n-<a name=\"total_download\"></a>\n-<a name=\"total_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btotal_download+total_upload%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btotal_download+total_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_download total_upload</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"last_request\"></a>\n-<a name=\"last_active\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blast_request+last_active%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blast_request+last_active%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_request last_active</dt>\n-<dd>the time since we last sent a request to this peer and since any\n-transfer occurred with this peer</dd>\n-</dl>\n-<a name=\"download_queue_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_queue_time%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_queue_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>download_queue_time</dt>\n-<dd>the time until all blocks in the request queue will be downloaded</dd>\n-</dl>\n-<a name=\"interesting\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Binteresting%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Binteresting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>interesting</dt>\n-<dd><strong>we</strong> are interested in pieces from this peer.</dd>\n-</dl>\n-<a name=\"choked\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bchoked%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bchoked%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>choked</dt>\n-<dd><strong>we</strong> have choked this peer.</dd>\n-</dl>\n-<a name=\"remote_interested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bremote_interested%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bremote_interested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>remote_interested</dt>\n-<dd>the peer is interested in <strong>us</strong></dd>\n-</dl>\n-<a name=\"remote_choked\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bremote_choked%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bremote_choked%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>remote_choked</dt>\n-<dd>the peer has choked <strong>us</strong>.</dd>\n-</dl>\n-<a name=\"supports_extensions\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsupports_extensions%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsupports_extensions%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>supports_extensions</dt>\n-<dd>means that this peer supports the\n-<a class=\"reference external\" href=\"extension_protocol.html\">extension protocol</a>.</dd>\n-</dl>\n-<a name=\"outgoing_connection\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Boutgoing_connection%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Boutgoing_connection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>outgoing_connection</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"local_connection\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blocal_connection%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blocal_connection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_connection</dt>\n-<dd>deprecated synonym for outgoing_connection</dd>\n-</dl>\n-<a name=\"handshake\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bhandshake%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bhandshake%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>handshake</dt>\n-<dd>The connection is opened, and waiting for the\n-handshake. Until the handshake is done, the peer\n-cannot be identified.</dd>\n-</dl>\n-<a name=\"connecting\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bconnecting%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bconnecting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>connecting</dt>\n-<dd>The connection is in a half-open state (i.e. it is\n-being connected).</dd>\n-</dl>\n-<a name=\"on_parole\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bon_parole%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bon_parole%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>on_parole</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bseed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bseed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>seed</dt>\n-<dd>This peer is a seed (it has all the pieces).</dd>\n-</dl>\n-<a name=\"optimistic_unchoke\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Boptimistic_unchoke%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Boptimistic_unchoke%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>optimistic_unchoke</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"snubbed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsnubbed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsnubbed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>snubbed</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"upload_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bupload_only%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bupload_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>upload_only</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"endgame_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bendgame_mode%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bendgame_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endgame_mode</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"holepunched\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bholepunched%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bholepunched%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>holepunched</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"i2p_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bi2p_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bi2p_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>i2p_socket</dt>\n-<dd>indicates that this socket is running on top of the\n-I2P transport.</dd>\n-</dl>\n-<a name=\"utp_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Butp_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Butp_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>utp_socket</dt>\n-<dd>indicates that this socket is a uTP socket</dd>\n-</dl>\n-<a name=\"ssl_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bssl_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bssl_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ssl_socket</dt>\n-<dd>indicates that this socket is running on top of an SSL\n-(TLS) channel</dd>\n-</dl>\n-<a name=\"rc4_encrypted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brc4_encrypted%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brc4_encrypted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>rc4_encrypted</dt>\n-<dd>this connection is obfuscated with RC4</dd>\n-</dl>\n-<a name=\"plaintext_encrypted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bplaintext_encrypted%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bplaintext_encrypted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>plaintext_encrypted</dt>\n-<dd>the handshake of this connection was obfuscated\n-with a Diffie-Hellman exchange</dd>\n-</dl>\n-<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flags</dt>\n-<dd>tells you in which state the peer is in. It is set to\n-any combination of the peer_flags_t flags above.</dd>\n-</dl>\n-<a name=\"tracker\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btracker%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btracker%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>tracker</dt>\n-<dd>The peer was received from the tracker.</dd>\n-</dl>\n-<a name=\"dht\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdht%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdht%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dht</dt>\n-<dd>The peer was received from the kademlia DHT.</dd>\n-</dl>\n-<a name=\"pex\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpex%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pex</dt>\n-<dd>The peer was received from the peer exchange\n-extension.</dd>\n-</dl>\n-<a name=\"lsd\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blsd%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blsd%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>lsd</dt>\n-<dd>The peer was received from the local service\n-discovery (The peer is on the local network).</dd>\n-</dl>\n-<a name=\"resume_data\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bresume_data%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bresume_data%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>resume_data</dt>\n-<dd>The peer was added from the fast resume data.</dd>\n-</dl>\n-<a name=\"incoming\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bincoming%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bincoming%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>incoming</dt>\n-<dd>we received an incoming connection from this peer</dd>\n-</dl>\n-<a name=\"source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsource%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsource%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>source</dt>\n-<dd>a combination of flags describing from which sources this peer\n-was received. A combination of the peer_source_flags_t above.</dd>\n-</dl>\n-<a name=\"up_speed\"></a>\n-<a name=\"down_speed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bup_speed+down_speed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bup_speed+down_speed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>up_speed down_speed</dt>\n-<dd>the current upload and download speed we have to and from this peer\n-(including any protocol messages). updated about once per second</dd>\n-</dl>\n-<a name=\"payload_up_speed\"></a>\n-<a name=\"payload_down_speed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpayload_up_speed+payload_down_speed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpayload_up_speed+payload_down_speed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>payload_up_speed payload_down_speed</dt>\n-<dd>The transfer rates of payload data only updated about once per second</dd>\n-</dl>\n-<a name=\"pid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpid%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pid</dt>\n-<dd>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()_</dd>\n-</dl>\n-<a name=\"queue_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bqueue_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bqueue_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>queue_bytes</dt>\n-<dd>the number of bytes we have requested from this peer, but not yet\n-received.</dd>\n-</dl>\n-<a name=\"request_timeout\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brequest_timeout%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brequest_timeout%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>request_timeout</dt>\n-<dd>the number of seconds until the current front piece request will time\n-out. This timeout can be adjusted through\n-<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::request_timeout</span></tt>.\n--1 means that there is not outstanding request.</dd>\n-</dl>\n-<a name=\"send_buffer_size\"></a>\n-<a name=\"used_send_buffer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsend_buffer_size+used_send_buffer%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsend_buffer_size+used_send_buffer%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>send_buffer_size used_send_buffer</dt>\n-<dd>the number of bytes allocated\n-and used for the peer's send buffer, respectively.</dd>\n-</dl>\n-<a name=\"receive_buffer_size\"></a>\n-<a name=\"used_receive_buffer\"></a>\n-<a name=\"receive_buffer_watermark\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Breceive_buffer_size+used_receive_buffer+receive_buffer_watermark%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Breceive_buffer_size+used_receive_buffer+receive_buffer_watermark%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>receive_buffer_size used_receive_buffer receive_buffer_watermark</dt>\n-<dd>the number of bytes\n-allocated and used as receive buffer, respectively.</dd>\n-</dl>\n-<a name=\"num_hashfails\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bnum_hashfails%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bnum_hashfails%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_hashfails</dt>\n-<dd>the number of pieces this peer has participated in sending us that\n-turned out to fail the hash check.</dd>\n-</dl>\n-<a name=\"download_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>download_queue_length</dt>\n-<dd>this is the number of requests we have sent to this peer that we\n-haven't got a response for yet</dd>\n-</dl>\n-<a name=\"timed_out_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btimed_out_requests%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btimed_out_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>timed_out_requests</dt>\n-<dd>the number of block requests that have timed out, and are still in the\n-download queue</dd>\n-</dl>\n-<a name=\"busy_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbusy_requests%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbusy_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>busy_requests</dt>\n-<dd>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</dd>\n-</dl>\n-<a name=\"requests_in_buffer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brequests_in_buffer%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brequests_in_buffer%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>requests_in_buffer</dt>\n-<dd>the number of requests messages that are currently in the send buffer\n-waiting to be sent.</dd>\n-</dl>\n-<a name=\"target_dl_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btarget_dl_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btarget_dl_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>target_dl_queue_length</dt>\n-<dd>the number of requests that is tried to be maintained (this is\n-typically a function of download speed)</dd>\n-</dl>\n-<a name=\"upload_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bupload_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bupload_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>upload_queue_length</dt>\n-<dd>the number of piece-requests we have received from this peer\n-that we haven't answered with a piece yet.</dd>\n-</dl>\n-<a name=\"failcount\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bfailcount%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bfailcount%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>failcount</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"downloading_piece_index\"></a>\n-<a name=\"downloading_block_index\"></a>\n-<a name=\"downloading_progress\"></a>\n-<a name=\"downloading_total\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownloading_piece_index+downloading_block_index+downloading_progress+downloading_total%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownloading_piece_index+downloading_block_index+downloading_progress+downloading_total%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>downloading_piece_index downloading_block_index downloading_progress downloading_total</dt>\n-<dd>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. <tt class=\"docutils literal\">downloading_piece_index</tt> 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. <tt class=\"docutils literal\">downloading_block_index</tt> is the\n-index of the block (or sub-piece) that is being downloaded.\n-<tt class=\"docutils literal\">downloading_progress</tt> is the number of bytes of this block we have\n-received from the peer, and <tt class=\"docutils literal\">downloading_total</tt> is the total number\n-of bytes in this block.</dd>\n-</dl>\n-<a name=\"standard_bittorrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bstandard_bittorrent%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bstandard_bittorrent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>standard_bittorrent</dt>\n-<dd>Regular bittorrent connection</dd>\n-</dl>\n-<a name=\"web_seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bweb_seed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bweb_seed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>web_seed</dt>\n-<dd>HTTP connection using the <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a> protocol</dd>\n-</dl>\n-<a name=\"http_seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bhttp_seed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bhttp_seed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>http_seed</dt>\n-<dd>HTTP connection using the <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> protocol</dd>\n-</dl>\n-<a name=\"connection_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bconnection_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bconnection_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>connection_type</dt>\n-<dd>the kind of connection this peer uses. See connection_type_t.</dd>\n-</dl>\n-<a name=\"pending_disk_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpending_disk_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpending_disk_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pending_disk_bytes</dt>\n-<dd>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 <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_queued_disk_bytes</span></tt>.</dd>\n-</dl>\n-<a name=\"pending_disk_read_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpending_disk_read_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpending_disk_read_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pending_disk_read_bytes</dt>\n-<dd>number of outstanding bytes to read\n-from disk</dd>\n-</dl>\n-<a name=\"send_quota\"></a>\n-<a name=\"receive_quota\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsend_quota+receive_quota%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsend_quota+receive_quota%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>send_quota receive_quota</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"rtt\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brtt%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brtt%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>rtt</dt>\n-<dd>an estimated round trip time to this peer, in milliseconds. It is\n-estimated by timing the TCP <tt class=\"docutils literal\">connect()</tt>. It may be 0 for\n-incoming connections.</dd>\n-</dl>\n-<a name=\"num_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bnum_pieces%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bnum_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_pieces</dt>\n-<dd>the number of pieces this peer has.</dd>\n-</dl>\n-<a name=\"download_rate_peak\"></a>\n-<a name=\"upload_rate_peak\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_rate_peak+upload_rate_peak%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_rate_peak+upload_rate_peak%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>download_rate_peak upload_rate_peak</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bprogress%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bprogress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>progress</dt>\n-<dd>the progress of the peer in the range [0, 1]. This is always 0 when\n-floating point operations are disabled, instead use <tt class=\"docutils literal\">progress_ppm</tt>.</dd>\n-</dl>\n-<a name=\"progress_ppm\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bprogress_ppm%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bprogress_ppm%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>progress_ppm</dt>\n-<dd>indicates the download progress of the peer in the range [0, 1000000]\n-(parts per million).</dd>\n-</dl>\n-<a name=\"ip\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bip%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bip%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ip</dt>\n-<dd>the IP-address to this peer. The type is an asio endpoint. For\n-more info, see the <a class=\"reference external\" href=\"http://asio.sourceforge.net/asio-0.3.8/doc/asio/reference.html\">asio</a> documentation. This field is not valid for\n-i2p peers. Instead use the <a class=\"reference external\" href=\"reference-Core.html#i2p_destination()\">i2p_destination()</a> function.</dd>\n-</dl>\n-<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_endpoint</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"bw_idle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_idle%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_idle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>bw_idle</dt>\n-<dd>The peer is not waiting for any external events to\n-send or receive data.</dd>\n+<p>called once per second.\n+If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n+<tt class=\"docutils literal\">tick_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n+<a name=\"get_unchoke_priority()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bget_unchoke_priority%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bget_unchoke_priority%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-unchoke-priority\">\n+<h2>get_unchoke_priority()</h2>\n+<pre class=\"literal-block\">\n+virtual uint64_t <strong>get_unchoke_priority</strong> (peer_connection_handle const& <em>/* peer */</em>);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has no priority to assign a peer it should return 2^64-1.\n+If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n+<tt class=\"docutils literal\">optimistic_unchoke_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.\n+If multiple plugins implement this function the lowest return value\n+(i.e. the highest priority) is used.</p>\n+<a name=\"load_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bload_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bload_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"load-state\">\n+<h2>load_state()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>load_state</strong> (std::map<std::string, std::string> const&);\n+</pre>\n+<p>called on startup while loading settings state from the <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a></p>\n+<a name=\"optimistic_unchoke_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Boptimistic_unchoke_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Boptimistic_unchoke_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>optimistic_unchoke_feature</dt>\n+<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to alter the order of the\n+optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n+callback be called.</dd>\n </dl>\n-<a name=\"bw_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_limit%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>bw_limit</dt>\n-<dd>The peer is waiting for the rate limiter.</dd>\n+<a name=\"tick_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Btick_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Btick_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>tick_feature</dt>\n+<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_tick()\">on_tick()</a> called</dd>\n </dl>\n-<a name=\"bw_network\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_network%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_network%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>bw_network</dt>\n-<dd>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.</dd>\n+<a name=\"dht_request_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bdht_request_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bdht_request_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dht_request_feature</dt>\n+<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_dht_request()\">on_dht_request()</a>\n+called</dd>\n </dl>\n-<a name=\"bw_disk\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_disk%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_disk%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>bw_disk</dt>\n-<dd>The peer is waiting for the disk I/O thread to catch\n-up writing buffers to disk before downloading more.</dd>\n+<a name=\"alert_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Balert_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Balert_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>alert_feature</dt>\n+<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_alert()\">on_alert()</a>\n+called</dd>\n </dl>\n-<a name=\"read_state\"></a>\n-<a name=\"write_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bread_state+write_state%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bread_state+write_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>read_state write_state</dt>\n-<dd>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.</dd>\n+<a name=\"unknown_torrent_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bunknown_torrent_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bunknown_torrent_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>unknown_torrent_feature</dt>\n+<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_unknown_torrent()\">on_unknown_torrent()</a>\n+called even if there is no active torrent in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></dd>\n </dl>\n-<a name=\"peer_request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_request&labels=documentation&body=Documentation+under+heading+%22class+peer_request%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"torrent_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_plugin&labels=documentation&body=Documentation+under+heading+%22class+torrent_plugin%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"peer-request\">\n-<h1>peer_request</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_request.hpp\">libtorrent/peer_request.hpp</a>"</p>\n-<p>represents a byte range within a piece. Internally this is is used for\n-incoming piece requests.</p>\n+<div class=\"section\" id=\"torrent-plugin\">\n+<h1>torrent_plugin</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n+<p>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.</p>\n <pre class=\"literal-block\">\n-struct peer_request\n+struct torrent_plugin\n {\n- bool <strong>operator==</strong> (peer_request const& r) const;\n+ virtual std::shared_ptr<peer_plugin> <strong>new_connection</strong> (peer_connection_handle const&);\n+ virtual void <strong>on_piece_failed</strong> (piece_index_t);\n+ virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+ virtual void <strong>tick</strong> ();\n+ virtual bool <strong>on_resume</strong> ();\n+ virtual bool <strong>on_pause</strong> ();\n+ virtual void <strong>on_files_checked</strong> ();\n+ virtual void <strong>on_state</strong> (torrent_status::state_t);\n+ virtual void <strong>on_add_peer</strong> (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n \n- piece_index_t piece;\n- int start;\n- int length;\n+ static constexpr add_peer_flags_t <strong>first_time</strong> = 1_bit;\n+ static constexpr add_peer_flags_t <strong>filtered</strong> = 2_bit;\n };\n </pre>\n-<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator\">\n-<h2>operator==()</h2>\n+<a name=\"new_connection()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bnew_connection%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bnew_connection%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-connection\">\n+<h2>new_connection()</h2>\n <pre class=\"literal-block\">\n-bool <strong>operator==</strong> (peer_request const& r) const;\n+virtual std::shared_ptr<peer_plugin> <strong>new_connection</strong> (peer_connection_handle const&);\n </pre>\n-<p>returns true if the right hand side <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> refers to the same\n-range as this does.</p>\n-<a name=\"piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bpiece%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bpiece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece</dt>\n-<dd>The index of the piece in which the range starts.</dd>\n-</dl>\n-<a name=\"start\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bstart%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bstart%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>start</dt>\n-<dd>The byte offset within that piece where the range starts.</dd>\n-</dl>\n-<a name=\"length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Blength%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Blength%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>length</dt>\n-<dd>The size of the range, in bytes.</dd>\n-</dl>\n-<a name=\"torrent_peer_equal()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_peer_equal%28%29&labels=documentation&body=Documentation+under+heading+%22torrent_peer_equal%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-peer-equal\">\n-<h1>torrent_peer_equal()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_peer.hpp\">libtorrent/torrent_peer.hpp</a>"</p>\n+<p>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+<tt class=\"docutils literal\">shared_ptr</tt> (in which case you don't need to override this member\n+function).</p>\n+<p>If you need an extension to the peer connection (which most plugins do) you\n+are supposed to return an instance of your <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a> class. Which in\n+turn will have its hook functions called on event specific to that peer.</p>\n+<p>The <tt class=\"docutils literal\">peer_connection_handle</tt> will be valid as long as the <tt class=\"docutils literal\">shared_ptr</tt>\n+is being held by the torrent object. So, it is generally a good idea to not\n+keep a <tt class=\"docutils literal\">shared_ptr</tt> to your own <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>. If you want to keep references\n+to it, use <tt class=\"docutils literal\">weak_ptr</tt>.</p>\n+<p>If this function throws an exception, the connection will be closed.</p>\n+<a name=\"on_piece_pass()\"></a>\n+<a name=\"on_piece_failed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-piece-pass-on-piece-failed\">\n+<h2>on_piece_pass() on_piece_failed()</h2>\n <pre class=\"literal-block\">\n-inline bool <strong>torrent_peer_equal</strong> (torrent_peer const* lhs, torrent_peer const* rhs);\n+virtual void <strong>on_piece_failed</strong> (piece_index_t);\n+virtual void <strong>on_piece_pass</strong> (piece_index_t);\n </pre>\n-<a name=\"make_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:make_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22make_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"make-magnet-uri\">\n-<h1>make_magnet_uri()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n+<p>These hooks are called when a piece passes the hash check or fails the hash\n+check, respectively. The <tt class=\"docutils literal\">index</tt> 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 <tt class=\"docutils literal\">torrent</tt> and the <tt class=\"docutils literal\">piece_picker</tt>.</p>\n+<a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tick\">\n+<h2>tick()</h2>\n <pre class=\"literal-block\">\n-std::string <strong>make_magnet_uri</strong> (torrent_handle const& handle);\n-std::string <strong>make_magnet_uri</strong> (add_torrent_params const& atp);\n-std::string <strong>make_magnet_uri</strong> (torrent_info const& info);\n+virtual void <strong>tick</strong> ();\n </pre>\n-<p>Generates a magnet URI from the specified torrent.</p>\n-<p>Several fields from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> objects are recorded in the\n-magnet link. In order to not include them, they have to be cleared before\n-calling <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a>. These fields are used:</p>\n-<blockquote>\n-<tt class=\"docutils literal\">ti</tt>, <tt class=\"docutils literal\">info_hashes</tt>, <tt class=\"docutils literal\">url_seeds</tt>, <tt class=\"docutils literal\">dht_nodes</tt>,\n-<tt class=\"docutils literal\">file_priorities</tt>, <tt class=\"docutils literal\">trackers</tt>, <tt class=\"docutils literal\">name</tt>, <tt class=\"docutils literal\">peers</tt>.</blockquote>\n-<p>Depending on what the use case for the resulting magnet link is, clearing\n-<tt class=\"docutils literal\">peers</tt> and <tt class=\"docutils literal\">dht_nodes</tt> is probably a good idea if the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n-came from a running torrent. Those lists may be long and be ephemeral.</p>\n-<p>If none of the <tt class=\"docutils literal\">info_hashes</tt> or <tt class=\"docutils literal\">ti</tt> fields are set, there is not\n-info-hash available, and a magnet link cannot be created. In this case\n-<a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a> returns an empty string.</p>\n-<p>The recommended way to generate a magnet link from a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is to\n-call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a>, which will post a <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>\n-containing an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. This can then be passed to\n-<a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a>.</p>\n-<p>The overload that takes a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> will make blocking calls to\n-query information about the torrent. If the torrent handle is invalid,\n-an empty string is returned.</p>\n-<p>For more information about magnet links, see <a class=\"reference external\" href=\"manual-ref.html#magnet-links\">magnet links</a>.</p>\n-<a name=\"parse_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:parse_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22parse_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"parse-magnet-uri\">\n-<h1>parse_magnet_uri()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n+<p>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.</p>\n+<a name=\"on_resume()\"></a>\n+<a name=\"on_pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-resume-on-pause\">\n+<h2>on_resume() on_pause()</h2>\n <pre class=\"literal-block\">\n-add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri, error_code& ec);\n-add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri);\n-void <strong>parse_magnet_uri</strong> (string_view uri, add_torrent_params& p, error_code& ec);\n+virtual bool <strong>on_resume</strong> ();\n+virtual bool <strong>on_pause</strong> ();\n </pre>\n-<p>This function parses out information from the magnet link and populates the\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. The overload that does not take an\n-<tt class=\"docutils literal\">error_code</tt> reference will throw a system_error on error\n-The overload taking an <tt class=\"docutils literal\">add_torrent_params</tt> reference will fill in the\n-fields specified in the magnet URI.</p>\n-<a name=\"truncate_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:truncate_files%28%29&labels=documentation&body=Documentation+under+heading+%22truncate_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"truncate-files\">\n-<h1>truncate_files()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/truncate.hpp\">libtorrent/truncate.hpp</a>"</p>\n+<p>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+<tt class=\"docutils literal\">true</tt> indicates that it was handled, and no other <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n+<p>Note that if you call <tt class=\"docutils literal\">pause()</tt> or <tt class=\"docutils literal\">resume()</tt> 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.</p>\n+<a name=\"on_files_checked()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_files_checked%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_files_checked%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-files-checked\">\n+<h2>on_files_checked()</h2>\n <pre class=\"literal-block\">\n-void <strong>truncate_files</strong> (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+virtual void <strong>on_files_checked</strong> ();\n </pre>\n-<p>Truncates files larger than specified in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>, saved under\n-the specified save_path.</p>\n-<a name=\"version()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:version%28%29&labels=documentation&body=Documentation+under+heading+%22version%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"version\">\n-<h1>version()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<p>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.</p>\n+<p>i.e. This function is always called when the torrent is in a state where it\n+can start downloading.</p>\n+<a name=\"on_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-state\">\n+<h2>on_state()</h2>\n <pre class=\"literal-block\">\n-char const* <strong>version</strong> ();\n+virtual void <strong>on_state</strong> (torrent_status::state_t);\n </pre>\n-<p>returns the libtorrent version as string form in this format:\n-"<major>.<minor>.<tiny>.<tag>"</p>\n-<a name=\"load_torrent_buffer()\"></a>\n-<a name=\"load_torrent_file()\"></a>\n-<a name=\"load_torrent_parsed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_buffer%28%29+load_torrent_file%28%29+load_torrent_parsed%28%29&labels=documentation&body=Documentation+under+heading+%22load_torrent_buffer%28%29+load_torrent_file%28%29+load_torrent_parsed%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"load-torrent-buffer-load-torrent-file-load-torrent-parsed\">\n-<h1>load_torrent_buffer() load_torrent_file() load_torrent_parsed()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/load_torrent.hpp\">libtorrent/load_torrent.hpp</a>"</p>\n+<p>called when the torrent changes state\n+the state is one of <a class=\"reference external\" href=\"reference-Torrent_Status.html#state_t\">torrent_status::state_t</a>\n+enum members</p>\n+<a name=\"on_add_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_add_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_add_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-add-peer\">\n+<h2>on_add_peer()</h2>\n <pre class=\"literal-block\">\n-add_torrent_params <strong>load_torrent_file</strong> (\n- std::string const& filename);\n-add_torrent_params <strong>load_torrent_buffer</strong> (\n- span<char const> buffer, load_torrent_limits const& cfg);\n-add_torrent_params <strong>load_torrent_buffer</strong> (\n- span<char const> buffer);\n-add_torrent_params <strong>load_torrent_file</strong> (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params <strong>load_torrent_parsed</strong> (\n- bdecode_node const& torrent_file);\n-add_torrent_params <strong>load_torrent_parsed</strong> (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+virtual void <strong>on_add_peer</strong> (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n </pre>\n-<p>These functions load the content of a .torrent file into an\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.\n-The immutable part of a torrent file (the info-dictionary) is stored in\n-the <tt class=\"docutils literal\">ti</tt> field in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object (as a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n-object).\n-The returned object is suitable to be:</p>\n-<blockquote>\n-<ul class=\"simple\">\n-<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n-<li>saved as a .torrent_file via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n-<li>turned into a magnet link via <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n-</ul>\n-</blockquote>\n-<a name=\"protocol_version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+protocol_version&labels=documentation&body=Documentation+under+heading+%22enum+protocol_version%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-protocol-version\">\n-<h1>enum protocol_version</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"8%\" />\n-<col width=\"10%\" />\n-<col width=\"82%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>V1</td>\n-<td>0</td>\n-<td>The original BitTorrent version, using SHA-1 hashes</td>\n-</tr>\n-<tr><td>V2</td>\n-<td>1</td>\n-<td>Version 2 of the BitTorrent protocol, using SHA-256 hashes</td>\n-</tr>\n-<tr><td>NUM</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-socket-type-t\">\n-<h1>enum socket_type_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socket_type.hpp\">libtorrent/socket_type.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"38%\" />\n-<col width=\"22%\" />\n-<col width=\"41%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>tcp</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>socks5</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>http</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>utp</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>i2p</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>tcp_ssl</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>socks5_ssl</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>http_ssl</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>utp_ssl</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"portmap_transport\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+portmap_transport&labels=documentation&body=Documentation+under+heading+%22enum+portmap_transport%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-portmap-transport\">\n-<h1>enum portmap_transport</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/portmap.hpp\">libtorrent/portmap.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"18%\" />\n-<col width=\"16%\" />\n-<col width=\"67%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>natpmp</td>\n-<td>0</td>\n-<td>natpmp can be NAT-PMP or PCP</td>\n-</tr>\n-<tr><td>upnp</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"portmap_protocol\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+portmap_protocol&labels=documentation&body=Documentation+under+heading+%22enum+portmap_protocol%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-portmap-protocol\">\n-<h1>enum portmap_protocol</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/portmap.hpp\">libtorrent/portmap.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"23%\" />\n-<col width=\"27%\" />\n-<col width=\"50%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>none</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>tcp</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>udp</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"event_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+event_t&labels=documentation&body=Documentation+under+heading+%22enum+event_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-event-t\">\n-<h1>enum event_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/tracker_manager.hpp\">libtorrent/tracker_manager.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"35%\" />\n-<col width=\"23%\" />\n-<col width=\"42%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>none</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>completed</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>started</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>stopped</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>paused</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"connection_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+connection_type&labels=documentation&body=Documentation+under+heading+%22enum+connection_type%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-connection-type\">\n-<h1>enum connection_type</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection.hpp\">libtorrent/peer_connection.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"38%\" />\n-<col width=\"22%\" />\n-<col width=\"41%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>bittorrent</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>url_seed</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>http_seed</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"torrent_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_flags_t&labels=documentation&body=Documentation+under+heading+%22torrent_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-flags-t\">\n-<h1>torrent_flags_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_flags.hpp\">libtorrent/torrent_flags.hpp</a>"</p>\n-<a name=\"torrent_flags_t::seed_mode\"></a><dl class=\"docutils\">\n-<dt>seed_mode</dt>\n-<dd><p class=\"first\">If <tt class=\"docutils literal\">seed_mode</tt> 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.</p>\n-<p>Setting <tt class=\"docutils literal\">seed_mode</tt> on a torrent without metadata (a\n-.torrent file) is a no-op and will be ignored.</p>\n-<p class=\"last\">It is not possible to <em>set</em> the <tt class=\"docutils literal\">seed_mode</tt> flag on a torrent after it has\n-been added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It is possible to <em>clear</em> it though.</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::upload_mode\"></a><dl class=\"docutils\">\n-<dt>upload_mode</dt>\n-<dd><p class=\"first\">If <tt class=\"docutils literal\">upload_mode</tt> 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 <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::optimistic_disk_retry</span></tt>).</p>\n-<p>This mode can be used to avoid race conditions when\n-adjusting priorities of pieces before allowing the torrent to start\n-downloading.</p>\n-<p class=\"last\">If the torrent is auto-managed (<tt class=\"docutils literal\">auto_managed</tt>), 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.</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::share_mode\"></a><dl class=\"docutils\">\n-<dt>share_mode</dt>\n-<dd><p class=\"first\">determines if the torrent should be added in <em>share mode</em> 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.</p>\n-<p>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.</p>\n-<p class=\"last\">The share mode has one setting, the share ratio target, see\n-<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::share_mode_target</span></tt> for more info.</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::apply_ip_filter\"></a><dl class=\"docutils\">\n-<dt>apply_ip_filter</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::paused\"></a><dl class=\"docutils\">\n-<dt>paused</dt>\n-<dd>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::auto_managed\"></a><dl class=\"docutils\">\n-<dt>auto_managed</dt>\n-<dd><p class=\"first\">If the torrent is auto-managed (<tt class=\"docutils literal\">auto_managed</tt>), 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.</p>\n-<p class=\"last\">If <tt class=\"docutils literal\">auto_managed</tt> 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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::duplicate_is_error\"></a><dl class=\"docutils\">\n-<dt>duplicate_is_error</dt>\n-<dd>used in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> to indicate that it's an error to attempt\n-to add a torrent that's already in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. If it's not considered an\n-error, a handle to the existing torrent is returned.\n-This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>, since it is only meant for\n-adding torrents.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::update_subscribe\"></a><dl class=\"docutils\">\n-<dt>update_subscribe</dt>\n-<dd>on by default and means that this torrent will be part of state\n-updates when calling <a class=\"reference external\" href=\"reference-Session.html#post_torrent_updates()\">post_torrent_updates()</a>.\n-This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::super_seeding\"></a><dl class=\"docutils\">\n-<dt>super_seeding</dt>\n-<dd>sets the torrent into super seeding/initial seeding mode. If the torrent\n-is not a seed, this flag has no effect.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::sequential_download\"></a><dl class=\"docutils\">\n-<dt>sequential_download</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_piece_deadline()\">set_piece_deadline()</a> instead.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::stop_when_ready\"></a><dl class=\"docutils\">\n-<dt>stop_when_ready</dt>\n-<dd><p class=\"first\">When this flag is set, the torrent will <em>force stop</em> 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.</p>\n-<p><em>Force stopped</em> 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.</p>\n-<p>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.</p>\n-<p>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.</p>\n-<p>The behavior is more robust when setting this flag as part of adding\n-the torrent. See <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.</p>\n-<p>The stop-when-ready flag fixes the inherent race condition of waiting\n-for the <a class=\"reference external\" href=\"reference-Alerts.html#state_changed_alert\">state_changed_alert</a> and then call <a class=\"reference external\" href=\"reference-Session.html#pause()\">pause()</a>. The download/seeding\n-will most likely start in between posting the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> and receiving the\n-call to pause.</p>\n-<p class=\"last\">A downloading state is one where peers are being connected. Which means\n-just downloading the metadata via the <tt class=\"docutils literal\">ut_metadata</tt> 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</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::override_trackers\"></a><dl class=\"docutils\">\n-<dt>override_trackers</dt>\n-<dd>when this flag is set, the tracker list in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n-object override any trackers from the torrent file. If the flag is\n-not set, the trackers from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object will be\n-added to the list of trackers used by the torrent.\n-This flag is set by <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n-This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></dd>\n-</dl>\n-<a name=\"torrent_flags_t::override_web_seeds\"></a><dl class=\"docutils\">\n-<dt>override_web_seeds</dt>\n-<dd>If this flag is set, the web seeds from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n-object will override any web seeds in the torrent file. If it's not\n-set, web seeds in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object will be added to the\n-list of web seeds used by the torrent.\n-This flag is set by <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n-This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></dd>\n-</dl>\n-<a name=\"torrent_flags_t::need_save_resume\"></a><dl class=\"docutils\">\n-<dt>need_save_resume</dt>\n-<dd><p class=\"first\">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-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> for details.</p>\n-<p class=\"last\">This flag is cleared by a successful call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a>\n-This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>, since it represents an\n-ephemeral state of a running torrent.</p>\n-</dd>\n-</dl>\n-<a name=\"torrent_flags_t::disable_dht\"></a><dl class=\"docutils\">\n-<dt>disable_dht</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::disable_lsd\"></a><dl class=\"docutils\">\n-<dt>disable_lsd</dt>\n-<dd>set this flag to disable local service discovery for this torrent.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::disable_pex\"></a><dl class=\"docutils\">\n-<dt>disable_pex</dt>\n-<dd>set this flag to disable peer exchange for this torrent.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::no_verify_files\"></a><dl class=\"docutils\">\n-<dt>no_verify_files</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::default_dont_download\"></a><dl class=\"docutils\">\n-<dt>default_dont_download</dt>\n-<dd>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).</dd>\n-</dl>\n-<a name=\"torrent_flags_t::i2p_torrent\"></a><dl class=\"docutils\">\n-<dt>i2p_torrent</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a> if the tracker list contains such\n-URL.</dd>\n-</dl>\n-<a name=\"torrent_flags_t::all\"></a><dl class=\"docutils\">\n-<dt>all</dt>\n-<dd>all torrent flags combined. Can conveniently be used when creating masks\n-for flags</dd>\n-</dl>\n-<a name=\"pex_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:pex_flags_t&labels=documentation&body=Documentation+under+heading+%22pex_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"pex-flags-t\">\n-<h1>pex_flags_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/pex_flags.hpp\">libtorrent/pex_flags.hpp</a>"</p>\n-<a name=\"pex_flags_t::pex_encryption\"></a><dl class=\"docutils\">\n-<dt>pex_encryption</dt>\n-<dd>the peer supports protocol encryption</dd>\n-</dl>\n-<a name=\"pex_flags_t::pex_seed\"></a><dl class=\"docutils\">\n-<dt>pex_seed</dt>\n-<dd>the peer is a seed</dd>\n-</dl>\n-<a name=\"pex_flags_t::pex_utp\"></a><dl class=\"docutils\">\n-<dt>pex_utp</dt>\n-<dd>the peer supports the uTP, transport protocol over UDP.</dd>\n-</dl>\n-<a name=\"pex_flags_t::pex_holepunch\"></a><dl class=\"docutils\">\n-<dt>pex_holepunch</dt>\n-<dd>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</dd>\n-</dl>\n-<a name=\"pex_flags_t::pex_lt_v2\"></a><dl class=\"docutils\">\n-<dt>pex_lt_v2</dt>\n-<dd>protocol v2\n-this is not a standard flag, it is only used internally</dd>\n-</dl>\n-<a name=\"download_priority_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:download_priority_t&labels=documentation&body=Documentation+under+heading+%22download_priority_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"download-priority-t\">\n-<h1>download_priority_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/download_priority.hpp\">libtorrent/download_priority.hpp</a>"</p>\n-<a name=\"download_priority_t::dont_download\"></a><dl class=\"docutils\">\n-<dt>dont_download</dt>\n-<dd>Don't download the file or piece. Partial pieces may still be downloaded when\n-setting file priorities.</dd>\n-</dl>\n-<a name=\"download_priority_t::default_priority\"></a><dl class=\"docutils\">\n-<dt>default_priority</dt>\n-<dd>The default priority for files and pieces.</dd>\n-</dl>\n-<a name=\"download_priority_t::low_priority\"></a><dl class=\"docutils\">\n-<dt>low_priority</dt>\n-<dd>The lowest priority for files and pieces.</dd>\n-</dl>\n-<a name=\"download_priority_t::top_priority\"></a><dl class=\"docutils\">\n-<dt>top_priority</dt>\n-<dd>The highest priority for files and pieces.</dd>\n-</dl>\n-<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"int\">\n-<h1>int</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"int::version_major\"></a><dl class=\"docutils\">\n-<dt>version_major</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"int::version_minor\"></a><dl class=\"docutils\">\n-<dt>version_minor</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"int::version_tiny\"></a><dl class=\"docutils\">\n-<dt>version_tiny</dt>\n-<dd>the major, minor and tiny versions of libtorrent</dd>\n-</dl>\n-<a name=\"char const*\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:char+const%2A&labels=documentation&body=Documentation+under+heading+%22char+const%2A%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"char-const\">\n-<h1>char const*</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"char const*::version_str\"></a><dl class=\"docutils\">\n-<dt>version_str</dt>\n-<dd>the libtorrent version in string form</dd>\n+<p>called every time a new peer is added to the peer list.\n+This is before the peer is connected to. For <tt class=\"docutils literal\">flags</tt>, see\n+torrent_plugin::flags_t. The <tt class=\"docutils literal\">source</tt> 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.</p>\n+<a name=\"first_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bfirst_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bfirst_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>first_time</dt>\n+<dd>this is the first time we see this peer</dd>\n </dl>\n-<a name=\"std::uint64_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:std%3A%3Auint64_t&labels=documentation&body=Documentation+under+heading+%22std%3A%3Auint64_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"std-uint64-t\">\n-<h1>std::uint64_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n-<a name=\"std::uint64_t::version_revision\"></a><dl class=\"docutils\">\n-<dt>version_revision</dt>\n-<dd>the git commit of this libtorrent version</dd>\n+<a name=\"filtered\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bfiltered%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bfiltered%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>filtered</dt>\n+<dd>this peer was not added because it was\n+filtered by the IP filter</dd>\n </dl>\n-<a name=\"block_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_info&labels=documentation&body=Documentation+under+heading+%22class+block_info%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"block-info\">\n-<h1>block_info</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n-<p>holds the state of a block in a piece. Who we requested\n-it from and how far along we are at downloading it.</p>\n+<a name=\"peer_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_plugin&labels=documentation&body=Documentation+under+heading+%22class+peer_plugin%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-plugin\">\n+<h1>peer_plugin</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n+<p>peer plugins are associated with a specific peer. A peer could be\n+both a regular bittorrent peer (<tt class=\"docutils literal\">bt_peer_connection</tt>) or one of the\n+web seed connections (<tt class=\"docutils literal\">web_peer_connection</tt> or <tt class=\"docutils literal\">http_seed_connection</tt>).\n+In order to only attach to certain peers, make your\n+torrent_plugin::new_connection only return a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> for certain peer\n+connection types</p>\n <pre class=\"literal-block\">\n-struct block_info\n+struct peer_plugin\n {\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n- void <strong>set_peer</strong> (tcp::endpoint const& ep);\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+ virtual string_view <strong>type</strong> () const;\n+ virtual void <strong>add_handshake</strong> (entry&);\n+ virtual void <strong>on_disconnect</strong> (error_code const&);\n+ virtual void <strong>on_connected</strong> ();\n+ virtual bool <strong>on_handshake</strong> (span<char const>);\n+ virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n+ virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n+ virtual bool <strong>on_dont_have</strong> (piece_index_t);\n+ virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n+ virtual bool <strong>on_have_all</strong> ();\n+ virtual bool <strong>on_choke</strong> ();\n+ virtual bool <strong>on_request</strong> (peer_request const&);\n+ virtual bool <strong>on_have_none</strong> ();\n+ virtual bool <strong>on_have</strong> (piece_index_t);\n+ virtual bool <strong>on_unchoke</strong> ();\n+ virtual bool <strong>on_not_interested</strong> ();\n+ virtual bool <strong>on_interested</strong> ();\n+ virtual bool <strong>on_piece</strong> (peer_request const& <em>/*piece*/</em>\n+ , span<char const> <em>/*buf*/</em>);\n+ virtual bool <strong>on_cancel</strong> (peer_request const&);\n+ virtual bool <strong>on_suggest</strong> (piece_index_t);\n+ virtual bool <strong>on_reject</strong> (peer_request const&);\n+ virtual void <strong>sent_have_none</strong> ();\n+ virtual void <strong>sent_choke</strong> ();\n+ virtual void <strong>sent_suggest</strong> (piece_index_t);\n+ virtual void <strong>sent_reject_request</strong> (peer_request const&);\n+ virtual void <strong>sent_request</strong> (peer_request const&);\n+ virtual void <strong>sent_allow_fast</strong> (piece_index_t);\n+ virtual void <strong>sent_cancel</strong> (peer_request const&);\n+ virtual void <strong>sent_have_all</strong> ();\n+ virtual void <strong>sent_have</strong> (piece_index_t);\n+ virtual void <strong>sent_interested</strong> ();\n+ virtual void <strong>sent_unchoke</strong> ();\n+ virtual void <strong>sent_piece</strong> (peer_request const&);\n+ virtual void <strong>sent_not_interested</strong> ();\n+ virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n+ virtual bool <strong>can_disconnect</strong> (error_code const& <em>/*ec*/</em>);\n+ virtual bool <strong>on_extended</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n+ span<char const> <em>/*body*/</em>);\n+ virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n+ span<char const> <em>/*body*/</em>);\n+ virtual void <strong>on_piece_failed</strong> (piece_index_t);\n+ virtual void <strong>on_piece_pass</strong> (piece_index_t);\n+ virtual void <strong>tick</strong> ();\n+ virtual bool <strong>write_request</strong> (peer_request const&);\n };\n </pre>\n-<a name=\"set_peer()\"></a>\n-<a name=\"peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bset_peer%28%29+peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bset_peer%28%29+peer%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"set-peer-peer\">\n-<h2>set_peer() peer()</h2>\n+<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"type\">\n+<h2>type()</h2>\n <pre class=\"literal-block\">\n-<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n-void <strong>set_peer</strong> (tcp::endpoint const& ep);\n+virtual string_view <strong>type</strong> () const;\n </pre>\n-<p>The peer is the ip address of the peer this block was downloaded from.</p>\n-<a name=\"block_state_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+block_state_t&labels=documentation&body=Documentation+under+heading+%22enum+block_state_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-block-state-t\">\n-<h2>enum block_state_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"13%\" />\n-<col width=\"8%\" />\n-<col width=\"79%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>none</td>\n-<td>0</td>\n-<td>This block has not been downloaded or requested form any peer.</td>\n-</tr>\n-<tr><td>requested</td>\n-<td>1</td>\n-<td>The block has been requested, but not completely downloaded yet.</td>\n-</tr>\n-<tr><td>writing</td>\n-<td>2</td>\n-<td>The block has been downloaded and is currently queued for being\n-written to disk.</td>\n-</tr>\n-<tr><td>finished</td>\n-<td>3</td>\n-<td>The block has been written to disk.</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"bytes_progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bbytes_progress%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bbytes_progress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>bytes_progress</dt>\n-<dd>the number of bytes that have been received for this block</dd>\n-</dl>\n-<a name=\"block_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bblock_size%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bblock_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>block_size</dt>\n-<dd>the total number of bytes in this block.</dd>\n-</dl>\n-<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>state</dt>\n-<dd>the state this block is in (see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_state_t\">block_state_t</a>)</dd>\n-</dl>\n-<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_peers</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"partial_piece_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+partial_piece_info&labels=documentation&body=Documentation+under+heading+%22class+partial_piece_info%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"partial-piece-info\">\n-<h1>partial_piece_info</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n-<p>This class holds information about pieces that have outstanding requests\n-or outstanding writes</p>\n+<p>This function is expected to return the name of\n+the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>.</p>\n+<a name=\"add_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Badd_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Badd_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-handshake\">\n+<h2>add_handshake()</h2>\n <pre class=\"literal-block\">\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+virtual void <strong>add_handshake</strong> (entry&);\n </pre>\n-<a name=\"piece_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bpiece_index%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bpiece_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_index</dt>\n-<dd>the index of the piece in question. <tt class=\"docutils literal\">blocks_in_piece</tt> 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.</dd>\n-</dl>\n-<a name=\"blocks_in_piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bblocks_in_piece%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bblocks_in_piece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>blocks_in_piece</dt>\n-<dd>the number of blocks in this piece</dd>\n-</dl>\n-<a name=\"finished\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bfinished%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bfinished%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>finished</dt>\n-<dd>the number of blocks that are in the finished state</dd>\n-</dl>\n-<a name=\"writing\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bwriting%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bwriting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>writing</dt>\n-<dd>the number of blocks that are in the writing state</dd>\n-</dl>\n-<a name=\"requested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Brequested%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Brequested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>requested</dt>\n-<dd>the number of blocks that are in the requested state</dd>\n-</dl>\n-<a name=\"blocks\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bblocks%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bblocks%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>blocks</dt>\n-<dd><p class=\"first\">this is an array of <tt class=\"docutils literal\">blocks_in_piece</tt> number of\n-items. One for each block in the piece.</p>\n-<div class=\"admonition warning last\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">This is a pointer that points to an array\n-that's owned by the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. The next time\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_download_queue()\">get_download_queue()</a> is called, it will be invalidated.\n-In the case of <a class=\"reference external\" href=\"reference-Alerts.html#piece_info_alert\">piece_info_alert</a>, these pointers point into the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-object itself, and will be invalidated when the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> destruct.</p>\n-</div>\n-</dd>\n-</dl>\n-<a name=\"torrent_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_handle&labels=documentation&body=Documentation+under+heading+%22class+torrent_handle%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-handle\">\n-<h1>torrent_handle</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n-<p>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.</p>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">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-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a> call.</p>\n-</div>\n-<p>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 <tt class=\"docutils literal\">invalid_handle</tt>.</p>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">All operations on a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> may throw system_error\n-exception, in case the handle is no longer referring to a torrent.\n-There is one exception <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> 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.</p>\n-</div>\n+<p>can add entries to the extension handshake\n+this is not called for web seeds</p>\n+<a name=\"on_disconnect()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_disconnect%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_disconnect%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-disconnect\">\n+<h2>on_disconnect()</h2>\n <pre class=\"literal-block\">\n-struct torrent_handle\n-{\n- friend std::size_t <strong>hash_value</strong> (torrent_handle const& th);\n- <strong>torrent_handle</strong> () noexcept = default;\n- void <strong>add_piece</strong> (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n- void <strong>add_piece</strong> (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n- void <strong>read_piece</strong> (piece_index_t piece) const;\n- bool <strong>have_piece</strong> (piece_index_t piece) const;\n- void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n- void <strong>post_peer_info</strong> () const;\n- torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n- void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n- void <strong>get_download_queue</strong> (std::vector<partial_piece_info>& queue) const;\n- void <strong>post_download_queue</strong> () const;\n- std::vector<partial_piece_info> <strong>get_download_queue</strong> () const;\n- void <strong>clear_piece_deadlines</strong> () const;\n- void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n- void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n- void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n- void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n- std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n- std::vector<open_file_state> <strong>file_status</strong> () const;\n- void <strong>clear_error</strong> () const;\n- void <strong>post_trackers</strong> () const;\n- std::vector<announce_entry> <strong>trackers</strong> () const;\n- void <strong>add_tracker</strong> (announce_entry const&) const;\n- void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n- void <strong>add_url_seed</strong> (std::string const& url) const;\n- std::set<std::string> <strong>url_seeds</strong> () const;\n- void <strong>remove_url_seed</strong> (std::string const& url) const;\n- std::set<std::string> <strong>http_seeds</strong> () const;\n- void <strong>add_http_seed</strong> (std::string const& url) const;\n- void <strong>remove_http_seed</strong> (std::string const& url) const;\n- void <strong>add_extension</strong> (\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 <strong>set_metadata</strong> (span<char const> metadata) const;\n- bool <strong>is_valid</strong> () const;\n- void <strong>resume</strong> () const;\n- void <strong>pause</strong> (pause_flags_t flags = {}) const;\n- void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n- void <strong>set_flags</strong> (torrent_flags_t flags) const;\n- torrent_flags_t <strong>flags</strong> () const;\n- void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n- void <strong>flush_cache</strong> () const;\n- void <strong>force_recheck</strong> () const;\n- void <strong>save_resume_data</strong> (resume_data_flags_t flags = {}) const;\n- bool <strong>need_save_resume_data</strong> (resume_data_flags_t flags) const;\n- bool <strong>need_save_resume_data</strong> () const;\n- void <strong>queue_position_up</strong> () const;\n- void <strong>queue_position_top</strong> () const;\n- void <strong>queue_position_bottom</strong> () const;\n- void <strong>queue_position_down</strong> () const;\n- queue_position_t <strong>queue_position</strong> () const;\n- void <strong>queue_position_set</strong> (queue_position_t p) const;\n- void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n- void <strong>set_ssl_certificate</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params\n- , std::string const& passphrase = "");\n- std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n- std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n- std::vector<std::vector<sha256_hash>> <strong>piece_layers</strong> () const;\n- void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n- void <strong>post_piece_availability</strong> () const;\n- std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n- void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n- download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n- void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n- void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n- std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n- download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n- void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n- void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n- void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n- void <strong>force_dht_announce</strong> () const;\n- void <strong>force_lsd_announce</strong> () const;\n- void <strong>scrape_tracker</strong> (int idx = -1) const;\n- void <strong>set_download_limit</strong> (int limit) const;\n- void <strong>set_upload_limit</strong> (int limit) const;\n- int <strong>upload_limit</strong> () const;\n- int <strong>download_limit</strong> () const;\n- void <strong>connect_peer</strong> (tcp::endpoint const& adr, peer_source_flags_t source = {}\n- , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n- void <strong>clear_peers</strong> ();\n- void <strong>set_max_uploads</strong> (int max_uploads) const;\n- int <strong>max_uploads</strong> () const;\n- int <strong>max_connections</strong> () const;\n- void <strong>set_max_connections</strong> (int max_connections) const;\n- void <strong>move_storage</strong> (std::string const& save_path\n- , move_flags_t flags = move_flags_t::always_replace_files\n- ) const;\n- void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n- info_hash_t <strong>info_hashes</strong> () const;\n- sha1_hash <strong>info_hash</strong> () const;\n- bool <strong>operator!=</strong> (const torrent_handle& h) const;\n- bool <strong>operator<</strong> (const torrent_handle& h) const;\n- bool <strong>operator==</strong> (const torrent_handle& h) const;\n- std::uint32_t <strong>id</strong> () const;\n- std::shared_ptr<torrent> <strong>native_handle</strong> () const;\n- client_data_t <strong>userdata</strong> () const;\n- bool <strong>in_session</strong> () const;\n-\n- static constexpr add_piece_flags_t <strong>overwrite_existing</strong> = 0_bit;\n- static constexpr status_flags_t <strong>query_distributed_copies</strong> = 0_bit;\n- static constexpr status_flags_t <strong>query_accurate_download_counters</strong> = 1_bit;\n- static constexpr status_flags_t <strong>query_last_seen_complete</strong> = 2_bit;\n- static constexpr status_flags_t <strong>query_pieces</strong> = 3_bit;\n- static constexpr status_flags_t <strong>query_verified_pieces</strong> = 4_bit;\n- static constexpr status_flags_t <strong>query_torrent_file</strong> = 5_bit;\n- static constexpr status_flags_t <strong>query_name</strong> = 6_bit;\n- static constexpr status_flags_t <strong>query_save_path</strong> = 7_bit;\n- static constexpr deadline_flags_t <strong>alert_when_available</strong> = 0_bit;\n- static constexpr file_progress_flags_t <strong>piece_granularity</strong> = 0_bit;\n- static constexpr pause_flags_t <strong>graceful_pause</strong> = 0_bit;\n- static constexpr resume_data_flags_t <strong>flush_disk_cache</strong> = 0_bit;\n- static constexpr resume_data_flags_t <strong>save_info_dict</strong> = 1_bit;\n- static constexpr resume_data_flags_t <strong>only_if_modified</strong> = 2_bit;\n- static constexpr resume_data_flags_t <strong>if_counters_changed</strong> = 3_bit;\n- static constexpr resume_data_flags_t <strong>if_download_progress</strong> = 4_bit;\n- static constexpr resume_data_flags_t <strong>if_config_changed</strong> = 5_bit;\n- static constexpr resume_data_flags_t <strong>if_state_changed</strong> = 6_bit;\n- static constexpr resume_data_flags_t <strong>if_metadata_changed</strong> = 7_bit;\n- static constexpr reannounce_flags_t <strong>ignore_min_interval</strong> = 0_bit;\n-};\n+virtual void <strong>on_disconnect</strong> (error_code const&);\n </pre>\n-<a name=\"torrent_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"torrent-handle-1\">\n-<h2>torrent_handle()</h2>\n+<p>called when the peer is being disconnected.</p>\n+<a name=\"on_connected()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_connected%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_connected%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-connected\">\n+<h2>on_connected()</h2>\n <pre class=\"literal-block\">\n-<strong>torrent_handle</strong> () noexcept = default;\n+virtual void <strong>on_connected</strong> ();\n </pre>\n-<p>constructs a torrent handle that does not refer to a torrent.\n-i.e. <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> will return false.</p>\n-<a name=\"add_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-piece\">\n-<h2>add_piece()</h2>\n+<p>called when the peer is successfully connected. Note that\n+incoming connections will have been connected by the time\n+the peer <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is attached to it, and won't have this hook\n+called.</p>\n+<a name=\"on_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-handshake\">\n+<h2>on_handshake()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_piece</strong> (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n-void <strong>add_piece</strong> (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+virtual bool <strong>on_handshake</strong> (span<char const>);\n </pre>\n-<p>This function will write <tt class=\"docutils literal\">data</tt> to the storage as piece <tt class=\"docutils literal\">piece</tt>,\n-as if it had been downloaded from a peer.</p>\n-<p>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.</p>\n-<p>Since the data is written asynchronously, you may know that is passed\n-or failed the hash check by waiting for <a class=\"reference external\" href=\"reference-Alerts.html#piece_finished_alert\">piece_finished_alert</a> or\n-<a class=\"reference external\" href=\"reference-Alerts.html#hash_failed_alert\">hash_failed_alert</a>.</p>\n-<p>Adding pieces while the torrent is being checked (i.e. in\n-<a class=\"reference external\" href=\"reference-Torrent_Status.html#checking_files\">torrent_status::checking_files</a> state) is not supported.</p>\n-<p>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. <tt class=\"docutils literal\">data</tt> is expected to point to a buffer of as\n-many bytes as the size of the specified piece. See\n-<a class=\"reference external\" href=\"reference-Storage.html#piece_size()\">file_storage::piece_size()</a>.</p>\n-<p>The data in the buffer is copied and passed on to the disk IO thread\n-to be written at a later point.</p>\n-<p>The overload taking a <tt class=\"docutils literal\"><span class=\"pre\">std::vector<char></span></tt> is not blocking, it will\n-send the buffer to the main thread and return immediately.</p>\n-<a name=\"read_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bread_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bread_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"read-piece\">\n-<h2>read_piece()</h2>\n+<p>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</p>\n+<a name=\"on_extension_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_extension_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_extension_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-extension-handshake\">\n+<h2>on_extension_handshake()</h2>\n <pre class=\"literal-block\">\n-void <strong>read_piece</strong> (piece_index_t piece) const;\n+virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n </pre>\n-<p>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.</p>\n-<p>When the read operation is completed, it is passed back through an\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, <a class=\"reference external\" href=\"reference-Alerts.html#read_piece_alert\">read_piece_alert</a>. Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit\n-call, it will always be posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n-<p>Note that if you read multiple pieces, the read operations are not\n-guaranteed to finish in the same order as you initiated them.</p>\n-<a name=\"have_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bhave_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bhave_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"have-piece\">\n-<h2>have_piece()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>\n+being removed from the peer_connection and destructed.\n+this is not called for web seeds</p>\n+<a name=\"on_have()\"></a>\n+<a name=\"on_have_all()\"></a>\n+<a name=\"on_request()\"></a>\n+<a name=\"on_bitfield()\"></a>\n+<a name=\"on_not_interested()\"></a>\n+<a name=\"on_choke()\"></a>\n+<a name=\"on_allowed_fast()\"></a>\n+<a name=\"on_have_none()\"></a>\n+<a name=\"on_unchoke()\"></a>\n+<a name=\"on_interested()\"></a>\n+<a name=\"on_dont_have()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_have%28%29+on_have_all%28%29+on_request%28%29+on_bitfield%28%29+on_not_interested%28%29+on_choke%28%29+on_allowed_fast%28%29+on_have_none%28%29+on_unchoke%28%29+on_interested%28%29+on_dont_have%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_have%28%29+on_have_all%28%29+on_request%28%29+on_bitfield%28%29+on_not_interested%28%29+on_choke%28%29+on_allowed_fast%28%29+on_have_none%28%29+on_unchoke%28%29+on_interested%28%29+on_dont_have%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-have-on-have-all-on-request-on-bitfield-on-not-interested-on-choke-on-allowed-fast-on-have-none-on-unchoke-on-interested-on-dont-have\">\n+<h2>on_have() on_have_all() on_request() on_bitfield() on_not_interested() on_choke() on_allowed_fast() on_have_none() on_unchoke() on_interested() on_dont_have()</h2>\n <pre class=\"literal-block\">\n-bool <strong>have_piece</strong> (piece_index_t piece) const;\n+virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n+virtual bool <strong>on_dont_have</strong> (piece_index_t);\n+virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n+virtual bool <strong>on_have_all</strong> ();\n+virtual bool <strong>on_choke</strong> ();\n+virtual bool <strong>on_request</strong> (peer_request const&);\n+virtual bool <strong>on_have_none</strong> ();\n+virtual bool <strong>on_have</strong> (piece_index_t);\n+virtual bool <strong>on_unchoke</strong> ();\n+virtual bool <strong>on_not_interested</strong> ();\n+virtual bool <strong>on_interested</strong> ();\n </pre>\n-<p>Returns true if this piece has been completely downloaded and written\n-to disk, and false otherwise.</p>\n-<a name=\"get_peer_info()\"></a>\n-<a name=\"post_peer_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_peer_info%28%29+post_peer_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_peer_info%28%29+post_peer_info%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-peer-info-post-peer-info\">\n-<h2>get_peer_info() post_peer_info()</h2>\n+<p>returning true from any of the message handlers\n+indicates that the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has handled the message.\n+it will break the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> chain traversing and not let\n+anyone else handle the message, including the default\n+handler.</p>\n+<a name=\"on_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-piece\">\n+<h2>on_piece()</h2>\n <pre class=\"literal-block\">\n-void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n-void <strong>post_peer_info</strong> () const;\n+virtual bool <strong>on_piece</strong> (peer_request const& <em>/*piece*/</em>\n+ , span<char const> <em>/*buf*/</em>);\n </pre>\n-<p>Query information about connected peers for this torrent. If the\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw a system_error exception.</p>\n-<p><tt class=\"docutils literal\">post_peer_info()</tt> is asynchronous and will trigger the posting of\n-a <a class=\"reference external\" href=\"reference-Alerts.html#peer_info_alert\">peer_info_alert</a>. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> contain a list of <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a> objects, one\n-for each connected peer.</p>\n-<p><tt class=\"docutils literal\">get_peer_info()</tt> is synchronous and takes a reference to a vector\n-that will be cleared and filled with one <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> for each peer\n-connected to this torrent, given the handle is valid. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in\n-the vector contains information about that particular peer. See\n-<a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a>.</p>\n-<a name=\"post_status()\"></a>\n-<a name=\"status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"post-status-status\">\n-<h2>post_status() status()</h2>\n+<p>This function is called when the peer connection is receiving\n+a piece. <tt class=\"docutils literal\">buf</tt> points (non-owning pointer) to the data in an\n+internal immutable disk buffer. The length of the data is specified\n+in the <tt class=\"docutils literal\">length</tt> member of the <tt class=\"docutils literal\">piece</tt> parameter.\n+returns true to indicate that the piece is handled and the\n+rest of the logic should be ignored.</p>\n+<a name=\"sent_have()\"></a>\n+<a name=\"sent_interested()\"></a>\n+<a name=\"sent_not_interested()\"></a>\n+<a name=\"sent_piece()\"></a>\n+<a name=\"sent_unchoke()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_have%28%29+sent_interested%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_have%28%29+sent_interested%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"sent-have-sent-interested-sent-not-interested-sent-piece-sent-unchoke\">\n+<h2>sent_have() sent_interested() sent_not_interested() sent_piece() sent_unchoke()</h2>\n <pre class=\"literal-block\">\n-torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n-void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n+virtual void <strong>sent_have</strong> (piece_index_t);\n+virtual void <strong>sent_interested</strong> ();\n+virtual void <strong>sent_unchoke</strong> ();\n+virtual void <strong>sent_piece</strong> (peer_request const&);\n+virtual void <strong>sent_not_interested</strong> ();\n </pre>\n-<p><tt class=\"docutils literal\">status()</tt> will return a structure with information about the status\n-of this torrent. If the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw\n-system_error exception. See <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>. The <tt class=\"docutils literal\">flags</tt>\n-argument filters what information is returned in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.\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.</p>\n-<p>The <tt class=\"docutils literal\">status()</tt> function will block until the internal libtorrent\n-thread responds with the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object. To avoid blocking,\n-instead call <tt class=\"docutils literal\">post_status()</tt>. It will trigger posting of a\n-<a class=\"reference external\" href=\"reference-Alerts.html#state_update_alert\">state_update_alert</a> with a single <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object for this\n-torrent.</p>\n-<p>In order to get regular updates for torrents whose status changes,\n-consider calling session::post_torrent_updates()`` instead.</p>\n-<p>By default everything is included. The flags you can use to decide\n-what to <em>include</em> are defined in this class.</p>\n-<a name=\"get_download_queue()\"></a>\n-<a name=\"post_download_queue()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_download_queue%28%29+post_download_queue%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_download_queue%28%29+post_download_queue%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-download-queue-post-download-queue\">\n-<h2>get_download_queue() post_download_queue()</h2>\n+<p>called after a choke message has been sent to the peer</p>\n+<a name=\"sent_payload()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_payload%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_payload%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"sent-payload\">\n+<h2>sent_payload()</h2>\n <pre class=\"literal-block\">\n-void <strong>get_download_queue</strong> (std::vector<partial_piece_info>& queue) const;\n-void <strong>post_download_queue</strong> () const;\n-std::vector<partial_piece_info> <strong>get_download_queue</strong> () const;\n+virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n </pre>\n-<p><tt class=\"docutils literal\">post_download_queue()</tt> triggers a download_queue_alert to be\n-posted.\n-<tt class=\"docutils literal\">get_download_queue()</tt> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a> for the\n-fields in the returned vector.</p>\n-<a name=\"clear_piece_deadlines()\"></a>\n-<a name=\"reset_piece_deadline()\"></a>\n-<a name=\"set_piece_deadline()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_piece_deadlines%28%29+reset_piece_deadline%28%29+set_piece_deadline%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_piece_deadlines%28%29+reset_piece_deadline%28%29+set_piece_deadline%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-piece-deadlines-reset-piece-deadline-set-piece-deadline\">\n-<h2>clear_piece_deadlines() reset_piece_deadline() set_piece_deadline()</h2>\n+<p>called after piece data has been sent to the peer\n+this can be used for stats book keeping</p>\n+<a name=\"can_disconnect()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bcan_disconnect%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bcan_disconnect%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"can-disconnect\">\n+<h2>can_disconnect()</h2>\n <pre class=\"literal-block\">\n-void <strong>clear_piece_deadlines</strong> () const;\n-void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n-void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n+virtual bool <strong>can_disconnect</strong> (error_code const& <em>/*ec*/</em>);\n </pre>\n-<p>This function sets or resets the deadline associated with a specific\n-piece index (<tt class=\"docutils literal\">index</tt>). 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.</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#read_piece()\">read_piece()</a> for <tt class=\"docutils literal\">index</tt>.</p>\n-<p><tt class=\"docutils literal\">deadline</tt> is the number of milliseconds until this piece should be\n-completed.</p>\n-<p><tt class=\"docutils literal\">reset_piece_deadline</tt> removes the deadline from the piece. If it\n-hasn't already been downloaded, it will no longer be considered a\n-priority.</p>\n-<p><tt class=\"docutils literal\">clear_piece_deadlines()</tt> removes deadlines on all pieces in\n-the torrent. As if <a class=\"reference external\" href=\"reference-Torrent_Handle.html#reset_piece_deadline()\">reset_piece_deadline()</a> was called on all pieces.</p>\n-<a name=\"file_progress()\"></a>\n-<a name=\"post_file_progress()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-progress-post-file-progress\">\n-<h2>file_progress() post_file_progress()</h2>\n+<p>called when libtorrent think this peer should be disconnected.\n+if the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> returns false, the peer will not be disconnected.</p>\n+<a name=\"on_extended()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_extended%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_extended%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-extended\">\n+<h2>on_extended()</h2>\n <pre class=\"literal-block\">\n-void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n-void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n-std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n+virtual bool <strong>on_extended</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n+ span<char const> <em>/*body*/</em>);\n </pre>\n-<p>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-<a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>.</p>\n-<p>This operation is not very cheap. Its complexity is <em>O(n + mj)</em>.\n-Where <em>n</em> is the number of files, <em>m</em> is the number of currently\n-downloading pieces and <em>j</em> is the number of blocks in a piece.</p>\n-<p>The <tt class=\"docutils literal\">flags</tt> 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-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::piece_granularity</span></tt> 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.</p>\n-<a name=\"file_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-status\">\n-<h2>file_status()</h2>\n+<p>called when an extended message is received. If returning true,\n+the message is not processed by any other <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> and if false\n+is returned the next <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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 <tt class=\"docutils literal\">body</tt> size equal the <tt class=\"docutils literal\">length</tt>.\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.</p>\n+<a name=\"on_unknown_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_unknown_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_unknown_message%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-unknown-message\">\n+<h2>on_unknown_message()</h2>\n <pre class=\"literal-block\">\n-std::vector<open_file_state> <strong>file_status</strong> () const;\n+virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n+ span<char const> <em>/*body*/</em>);\n </pre>\n-<p>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.</p>\n-<p>See <a class=\"reference external\" href=\"reference-Custom_Storage.html#open_file_state\">open_file_state</a></p>\n-<a name=\"clear_error()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_error%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_error%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-error\">\n-<h2>clear_error()</h2>\n+<p>this is not called for web seeds</p>\n+<a name=\"on_piece_pass()\"></a>\n+<a name=\"on_piece_failed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece_pass%28%29+on_piece_failed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"on-piece-pass-on-piece-failed-1\">\n+<h2>on_piece_pass() on_piece_failed()</h2>\n <pre class=\"literal-block\">\n-void <strong>clear_error</strong> () const;\n+virtual void <strong>on_piece_failed</strong> (piece_index_t);\n+virtual void <strong>on_piece_pass</strong> (piece_index_t);\n </pre>\n-<p>If the torrent is in an error state (i.e. <tt class=\"docutils literal\"><span class=\"pre\">torrent_status::error</span></tt> is\n-non-empty), this will clear the error and start the torrent again.</p>\n-<a name=\"add_tracker()\"></a>\n-<a name=\"replace_trackers()\"></a>\n-<a name=\"trackers()\"></a>\n-<a name=\"post_trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-tracker-replace-trackers-trackers-post-trackers\">\n-<h2>add_tracker() replace_trackers() trackers() post_trackers()</h2>\n+<p>called when a piece that this peer participated in either\n+fails or passes the hash_check</p>\n+<a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tick-1\">\n+<h2>tick()</h2>\n <pre class=\"literal-block\">\n-void <strong>post_trackers</strong> () const;\n-std::vector<announce_entry> <strong>trackers</strong> () const;\n-void <strong>add_tracker</strong> (announce_entry const&) const;\n-void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n+virtual void <strong>tick</strong> ();\n </pre>\n-<p><tt class=\"docutils literal\">trackers()</tt> returns the list of trackers for this torrent. The\n-announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> contains both a string <tt class=\"docutils literal\">url</tt> which specify the\n-announce url for the tracker as well as an <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> <tt class=\"docutils literal\">tier</tt>, 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 <tt class=\"docutils literal\">replace_trackers()</tt> which takes a list of the same form as the\n-one returned from <tt class=\"docutils literal\">trackers()</tt> and will replace it. If you want an\n-immediate effect, you have to call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#force_reannounce()\">force_reannounce()</a>. See\n-<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n-<p><tt class=\"docutils literal\">post_trackers()</tt> is the asynchronous version of <tt class=\"docutils literal\">trackers()</tt>. It\n-will trigger a <a class=\"reference external\" href=\"reference-Alerts.html#tracker_list_alert\">tracker_list_alert</a> to be posted.</p>\n-<p><tt class=\"docutils literal\">add_tracker()</tt> 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-<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n-<p>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.</p>\n-<a name=\"url_seeds()\"></a>\n-<a name=\"remove_url_seed()\"></a>\n-<a name=\"add_url_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Burl_seeds%28%29+remove_url_seed%28%29+add_url_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Burl_seeds%28%29+remove_url_seed%28%29+add_url_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"url-seeds-remove-url-seed-add-url-seed\">\n-<h2>url_seeds() remove_url_seed() add_url_seed()</h2>\n+<p>called approximately once every second</p>\n+<a name=\"write_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bwrite_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bwrite_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"write-request\">\n+<h2>write_request()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_url_seed</strong> (std::string const& url) const;\n-std::set<std::string> <strong>url_seeds</strong> () const;\n-void <strong>remove_url_seed</strong> (std::string const& url) const;\n+virtual bool <strong>write_request</strong> (peer_request const&);\n </pre>\n-<p><tt class=\"docutils literal\">add_url_seed()</tt> 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-<tt class=\"docutils literal\">remove_url_seed()</tt> removes the given url if it exists already.\n-<tt class=\"docutils literal\">url_seeds()</tt> 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.</p>\n-<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n-<a name=\"add_http_seed()\"></a>\n-<a name=\"remove_http_seed()\"></a>\n-<a name=\"http_seeds()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_http_seed%28%29+remove_http_seed%28%29+http_seeds%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_http_seed%28%29+remove_http_seed%28%29+http_seeds%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-http-seed-remove-http-seed-http-seeds\">\n-<h2>add_http_seed() remove_http_seed() http_seeds()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> will have this function called.</p>\n+<a name=\"crypto_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+crypto_plugin&labels=documentation&body=Documentation+under+heading+%22class+crypto_plugin%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"crypto-plugin\">\n+<h1>crypto_plugin</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n <pre class=\"literal-block\">\n-std::set<std::string> <strong>http_seeds</strong> () const;\n-void <strong>add_http_seed</strong> (std::string const& url) const;\n-void <strong>remove_http_seed</strong> (std::string const& url) const;\n+struct crypto_plugin\n+{\n+ virtual void <strong>set_incoming_key</strong> (span<char const> key) = 0;\n+ virtual void <strong>set_outgoing_key</strong> (span<char const> key) = 0;\n+ <strong>encrypt</strong> (span<span<char>> <em>/*send_vec*/</em>) = 0;\n+ virtual std::tuple<int, int, int> <strong>decrypt</strong> (span<span<char>> <em>/*receive_vec*/</em>) = 0;\n+};\n </pre>\n-<p>These functions are identical as the <tt class=\"docutils literal\">*_url_seed()</tt> variants, but\n-they operate on <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> web seeds instead of <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n-<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n-<a name=\"add_extension()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_extension%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_extension%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-extension\">\n-<h2>add_extension()</h2>\n+<a name=\"decrypt()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:crypto_plugin%3A%3A%5Bdecrypt%28%29%5D&labels=documentation&body=Documentation+under+heading+%22crypto_plugin%3A%3A%5Bdecrypt%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"decrypt\">\n+<h2>decrypt()</h2>\n <pre class=\"literal-block\">\n-void <strong>add_extension</strong> (\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+virtual std::tuple<int, int, int> <strong>decrypt</strong> (span<span<char>> <em>/*receive_vec*/</em>) = 0;\n </pre>\n-<p>add the specified extension to this torrent. The <tt class=\"docutils literal\">ext</tt> 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 <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> instance.</p>\n-<a name=\"set_metadata()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_metadata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_metadata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-metadata\">\n-<h2>set_metadata()</h2>\n+<p>decrypt the provided buffers.\n+returns is a tuple representing the values\n+(consume, produce, packet_size)</p>\n+<p>consume is set to the number of bytes which should be trimmed from the\n+head of the buffers, default is 0</p>\n+<p>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</p>\n+<p>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</p>\n+<a name=\"create_ut_pex_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_pex_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_pex_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"create-ut-pex-plugin\">\n+<h1>create_ut_pex_plugin()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_pex.hpp\">libtorrent/extensions/ut_pex.hpp</a>"</p>\n <pre class=\"literal-block\">\n-bool <strong>set_metadata</strong> (span<char const> metadata) const;\n+std::shared_ptr<torrent_plugin> <strong>create_ut_pex_plugin</strong> (torrent_handle const&, client_data_t);\n </pre>\n-<p><tt class=\"docutils literal\">set_metadata</tt> expects the <em>info</em> section of metadata. i.e. The\n-buffer passed in will be hashed and verified against the info-hash. If\n-it fails, a <tt class=\"docutils literal\">metadata_failed_alert</tt> will be generated. If it passes,\n-a <tt class=\"docutils literal\">metadata_received_alert</tt> 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.</p>\n-<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-valid\">\n-<h2>is_valid()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor.</p>\n+<p>This can either be passed in the add_torrent_params::extensions field, or\n+via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n+<a name=\"create_smart_ban_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_smart_ban_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_smart_ban_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"create-smart-ban-plugin\">\n+<h1>create_smart_ban_plugin()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/smart_ban.hpp\">libtorrent/extensions/smart_ban.hpp</a>"</p>\n <pre class=\"literal-block\">\n-bool <strong>is_valid</strong> () const;\n+std::shared_ptr<torrent_plugin> <strong>create_smart_ban_plugin</strong> (torrent_handle const&, client_data_t);\n </pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> AND destructed.</p>\n-<p>To tell if the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, use\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#in_session()\">torrent_handle::in_session()</a>. This will return true before\n-<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">session_handle::remove_torrent()</a> is called, and false\n-afterward.</p>\n-<p>Clients should only use <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> to determine if the result of\n-session::find_torrent() was successful.</p>\n-<p>Unlike other member functions which return a value, <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a>\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.</p>\n-<a name=\"resume()\"></a>\n-<a name=\"pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bresume%28%29+pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bresume%28%29+pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"resume-pause\">\n-<h2>resume() pause()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n+<a name=\"create_ut_metadata_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_metadata_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_metadata_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"create-ut-metadata-plugin\">\n+<h1>create_ut_metadata_plugin()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_metadata.hpp\">libtorrent/extensions/ut_metadata.hpp</a>"</p>\n <pre class=\"literal-block\">\n-void <strong>resume</strong> () const;\n-void <strong>pause</strong> (pause_flags_t flags = {}) const;\n+std::shared_ptr<torrent_plugin> <strong>create_ut_metadata_plugin</strong> (torrent_handle const&, client_data_t);\n </pre>\n-<p><tt class=\"docutils literal\">pause()</tt>, and <tt class=\"docutils literal\">resume()</tt> 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-<a class=\"reference external\" href=\"reference-Alerts.html#file_error_alert\">file_error_alert</a>.</p>\n-<p>For possible values of the <tt class=\"docutils literal\">flags</tt> parameter, see pause_flags_t.</p>\n-<p>To know if a torrent is paused or not, call\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flags()</span></tt> and check for the\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_status::paused</span></tt> flag.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor.</p>\n+<p>This can either be passed in the add_torrent_params::extensions field, or\n+via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n+<a name=\"add_torrent_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_params&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_params%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-torrent-params\">\n+<h1>add_torrent_params</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/add_torrent_params.hpp\">libtorrent/add_torrent_params.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> contains all the information in a .torrent file\n+along with all information necessary to add that torrent to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n+The key fields when adding a torrent are:</p>\n+<ul class=\"simple\">\n+<li>ti - the immutable info-dict part of the torrent</li>\n+<li>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.</li>\n+</ul>\n+<p>In order to add a torrent to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, one of those fields must be set\n+in addition to <tt class=\"docutils literal\">save_path</tt>. The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object can then be\n+passed into one of the <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent()</span></tt> overloads or\n+<tt class=\"docutils literal\"><span class=\"pre\">session::async_add_torrent()</span></tt>.</p>\n+<p>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 (<tt class=\"docutils literal\">TORRENT_DISABLE_EXTENSIONS</tt> must not be defined). It also\n+takes an optional <tt class=\"docutils literal\">name</tt> 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+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::name</span></tt>.</p>\n+<p>The <tt class=\"docutils literal\">add_torrent_params</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For serialization and de-serialization of\n+<tt class=\"docutils literal\">add_torrent_params</tt> objects, see <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> and\n+<a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>.</p>\n+<p>The <tt class=\"docutils literal\">add_torrent_params</tt> is also used to represent a parsed .torrent\n+file. It can be loaded via <a class=\"reference external\" href=\"reference-Core.html#load_torrent_file()\">load_torrent_file()</a>, <a class=\"reference external\" href=\"reference-Core.html#load_torrent_buffer()\">load_torrent_buffer()</a> and\n+<a class=\"reference external\" href=\"reference-Core.html#load_torrent_parsed()\">load_torrent_parsed()</a>. It can be saved via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a>.</p>\n+<pre class=\"literal-block\">\n+struct add_torrent_params\n+{\n+ int <strong>version</strong> = 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 <strong>storage_mode</strong> = 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 <strong>flags</strong> = torrent_flags::default_flags;\n+ info_hash_t info_hashes;\n+ int <strong>max_uploads</strong> = -1;\n+ int <strong>max_connections</strong> = -1;\n+ int <strong>upload_limit</strong> = -1;\n+ int <strong>download_limit</strong> = -1;\n+ std::int64_t <strong>total_uploaded</strong> = 0;\n+ std::int64_t <strong>total_downloaded</strong> = 0;\n+ int <strong>active_time</strong> = 0;\n+ int <strong>finished_time</strong> = 0;\n+ int <strong>seeding_time</strong> = 0;\n+ std::time_t <strong>added_time</strong> = 0;\n+ std::time_t <strong>completed_time</strong> = 0;\n+ std::time_t <strong>last_seen_complete</strong> = 0;\n+ int <strong>num_complete</strong> = -1;\n+ int <strong>num_incomplete</strong> = -1;\n+ int <strong>num_downloaded</strong> = -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 <strong>last_download</strong> = 0;\n+ std::time_t <strong>last_upload</strong> = 0;\n+};\n+</pre>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>filled in by the constructor and should be left untouched. It is used\n+for forward binary compatibility.</dd>\n+</dl>\n+<a name=\"ti\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bti%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bti%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ti</dt>\n+<dd><a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object with the torrent to add. Unless the\n+info_hash is set, this is required to be initialized.</dd>\n+</dl>\n+<a name=\"trackers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>trackers</dt>\n+<dd>If the torrent doesn't have a tracker, but relies on the DHT to find\n+peers, the <tt class=\"docutils literal\">trackers</tt> can specify tracker URLs for the torrent.</dd>\n+</dl>\n+<a name=\"tracker_tiers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btracker_tiers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btracker_tiers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>tracker_tiers</dt>\n+<dd>the tiers the URLs in <tt class=\"docutils literal\">trackers</tt> 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.</dd>\n+</dl>\n+<a name=\"dht_nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bdht_nodes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bdht_nodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dht_nodes</dt>\n+<dd>a list of hostname and port pairs, representing DHT nodes to be added\n+to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (if DHT is enabled). The hostname may be an IP address.</dd>\n+</dl>\n+<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>name</dt>\n+<dd>in case there's no other name in this torrent, this name will be used.\n+The name out of the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object takes precedence if available.</dd>\n+</dl>\n+<a name=\"save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bsave_path%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bsave_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_path</dt>\n+<dd><p class=\"first\">the path where the torrent is or will be stored.</p>\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information, see <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n+<p class=\"last\">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 "..".</p>\n </div>\n-<a name=\"flags()\"></a>\n-<a name=\"unset_flags()\"></a>\n-<a name=\"set_flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflags%28%29+unset_flags%28%29+set_flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflags%28%29+unset_flags%28%29+set_flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"flags-unset-flags-set-flags\">\n-<h2>flags() unset_flags() set_flags()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n-void <strong>set_flags</strong> (torrent_flags_t flags) const;\n-torrent_flags_t <strong>flags</strong> () const;\n-void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n-</pre>\n-<p>sets and gets the torrent state flags. See <a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a>.\n-The <tt class=\"docutils literal\">set_flags</tt> overload that take a mask will affect all\n-flags part of the mask, and set their values to what the\n-<tt class=\"docutils literal\">flags</tt> argument is set to. This allows clearing and\n-setting flags in a single function call.\n-The <tt class=\"docutils literal\">set_flags</tt> overload that just takes flags, sets all\n-the specified flags and leave any other flags unchanged.\n-<tt class=\"docutils literal\">unset_flags</tt> clears the specified flags, while leaving\n-any other flags unchanged.</p>\n-<p>The <cite>seed_mode</cite> 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-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> flags, when adding the torrent.</p>\n-<a name=\"flush_cache()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflush_cache%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflush_cache%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"flush-cache\">\n-<h2>flush_cache()</h2>\n+<p class=\"last\">Setting this to an absolute path performs slightly better than a\n+relative path.</p>\n+</dd>\n+</dl>\n+<a name=\"storage_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bstorage_mode%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bstorage_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>storage_mode</dt>\n+<dd>One of the values from <a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a>. For more information, see\n+<a class=\"reference external\" href=\"manual-ref.html#storage-allocation\">storage allocation</a>.</dd>\n+</dl>\n+<a name=\"userdata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Buserdata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>userdata</dt>\n+<dd>The <tt class=\"docutils literal\">userdata</tt> parameter is optional and will be passed on to the\n+extension constructor functions, if any\n+(see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>). It will also be stored in the\n+torrent object and can be retrieved by calling <a class=\"reference external\" href=\"reference-Torrent_Handle.html#userdata()\">userdata()</a>.</dd>\n+</dl>\n+<a name=\"file_priorities\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bfile_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bfile_priorities%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>file_priorities</dt>\n+<dd>can be set to control the initial file priorities when adding a\n+torrent. The semantics are the same as for\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::prioritize_files()</span></tt>. 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.</dd>\n+</dl>\n+<a name=\"trackerid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackerid%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackerid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>trackerid</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flags</dt>\n+<dd><p class=\"first\">flags controlling aspects of this torrent and how it's added. See\n+<a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a> for details.</p>\n+<div class=\"admonition note last\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">The <tt class=\"docutils literal\">flags</tt> 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.</p>\n+</div>\n+</dd>\n+</dl>\n+<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hashes</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a> to populate fields in the\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.</dd>\n+</dl>\n+<a name=\"max_uploads\"></a>\n+<a name=\"max_connections\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>max_uploads max_connections</dt>\n+<dd><p class=\"first\"><tt class=\"docutils literal\">max_uploads</tt>, <tt class=\"docutils literal\">max_connections</tt>, <tt class=\"docutils literal\">upload_limit</tt>,\n+<tt class=\"docutils literal\">download_limit</tt> correspond to the <tt class=\"docutils literal\">set_max_uploads()</tt>,\n+<tt class=\"docutils literal\">set_max_connections()</tt>, <tt class=\"docutils literal\">set_upload_limit()</tt> and\n+<tt class=\"docutils literal\">set_download_limit()</tt> functions on <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>. These values let\n+you initialize these settings when the torrent is added, instead of\n+calling these functions immediately following adding it.</p>\n+<p>-1 means unlimited on these settings just like their counterpart\n+functions on <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a></p>\n+<p class=\"last\">For fine grained control over rate limits, including making them apply\n+to local peers, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+</dd>\n+</dl>\n+<a name=\"upload_limit\"></a>\n+<a name=\"download_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>upload_limit download_limit</dt>\n+<dd>the upload and download rate limits for this torrent, specified in\n+bytes per second. -1 means unlimited.</dd>\n+</dl>\n+<a name=\"total_uploaded\"></a>\n+<a name=\"total_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_uploaded total_downloaded</dt>\n+<dd>the total number of bytes uploaded and downloaded by this torrent so\n+far.</dd>\n+</dl>\n+<a name=\"active_time\"></a>\n+<a name=\"finished_time\"></a>\n+<a name=\"seeding_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>active_time finished_time seeding_time</dt>\n+<dd>the number of seconds this torrent has spent in started, finished and\n+seeding state so far, respectively.</dd>\n+</dl>\n+<a name=\"added_time\"></a>\n+<a name=\"completed_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Badded_time+completed_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Badded_time+completed_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>added_time completed_time</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> is\n+called.</dd>\n+</dl>\n+<a name=\"last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_seen_complete</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"num_complete\"></a>\n+<a name=\"num_incomplete\"></a>\n+<a name=\"num_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_complete num_incomplete num_downloaded</dt>\n+<dd><p class=\"first\">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). <tt class=\"docutils literal\">num_complete</tt> is the number of\n+peers in the swarm that are seeds, or have every piece in the torrent.\n+<tt class=\"docutils literal\">num_incomplete</tt> is the number of peers in the swarm that do not have\n+every piece. <tt class=\"docutils literal\">num_downloaded</tt> is the number of times the torrent has\n+been downloaded (not initiated, but the number of times a download has\n+completed).</p>\n+<p class=\"last\">Leaving any of these values set to -1 indicates we don't know, or we\n+have not received any scrape data.</p>\n+</dd>\n+</dl>\n+<a name=\"http_seeds\"></a>\n+<a name=\"url_seeds\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>http_seeds url_seeds</dt>\n+<dd><p class=\"first\">URLs can be added to these two lists to specify additional web\n+seeds to be used by the torrent. If the <tt class=\"docutils literal\">flag_override_web_seeds</tt>\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.</p>\n+<p>http_seeds expects URLs to web servers implementing the original HTTP\n+seed specification <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a>.</p>\n+<p class=\"last\">url_seeds expects URLs to regular web servers, aka "get right" style,\n+specified in <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n+</dd>\n+</dl>\n+<a name=\"peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpeers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpeers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>peers</dt>\n+<dd>peers to add to the torrent, to be tried to be connected to as\n+bittorrent peers.</dd>\n+</dl>\n+<a name=\"banned_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bbanned_peers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bbanned_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>banned_peers</dt>\n+<dd>peers banned from this torrent. The will not be connected to</dd>\n+</dl>\n+<a name=\"unfinished_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bunfinished_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bunfinished_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>unfinished_pieces</dt>\n+<dd>this is a map of partially downloaded piece. The key is the piece index\n+and the value is a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> where each bit represents a 16 kiB block.\n+A set bit means we have that block.</dd>\n+</dl>\n+<a name=\"have_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhave_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhave_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>have_pieces</dt>\n+<dd>this is a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> indicating which pieces we already have of this\n+torrent.</dd>\n+</dl>\n+<a name=\"verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>verified_pieces</dt>\n+<dd>when in seed_mode, pieces with a set bit in this <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> have been\n+verified to be valid. Other pieces will be verified the first time a\n+peer requests it.</dd>\n+</dl>\n+<a name=\"piece_priorities\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpiece_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpiece_priorities%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_priorities</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"merkle_trees\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_trees%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_trees%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>merkle_trees</dt>\n+<dd>v2 hashes, if known</dd>\n+</dl>\n+<a name=\"merkle_tree_mask\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>merkle_tree_mask</dt>\n+<dd>if set, indicates which hashes are included in the corresponding\n+vector of <tt class=\"docutils literal\">merkle_trees</tt>. 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+<tt class=\"docutils literal\">merkle_trees</tt> is the hash for that node. This is an optimization\n+to avoid storing a lot of zeros.</dd>\n+</dl>\n+<a name=\"verified_leaf_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>verified_leaf_hashes</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"renamed_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Brenamed_files%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Brenamed_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>renamed_files</dt>\n+<dd>this is a map of file indices in the torrent and new filenames to be\n+applied before the torrent is added.</dd>\n+</dl>\n+<a name=\"last_download\"></a>\n+<a name=\"last_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_download+last_upload%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_download+last_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_download last_upload</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"client_data_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+client_data_t&labels=documentation&body=Documentation+under+heading+%22class+client_data_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"client-data-t\">\n+<h1>client_data_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/client_data.hpp\">libtorrent/client_data.hpp</a>"</p>\n+<p>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.</p>\n <pre class=\"literal-block\">\n-void <strong>flush_cache</strong> () const;\n+struct client_data_t\n+{\n+ <strong>client_data_t</strong> () = default;\n+ explicit <strong>client_data_t</strong> (T* v);\n+ client_data_t& <strong>operator=</strong> (T* v);\n+ explicit operator <strong>T</strong> () const;\n+ T* <strong>get</strong> () const;\n+ operator <strong>void*</strong> () const = delete;\n+ client_data_t& <strong>operator=</strong> (void const*) = delete;\n+ client_data_t& <strong>operator=</strong> (void*) = delete;\n+ operator void <strong>const*</strong> () const = delete;\n+\n+ template <typename T, typename <strong>U</strong> = typename std::enable_if<std::is_pointer<T>::value>::type>\n+};\n </pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#cache_flushed_alert\">cache_flushed_alert</a>.</p>\n-<p>Note that by the time you get the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, 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-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flush_cache()</span></tt> has been written to disk.</p>\n-<a name=\"force_recheck()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_recheck%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_recheck%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"force-recheck\">\n-<h2>force_recheck()</h2>\n+<a name=\"client_data_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bclient_data_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bclient_data_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"client-data-t-1\">\n+<h2>client_data_t()</h2>\n <pre class=\"literal-block\">\n-void <strong>force_recheck</strong> () const;\n+<strong>client_data_t</strong> () = default;\n </pre>\n-<p><tt class=\"docutils literal\">force_recheck</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n-<a name=\"save_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bsave_resume_data%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bsave_resume_data%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"save-resume-data\">\n-<h2>save_resume_data()</h2>\n+<p>construct a nullptr client data</p>\n+<a name=\"operator=()\"></a>\n+<a name=\"const*()\"></a>\n+<a name=\"void*()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Boperator%3D%28%29+const%2A%28%29+void%2A%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Boperator%3D%28%29+const%2A%28%29+void%2A%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-const-void\">\n+<h2>operator=() const*() void*()</h2>\n <pre class=\"literal-block\">\n-void <strong>save_resume_data</strong> (resume_data_flags_t flags = {}) const;\n+operator <strong>void*</strong> () const = delete;\n+client_data_t& <strong>operator=</strong> (void const*) = delete;\n+client_data_t& <strong>operator=</strong> (void*) = delete;\n+operator void <strong>const*</strong> () const = delete;\n </pre>\n-<p><tt class=\"docutils literal\">save_resume_data()</tt> asks libtorrent to generate fast-resume data for\n-this torrent. The fast resume data (stored in an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n-object) can be used to resume a torrent in the next <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>.</p>\n-<p>This operation is asynchronous, <tt class=\"docutils literal\">save_resume_data</tt> will return\n-immediately. The resume data is delivered when it's done through a\n-<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.</p>\n-<p>The operation will fail, and post a <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_failed_alert\">save_resume_data_failed_alert</a>\n-instead, in the following cases:</p>\n-<blockquote>\n-<ol class=\"arabic simple\">\n-<li>The torrent is in the process of being removed.</li>\n-<li>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 <a class=\"reference external\" href=\"manual-ref.html#metadata-from-peers\">metadata from peers</a> extension)</li>\n-</ol>\n-</blockquote>\n-<p>Note that some <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> may be outdated by the time you receive the fast resume data</p>\n-<p>When saving resume data because of shutting down, make sure not to\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> before you receive the <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.\n-There's no need to pause the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> or torrent when saving resume\n-data.</p>\n-<p>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.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">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.</p>\n-</div>\n-<p>Example code to pause and save resume data for all torrents and wait\n-for the alerts:</p>\n+<p>we don't allow type-unsafe operations</p>\n+<p>The disk I/O can be customized in libtorrent. In previous versions, the\n+customization was at the level of each torrent. Now, the customization point\n+is at the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> level. All torrents added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> will use the same\n+disk I/O subsystem, as determined by the disk_io_constructor (in\n+<a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a>).</p>\n+<p>This allows the disk subsystem to also customize threading and disk job\n+management.</p>\n+<p>To customize the disk subsystem, implement <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a> and provide a\n+factory function to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor (via <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a>).</p>\n+<p>Example use:</p>\n <pre class=\"code c++ literal-block\">\n-<span class=\"keyword\">extern</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"comment single\">// global counter of outstanding resume data\n-</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">torrent_handle</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handles</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">get_torrents</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">handles</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">try</span><span class=\"whitespace\">\n+<span class=\"keyword\">struct</span><span class=\"whitespace\"> </span><span class=\"name class\">temp_storage</span><span class=\"whitespace\">\n </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">h</span><span class=\"punctuation\">.</span><span class=\"name\">save_resume_data</span><span class=\"punctuation\">(</span><span class=\"name\">torrent_handle</span><span class=\"operator\">::</span><span class=\"name\">only_if_modified</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"operator\">++</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">catch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">e</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">explicit</span><span class=\"whitespace\"> </span><span class=\"name\">temp_storage</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">fs</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">readv</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\"><=</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">length</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">writev</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">data</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">[</span><span class=\"name\">piece</span><span class=\"punctuation\">];</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// allocate the whole piece, otherwise we'll invalidate the pointers\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// we have returned back to libtorrent\n+</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">size</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">resize</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">size_t</span><span class=\"punctuation\">(</span><span class=\"name\">size</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">TORRENT_ASSERT</span><span class=\"punctuation\">(</span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\"><=</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()));</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">memcpy</span><span class=\"punctuation\">(</span><span class=\"name\">data</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">size_t</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">()));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"operator\">!</span><span class=\"name\">block_hashes</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_size2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">blocks_in_piece2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">blocks_in_piece2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">int64_t</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">k</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"name\">k</span><span class=\"whitespace\"> </span><span class=\"operator\"><</span><span class=\"whitespace\"> </span><span class=\"name\">blocks_in_piece2</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"operator\">++</span><span class=\"name\">k</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher256</span><span class=\"whitespace\"> </span><span class=\"name\">h2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">ptrdiff_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">default_block_size</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">piece_size2</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"name\">h2</span><span class=\"punctuation\">.</span><span class=\"name\">update</span><span class=\"punctuation\">({</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">+=</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">offset</span><span class=\"whitespace\"> </span><span class=\"operator\">+=</span><span class=\"whitespace\"> </span><span class=\"name\">len2</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">[</span><span class=\"name\">k</span><span class=\"punctuation\">]</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">h2</span><span class=\"punctuation\">.</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">).</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"name\">hash2</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">operation</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">operation_t</span><span class=\"operator\">::</span><span class=\"name\">file_read</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ec</span><span class=\"punctuation\">.</span><span class=\"name\">ec</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">asio</span><span class=\"operator\">::</span><span class=\"name\">error</span><span class=\"operator\">::</span><span class=\"name\">eof</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_size2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">ptrdiff_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">len</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">default_block_size</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">len</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">hasher256</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">).</span><span class=\"keyword\">final</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">private</span><span class=\"operator\">:</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">piece_size</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">((</span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">total_size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">/</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\"><</span><span class=\"whitespace\"> </span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">?</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">int</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">total_size</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">int64_t</span><span class=\"punctuation\">(</span><span class=\"name\">num_pieces</span><span class=\"whitespace\"> </span><span class=\"operator\">-</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">.</span><span class=\"name\">piece_length</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">m_files</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">map</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">>></span><span class=\"whitespace\"> </span><span class=\"name\">m_file_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+\n+</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name function\">pop</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">>&</span><span class=\"whitespace\"> </span><span class=\"name\">q</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// the handle was invalid, ignore this one and move to the next\n+ </span><span class=\"name\">TORRENT_ASSERT</span><span class=\"punctuation\">(</span><span class=\"operator\">!</span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">ret</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">back</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">q</span><span class=\"punctuation\">.</span><span class=\"name\">pop_back</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">ret</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n \n-</span><span class=\"keyword\">while</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">outstanding_resume_data</span><span class=\"whitespace\"> </span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">struct</span><span class=\"whitespace\"> </span><span class=\"name class\">temp_disk_io</span><span class=\"whitespace\"> </span><span class=\"keyword\">final</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_interface</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">buffer_allocator_interface</span><span class=\"whitespace\">\n </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">alert</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">wait_for_alert</span><span class=\"punctuation\">(</span><span class=\"name\">seconds</span><span class=\"punctuation\">(</span><span class=\"literal number integer\">30</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n-\n- </span><span class=\"comment single\">// if we don't get an alert within 30 seconds, abort\n-</span><span class=\"whitespace\"> </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"keyword\">nullptr</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">explicit</span><span class=\"whitespace\"> </span><span class=\"name\">temp_disk_io</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ioc</span><span class=\"punctuation\">)</span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">m_ioc</span><span class=\"punctuation\">(</span><span class=\"name\">ioc</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n \n- </span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert_cast</span><span class=\"operator\"><</span><span class=\"name\">save_resume_data_failed_alert</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">))</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">process_alert</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"operator\">--</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">continue</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">settings_updated</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n \n- </span><span class=\"name\">save_resume_data_alert</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">rd</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">alert_cast</span><span class=\"operator\"><</span><span class=\"name\">save_resume_data_alert</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">rd</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"keyword\">nullptr</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">process_alert</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">continue</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_holder</span><span class=\"whitespace\"> </span><span class=\"name\">new_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_params</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">params</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">.</span><span class=\"name\">empty</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">?</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">end_index</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">pop</span><span class=\"punctuation\">(</span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">make_unique</span><span class=\"operator\"><</span><span class=\"name\">temp_storage</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">files</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">end_index</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">.</span><span class=\"name\">emplace_back</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">storage</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">else</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">idx</span><span class=\"punctuation\">]</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">storage</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_holder</span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"keyword\">this</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">remove_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">idx</span><span class=\"punctuation\">].</span><span class=\"name\">reset</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">.</span><span class=\"name\">push_back</span><span class=\"punctuation\">(</span><span class=\"name\">idx</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">abort</span><span class=\"punctuation\">(</span><span class=\"keyword type\">bool</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_read</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_buffer_holder</span><span class=\"whitespace\"> </span><span class=\"name\">block</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">se</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// this buffer is owned by the storage. It will remain valid for as\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// long as the torrent remains in the session. We don't need any lifetime\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// management of it.\n+</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">readv</span><span class=\"punctuation\">(</span><span class=\"name\">r</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"name\">handler</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword\">this</span><span class=\"punctuation\">]</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_buffer_holder</span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"keyword\">this</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword\">const_cast</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">()),</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">())),</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">bool</span><span class=\"whitespace\"> </span><span class=\"name\">async_write</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">peer_request</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_observer</span><span class=\"operator\">></span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">b</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">length</span><span class=\"whitespace\"> </span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">writev</span><span class=\"punctuation\">(</span><span class=\"name\">b</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">r</span><span class=\"punctuation\">.</span><span class=\"name\">start</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name builtin\">false</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_hash</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">span</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha1_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">hash</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">block_hashes</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_hash2</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">storage</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">piece</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_job_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">sha256_hash</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">[</span><span class=\"name\">storage</span><span class=\"punctuation\">]</span><span class=\"operator\">-></span><span class=\"name\">hash2</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">offset</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">piece</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">hash</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">error</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_move_storage</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">move_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"operator\">::</span><span class=\"name\">fatal_disk_error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">error_code</span><span class=\"punctuation\">(</span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">system</span><span class=\"operator\">::</span><span class=\"name\">errc</span><span class=\"operator\">::</span><span class=\"name\">operation_not_supported</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_category</span><span class=\"punctuation\">())));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_release_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">()</span><span class=\"operator\">></span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_delete_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">remove_flags_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_check_files</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">add_torrent_params</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">status_t</span><span class=\"operator\">::</span><span class=\"name\">no_error</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_rename_file</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"name\">name</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">name</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">idx</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">());</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_stop_torrent</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">()</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_set_file_priority</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">download_priority_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">prio</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">download_priority_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">file_index_t</span><span class=\"operator\">></span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_error</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">error_code</span><span class=\"punctuation\">(</span><span class=\"whitespace\">\n+ </span><span class=\"name\">boost</span><span class=\"operator\">::</span><span class=\"name\">system</span><span class=\"operator\">::</span><span class=\"name\">errc</span><span class=\"operator\">::</span><span class=\"name\">operation_not_supported</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_category</span><span class=\"punctuation\">())),</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">move</span><span class=\"punctuation\">(</span><span class=\"name\">prio</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">async_clear_piece</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"whitespace\"> </span><span class=\"name\">index</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">function</span><span class=\"operator\"><</span><span class=\"keyword type\">void</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">)</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">post</span><span class=\"punctuation\">(</span><span class=\"name\">m_ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"punctuation\">[</span><span class=\"operator\">=</span><span class=\"punctuation\">]{</span><span class=\"whitespace\"> </span><span class=\"name\">handler</span><span class=\"punctuation\">(</span><span class=\"name\">index</span><span class=\"punctuation\">);</span><span class=\"whitespace\"> </span><span class=\"punctuation\">});</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// implements buffer_allocator_interface\n+</span><span class=\"whitespace\"> </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">free_disk_buffer</span><span class=\"punctuation\">(</span><span class=\"keyword type\">char</span><span class=\"operator\">*</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// never free any buffer. We only return buffers owned by the storage\n+</span><span class=\"whitespace\"> </span><span class=\"comment single\">// object\n+</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">update_stats_counters</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">counters</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">open_file_state</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">get_status</span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\"> </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{};</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name\">submit_jobs</span><span class=\"punctuation\">()</span><span class=\"whitespace\"> </span><span class=\"keyword\">override</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">private</span><span class=\"operator\">:</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">aux</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">temp_storage</span><span class=\"operator\">></span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">m_torrents</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// slots that are unused in the m_torrents vector\n+</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">storage_index_t</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">m_free_slots</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// callbacks are posted on this\n+</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">m_ioc</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">};</span><span class=\"whitespace\">\n \n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ofstream</span><span class=\"whitespace\"> </span><span class=\"name\">out</span><span class=\"punctuation\">((</span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">save_path</span><span class=\"whitespace\">\n- </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">"/"</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">name</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">".fastresume"</span><span class=\"punctuation\">).</span><span class=\"name\">c_str</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ios_base</span><span class=\"operator\">::</span><span class=\"name\">binary</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">write_resume_data_buf</span><span class=\"punctuation\">(</span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"name\">out</span><span class=\"punctuation\">.</span><span class=\"name\">write</span><span class=\"punctuation\">(</span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n- </span><span class=\"operator\">--</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">unique_ptr</span><span class=\"operator\"><</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">disk_interface</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">temp_disk_constructor</span><span class=\"punctuation\">(</span><span class=\"whitespace\">\n+ </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">io_context</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">ioc</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">settings_interface</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">counters</span><span class=\"operator\">&</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">return</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">make_unique</span><span class=\"operator\"><</span><span class=\"name\">temp_disk_io</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">ioc</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n </span><span class=\"punctuation\">}</span>\n </pre>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">Note how <tt class=\"docutils literal\">outstanding_resume_data</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, 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.</p>\n+<a name=\"settings_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_interface&labels=documentation&body=Documentation+under+heading+%22class+settings_interface%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<a name=\"need_save_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bneed_save_resume_data%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bneed_save_resume_data%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"need-save-resume-data\">\n-<h2>need_save_resume_data()</h2>\n+<div class=\"section\" id=\"settings-interface\">\n+<h1>settings_interface</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<p>the common interface to <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> and the internal representation of\n+settings.</p>\n <pre class=\"literal-block\">\n-bool <strong>need_save_resume_data</strong> (resume_data_flags_t flags) const;\n-bool <strong>need_save_resume_data</strong> () const;\n+struct settings_interface\n+{\n+ virtual void <strong>set_int</strong> (int name, int val) = 0;\n+ virtual bool <strong>has_val</strong> (int name) const = 0;\n+ virtual void <strong>set_bool</strong> (int name, bool val) = 0;\n+ virtual void <strong>set_str</strong> (int name, std::string val) = 0;\n+ virtual bool <strong>get_bool</strong> (int name) const = 0;\n+ virtual int <strong>get_int</strong> (int name) const = 0;\n+ virtual std::string const& <strong>get_str</strong> (int name) const = 0;\n+};\n </pre>\n-<p>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 <tt class=\"docutils literal\">flags</tt> let you ask if specific categories\n-of properties have changed. These flags have the same behavior as in\n-the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> call.</p>\n-<p>This is a <em>blocking</em> call. It will wait for a response from\n-libtorrent's main thread. A way to avoid blocking is to instead\n-call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> directly, specifying the conditions under\n-which resume data should be saved.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">A torrent's resume data is considered saved as soon as the\n-<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> is posted. It is important to make sure this\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is received and handled in order for this function to be\n-meaningful.</p>\n-</div>\n-<a name=\"queue_position_bottom()\"></a>\n-<a name=\"queue_position_up()\"></a>\n-<a name=\"queue_position_top()\"></a>\n-<a name=\"queue_position_down()\"></a>\n-<a name=\"queue_position()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_bottom%28%29+queue_position_up%28%29+queue_position_top%28%29+queue_position_down%28%29+queue_position%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_bottom%28%29+queue_position_up%28%29+queue_position_top%28%29+queue_position_down%28%29+queue_position%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"queue-position-bottom-queue-position-up-queue-position-top-queue-position-down-queue-position\">\n-<h2>queue_position_bottom() queue_position_up() queue_position_top() queue_position_down() queue_position()</h2>\n+<a name=\"buffer_allocator_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+buffer_allocator_interface&labels=documentation&body=Documentation+under+heading+%22class+buffer_allocator_interface%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"buffer-allocator-interface\">\n+<h1>buffer_allocator_interface</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n+<p>the interface for freeing disk buffers, used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>.\n+when implementing <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>, this must also be implemented in order\n+to return disk buffers back to libtorrent</p>\n <pre class=\"literal-block\">\n-void <strong>queue_position_up</strong> () const;\n-void <strong>queue_position_top</strong> () const;\n-void <strong>queue_position_bottom</strong> () const;\n-void <strong>queue_position_down</strong> () const;\n-queue_position_t <strong>queue_position</strong> () const;\n+struct buffer_allocator_interface\n+{\n+ virtual void <strong>free_disk_buffer</strong> (char* b) = 0;\n+};\n </pre>\n-<p>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.</p>\n-<p>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.</p>\n-<p><tt class=\"docutils literal\">queue_position()</tt> 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.</p>\n-<p>The queue position is also available in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.</p>\n-<p>The <tt class=\"docutils literal\"><span class=\"pre\">queue_position_*()</span></tt> 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.</p>\n-<a name=\"queue_position_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"queue-position-set\">\n-<h2>queue_position_set()</h2>\n+<a name=\"disk_buffer_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_buffer_holder&labels=documentation&body=Documentation+under+heading+%22class+disk_buffer_holder%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder\">\n+<h1>disk_buffer_holder</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n+<p>The disk buffer holder acts like a <tt class=\"docutils literal\">unique_ptr</tt> that frees a disk buffer\n+when it's destructed</p>\n+<p>If this buffer holder is moved-from, default constructed or reset,\n+<tt class=\"docutils literal\">data()</tt> will return nullptr.</p>\n <pre class=\"literal-block\">\n-void <strong>queue_position_set</strong> (queue_position_t p) const;\n+struct disk_buffer_holder\n+{\n+ disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder&&) & noexcept;\n+ <strong>disk_buffer_holder</strong> (disk_buffer_holder&&) noexcept;\n+ <strong>disk_buffer_holder</strong> (disk_buffer_holder const&) = delete;\n+ disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder const&) = delete;\n+ <strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n+ <strong>disk_buffer_holder</strong> () noexcept = default;\n+ <strong>~disk_buffer_holder</strong> ();\n+ char* <strong>data</strong> () const noexcept;\n+ void <strong>reset</strong> ();\n+ void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n+ bool <strong>is_mutable</strong> () const noexcept;\n+ explicit operator <strong>bool</strong> () const noexcept;\n+ std::ptrdiff_t <strong>size</strong> () const;\n+};\n </pre>\n-<p>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</p>\n-<a name=\"set_ssl_certificate_buffer()\"></a>\n-<a name=\"set_ssl_certificate()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_ssl_certificate_buffer%28%29+set_ssl_certificate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_ssl_certificate_buffer%28%29+set_ssl_certificate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-ssl-certificate-buffer-set-ssl-certificate\">\n-<h2>set_ssl_certificate_buffer() set_ssl_certificate()</h2>\n+<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"disk-buffer-holder-1\">\n+<h2>disk_buffer_holder()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n-void <strong>set_ssl_certificate</strong> (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params\n- , std::string const& passphrase = "");\n+<strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n+ , char* buf, int sz) noexcept;\n </pre>\n-<p>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.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_ssl_certificate_buffer()\">set_ssl_certificate_buffer()</a> overload takes the actual certificate,\n-private key and DH params as strings, rather than paths to files.</p>\n-<p><tt class=\"docutils literal\">cert</tt> is a path to the (signed) certificate in .pem format\n-corresponding to this torrent.</p>\n-<p><tt class=\"docutils literal\">private_key</tt> is a path to the private key for the specified\n-certificate. This must be in .pem format.</p>\n-<p><tt class=\"docutils literal\">dh_params</tt> 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: <tt class=\"docutils literal\">openssl dhparam <span class=\"pre\">-outform</span> PEM <span class=\"pre\">-out</span>\n-dhparams.pem 512</tt>.</p>\n-<p><tt class=\"docutils literal\">passphrase</tt> may be specified if the private key is encrypted and\n-requires a passphrase to be decrypted.</p>\n-<p>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.</p>\n-<p>If you receive a <a class=\"reference external\" href=\"reference-Alerts.html#torrent_need_cert_alert\">torrent_need_cert_alert</a>, 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.</p>\n-<a name=\"torrent_file()\"></a>\n-<a name=\"torrent_file_with_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_file%28%29+torrent_file_with_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_file%28%29+torrent_file_with_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-file-torrent-file-with-hashes\">\n-<h2>torrent_file() torrent_file_with_hashes()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>)</p>\n+<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder-2\">\n+<h2>disk_buffer_holder()</h2>\n <pre class=\"literal-block\">\n-std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n-std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n+<strong>disk_buffer_holder</strong> () noexcept = default;\n </pre>\n-<p><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file()\">torrent_file()</a> returns a pointer to the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object\n-associated with this torrent. The <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n-<p>Note that the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object returned here may be a different\n-instance than the one added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, with different attributes\n-like piece layers, dht nodes and trackers. A <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object does\n-not round-trip cleanly when added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n-<p>If you want to save a .torrent file from the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>, instead\n-call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> and <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a> the\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object passed back in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<p><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a> returns a <em>copy</em> of the internal\n-<a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file()\">torrent_file()</a> since it needs to make copies of this information.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a> is here for backwards compatibility\n-when constructing a <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> object from a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> that's\n-in a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Prefer <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> + <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a>.</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> returned from <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a>. Once the\n-torrent completes downloading all files, becoming a seed, you can\n-make a .torrent file from it.</p>\n-<a name=\"piece_layers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_layers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_layers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-layers\">\n-<h2>piece_layers()</h2>\n+<p>default construct a holder that does not own any buffer</p>\n+<a name=\"~disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-buffer-holder-3\">\n+<h2>~disk_buffer_holder()</h2>\n <pre class=\"literal-block\">\n-std::vector<std::vector<sha256_hash>> <strong>piece_layers</strong> () const;\n+<strong>~disk_buffer_holder</strong> ();\n </pre>\n-<p>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.</p>\n-<a name=\"piece_availability()\"></a>\n-<a name=\"post_piece_availability()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_availability%28%29+post_piece_availability%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_availability%28%29+post_piece_availability%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-availability-post-piece-availability\">\n-<h2>piece_availability() post_piece_availability()</h2>\n+<p>frees disk buffer held by this object</p>\n+<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"data\">\n+<h2>data()</h2>\n <pre class=\"literal-block\">\n-void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n-void <strong>post_piece_availability</strong> () const;\n+char* <strong>data</strong> () const noexcept;\n </pre>\n-<p>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.</p>\n-<p><tt class=\"docutils literal\">post_piece_availability()</tt> will trigger a <a class=\"reference external\" href=\"reference-Alerts.html#piece_availability_alert\">piece_availability_alert</a>\n-to be posted.</p>\n-<p><tt class=\"docutils literal\">piece_availability()</tt> fills the specified <tt class=\"docutils literal\"><span class=\"pre\">std::vector<int></span></tt>\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.</p>\n-<a name=\"get_piece_priorities()\"></a>\n-<a name=\"piece_priority()\"></a>\n-<a name=\"prioritize_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_piece_priorities%28%29+piece_priority%28%29+prioritize_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_piece_priorities%28%29+piece_priority%28%29+prioritize_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-piece-priorities-piece-priority-prioritize-pieces\">\n-<h2>get_piece_priorities() piece_priority() prioritize_pieces()</h2>\n+<p>return a pointer to the held buffer, if any. Otherwise returns nullptr.</p>\n+<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reset\">\n+<h2>reset()</h2>\n <pre class=\"literal-block\">\n-std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n-void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n-download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n-void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n-void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+void <strong>reset</strong> ();\n </pre>\n-<p>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.</p>\n-<p>The default priority of pieces is 4.</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#metadata_received_alert\">metadata_received_alert</a>.</p>\n-<p><tt class=\"docutils literal\">piece_priority</tt> sets or gets the priority for an individual piece,\n-specified by <tt class=\"docutils literal\">index</tt>.</p>\n-<p><tt class=\"docutils literal\">prioritize_pieces</tt> 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 <tt class=\"docutils literal\">prioritize_pieces</tt> 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.</p>\n-<p><tt class=\"docutils literal\">get_piece_priorities</tt> returns a vector with one element for each piece\n-in the torrent. Each element is the current priority of that piece.</p>\n-<p>It's possible to cancel the effect of <em>file</em> priorities by setting the\n-priorities for the affected pieces. Care has to be taken when mixing\n-usage of file- and piece priorities.</p>\n-<a name=\"get_file_priorities()\"></a>\n-<a name=\"file_priority()\"></a>\n-<a name=\"prioritize_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_file_priorities%28%29+file_priority%28%29+prioritize_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_file_priorities%28%29+file_priority%28%29+prioritize_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-file-priorities-file-priority-prioritize-files\">\n-<h2>get_file_priorities() file_priority() prioritize_files()</h2>\n+<p>free the held disk buffer, if any, and clear the holder. This sets the\n+holder object to a default-constructed state</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap\">\n+<h2>swap()</h2>\n <pre class=\"literal-block\">\n-std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n-download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n-void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n-void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n+void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n </pre>\n-<p><tt class=\"docutils literal\">index</tt> must be in the range [0, number_of_files).</p>\n-<p><tt class=\"docutils literal\">file_priority()</tt> queries or sets the priority of file <tt class=\"docutils literal\">index</tt>.</p>\n-<p><tt class=\"docutils literal\">prioritize_files()</tt> takes a vector that has at as many elements as\n-there are files in the torrent. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is the priority of that\n-file. The function sets the priorities of all the pieces in the\n-torrent based on the vector.</p>\n-<p><tt class=\"docutils literal\">get_file_priorities()</tt> returns a vector with the priorities of all\n-files.</p>\n-<p>The priority values are the same as for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#piece_priority()\">piece_priority()</a>. See\n-<a class=\"reference external\" href=\"reference-Core.html#download_priority_t\">download_priority_t</a>.</p>\n-<p>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, <a class=\"reference external\" href=\"reference-Torrent_Handle.html#piece_priority()\">piece_priority()</a> has to be called\n-again for those pieces.</p>\n-<p>You cannot set the file priorities on a torrent that does not yet have\n-metadata or a torrent that is a seed. <tt class=\"docutils literal\">file_priority(int, int)</tt> and\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#prioritize_files()\">prioritize_files()</a> are both no-ops for such torrents.</p>\n-<p>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-<a class=\"reference external\" href=\"reference-Alerts.html#file_prio_alert\">file_prio_alert</a>.</p>\n-<p>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.</p>\n-<p>Moving data from a file into the part file is currently not\n-supported. If a file has its priority set to 0 <em>after</em> it has already\n-been created, it will not be moved into the partfile.</p>\n-<a name=\"force_reannounce()\"></a>\n-<a name=\"force_dht_announce()\"></a>\n-<a name=\"force_lsd_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_reannounce%28%29+force_dht_announce%28%29+force_lsd_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_reannounce%28%29+force_dht_announce%28%29+force_lsd_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"force-reannounce-force-dht-announce-force-lsd-announce\">\n-<h2>force_reannounce() force_dht_announce() force_lsd_announce()</h2>\n+<p>swap pointers of two disk buffer holders.</p>\n+<a name=\"is_mutable()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-mutable\">\n+<h2>is_mutable()</h2>\n <pre class=\"literal-block\">\n-void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n-void <strong>force_dht_announce</strong> () const;\n-void <strong>force_lsd_announce</strong> () const;\n+bool <strong>is_mutable</strong> () const noexcept;\n </pre>\n-<p><tt class=\"docutils literal\">force_reannounce()</tt> will force this torrent to do another tracker\n-request, to receive new peers. The <tt class=\"docutils literal\">seconds</tt> argument specifies how\n-many seconds from now to issue the tracker announces.</p>\n-<p>If the tracker's <tt class=\"docutils literal\">min_interval</tt> has not passed since the last\n-announce, the forced announce will be scheduled to happen immediately\n-as the <tt class=\"docutils literal\">min_interval</tt> expires. This is to honor trackers minimum\n-re-announce interval settings.</p>\n-<p>The <tt class=\"docutils literal\">tracker_index</tt> argument specifies which tracker to re-announce.\n-If set to -1 (which is the default), all trackers are re-announce.</p>\n-<p>The <tt class=\"docutils literal\">flags</tt> argument can be used to affect the re-announce. See\n-ignore_min_interval.</p>\n-<p><tt class=\"docutils literal\">force_dht_announce</tt> will announce the torrent to the DHT\n-immediately.</p>\n-<p><tt class=\"docutils literal\">force_lsd_announce</tt> will announce the torrent on LSD\n-immediately.</p>\n-<a name=\"scrape_tracker()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bscrape_tracker%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bscrape_tracker%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"scrape-tracker\">\n-<h2>scrape_tracker()</h2>\n+<p>if this returns true, the buffer may not be modified in place</p>\n+<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bool\">\n+<h2>bool()</h2>\n <pre class=\"literal-block\">\n-void <strong>scrape_tracker</strong> (int idx = -1) const;\n+explicit operator <strong>bool</strong> () const noexcept;\n </pre>\n-<p><tt class=\"docutils literal\">scrape_tracker()</tt> will send a scrape request to a tracker. By\n-default (<tt class=\"docutils literal\">idx</tt> = -1) it will scrape the last working tracker. If\n-<tt class=\"docutils literal\">idx</tt> is >= 0, the tracker with the specified index will scraped.</p>\n-<p>A scrape request queries the tracker for statistics such as total\n-number of incomplete peers, complete peers, number of downloads etc.</p>\n-<p>This request will specifically update the <tt class=\"docutils literal\">num_complete</tt> and\n-<tt class=\"docutils literal\">num_incomplete</tt> fields in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> struct once it\n-completes. When it completes, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_reply_alert\">scrape_reply_alert</a>.\n-If it fails, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_failed_alert\">scrape_failed_alert</a>.</p>\n-<a name=\"set_download_limit()\"></a>\n-<a name=\"download_limit()\"></a>\n-<a name=\"upload_limit()\"></a>\n-<a name=\"set_upload_limit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_download_limit%28%29+download_limit%28%29+upload_limit%28%29+set_upload_limit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_download_limit%28%29+download_limit%28%29+upload_limit%28%29+set_upload_limit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-download-limit-download-limit-upload-limit-set-upload-limit\">\n-<h2>set_download_limit() download_limit() upload_limit() set_upload_limit()</h2>\n+<p>implicitly convertible to true if the object is currently holding a\n+buffer</p>\n+<a name=\"open_file_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+open_file_state&labels=documentation&body=Documentation+under+heading+%22class+open_file_state%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"open-file-state\">\n+<h1>open_file_state</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n+<p>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.</p>\n <pre class=\"literal-block\">\n-void <strong>set_download_limit</strong> (int limit) const;\n-void <strong>set_upload_limit</strong> (int limit) const;\n-int <strong>upload_limit</strong> () const;\n-int <strong>download_limit</strong> () const;\n+struct open_file_state\n+{\n+ file_index_t file_index;\n+ file_open_mode_t open_mode;\n+ time_point last_use;\n+};\n </pre>\n-<p><tt class=\"docutils literal\">set_upload_limit</tt> 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-<tt class=\"docutils literal\">set_download_limit</tt> 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-(<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::upload_rate_limit</span></tt>) will not override the global\n-rate limit. The torrent can never upload more than the global rate\n-limit.</p>\n-<p><tt class=\"docutils literal\">upload_limit</tt> and <tt class=\"docutils literal\">download_limit</tt> will return the current limit\n-setting, for upload and download, respectively.</p>\n-<p>Local peers are not rate limited by default. see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"connect_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bconnect_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bconnect_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"connect-peer\">\n-<h2>connect_peer()</h2>\n+<a name=\"file_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Bfile_index%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Bfile_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>file_index</dt>\n+<dd>the index of the file this <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> refers to into the <tt class=\"docutils literal\">file_storage</tt>\n+file list of this torrent. This starts indexing at 0.</dd>\n+</dl>\n+<a name=\"open_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Bopen_mode%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Bopen_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>open_mode</dt>\n+<dd><p class=\"first\"><tt class=\"docutils literal\">open_mode</tt> is a bitmask of the file flags this file is currently\n+opened with. For possible flags, see <a class=\"reference external\" href=\"reference-Custom_Storage.html#file_open_mode_t\">file_open_mode_t</a>.</p>\n+<p class=\"last\">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 <tt class=\"docutils literal\">rw_mask</tt> constant.</p>\n+</dd>\n+</dl>\n+<a name=\"last_use\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Blast_use%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Blast_use%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_use</dt>\n+<dd>a (high precision) timestamp of when the file was last used.</dd>\n+</dl>\n+<a name=\"disk_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_interface&labels=documentation&body=Documentation+under+heading+%22class+disk_interface%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-interface\">\n+<h1>disk_interface</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a> is the customization point for disk I/O in libtorrent.\n+implement this interface and provide a factory function to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor\n+use custom disk I/O. All functions on the disk subsystem (implementing\n+<a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>) 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.</p>\n+<p>Although the functions are called <tt class=\"docutils literal\">async_*</tt>, they do not technically\n+<em>have</em> 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.</p>\n <pre class=\"literal-block\">\n-void <strong>connect_peer</strong> (tcp::endpoint const& adr, peer_source_flags_t source = {}\n- , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n+struct disk_interface\n+{\n+ virtual storage_holder <strong>new_torrent</strong> (storage_params const& p\n+ , std::shared_ptr<void> const& torrent) = 0;\n+ virtual void <strong>remove_torrent</strong> (storage_index_t) = 0;\n+ virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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 <strong>async_hash</strong> (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 <strong>async_hash2</strong> (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 <strong>async_move_storage</strong> (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 <strong>async_release_files</strong> (storage_index_t storage\n+ , std::function<void()> handler = std::function<void()>()) = 0;\n+ virtual void <strong>async_check_files</strong> (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 <strong>async_stop_torrent</strong> (storage_index_t storage\n+ , std::function<void()> handler = std::function<void()>()) = 0;\n+ virtual void <strong>async_rename_file</strong> (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 <strong>async_delete_files</strong> (storage_index_t storage, remove_flags_t options\n+ , std::function<void(storage_error const&)> handler) = 0;\n+ virtual void <strong>async_set_file_priority</strong> (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 <strong>async_clear_piece</strong> (storage_index_t storage, piece_index_t index\n+ , std::function<void(piece_index_t)> handler) = 0;\n+ virtual void <strong>update_stats_counters</strong> (counters& c) const = 0;\n+ virtual std::vector<open_file_state> <strong>get_status</strong> (storage_index_t) const = 0;\n+ virtual void <strong>abort</strong> (bool wait) = 0;\n+ virtual void <strong>submit_jobs</strong> () = 0;\n+ virtual void <strong>settings_updated</strong> () = 0;\n+\n+ static constexpr disk_job_flags_t <strong>force_copy</strong> = 0_bit;\n+ static constexpr disk_job_flags_t <strong>sequential_access</strong> = 3_bit;\n+ static constexpr disk_job_flags_t <strong>volatile_read</strong> = 4_bit;\n+ static constexpr disk_job_flags_t <strong>v1_hash</strong> = 5_bit;\n+ static constexpr disk_job_flags_t <strong>flush_piece</strong> = 7_bit;\n+};\n </pre>\n-<p><tt class=\"docutils literal\">connect_peer()</tt> 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 <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a>. i.e.\n-<tt class=\"docutils literal\">tracker</tt>, <tt class=\"docutils literal\">pex</tt>, <tt class=\"docutils literal\">dht</tt> etc.</p>\n-<p>For possible values of <tt class=\"docutils literal\">flags</tt>, see <a class=\"reference external\" href=\"reference-Core.html#pex_flags_t\">pex_flags_t</a>.</p>\n-<a name=\"clear_peers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_peers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_peers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-peers\">\n-<h2>clear_peers()</h2>\n+<a name=\"new_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bnew_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bnew_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-torrent-1\">\n+<h2>new_torrent()</h2>\n <pre class=\"literal-block\">\n-void <strong>clear_peers</strong> ();\n+virtual storage_holder <strong>new_torrent</strong> (storage_params const& p\n+ , std::shared_ptr<void> const& torrent) = 0;\n </pre>\n-<p>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.</p>\n-<a name=\"set_max_uploads()\"></a>\n-<a name=\"max_uploads()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_max_uploads%28%29+max_uploads%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_max_uploads%28%29+max_uploads%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-max-uploads-max-uploads\">\n-<h2>set_max_uploads() max_uploads()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#storage_holder\">storage_holder</a> is an owning reference to the underlying\n+storage that was just created. It is fundamentally a storage_index_t</p>\n+<a name=\"remove_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bremove_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bremove_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"remove-torrent\">\n+<h2>remove_torrent()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_max_uploads</strong> (int max_uploads) const;\n-int <strong>max_uploads</strong> () const;\n+virtual void <strong>remove_torrent</strong> (storage_index_t) = 0;\n </pre>\n-<p><tt class=\"docutils literal\">set_max_uploads()</tt> 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-<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n-<p><tt class=\"docutils literal\">max_uploads()</tt> returns the current settings.</p>\n-<a name=\"max_connections()\"></a>\n-<a name=\"set_max_connections()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bmax_connections%28%29+set_max_connections%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bmax_connections%28%29+set_max_connections%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"max-connections-set-max-connections\">\n-<h2>max_connections() set_max_connections()</h2>\n+<p>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.</p>\n+<a name=\"async_read()\"></a>\n+<a name=\"async_write()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-read-async-write\">\n+<h2>async_read() async_write()</h2>\n <pre class=\"literal-block\">\n-int <strong>max_connections</strong> () const;\n-void <strong>set_max_connections</strong> (int max_connections) const;\n+virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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 </pre>\n-<p><tt class=\"docutils literal\">set_max_connections()</tt> 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-<tt class=\"docutils literal\">connections_limit</tt> in <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n-<p><tt class=\"docutils literal\">max_connections()</tt> returns the current settings.</p>\n-<a name=\"move_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bmove_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bmove_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"move-storage\">\n-<h2>move_storage()</h2>\n+<p>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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>, holding the buffer with\n+the result. Flags may be set to affect the read operation. See\n+disk_job_flags_t.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_observer\">disk_observer</a> 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 <tt class=\"docutils literal\">async_write()</tt> returns\n+<tt class=\"docutils literal\">true</tt>, indicating the write queue is full, the peer will stop\n+further writes and wait for the passed-in <tt class=\"docutils literal\">disk_observer</tt> to be\n+notified before resuming.</p>\n+<p>Note that for <tt class=\"docutils literal\">async_read</tt>, the <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> (<tt class=\"docutils literal\">r</tt>) is not\n+necessarily aligned to blocks (but it is most of the time). However,\n+all writes (passed to <tt class=\"docutils literal\">async_write</tt>) are guaranteed to be block\n+aligned.</p>\n+<a name=\"async_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-hash\">\n+<h2>async_hash()</h2>\n <pre class=\"literal-block\">\n-void <strong>move_storage</strong> (std::string const& save_path\n- , move_flags_t flags = move_flags_t::always_replace_files\n- ) const;\n+virtual void <strong>async_hash</strong> (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 </pre>\n-<p>Moves the file(s) that this torrent are currently seeding from or\n-downloading to. If the given <tt class=\"docutils literal\">save_path</tt> 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.</p>\n-<p>Since disk IO is performed in a separate thread, this operation is\n-also asynchronous. Once the operation completes, the\n-<tt class=\"docutils literal\">storage_moved_alert</tt> is generated, with the new path as the\n-message. If the move fails for some reason,\n-<tt class=\"docutils literal\">storage_moved_failed_alert</tt> is generated instead, containing the\n-error message.</p>\n-<p>The <tt class=\"docutils literal\">flags</tt> argument determines the behavior of the copying/moving\n-of the files in the torrent. see <a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a>.</p>\n-<p><tt class=\"docutils literal\">always_replace_files</tt> is the default and replaces any file that\n-exist in both the source directory and the target directory.</p>\n-<p><tt class=\"docutils literal\">fail_if_exist</tt> 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 <tt class=\"docutils literal\">always_replace_files</tt> 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 <tt class=\"docutils literal\">error</tt> of\n-<tt class=\"docutils literal\">move_storage_failed_alert</tt> is set to\n-<tt class=\"docutils literal\"><span class=\"pre\">boost::system::errc::file_exists</span></tt>.</p>\n-<p>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 <tt class=\"docutils literal\">move_storage</tt> call with one of the other modes.</p>\n-<p><tt class=\"docutils literal\">dont_replace</tt> 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.</p>\n-<p>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.</p>\n-<p>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.</p>\n-<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"rename-file\">\n-<h2>rename_file()</h2>\n+<p>Compute hash(es) for the specified piece. Unless the v1_hash flag is\n+set (in <tt class=\"docutils literal\">flags</tt>), the SHA-1 hash of the whole piece does not need\n+to be computed.</p>\n+<p>The <cite>v2</cite> 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.</p>\n+<a name=\"async_hash2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_hash2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_hash2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-hash2\">\n+<h2>async_hash2()</h2>\n <pre class=\"literal-block\">\n-void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n+virtual void <strong>async_hash2</strong> (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 </pre>\n-<p>Renames the file with the given index asynchronously. The rename\n-operation is complete when either a <a class=\"reference external\" href=\"reference-Alerts.html#file_renamed_alert\">file_renamed_alert</a> or\n-<a class=\"reference external\" href=\"reference-Alerts.html#file_rename_failed_alert\">file_rename_failed_alert</a> is posted.</p>\n-<a name=\"info_hashes()\"></a>\n-<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hashes-info-hash\">\n-<h2>info_hashes() info_hash()</h2>\n+<p>computes the v2 hash (SHA-256) of a single block. The block at\n+<tt class=\"docutils literal\">offset</tt> in piece <tt class=\"docutils literal\">piece</tt>.</p>\n+<a name=\"async_move_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_move_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_move_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-move-storage\">\n+<h2>async_move_storage()</h2>\n <pre class=\"literal-block\">\n-info_hash_t <strong>info_hashes</strong> () const;\n-sha1_hash <strong>info_hash</strong> () const;\n+virtual void <strong>async_move_storage</strong> (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 </pre>\n-<p>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 <tt class=\"docutils literal\">info_hash()</tt> 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-<tt class=\"docutils literal\">info_hashes()</tt> instead.</p>\n-<a name=\"operator!=()\"></a>\n-<a name=\"operator==()\"></a>\n-<a name=\"operator<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3D%3D%28%29+operator%3C%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3D%3D%28%29+operator%3C%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-operator-operator\">\n-<h2>operator!=() operator==() operator<()</h2>\n+<p>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 <tt class=\"docutils literal\">flags</tt> (see <a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a>).</p>\n+<a name=\"async_release_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_release_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_release_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-release-files\">\n+<h2>async_release_files()</h2>\n <pre class=\"literal-block\">\n-bool <strong>operator!=</strong> (const torrent_handle& h) const;\n-bool <strong>operator<</strong> (const torrent_handle& h) const;\n-bool <strong>operator==</strong> (const torrent_handle& h) const;\n+virtual void <strong>async_release_files</strong> (storage_index_t storage\n+ , std::function<void()> handler = std::function<void()>()) = 0;\n </pre>\n-<p>comparison operators. The order of the torrents is unspecified\n-but stable.</p>\n-<a name=\"id()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"id\">\n-<h2>id()</h2>\n+<p>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.</p>\n+<a name=\"async_check_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_check_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_check_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-check-files\">\n+<h2>async_check_files()</h2>\n <pre class=\"literal-block\">\n-std::uint32_t <strong>id</strong> () const;\n+virtual void <strong>async_check_files</strong> (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 </pre>\n-<p>returns a unique identifier for this torrent. It's not a dense index.\n-It's not preserved across sessions.</p>\n-<a name=\"native_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bnative_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bnative_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"native-handle\">\n-<h2>native_handle()</h2>\n+<p>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:</p>\n+<p>if <tt class=\"docutils literal\">links</tt> 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 <tt class=\"docutils literal\">storage</tt>). 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.</p>\n+<p>The <tt class=\"docutils literal\">resume_data</tt> points the resume data passed in by the client.</p>\n+<p>If the <tt class=\"docutils literal\"><span class=\"pre\">resume_data->flags</span></tt> 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.</p>\n+<p>Any file with a piece set in the <tt class=\"docutils literal\"><span class=\"pre\">resume_data->have_pieces</span></tt> bitmask\n+should exist on disk, this should be verified. Pad files and files\n+with zero priority may be skipped.</p>\n+<a name=\"async_stop_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_stop_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_stop_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-stop-torrent\">\n+<h2>async_stop_torrent()</h2>\n <pre class=\"literal-block\">\n-std::shared_ptr<torrent> <strong>native_handle</strong> () const;\n+virtual void <strong>async_stop_torrent</strong> (storage_index_t storage\n+ , std::function<void()> handler = std::function<void()>()) = 0;\n </pre>\n-<p>This function is intended only for use by plugins and the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> callbacks).\n-The <tt class=\"docutils literal\">torrent</tt> 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 <tt class=\"docutils literal\">TORRENT_</tt> macros must match between libtorrent and the\n-client builds.</p>\n-<a name=\"userdata()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Buserdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Buserdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"userdata\">\n-<h2>userdata()</h2>\n+<p>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+<a class=\"reference external\" href=\"reference-Custom_Storage.html#async_release_files()\">async_release_files()</a>.</p>\n+<a name=\"async_rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_rename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_rename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-rename-file\">\n+<h2>async_rename_file()</h2>\n <pre class=\"literal-block\">\n-client_data_t <strong>userdata</strong> () const;\n+virtual void <strong>async_rename_file</strong> (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 </pre>\n-<p>returns the userdata pointer as set in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a></p>\n-<a name=\"in_session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bin_session%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bin_session%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"in-session\">\n-<h2>in_session()</h2>\n+<p>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.).</p>\n+<a name=\"async_delete_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_delete_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_delete_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-delete-files\">\n+<h2>async_delete_files()</h2>\n <pre class=\"literal-block\">\n-bool <strong>in_session</strong> () const;\n+virtual void <strong>async_delete_files</strong> (storage_index_t storage, remove_flags_t options\n+ , std::function<void(storage_error const&)> handler) = 0;\n </pre>\n-<p>Returns true if the torrent is in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It returns true before\n-session::remove_torrent() is called, and false afterward.</p>\n-<p>Note that this is a blocking function, unlike <a class=\"reference external\" href=\"reference-Torrent_Handle.html#is_valid()\">torrent_handle::is_valid()</a>\n-which returns immediately.</p>\n-<a name=\"overwrite_existing\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boverwrite_existing%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boverwrite_existing%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>overwrite_existing</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"query_distributed_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_distributed_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_distributed_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_distributed_copies</dt>\n-<dd>calculates <tt class=\"docutils literal\">distributed_copies</tt>, <tt class=\"docutils literal\">distributed_full_copies</tt> and\n-<tt class=\"docutils literal\">distributed_fraction</tt>.</dd>\n-</dl>\n-<a name=\"query_accurate_download_counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_accurate_download_counters%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_accurate_download_counters%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_accurate_download_counters</dt>\n-<dd>includes partial downloaded blocks in <tt class=\"docutils literal\">total_done</tt> and\n-<tt class=\"docutils literal\">total_wanted_done</tt>.</dd>\n-</dl>\n-<a name=\"query_last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_last_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_last_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_last_seen_complete</dt>\n-<dd>includes <tt class=\"docutils literal\">last_seen_complete</tt>.</dd>\n-</dl>\n-<a name=\"query_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_pieces</dt>\n-<dd>populate the <tt class=\"docutils literal\">pieces</tt> field in <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.</dd>\n-</dl>\n-<a name=\"query_verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_verified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_verified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_verified_pieces</dt>\n-<dd>includes <tt class=\"docutils literal\">verified_pieces</tt> (only applies to torrents in <em>seed\n-mode</em>).</dd>\n-</dl>\n-<a name=\"query_torrent_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_torrent_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_torrent_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_torrent_file</dt>\n-<dd>includes <tt class=\"docutils literal\">torrent_file</tt>, which is all the static information from\n-the .torrent file.</dd>\n-</dl>\n-<a name=\"query_name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_name%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_name%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_name</dt>\n-<dd>includes <tt class=\"docutils literal\">name</tt>, the name of the torrent. This is either derived\n-from the .torrent file, or from the <tt class=\"docutils literal\">&dn=</tt> magnet link argument\n-or possibly some other source. If the name of the torrent is not\n-known, this is an empty string.</dd>\n-</dl>\n-<a name=\"query_save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_save_path%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_save_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>query_save_path</dt>\n-<dd>includes <tt class=\"docutils literal\">save_path</tt>, the path to the directory the files of the\n-torrent are saved to.</dd>\n-</dl>\n-<a name=\"alert_when_available\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Balert_when_available%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Balert_when_available%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>alert_when_available</dt>\n-<dd>used to ask libtorrent to send an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> once the piece has been\n-downloaded, by passing alert_when_available. When set, the\n-<a class=\"reference external\" href=\"reference-Alerts.html#read_piece_alert\">read_piece_alert</a> <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> will be delivered, with the piece data, when\n-it's downloaded.</dd>\n-</dl>\n-<a name=\"piece_granularity\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_granularity%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_granularity%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_granularity</dt>\n-<dd>only calculate file progress at piece granularity. This makes\n-the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#file_progress()\">file_progress()</a> call cheaper and also only takes bytes that\n-have passed the hash check into account, so progress cannot\n-regress in this mode.</dd>\n-</dl>\n-<a name=\"graceful_pause\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bgraceful_pause%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bgraceful_pause%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>graceful_pause</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"flush_disk_cache\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflush_disk_cache%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflush_disk_cache%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flush_disk_cache</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"save_info_dict\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bsave_info_dict%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bsave_info_dict%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_info_dict</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"only_if_modified\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bonly_if_modified%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bonly_if_modified%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>only_if_modified</dt>\n-<dd>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</dd>\n-</dl>\n-<a name=\"if_counters_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_counters_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_counters_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>if_counters_changed</dt>\n-<dd>save resume data if any <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> has changed since the last time\n-resume data was saved. This includes upload/download <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, active\n-time <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> and scrape data. A torrent that is not paused will have\n-its active time <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> incremented continuously.</dd>\n-</dl>\n-<a name=\"if_download_progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_download_progress%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_download_progress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>if_download_progress</dt>\n-<dd>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</dd>\n+<p>This function is called when some file(s) on disk have been requested\n+to be removed by the client. <tt class=\"docutils literal\">storage</tt> indicates which torrent is\n+referred to. See <a class=\"reference external\" href=\"reference-Session.html#session_handle\">session_handle</a> for <tt class=\"docutils literal\">remove_flags_t</tt> flags\n+indicating which files are to be removed.\n+e.g. <a class=\"reference external\" href=\"reference-Session.html#delete_files\">session_handle::delete_files</a> - delete all files\n+<a class=\"reference external\" href=\"reference-Session.html#delete_partfile\">session_handle::delete_partfile</a> - only delete part file.</p>\n+<a name=\"async_set_file_priority()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_set_file_priority%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_set_file_priority%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-set-file-priority\">\n+<h2>async_set_file_priority()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>async_set_file_priority</strong> (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+</pre>\n+<p>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.</p>\n+<p><tt class=\"docutils literal\">prio</tt> 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.</p>\n+<a name=\"async_clear_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_clear_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_clear_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-clear-piece\">\n+<h2>async_clear_piece()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>async_clear_piece</strong> (storage_index_t storage, piece_index_t index\n+ , std::function<void(piece_index_t)> handler) = 0;\n+</pre>\n+<p>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.</p>\n+<a name=\"update_stats_counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bupdate_stats_counters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bupdate_stats_counters%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"update-stats-counters\">\n+<h2>update_stats_counters()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>update_stats_counters</strong> (counters& c) const = 0;\n+</pre>\n+<p><a class=\"reference external\" href=\"reference-Custom_Storage.html#update_stats_counters()\">update_stats_counters()</a> is called to give the disk storage an\n+opportunity to update gauges in the <tt class=\"docutils literal\">c</tt> stats <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, that aren't\n+updated continuously as operations are performed. This is called\n+before a snapshot of the <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are passed to the client.</p>\n+<a name=\"get_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bget_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bget_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-status\">\n+<h2>get_status()</h2>\n+<pre class=\"literal-block\">\n+virtual std::vector<open_file_state> <strong>get_status</strong> (storage_index_t) const = 0;\n+</pre>\n+<p>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.</p>\n+<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"abort-1\">\n+<h2>abort()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>abort</strong> (bool wait) = 0;\n+</pre>\n+<p>this is called when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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+<tt class=\"docutils literal\">wait</tt> 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.</p>\n+<a name=\"submit_jobs()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsubmit_jobs%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsubmit_jobs%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"submit-jobs\">\n+<h2>submit_jobs()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>submit_jobs</strong> () = 0;\n+</pre>\n+<p>This will be called after a batch of disk jobs has been issues (via\n+the <tt class=\"docutils literal\">async_*</tt> ). 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 <tt class=\"docutils literal\">async_*</tt> 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.</p>\n+<a name=\"settings_updated()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsettings_updated%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsettings_updated%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"settings-updated\">\n+<h2>settings_updated()</h2>\n+<pre class=\"literal-block\">\n+virtual void <strong>settings_updated</strong> () = 0;\n+</pre>\n+<p>This is called to notify the disk I/O object that the settings have\n+been updated. In the disk io constructor, a <a class=\"reference external\" href=\"reference-Custom_Storage.html#settings_interface\">settings_interface</a>\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.</p>\n+<a name=\"force_copy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bforce_copy%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bforce_copy%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>force_copy</dt>\n+<dd>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.</dd>\n </dl>\n-<a name=\"if_config_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_config_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_config_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>if_config_changed</dt>\n-<dd>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)</dd>\n+<a name=\"sequential_access\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsequential_access%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsequential_access%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>sequential_access</dt>\n+<dd>hint that there may be more disk operations with sequential access to\n+the file</dd>\n </dl>\n-<a name=\"if_state_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_state_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_state_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>if_state_changed</dt>\n-<dd>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</dd>\n+<a name=\"volatile_read\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bvolatile_read%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bvolatile_read%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>volatile_read</dt>\n+<dd>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.</dd>\n </dl>\n-<a name=\"if_metadata_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_metadata_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_metadata_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>if_metadata_changed</dt>\n-<dd>save the resume data if any <em>metadata</em> 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</dd>\n+<a name=\"v1_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bv1_hash%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bv1_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>v1_hash</dt>\n+<dd>compute a v1 piece hash. This is only used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#async_hash()\">async_hash()</a> call.\n+If this flag is not set in the <a class=\"reference external\" href=\"reference-Custom_Storage.html#async_hash()\">async_hash()</a> call, the SHA-1 piece\n+hash does not need to be computed.</dd>\n </dl>\n-<a name=\"ignore_min_interval\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bignore_min_interval%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bignore_min_interval%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ignore_min_interval</dt>\n-<dd>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.</dd>\n+<a name=\"flush_piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bflush_piece%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bflush_piece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flush_piece</dt>\n+<dd>this flag instructs a hash job that we just completed this piece, and\n+it should be flushed to disk</dd>\n </dl>\n-<a name=\"hash_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hash_value%28%29&labels=documentation&body=Documentation+under+heading+%22hash_value%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"storage_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_holder&labels=documentation&body=Documentation+under+heading+%22class+storage_holder%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"hash-value\">\n-<h1>hash_value()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::size_t <strong>hash_value</strong> (torrent_handle const& h);\n-</pre>\n-<p>for std::hash (and to support using this type in unordered_map etc.)</p>\n-<a name=\"web_seed_entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+web_seed_entry&labels=documentation&body=Documentation+under+heading+%22class+web_seed_entry%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"web-seed-entry\">\n-<h1>web_seed_entry</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n-<p>the <a class=\"reference external\" href=\"reference-Torrent_Info.html#web_seed_entry\">web_seed_entry</a> 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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> and <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n+<div class=\"section\" id=\"storage-holder\">\n+<h1>storage_holder</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n+<p>a unique, owning, reference to the storage of a torrent in a disk io\n+subsystem (class that implements <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>). 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, this holder is destructed and will\n+inform the disk object.</p>\n <pre class=\"literal-block\">\n-struct web_seed_entry\n+struct storage_holder\n {\n- bool <strong>operator==</strong> (web_seed_entry const& e) const;\n- bool <strong>operator<</strong> (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+ <strong>storage_holder</strong> () = default;\n+ <strong>storage_holder</strong> (storage_index_t idx, disk_interface& disk_io);\n+ <strong>~storage_holder</strong> ();\n+ explicit operator <strong>bool</strong> () const;\n+ operator <strong>storage_index_t</strong> () const;\n+ void <strong>reset</strong> ();\n+ <strong>storage_holder</strong> (storage_holder const&) = delete;\n+ storage_holder& <strong>operator=</strong> (storage_holder const&) = delete;\n+ <strong>storage_holder</strong> (storage_holder&& rhs) noexcept;\n+ storage_holder& <strong>operator=</strong> (storage_holder&& rhs) noexcept;\n };\n </pre>\n-<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-1\">\n-<h2>operator==()</h2>\n+<a name=\"disk_observer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_observer&labels=documentation&body=Documentation+under+heading+%22class+disk_observer%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disk-observer\">\n+<h1>disk_observer</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_observer.hpp\">libtorrent/disk_observer.hpp</a>"</p>\n <pre class=\"literal-block\">\n-bool <strong>operator==</strong> (web_seed_entry const& e) const;\n+struct disk_observer\n+{\n+ virtual void <strong>on_disk</strong> () = 0;\n+};\n </pre>\n-<p>URL and type comparison</p>\n-<a name=\"operator<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Boperator%3C%28%29%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Boperator%3C%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-2\">\n-<h2>operator<()</h2>\n+<a name=\"on_disk()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_observer%3A%3A%5Bon_disk%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_observer%3A%3A%5Bon_disk%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"on-disk\">\n+<h2>on_disk()</h2>\n <pre class=\"literal-block\">\n-bool <strong>operator<</strong> (web_seed_entry const& e) const;\n+virtual void <strong>on_disk</strong> () = 0;\n </pre>\n-<p>URL and type less-than comparison</p>\n-<a name=\"type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_t&labels=documentation&body=Documentation+under+heading+%22enum+type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-type-t\">\n-<h2>enum type_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n+<p>called when the disk cache size has dropped\n+below the low watermark again and we can\n+resume downloading from peers</p>\n+<a name=\"file_open_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_open_mode_t&labels=documentation&body=Documentation+under+heading+%22file_open_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"file-open-mode-t\">\n+<h1>file_open_mode_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n+<a name=\"file_open_mode_t::read_only\"></a><dl class=\"docutils\">\n+<dt>read_only</dt>\n+<dd>open the file for reading only</dd>\n+</dl>\n+<a name=\"file_open_mode_t::write_only\"></a><dl class=\"docutils\">\n+<dt>write_only</dt>\n+<dd>open the file for writing only</dd>\n+</dl>\n+<a name=\"file_open_mode_t::read_write\"></a><dl class=\"docutils\">\n+<dt>read_write</dt>\n+<dd>open the file for reading and writing</dd>\n+</dl>\n+<a name=\"file_open_mode_t::rw_mask\"></a><dl class=\"docutils\">\n+<dt>rw_mask</dt>\n+<dd>the mask for the bits determining read or write mode</dd>\n+</dl>\n+<a name=\"file_open_mode_t::sparse\"></a><dl class=\"docutils\">\n+<dt>sparse</dt>\n+<dd>open the file in sparse mode (if supported by the\n+filesystem).</dd>\n+</dl>\n+<a name=\"file_open_mode_t::no_atime\"></a><dl class=\"docutils\">\n+<dt>no_atime</dt>\n+<dd>don't update the access timestamps on the file (if\n+supported by the operating system and filesystem).\n+this generally improves disk performance.</dd>\n+</dl>\n+<a name=\"file_open_mode_t::random_access\"></a><dl class=\"docutils\">\n+<dt>random_access</dt>\n+<dd>When this is not set, the kernel is hinted that access to this file will\n+be made sequentially.</dd>\n+</dl>\n+<a name=\"file_open_mode_t::mmapped\"></a><dl class=\"docutils\">\n+<dt>mmapped</dt>\n+<dd>the file is memory mapped</dd>\n+</dl>\n+<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the session::apply_settings()\n+member function. To change one or more configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>\n+object and fill it with the settings to be set and pass it in to session::apply_settings().</p>\n+<p>The <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> object is a collection of settings updates that are applied\n+to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when passed to session::apply_settings(). It's empty when\n+constructed.</p>\n+<p>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.</p>\n+<p>Each configuration option is named with an enum value inside the\n+<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> class. These are the available settings:</p>\n+<a name=\"settings_pack\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_pack&labels=documentation&body=Documentation+under+heading+%22class+settings_pack%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"settings-pack\">\n+<h1>settings_pack</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">settings_pack</tt> struct, contains the names of all settings as\n+enum values. These values are passed in to the <tt class=\"docutils literal\">set_str()</tt>,\n+<tt class=\"docutils literal\">set_int()</tt>, <tt class=\"docutils literal\">set_bool()</tt> functions, to specify the setting to\n+change.</p>\n+<p>The <tt class=\"docutils literal\">settings_pack</tt> 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.</p>\n+<a name=\"user_agent\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"35%\" />\n-<col width=\"23%\" />\n-<col width=\"42%\" />\n+<col width=\"36%\" />\n+<col width=\"24%\" />\n+<col width=\"39%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>url_seed</td>\n-<td>0</td>\n-<td> </td>\n+<tr><td>user_agent</td>\n+<td>string</td>\n+<td>libtorrent/</td>\n </tr>\n-<tr><td>http_seed</td>\n-<td>1</td>\n-<td> </td>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"announce_ip\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"43%\" />\n+<col width=\"27%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>announce_ip</td>\n+<td>string</td>\n+<td>nullptr</td>\n </tr>\n </tbody>\n </table>\n-<a name=\"url\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Burl%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Burl%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>url</dt>\n-<dd>The URL of the web seed</dd>\n-</dl>\n-<a name=\"auth\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Bauth%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Bauth%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>auth</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"extra_headers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Bextra_headers%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Bextra_headers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>extra_headers</dt>\n-<dd>Any extra HTTP headers that need to be passed to the web seed</dd>\n-</dl>\n-<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Btype%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Btype%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>type</dt>\n-<dd>The type of web seed (see <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>)</dd>\n-</dl>\n-<a name=\"load_torrent_limits\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+load_torrent_limits&labels=documentation&body=Documentation+under+heading+%22class+load_torrent_limits%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"load-torrent-limits\">\n-<h1>load_torrent_limits</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct load_torrent_limits\n-{\n- int <strong>max_buffer_size</strong> = 10000000;\n- int <strong>max_pieces</strong> = 0x200000;\n- int <strong>max_decode_depth</strong> = 100;\n- int <strong>max_decode_tokens</strong> = 3000000;\n-};\n-</pre>\n-<a name=\"max_buffer_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_buffer_size%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_buffer_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>max_buffer_size</dt>\n-<dd>the max size of a .torrent file to load into RAM</dd>\n-</dl>\n-<a name=\"max_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_pieces%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>max_pieces</dt>\n-<dd>the max number of pieces allowed in the torrent</dd>\n-</dl>\n-<a name=\"max_decode_depth\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_decode_depth%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_decode_depth%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>max_decode_depth</dt>\n-<dd>the max recursion depth in the bdecoded structure</dd>\n-</dl>\n-<a name=\"max_decode_tokens\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_decode_tokens%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_decode_tokens%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>max_decode_tokens</dt>\n-<dd>the max number of bdecode tokens</dd>\n-</dl>\n-<a name=\"torrent_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_info&labels=documentation&body=Documentation+under+heading+%22class+torrent_info%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-info\">\n-<h1>torrent_info</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n-<p>the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> class holds the information found in a .torrent file.</p>\n-<pre class=\"literal-block\">\n-class torrent_info\n-{\n- explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n- <strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n- <strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n- <strong>torrent_info</strong> (char const* buffer, int size);\n- explicit <strong>torrent_info</strong> (std::string const& filename);\n- explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n- explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n- <strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n- <strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n- <strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n- <strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n- <strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n- <strong>torrent_info</strong> (torrent_info const& t);\n- <strong>~torrent_info</strong> ();\n- file_storage const& <strong>files</strong> () const;\n- file_storage const& <strong>orig_files</strong> () const;\n- void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n- void <strong>remap_files</strong> (file_storage const& f);\n- void <strong>add_tracker</strong> (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n- void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n- std::vector<announce_entry> const& <strong>trackers</strong> () const;\n- void <strong>clear_trackers</strong> ();\n- std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n- std::vector<std::string> <strong>collections</strong> () const;\n- void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n- void <strong>add_http_seed</strong> (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& <strong>web_seeds</strong> () const;\n- void <strong>add_url_seed</strong> (std::string const& url\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n- std::int64_t <strong>total_size</strong> () const;\n- int <strong>piece_length</strong> () const;\n- int <strong>num_pieces</strong> () const;\n- int <strong>blocks_per_piece</strong> () const;\n- piece_index_t <strong>last_piece</strong> () const;\n- piece_index_t <strong>end_piece</strong> () const;\n- index_range<piece_index_t> <strong>piece_range</strong> () const;\n- sha1_hash <strong>info_hash</strong> () const noexcept;\n- info_hash_t const& <strong>info_hashes</strong> () const;\n- bool <strong>v2</strong> () const;\n- bool <strong>v1</strong> () const;\n- int <strong>num_files</strong> () const;\n- std::vector<file_slice> <strong>map_block</strong> (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n- peer_request <strong>map_file</strong> (file_index_t const file, std::int64_t offset, int size) const;\n- string_view <strong>ssl_cert</strong> () const;\n- bool <strong>is_valid</strong> () const;\n- bool <strong>priv</strong> () const;\n- bool <strong>is_i2p</strong> () const;\n- int <strong>piece_size</strong> (piece_index_t index) const;\n- sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n- char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n- bool <strong>is_loaded</strong> () const;\n- const std::string& <strong>name</strong> () const;\n- std::time_t <strong>creation_date</strong> () const;\n- const std::string& <strong>creator</strong> () const;\n- const std::string& <strong>comment</strong> () const;\n- std::vector<std::pair<std::string, int>> const& <strong>nodes</strong> () const;\n- void <strong>add_node</strong> (std::pair<std::string, int> const& node);\n- bool <strong>parse_info_section</strong> (bdecode_node const& info, error_code& ec, int max_pieces);\n- bdecode_node <strong>info</strong> (char const* key) const;\n- span<char const> <strong>info_section</strong> () const;\n- span<char const> <strong>piece_layer</strong> (file_index_t) const;\n- void <strong>free_piece_layers</strong> ();\n-};\n-</pre>\n-<a name=\"torrent_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Btorrent_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Btorrent_info%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"torrent-info-1\">\n-<h2>torrent_info()</h2>\n-<pre class=\"literal-block\">\n-explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n-<strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-<strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n-<strong>torrent_info</strong> (char const* buffer, int size);\n-explicit <strong>torrent_info</strong> (std::string const& filename);\n-explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n-explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n-<strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n-<strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n-<strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n-<strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-<strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n-<strong>torrent_info</strong> (torrent_info const& t);\n-</pre>\n-<p>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.</p>\n-<p>The constructor that takes a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> will create a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n-object from the information found in the given torrent_file. The\n-<a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> represents a tree node in an bencoded file. To load an\n-ordinary .torrent file into a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>, use <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>.</p>\n-<p>The version that takes a buffer pointer and a size will decode it as a\n-.torrent file and initialize the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object for you.</p>\n-<p>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.</p>\n-<p>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.</p>\n-<p>The overloads that takes an <tt class=\"docutils literal\">error_code const&</tt> 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 <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n-<p>The overload that takes a <tt class=\"docutils literal\">span</tt> also needs an extra parameter of\n-type <tt class=\"docutils literal\">from_span_t</tt> to disambiguate the <tt class=\"docutils literal\"><span class=\"pre\">std::string</span></tt> overload for\n-string literals. There is an object in the libtorrent namespace of this\n-type called <tt class=\"docutils literal\">from_span</tt>.</p>\n-<a name=\"~torrent_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5B~torrent_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5B~torrent_info%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-info-2\">\n-<h2>~torrent_info()</h2>\n-<pre class=\"literal-block\">\n-<strong>~torrent_info</strong> ();\n-</pre>\n-<p>frees all storage associated with this <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object</p>\n-<a name=\"files()\"></a>\n-<a name=\"orig_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bfiles%28%29+orig_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bfiles%28%29+orig_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"files-orig-files\">\n-<h2>files() orig_files()</h2>\n-<pre class=\"literal-block\">\n-file_storage const& <strong>files</strong> () const;\n-file_storage const& <strong>orig_files</strong> () const;\n-</pre>\n-<p>The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object contains the information on how to map the\n-pieces to files. It is separated from the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> in order to make its\n-mapping differ from the one in the torrent file.</p>\n-<p><tt class=\"docutils literal\">orig_files()</tt> 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-<tt class=\"docutils literal\"><span class=\"pre\">torrent_info::rename_file()</span></tt>.</p>\n-<p>For more information on the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object, see the separate\n-document on how to create torrents.</p>\n-<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"rename-file-1\">\n-<h2>rename_file()</h2>\n-<pre class=\"literal-block\">\n-void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n-</pre>\n-<p>Renames the file with the specified index to the new name. The new\n-filename is reflected by the <tt class=\"docutils literal\">file_storage</tt> returned by <tt class=\"docutils literal\">files()</tt>\n-but not by the one returned by <tt class=\"docutils literal\">orig_files()</tt>.</p>\n-<p>If you want to rename the base name of the torrent (for a multi file\n-torrent), you can copy the <tt class=\"docutils literal\">file_storage</tt> (see <a class=\"reference external\" href=\"reference-Create_Torrents.html#files()\">files()</a> and\n-<a class=\"reference external\" href=\"reference-Torrent_Info.html#orig_files()\">orig_files()</a> ), change the name, and then use <a class=\"reference internal\" href=\"#remap-files\">remap_files()</a>.</p>\n-<p>The <tt class=\"docutils literal\">new_filename</tt> can both be a relative path, in which case the\n-file name is relative to the <tt class=\"docutils literal\">save_path</tt> of the torrent. If the\n-<tt class=\"docutils literal\">new_filename</tt> is an absolute path (i.e. <tt class=\"docutils literal\">is_complete(new_filename)\n-== true</tt>), then the file is detached from the <tt class=\"docutils literal\">save_path</tt> of the\n-torrent. In this case the file is not moved when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#move_storage()\">move_storage()</a> is\n-invoked.</p>\n-<a name=\"remap_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bremap_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bremap_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"remap-files\">\n-<h2>remap_files()</h2>\n-<pre class=\"literal-block\">\n-void <strong>remap_files</strong> (file_storage const& f);\n-</pre>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">Using <cite>remap_files()</cite> 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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>\n-to customize how to store files.</p>\n-</div>\n-<p>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.</p>\n-<p>The new specified <tt class=\"docutils literal\">file_storage</tt> must have the exact same size as\n-the current one.</p>\n-<a name=\"add_tracker()\"></a>\n-<a name=\"clear_trackers()\"></a>\n-<a name=\"trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_tracker%28%29+clear_trackers%28%29+trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_tracker%28%29+clear_trackers%28%29+trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-tracker-clear-trackers-trackers\">\n-<h2>add_tracker() clear_trackers() trackers()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_tracker</strong> (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n-void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n-std::vector<announce_entry> const& <strong>trackers</strong> () const;\n-void <strong>clear_trackers</strong> ();\n-</pre>\n-<p><tt class=\"docutils literal\">add_tracker()</tt> adds a tracker to the announce-list. The <tt class=\"docutils literal\">tier</tt>\n-determines the order in which the trackers are to be tried.\n-The <tt class=\"docutils literal\">trackers()</tt> function will return a sorted vector of\n-<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>. Each announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> 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 <a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n-<p><tt class=\"docutils literal\">trackers()</tt> returns all entries from announce-list.</p>\n-<p><tt class=\"docutils literal\">clear_trackers()</tt> removes all trackers from announce-list.</p>\n-<a name=\"collections()\"></a>\n-<a name=\"similar_torrents()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcollections%28%29+similar_torrents%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcollections%28%29+similar_torrents%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"collections-similar-torrents\">\n-<h2>collections() similar_torrents()</h2>\n-<pre class=\"literal-block\">\n-std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n-std::vector<std::string> <strong>collections</strong> () const;\n-</pre>\n-<p>These two functions are related to <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a> (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.</p>\n-<a name=\"add_http_seed()\"></a>\n-<a name=\"set_web_seeds()\"></a>\n-<a name=\"add_url_seed()\"></a>\n-<a name=\"web_seeds()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_http_seed%28%29+set_web_seeds%28%29+add_url_seed%28%29+web_seeds%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_http_seed%28%29+set_web_seeds%28%29+add_url_seed%28%29+web_seeds%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-http-seed-set-web-seeds-add-url-seed-web-seeds\">\n-<h2>add_http_seed() set_web_seeds() add_url_seed() web_seeds()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n-void <strong>add_http_seed</strong> (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& <strong>web_seeds</strong> () const;\n-void <strong>add_url_seed</strong> (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-</pre>\n-<p><tt class=\"docutils literal\">web_seeds()</tt> returns all url seeds and http seeds in the torrent.\n-Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is a <tt class=\"docutils literal\">web_seed_entry</tt> and may refer to either a url seed\n-or http seed.</p>\n-<p><tt class=\"docutils literal\">add_url_seed()</tt> and <tt class=\"docutils literal\">add_http_seed()</tt> adds one url to the list of\n-url/http seeds.</p>\n-<p><tt class=\"docutils literal\">set_web_seeds()</tt> replaces all web seeds with the ones specified in\n-the <tt class=\"docutils literal\">seeds</tt> vector.</p>\n-<p>The <tt class=\"docutils literal\">extern_auth</tt> 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").</p>\n-<p>The <tt class=\"docutils literal\">extra_headers</tt> 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.</p>\n-<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n-<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"total-size\">\n-<h2>total_size()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>total_size</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">total_size()</tt> 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.</p>\n-<a name=\"piece_length()\"></a>\n-<a name=\"num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_length%28%29+num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_length%28%29+num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-length-num-pieces\">\n-<h2>piece_length() num_pieces()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_length</strong> () const;\n-int <strong>num_pieces</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">piece_length()</tt> and <tt class=\"docutils literal\">num_pieces()</tt> returns the number of byte\n-for each piece and the total number of pieces, respectively. The\n-difference between <tt class=\"docutils literal\">piece_size()</tt> and <tt class=\"docutils literal\">piece_length()</tt> is that\n-<tt class=\"docutils literal\">piece_size()</tt> takes the piece index as argument and gives you the\n-exact size of that piece. It will always be the same as\n-<tt class=\"docutils literal\">piece_length()</tt> except in the case of the last piece, which may be\n-smaller.</p>\n-<a name=\"blocks_per_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bblocks_per_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bblocks_per_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"blocks-per-piece\">\n-<h2>blocks_per_piece()</h2>\n-<pre class=\"literal-block\">\n-int <strong>blocks_per_piece</strong> () const;\n-</pre>\n-<p>returns the number of blocks there are in the typical piece. There\n-may be fewer in the last piece)</p>\n-<a name=\"last_piece()\"></a>\n-<a name=\"end_piece()\"></a>\n-<a name=\"piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Blast_piece%28%29+end_piece%28%29+piece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Blast_piece%28%29+end_piece%28%29+piece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"last-piece-end-piece-piece-range\">\n-<h2>last_piece() end_piece() piece_range()</h2>\n-<pre class=\"literal-block\">\n-piece_index_t <strong>last_piece</strong> () const;\n-piece_index_t <strong>end_piece</strong> () const;\n-index_range<piece_index_t> <strong>piece_range</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">last_piece()</tt> returns the index to the last piece in the torrent and\n-<tt class=\"docutils literal\">end_piece()</tt> returns the index to the one-past-end piece in the\n-torrent\n-<tt class=\"docutils literal\">piece_range()</tt> 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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"info_hashes()\"></a>\n-<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-hashes-info-hash-1\">\n-<h2>info_hashes() info_hash()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>info_hash</strong> () const noexcept;\n-info_hash_t const& <strong>info_hashes</strong> () const;\n-</pre>\n-<p>returns the info-hash of the torrent. For BitTorrent v2 support, use\n-<tt class=\"docutils literal\">info_hashes()</tt> to get an object that may hold both a v1 and v2\n-info-hash</p>\n-<a name=\"v1()\"></a>\n-<a name=\"v2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"v1-v2\">\n-<h2>v1() v2()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>v2</strong> () const;\n-bool <strong>v1</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"num_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnum_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnum_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-files\">\n-<h2>num_files()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_files</strong> () const;\n-</pre>\n-<p>If you need index-access to files you can use the <tt class=\"docutils literal\">num_files()</tt> along\n-with the <tt class=\"docutils literal\">file_path()</tt>, <tt class=\"docutils literal\">file_size()</tt>-family of functions to access\n-files using indices.</p>\n-<a name=\"map_block()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bmap_block%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bmap_block%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"map-block\">\n-<h2>map_block()</h2>\n-<pre class=\"literal-block\">\n-std::vector<file_slice> <strong>map_block</strong> (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a>.</p>\n-<a name=\"map_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bmap_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bmap_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"map-file\">\n-<h2>map_file()</h2>\n-<pre class=\"literal-block\">\n-peer_request <strong>map_file</strong> (file_index_t const file, std::int64_t offset, int size) const;\n-</pre>\n-<p>This function will map a range in a specific file into a range in the\n-torrent. The <tt class=\"docutils literal\">file_offset</tt> parameter is the offset in the file,\n-given in bytes, where 0 is the start of the file. See <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a>.</p>\n-<p>The input range is assumed to be valid within the torrent.\n-<tt class=\"docutils literal\">file_offset</tt> + <tt class=\"docutils literal\">size</tt> is not allowed to be greater than the file\n-size. <tt class=\"docutils literal\">file_index</tt> must refer to a valid file, i.e. it cannot be >=\n-<tt class=\"docutils literal\">num_files()</tt>.</p>\n-<a name=\"ssl_cert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bssl_cert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bssl_cert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"ssl-cert\">\n-<h2>ssl_cert()</h2>\n-<pre class=\"literal-block\">\n-string_view <strong>ssl_cert</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-valid-1\">\n-<h2>is_valid()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_valid</strong> () const;\n-</pre>\n-<p>returns true if this <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n-<a name=\"priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpriv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpriv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"priv\">\n-<h2>priv()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>priv</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"is_i2p()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bis_i2p%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bis_i2p%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-i2p\">\n-<h2>is_i2p()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_i2p</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-size\">\n-<h2>piece_size()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_size</strong> (piece_index_t index) const;\n-</pre>\n-<p>returns the piece size of file with <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Create_Torrents.html#piece_length()\">piece_length()</a>,\n-except for the last piece, which may be shorter.</p>\n-<a name=\"hash_for_piece_ptr()\"></a>\n-<a name=\"hash_for_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bhash_for_piece_ptr%28%29+hash_for_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bhash_for_piece_ptr%28%29+hash_for_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"hash-for-piece-ptr-hash-for-piece\">\n-<h2>hash_for_piece_ptr() hash_for_piece()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n-char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n-</pre>\n-<p><tt class=\"docutils literal\">hash_for_piece()</tt> takes a piece-index and returns the 20-bytes\n-sha1-hash for that piece and <tt class=\"docutils literal\">info_hash()</tt> returns the 20-bytes\n-sha1-hash for the info-section of the torrent file.\n-<tt class=\"docutils literal\">hash_for_piece_ptr()</tt> returns a pointer to the 20 byte sha1 digest\n-for the piece. Note that the string is not 0-terminated.</p>\n-<a name=\"name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bname%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bname%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"name\">\n-<h2>name()</h2>\n-<pre class=\"literal-block\">\n-const std::string& <strong>name</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">name()</tt> returns the name of the torrent.\n-name contains UTF-8 encoded string.</p>\n-<a name=\"creation_date()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcreation_date%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcreation_date%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"creation-date\">\n-<h2>creation_date()</h2>\n-<pre class=\"literal-block\">\n-std::time_t <strong>creation_date</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">creation_date()</tt> returns the creation date of the torrent as time_t\n-(<a class=\"reference internal\" href=\"#posix-time\">posix time</a>). If there's no time stamp in the torrent file, 0 is\n-returned.\n-.. <span class=\"target\" id=\"posix-time\">posix time</span>: <a class=\"reference external\" href=\"http://www.opengroup.org/onlinepubs/009695399/functions/time.html\">http://www.opengroup.org/onlinepubs/009695399/functions/time.html</a></p>\n-<a name=\"creator()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcreator%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcreator%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"creator\">\n-<h2>creator()</h2>\n-<pre class=\"literal-block\">\n-const std::string& <strong>creator</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">creator()</tt> returns the creator string in the torrent. If there is\n-no creator string it will return an empty string.</p>\n-<a name=\"comment()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcomment%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcomment%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"comment\">\n-<h2>comment()</h2>\n-<pre class=\"literal-block\">\n-const std::string& <strong>comment</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">comment()</tt> 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.</p>\n-<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"nodes\">\n-<h2>nodes()</h2>\n-<pre class=\"literal-block\">\n-std::vector<std::pair<std::string, int>> const& <strong>nodes</strong> () const;\n-</pre>\n-<p>If this torrent contains any DHT nodes, they are put in this vector in\n-their original form (host name and port number).</p>\n-<a name=\"add_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-node\">\n-<h2>add_node()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_node</strong> (std::pair<std::string, int> const& node);\n-</pre>\n-<p>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.</p>\n-<a name=\"parse_info_section()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bparse_info_section%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bparse_info_section%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"parse-info-section\">\n-<h2>parse_info_section()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>parse_info_section</strong> (bdecode_node const& info, error_code& ec, int max_pieces);\n-</pre>\n-<p>populates the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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 <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> <tt class=\"docutils literal\">e</tt> points to a\n-parsed info-dictionary. <tt class=\"docutils literal\">ec</tt> returns an error code if something\n-fails (typically if the info dictionary is malformed).\n-The <cite>max_pieces</cite> 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 <a class=\"reference external\" href=\"reference-Settings.html#max_piece_count\">settings_pack::max_piece_count</a> and in calls to\n-<a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a>.</p>\n-<a name=\"info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info\">\n-<h2>info()</h2>\n-<pre class=\"literal-block\">\n-bdecode_node <strong>info</strong> (char const* key) const;\n-</pre>\n-<p>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.</p>\n-<a name=\"info_section()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_section%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_section%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"info-section\">\n-<h2>info_section()</h2>\n-<pre class=\"literal-block\">\n-span<char const> <strong>info_section</strong> () const;\n-</pre>\n-<p>returns a the raw info section of the torrent file.\n-The underlying buffer is still owned by the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object</p>\n-<a name=\"piece_layer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_layer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_layer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-layer\">\n-<h2>piece_layer()</h2>\n-<pre class=\"literal-block\">\n-span<char const> <strong>piece_layer</strong> (file_index_t) const;\n-</pre>\n-<p>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.</p>\n-<a name=\"free_piece_layers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bfree_piece_layers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bfree_piece_layers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"free-piece-layers\">\n-<h2>free_piece_layers()</h2>\n-<pre class=\"literal-block\">\n-void <strong>free_piece_layers</strong> ();\n-</pre>\n-<p>clears the piece layers from the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>. This is done by the\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n-<a name=\"hasher\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hasher&labels=documentation&body=Documentation+under+heading+%22class+hasher%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"hasher\">\n-<h1>hasher</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/hasher.hpp\">libtorrent/hasher.hpp</a>"</p>\n-<p>this is a SHA-1 hash class.</p>\n-<p>You use it by first instantiating it, then call <tt class=\"docutils literal\">update()</tt> 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 <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> parts of it at a time. When\n-You have fed the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> with all the data, you call <tt class=\"docutils literal\">final()</tt> and it\n-will return the sha1-hash of the data.</p>\n-<p>The constructor that takes a <tt class=\"docutils literal\">char const*</tt> and an integer will construct the\n-sha1 context and feed it the data passed in.</p>\n-<p>If you want to reuse the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> object once you have created a hash, you have to\n-call <tt class=\"docutils literal\">reset()</tt> to reinitialize it.</p>\n-<p>The built-in software version of sha1-algorithm was implemented\n-by Steve Reid and released as public domain.\n-For more info, see <tt class=\"docutils literal\">src/sha1.cpp</tt>.</p>\n-<pre class=\"literal-block\">\n-class hasher\n-{\n- <strong>hasher</strong> ();\n- hasher& <strong>operator=</strong> (hasher const&) &;\n- <strong>hasher</strong> (char const* data, int len);\n- explicit <strong>hasher</strong> (span<char const> data);\n- <strong>hasher</strong> (hasher const&);\n- hasher& <strong>update</strong> (span<char const> data);\n- hasher& <strong>update</strong> (char const* data, int len);\n- sha1_hash <strong>final</strong> ();\n- void <strong>reset</strong> ();\n-};\n-</pre>\n-<a name=\"operator=()\"></a>\n-<a name=\"hasher()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher\">\n-<h2>operator=() hasher()</h2>\n-<pre class=\"literal-block\">\n-hasher& <strong>operator=</strong> (hasher const&) &;\n-<strong>hasher</strong> (char const* data, int len);\n-explicit <strong>hasher</strong> (span<char const> data);\n-<strong>hasher</strong> (hasher const&);\n-</pre>\n-<p>this is the same as default constructing followed by a call to\n-<tt class=\"docutils literal\">update(data, len)</tt>.</p>\n-<a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"update\">\n-<h2>update()</h2>\n-<pre class=\"literal-block\">\n-hasher& <strong>update</strong> (span<char const> data);\n-hasher& <strong>update</strong> (char const* data, int len);\n-</pre>\n-<p>append the following bytes to what is being hashed</p>\n-<a name=\"final()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bfinal%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bfinal%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"final\">\n-<h2>final()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>final</strong> ();\n-</pre>\n-<p>returns the SHA-1 digest of the buffers previously passed to\n-<a class=\"reference external\" href=\"reference-Utility.html#update()\">update()</a> and the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> constructor.</p>\n-<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reset\">\n-<h2>reset()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reset</strong> ();\n-</pre>\n-<p>restore the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> state to be as if the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> has just been\n-default constructed.</p>\n-<a name=\"hasher256\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hasher256&labels=documentation&body=Documentation+under+heading+%22class+hasher256%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"hasher256\">\n-<h1>hasher256</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/hasher.hpp\">libtorrent/hasher.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-class hasher256\n-{\n- <strong>hasher256</strong> ();\n- <strong>hasher256</strong> (hasher256 const&);\n- explicit <strong>hasher256</strong> (span<char const> data);\n- <strong>hasher256</strong> (char const* data, int len);\n- hasher256& <strong>operator=</strong> (hasher256 const&) &;\n- hasher256& <strong>update</strong> (span<char const> data);\n- hasher256& <strong>update</strong> (char const* data, int len);\n- sha256_hash <strong>final</strong> ();\n- void <strong>reset</strong> ();\n- <strong>~hasher256</strong> ();\n-};\n-</pre>\n-<a name=\"operator=()\"></a>\n-<a name=\"hasher256()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher256\">\n-<h2>operator=() hasher256()</h2>\n-<pre class=\"literal-block\">\n-<strong>hasher256</strong> (hasher256 const&);\n-explicit <strong>hasher256</strong> (span<char const> data);\n-<strong>hasher256</strong> (char const* data, int len);\n-hasher256& <strong>operator=</strong> (hasher256 const&) &;\n-</pre>\n-<p>this is the same as default constructing followed by a call to\n-<tt class=\"docutils literal\">update(data, len)</tt>.</p>\n-<a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"update-1\">\n-<h2>update()</h2>\n-<pre class=\"literal-block\">\n-hasher256& <strong>update</strong> (span<char const> data);\n-hasher256& <strong>update</strong> (char const* data, int len);\n-</pre>\n-<p>append the following bytes to what is being hashed</p>\n-<a name=\"final()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bfinal%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bfinal%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"final-1\">\n-<h2>final()</h2>\n-<pre class=\"literal-block\">\n-sha256_hash <strong>final</strong> ();\n-</pre>\n-<p>returns the SHA-1 digest of the buffers previously passed to\n-<a class=\"reference external\" href=\"reference-Utility.html#update()\">update()</a> and the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> constructor.</p>\n-<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reset-1\">\n-<h2>reset()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reset</strong> ();\n-</pre>\n-<p>restore the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> state to be as if the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> has just been\n-default constructed.</p>\n-<a name=\"bitfield\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bitfield&labels=documentation&body=Documentation+under+heading+%22class+bitfield%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"bitfield\">\n-<h1>bitfield</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bitfield.hpp\">libtorrent/bitfield.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> type stores any number of bits as a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n-in a heap allocated array.</p>\n-<pre class=\"literal-block\">\n-struct bitfield\n-{\n- <strong>bitfield</strong> (int bits, bool val);\n- <strong>bitfield</strong> () noexcept = default;\n- explicit <strong>bitfield</strong> (int bits);\n- <strong>bitfield</strong> (char const* b, int bits);\n- <strong>bitfield</strong> (bitfield const& rhs);\n- <strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n- void <strong>assign</strong> (char const* b, int const bits);\n- bool <strong>operator[]</strong> (int index) const noexcept;\n- bool <strong>get_bit</strong> (int index) const noexcept;\n- void <strong>clear_bit</strong> (int index) noexcept;\n- void <strong>set_bit</strong> (int index) noexcept;\n- bool <strong>all_set</strong> () const noexcept;\n- bool <strong>none_set</strong> () const noexcept;\n- int <strong>size</strong> () const noexcept;\n- int <strong>num_words</strong> () const noexcept;\n- int <strong>num_bytes</strong> () const noexcept;\n- bool <strong>empty</strong> () const noexcept;\n- char* <strong>data</strong> () noexcept;\n- char const* <strong>data</strong> () const noexcept;\n- void <strong>swap</strong> (bitfield& rhs) noexcept;\n- int <strong>count</strong> () const noexcept;\n- int <strong>find_first_set</strong> () const noexcept;\n- int <strong>find_last_clear</strong> () const noexcept;\n- bool <strong>operator==</strong> (lt::bitfield const& rhs) const;\n-};\n-</pre>\n-<a name=\"bitfield()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bbitfield%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bbitfield%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bitfield-1\">\n-<h2>bitfield()</h2>\n-<pre class=\"literal-block\">\n-<strong>bitfield</strong> (int bits, bool val);\n-<strong>bitfield</strong> () noexcept = default;\n-explicit <strong>bitfield</strong> (int bits);\n-<strong>bitfield</strong> (char const* b, int bits);\n-<strong>bitfield</strong> (bitfield const& rhs);\n-<strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n-</pre>\n-<p>constructs a new <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. The default constructor creates an empty\n-<a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. <tt class=\"docutils literal\">bits</tt> is the size of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> (specified in bits).\n-<tt class=\"docutils literal\">val</tt> is the value to initialize the bits to. If not specified\n-all bits are initialized to 0.</p>\n-<p>The constructor taking a pointer <tt class=\"docutils literal\">b</tt> and <tt class=\"docutils literal\">bits</tt> copies a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n-from the specified buffer, and <tt class=\"docutils literal\">bits</tt> number of bits (rounded up to\n-the nearest byte boundary).</p>\n-<a name=\"assign()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bassign%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bassign%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"assign\">\n-<h2>assign()</h2>\n-<pre class=\"literal-block\">\n-void <strong>assign</strong> (char const* b, int const bits);\n-</pre>\n-<p>copy <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> from buffer <tt class=\"docutils literal\">b</tt> of <tt class=\"docutils literal\">bits</tt> number of bits, rounded up to\n-the nearest byte boundary.</p>\n-<a name=\"operator[]()\"></a>\n-<a name=\"get_bit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Boperator%5B%5D%28%29+get_bit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Boperator%5B%5D%28%29+get_bit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-get-bit\">\n-<h2>operator[]() get_bit()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>operator[]</strong> (int index) const noexcept;\n-bool <strong>get_bit</strong> (int index) const noexcept;\n-</pre>\n-<p>query bit at <tt class=\"docutils literal\">index</tt>. Returns true if bit is 1, otherwise false.</p>\n-<a name=\"clear_bit()\"></a>\n-<a name=\"set_bit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bclear_bit%28%29+set_bit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bclear_bit%28%29+set_bit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-bit-set-bit\">\n-<h2>clear_bit() set_bit()</h2>\n-<pre class=\"literal-block\">\n-void <strong>clear_bit</strong> (int index) noexcept;\n-void <strong>set_bit</strong> (int index) noexcept;\n-</pre>\n-<p>set bit at <tt class=\"docutils literal\">index</tt> to 0 (clear_bit) or 1 (set_bit).</p>\n-<a name=\"all_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Ball_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Ball_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"all-set\">\n-<h2>all_set()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>all_set</strong> () const noexcept;\n-</pre>\n-<p>returns true if all bits in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> are set</p>\n-<a name=\"none_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnone_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnone_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"none-set\">\n-<h2>none_set()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>none_set</strong> () const noexcept;\n-</pre>\n-<p>returns true if no bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> is set</p>\n-<a name=\"size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bsize%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bsize%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"size\">\n-<h2>size()</h2>\n-<pre class=\"literal-block\">\n-int <strong>size</strong> () const noexcept;\n-</pre>\n-<p>returns the size of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> in bits.</p>\n-<a name=\"num_words()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnum_words%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnum_words%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-words\">\n-<h2>num_words()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_words</strong> () const noexcept;\n-</pre>\n-<p>returns the number of 32 bit words are needed to represent all bits in\n-this <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>.</p>\n-<a name=\"num_bytes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnum_bytes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnum_bytes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-bytes\">\n-<h2>num_bytes()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_bytes</strong> () const noexcept;\n-</pre>\n-<p>returns the number of bytes needed to represent all bits in this\n-<a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a></p>\n-<a name=\"empty()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bempty%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bempty%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"empty\">\n-<h2>empty()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>empty</strong> () const noexcept;\n-</pre>\n-<p>returns true if the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> has zero size.</p>\n-<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"data\">\n-<h2>data()</h2>\n-<pre class=\"literal-block\">\n-char* <strong>data</strong> () noexcept;\n-char const* <strong>data</strong> () const noexcept;\n-</pre>\n-<p>returns a pointer to the internal buffer of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, or\n-<tt class=\"docutils literal\">nullptr</tt> if it's empty.</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (bitfield& rhs) noexcept;\n-</pre>\n-<p>swaps the bit-fields two variables refer to</p>\n-<a name=\"count()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bcount%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bcount%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"count\">\n-<h2>count()</h2>\n-<pre class=\"literal-block\">\n-int <strong>count</strong> () const noexcept;\n-</pre>\n-<p>count the number of bits in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> that are set to 1.</p>\n-<a name=\"find_first_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bfind_first_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bfind_first_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"find-first-set\">\n-<h2>find_first_set()</h2>\n-<pre class=\"literal-block\">\n-int <strong>find_first_set</strong> () const noexcept;\n-</pre>\n-<p>returns the index of the first set bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, i.e. 1 bit.</p>\n-<a name=\"find_last_clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bfind_last_clear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bfind_last_clear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"find-last-clear\">\n-<h2>find_last_clear()</h2>\n-<pre class=\"literal-block\">\n-int <strong>find_last_clear</strong> () const noexcept;\n-</pre>\n-<p>returns the index to the last cleared bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, i.e. 0 bit.</p>\n-<a name=\"session_proxy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_proxy&labels=documentation&body=Documentation+under+heading+%22class+session_proxy%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session-proxy\">\n-<h1>session_proxy</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n-<p>this is a holder for the internal <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> implementation object. Once the\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destruction is explicitly initiated, this holder is used to\n-synchronize the completion of the shutdown. The lifetime of this object\n-may outlive <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, causing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destructor to not block. The\n-<a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> destructor will block however, until the underlying <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n-is done shutting down.</p>\n-<pre class=\"literal-block\">\n-struct session_proxy\n-{\n- session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n- <strong>session_proxy</strong> (session_proxy&&) noexcept;\n- <strong>~session_proxy</strong> ();\n- <strong>session_proxy</strong> ();\n- <strong>session_proxy</strong> (session_proxy const&);\n- session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n-};\n-</pre>\n-<a name=\"operator=()\"></a>\n-<a name=\"session_proxy()\"></a>\n-<a name=\"~session_proxy()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_proxy%3A%3A%5Boperator%3D%28%29+session_proxy%28%29+~session_proxy%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_proxy%3A%3A%5Boperator%3D%28%29+session_proxy%28%29+~session_proxy%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-session-proxy-session-proxy\">\n-<h2>operator=() session_proxy() ~session_proxy()</h2>\n-<pre class=\"literal-block\">\n-session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n-<strong>session_proxy</strong> (session_proxy&&) noexcept;\n-<strong>~session_proxy</strong> ();\n-<strong>session_proxy</strong> ();\n-<strong>session_proxy</strong> (session_proxy const&);\n-session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n-</pre>\n-<p>default constructor, does not refer to any <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n-implementation object.</p>\n-<a name=\"session\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session&labels=documentation&body=Documentation+under+heading+%22class+session%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session\">\n-<h1>session</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n-<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the\n-<tt class=\"docutils literal\"><span class=\"pre\">session_handle::apply_settings()</span></tt> member function. To change one or more\n-configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>. object and fill it with\n-the settings to be set and pass it in to <tt class=\"docutils literal\"><span class=\"pre\">session::apply_settings()</span></tt>.</p>\n-<p>see <a class=\"reference external\" href=\"reference-Session.html#apply_settings()\">apply_settings()</a>.</p>\n-<pre class=\"literal-block\">\n-struct session : session_handle\n-{\n- <strong>session</strong> (session_params const& params, session_flags_t flags);\n- <strong>session</strong> ();\n- explicit <strong>session</strong> (session_params const& params);\n- explicit <strong>session</strong> (session_params&& params);\n- <strong>session</strong> (session_params&& params, session_flags_t flags);\n- <strong>session</strong> (session_params&& params, io_context& ios);\n- <strong>session</strong> (session_params const& params, io_context& ios);\n- <strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n- <strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n- <strong>~session</strong> ();\n- session_proxy <strong>abort</strong> ();\n-};\n-</pre>\n-<a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-1\">\n-<h2>session()</h2>\n-<pre class=\"literal-block\">\n-<strong>session</strong> (session_params const& params, session_flags_t flags);\n-<strong>session</strong> ();\n-explicit <strong>session</strong> (session_params const& params);\n-explicit <strong>session</strong> (session_params&& params);\n-<strong>session</strong> (session_params&& params, session_flags_t flags);\n-</pre>\n-<p>Constructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> objects which acts as the container of torrents.\n-In order to avoid a race condition between starting the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> and\n-configuring it, you can pass in a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. Its settings\n-will take effect before the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts up.</p>\n-<p>The overloads taking <tt class=\"docutils literal\">flags</tt> can be used to start a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> in\n-paused mode (by passing in <tt class=\"docutils literal\"><span class=\"pre\">session::paused</span></tt>). Note that\n-<tt class=\"docutils literal\">add_default_plugins</tt> do not have an affect on constructors that\n-take a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. It already contains the plugins to use.</p>\n-<a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-2\">\n-<h2>session()</h2>\n-<pre class=\"literal-block\">\n-<strong>session</strong> (session_params&& params, io_context& ios);\n-<strong>session</strong> (session_params const& params, io_context& ios);\n-<strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n-<strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n-</pre>\n-<p>Overload of the constructor that takes an external io_context to run\n-the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object does not cleanly terminate with an external\n-<tt class=\"docutils literal\">io_context</tt>. The <tt class=\"docutils literal\"><span class=\"pre\">io_context::run()</span></tt> call <em>must</em> have returned\n-before it's safe to destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Which means you <em>MUST</em>\n-call <a class=\"reference external\" href=\"reference-Session.html#abort()\">session::abort()</a> and save the <a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> first, then\n-destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object, then sync with the io_context, then\n-destruct the <a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> object.</p>\n-</div>\n-<a name=\"~session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5B~session%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5B~session%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-3\">\n-<h2>~session()</h2>\n-<pre class=\"literal-block\">\n-<strong>~session</strong> ();\n-</pre>\n-<p>The destructor of <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> returns. So, it's advised\n-that any kind of interface (such as windows) are closed before\n-destructing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. Because it can take a few second for\n-it to finish. The timeout can be set with <a class=\"reference external\" href=\"reference-Session.html#apply_settings()\">apply_settings()</a>.</p>\n-<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"abort\">\n-<h2>abort()</h2>\n-<pre class=\"literal-block\">\n-session_proxy <strong>abort</strong> ();\n-</pre>\n-<p>In case you want to destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> asynchronously, you can\n-request a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destruction proxy. If you don't do this, the\n-destructor of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object will block while the trackers are\n-contacted. If you keep one <tt class=\"docutils literal\">session_proxy</tt> to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when\n-destructing it, the destructor will not block, but start to close down\n-the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, the destructor of the proxy will then synchronize the\n-threads. So, the destruction of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is performed from the\n-<tt class=\"docutils literal\">session</tt> destructor call until the <tt class=\"docutils literal\">session_proxy</tt> destructor\n-call. The <tt class=\"docutils literal\">session_proxy</tt> does not have any operations on it (since\n-the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is being closed down, no operations are allowed on it).\n-The only valid operation is calling the destructor:</p>\n-<pre class=\"literal-block\">\n-struct session_proxy {};\n-</pre>\n-<a name=\"session_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_params&labels=documentation&body=Documentation+under+heading+%22class+session_params%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session-params\">\n-<h1>session_params</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> is a parameters pack for configuring the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n-before it's started.</p>\n-<pre class=\"literal-block\">\n-struct session_params\n-{\n- <strong>session_params</strong> (settings_pack const& sp);\n- <strong>session_params</strong> (settings_pack&& sp);\n- <strong>session_params</strong> ();\n- <strong>session_params</strong> (settings_pack const& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n- <strong>session_params</strong> (settings_pack&& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n-\n- settings_pack settings;\n- std::vector<std::shared_ptr<plugin>> extensions;\n- dht::dht_state dht_state;\n- dht::dht_storage_constructor_type dht_storage_constructor;\n- disk_io_constructor_type disk_io_constructor;\n- std::map<std::string, std::string> ext_state;\n- libtorrent::ip_filter ip_filter;\n-};\n-</pre>\n-<a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-params-1\">\n-<h2>session_params()</h2>\n-<pre class=\"literal-block\">\n-<strong>session_params</strong> (settings_pack const& sp);\n-<strong>session_params</strong> (settings_pack&& sp);\n-<strong>session_params</strong> ();\n-</pre>\n-<p>This constructor can be used to start with the default plugins\n-(ut_metadata, ut_pex and smart_ban). Pass a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> to set the\n-initial settings when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts.</p>\n-<a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-params-2\">\n-<h2>session_params()</h2>\n-<pre class=\"literal-block\">\n-<strong>session_params</strong> (settings_pack const& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n-<strong>session_params</strong> (settings_pack&& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n-</pre>\n-<p>This constructor helps to configure the set of initial plugins\n-to be added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> before it's started.</p>\n-<a name=\"settings\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsettings%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsettings%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>settings</dt>\n-<dd>The settings to configure the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with</dd>\n-</dl>\n-<a name=\"extensions\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bextensions%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bextensions%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>extensions</dt>\n-<dd>the plugins to add to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> as it is constructed</dd>\n-</dl>\n-<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdht_state%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdht_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dht_state</dt>\n-<dd>DHT node ID and node addresses to bootstrap the DHT with.</dd>\n-</dl>\n-<a name=\"dht_storage_constructor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdht_storage_constructor%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdht_storage_constructor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dht_storage_constructor</dt>\n-<dd>function object to construct the storage object for DHT items.</dd>\n-</dl>\n-<a name=\"disk_io_constructor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdisk_io_constructor%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdisk_io_constructor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>disk_io_constructor</dt>\n-<dd>function object to create the disk I/O subsystem. Defaults to\n-default_disk_io_constructor.</dd>\n-</dl>\n-<a name=\"ext_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bext_state%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bext_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ext_state</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a> and <a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a>.</dd>\n-</dl>\n-<a name=\"ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bip_filter%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bip_filter%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ip_filter</dt>\n-<dd>the IP filter to use for the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. This restricts which peers are allowed\n-to connect. As if passed to <a class=\"reference external\" href=\"reference-Session.html#set_ip_filter()\">set_ip_filter()</a>.</dd>\n-</dl>\n-<a name=\"session_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_handle&labels=documentation&body=Documentation+under+heading+%22class+session_handle%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session-handle\">\n-<h1>session_handle</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_handle.hpp\">libtorrent/session_handle.hpp</a>"</p>\n-<p>this class provides a non-owning handle to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> and a subset of the\n-interface of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> class. If the underlying <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is destructed\n-any handle to it will no longer be valid. <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> will return false and\n-any operation on it will throw a system_error exception, with error code\n-invalid_session_handle.</p>\n-<pre class=\"literal-block\">\n-struct session_handle\n-{\n- bool <strong>is_valid</strong> () const;\n- session_params <strong>session_state</strong> (save_state_flags_t flags = save_state_flags_t::all()) const;\n- void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n- , status_flags_t flags = {}) const;\n- std::vector<torrent_status> <strong>get_torrent_status</strong> (\n- std::function<bool(torrent_status const&)> const& pred\n- , status_flags_t flags = {}) const;\n- void <strong>post_torrent_updates</strong> (status_flags_t flags = status_flags_t::all());\n- void <strong>post_session_stats</strong> ();\n- void <strong>post_dht_stats</strong> ();\n- void <strong>set_dht_state</strong> (dht::dht_state&& st);\n- void <strong>set_dht_state</strong> (dht::dht_state const& st);\n- torrent_handle <strong>find_torrent</strong> (sha1_hash const& info_hash) const;\n- std::vector<torrent_handle> <strong>get_torrents</strong> () const;\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n- void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n- torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n- void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n- void <strong>resume</strong> ();\n- void <strong>pause</strong> ();\n- bool <strong>is_paused</strong> () const;\n- bool <strong>is_dht_running</strong> () const;\n- void <strong>set_dht_storage</strong> (dht::dht_storage_constructor_type sc);\n- void <strong>add_dht_node</strong> (std::pair<std::string, int> const& node);\n- void <strong>dht_get_item</strong> (sha1_hash const& target);\n- void <strong>dht_get_item</strong> (std::array<char, 32> key\n- , std::string salt = std::string());\n- sha1_hash <strong>dht_put_item</strong> (entry data);\n- void <strong>dht_put_item</strong> (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 <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n- void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n- void <strong>dht_live_nodes</strong> (sha1_hash const& nid);\n- void <strong>dht_sample_infohashes</strong> (udp::endpoint const& ep, sha1_hash const& target);\n- void <strong>dht_direct_request</strong> (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n- void <strong>add_extension</strong> (std::function<std::shared_ptr<torrent_plugin>(\n- torrent_handle const&, client_data_t)> ext);\n- void <strong>add_extension</strong> (std::shared_ptr<plugin> ext);\n- ip_filter <strong>get_ip_filter</strong> () const;\n- void <strong>set_ip_filter</strong> (ip_filter f);\n- void <strong>set_port_filter</strong> (port_filter const& f);\n- unsigned short <strong>listen_port</strong> () const;\n- bool <strong>is_listening</strong> () const;\n- unsigned short <strong>ssl_listen_port</strong> () const;\n- void <strong>set_peer_class_filter</strong> (ip_filter const& f);\n- ip_filter <strong>get_peer_class_filter</strong> () const;\n- void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n- peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n- peer_class_t <strong>create_peer_class</strong> (char const* name);\n- void <strong>delete_peer_class</strong> (peer_class_t cid);\n- void <strong>set_peer_class</strong> (peer_class_t cid, peer_class_info const& pci);\n- peer_class_info <strong>get_peer_class</strong> (peer_class_t cid) const;\n- void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n- void <strong>apply_settings</strong> (settings_pack&&);\n- settings_pack <strong>get_settings</strong> () const;\n- void <strong>apply_settings</strong> (settings_pack const&);\n- void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n- alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n- void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n- void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n- std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n- void <strong>reopen_network_sockets</strong> (reopen_network_flags_t options = reopen_map_ports);\n- std::shared_ptr<aux::session_impl> <strong>native_handle</strong> () const;\n-\n- static constexpr save_state_flags_t <strong>save_settings</strong> = 0_bit;\n- static constexpr save_state_flags_t <strong>save_dht_state</strong> = 2_bit;\n- static constexpr save_state_flags_t <strong>save_extension_state</strong> = 11_bit;\n- static constexpr save_state_flags_t <strong>save_ip_filter</strong> = 12_bit;\n- static constexpr peer_class_t <strong>global_peer_class_id</strong> {0};\n- static constexpr peer_class_t <strong>tcp_peer_class_id</strong> {1};\n- static constexpr peer_class_t <strong>local_peer_class_id</strong> {2};\n- static constexpr remove_flags_t <strong>delete_files</strong> = 0_bit;\n- static constexpr remove_flags_t <strong>delete_partfile</strong> = 1_bit;\n- static constexpr session_flags_t <strong>paused</strong> = 2_bit;\n- static constexpr portmap_protocol <strong>udp</strong> = portmap_protocol::udp;\n- static constexpr portmap_protocol <strong>tcp</strong> = portmap_protocol::tcp;\n- static constexpr reopen_network_flags_t <strong>reopen_map_ports</strong> = 0_bit;\n-};\n-</pre>\n-<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"is-valid-2\">\n-<h2>is_valid()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_valid</strong> () const;\n-</pre>\n-<p>returns true if this handle refers to a valid <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. If the\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> has been destroyed, all <a class=\"reference external\" href=\"reference-Session.html#session_handle\">session_handle</a> objects will expire and\n-not be valid.</p>\n-<a name=\"session_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsession_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsession_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-state\">\n-<h2>session_state()</h2>\n-<pre class=\"literal-block\">\n-session_params <strong>session_state</strong> (save_state_flags_t flags = save_state_flags_t::all()) const;\n-</pre>\n-<p>returns the current <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state. This can be passed to\n-<a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a> to save the state to disk and restored using\n-<a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a> when constructing a new <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state</p>\n-<a name=\"refresh_torrent_status()\"></a>\n-<a name=\"get_torrent_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Brefresh_torrent_status%28%29+get_torrent_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Brefresh_torrent_status%28%29+get_torrent_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"refresh-torrent-status-get-torrent-status\">\n-<h2>refresh_torrent_status() get_torrent_status()</h2>\n-<pre class=\"literal-block\">\n-void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n- , status_flags_t flags = {}) const;\n-std::vector<torrent_status> <strong>get_torrent_status</strong> (\n- std::function<bool(torrent_status const&)> const& pred\n- , status_flags_t flags = {}) const;\n-</pre>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">these calls are potentially expensive and won't scale well with\n-lots of torrents. If you're concerned about performance, consider\n-using <tt class=\"docutils literal\">post_torrent_updates()</tt> instead.</p>\n-</div>\n-<p><tt class=\"docutils literal\">get_torrent_status</tt> returns a vector of the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> for\n-every torrent which satisfies <tt class=\"docutils literal\">pred</tt>, 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 <tt class=\"docutils literal\">flags</tt> argument is the same as to\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>. Since <tt class=\"docutils literal\">pred</tt> 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.</p>\n-<p><tt class=\"docutils literal\">refresh_torrent_status</tt> takes a vector of <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> structs\n-(for instance the same vector that was returned by\n-<a class=\"reference external\" href=\"reference-Session.html#get_torrent_status()\">get_torrent_status()</a> ) and refreshes the status based on the\n-<tt class=\"docutils literal\">handle</tt> member. It is possible to use this function by first\n-setting up a vector of default constructed <tt class=\"docutils literal\">torrent_status</tt> objects,\n-only initializing the <tt class=\"docutils literal\">handle</tt> 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.</p>\n-<p>Any <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object whose <tt class=\"docutils literal\">handle</tt> member is not referring to\n-a valid torrent are ignored.</p>\n-<p>The intended use of these functions is to start off by calling\n-<tt class=\"docutils literal\">get_torrent_status()</tt> to get a list of all torrents that match your\n-criteria. Then call <tt class=\"docutils literal\">refresh_torrent_status()</tt> 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 <tt class=\"docutils literal\">get_torrent_status()</tt> 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.</p>\n-<a name=\"post_torrent_updates()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_torrent_updates%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_torrent_updates%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"post-torrent-updates\">\n-<h2>post_torrent_updates()</h2>\n-<pre class=\"literal-block\">\n-void <strong>post_torrent_updates</strong> (status_flags_t flags = status_flags_t::all());\n-</pre>\n-<p>This functions instructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> to post the <a class=\"reference external\" href=\"reference-Alerts.html#state_update_alert\">state_update_alert</a>,\n-containing the status of all torrents whose state changed since the\n-last time this function was called.</p>\n-<p>Only torrents who has the state subscription flag set will be\n-included. This flag is on by default. See <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.\n-the <tt class=\"docutils literal\">flags</tt> argument is the same as for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>.\n-see status_flags_t in <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>.</p>\n-<a name=\"post_session_stats()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_session_stats%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_session_stats%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"post-session-stats\">\n-<h2>post_session_stats()</h2>\n-<pre class=\"literal-block\">\n-void <strong>post_session_stats</strong> ();\n-</pre>\n-<p>This function will post a <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> object, containing a\n-snapshot of the performance <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> from the internals of libtorrent.\n-To interpret these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, query the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via\n-<a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a>.</p>\n-<p>For more information, see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n-<a name=\"post_dht_stats()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_dht_stats%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_dht_stats%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"post-dht-stats\">\n-<h2>post_dht_stats()</h2>\n-<pre class=\"literal-block\">\n-void <strong>post_dht_stats</strong> ();\n-</pre>\n-<p>This will cause a <a class=\"reference external\" href=\"reference-Alerts.html#dht_stats_alert\">dht_stats_alert</a> to be posted.</p>\n-<a name=\"set_dht_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_dht_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_dht_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-dht-state\">\n-<h2>set_dht_state()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_dht_state</strong> (dht::dht_state&& st);\n-void <strong>set_dht_state</strong> (dht::dht_state const& st);\n-</pre>\n-<p>set the DHT state for the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. This will be taken into account the\n-next time the DHT is started, as if it had been passed in via the\n-<a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> on startup.</p>\n-<a name=\"find_torrent()\"></a>\n-<a name=\"get_torrents()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bfind_torrent%28%29+get_torrents%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bfind_torrent%28%29+get_torrents%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"find-torrent-get-torrents\">\n-<h2>find_torrent() get_torrents()</h2>\n-<pre class=\"literal-block\">\n-torrent_handle <strong>find_torrent</strong> (sha1_hash const& info_hash) const;\n-std::vector<torrent_handle> <strong>get_torrents</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">find_torrent()</tt> looks for a torrent with the given info-hash. In\n-case there is such a torrent in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> to that\n-torrent is returned. In case the torrent cannot be found, an invalid\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is returned.</p>\n-<p>See <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::is_valid()</span></tt> to know if the torrent was found or\n-not.</p>\n-<p><tt class=\"docutils literal\">get_torrents()</tt> returns a vector of torrent_handles to all the\n-torrents currently in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n-<a name=\"add_torrent()\"></a>\n-<a name=\"async_add_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_torrent%28%29+async_add_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_torrent%28%29+async_add_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-torrent-async-add-torrent\">\n-<h2>add_torrent() async_add_torrent()</h2>\n-<pre class=\"literal-block\">\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n-void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n-torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n-void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n-</pre>\n-<p>You add torrents through the <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> function where you give an\n-object with all the parameters. The <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> overloads will block\n-until the torrent has been added (or failed to be added) and returns\n-an error code and a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>. In order to add torrents more\n-efficiently, consider using <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a> which returns\n-immediately, without waiting for the torrent to add. Notification of\n-the torrent being added is sent as <a class=\"reference external\" href=\"reference-Alerts.html#add_torrent_alert\">add_torrent_alert</a>.</p>\n-<p>The <tt class=\"docutils literal\">save_path</tt> field in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> must be set to a valid\n-path where the files for the torrent will be saved. Even when using a\n-custom storage, this needs to be set to something. If the save_path\n-is empty, the call to <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> will throw a system_error\n-exception.</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> returned by <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> can be used to retrieve\n-information about the torrent's progress, its peers etc. It is also\n-used to abort a torrent.</p>\n-<p>If the torrent you are trying to add already exists in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (is\n-either queued for checking, being checked or downloading)\n-<tt class=\"docutils literal\">add_torrent()</tt> will throw system_error which derives from\n-<tt class=\"docutils literal\"><span class=\"pre\">std::exception</span></tt> unless duplicate_is_error is set to false. In that\n-case, <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> will return the handle to the existing torrent.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> 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.</p>\n-<p>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 <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.</p>\n-<a name=\"is_paused()\"></a>\n-<a name=\"resume()\"></a>\n-<a name=\"pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_paused%28%29+resume%28%29+pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_paused%28%29+resume%28%29+pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-paused-resume-pause\">\n-<h2>is_paused() resume() pause()</h2>\n-<pre class=\"literal-block\">\n-void <strong>resume</strong> ();\n-void <strong>pause</strong> ();\n-bool <strong>is_paused</strong> () const;\n-</pre>\n-<p>Pausing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> pause state is separate from the torrent pause\n-state. A torrent is inactive if it is paused or if the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is\n-paused.</p>\n-<a name=\"is_dht_running()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_dht_running%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_dht_running%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-dht-running\">\n-<h2>is_dht_running()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_dht_running</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">is_dht_running()</tt> returns true if the DHT support has been started\n-and false otherwise.</p>\n-<a name=\"set_dht_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_dht_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_dht_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-dht-storage\">\n-<h2>set_dht_storage()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_dht_storage</strong> (dht::dht_storage_constructor_type sc);\n-</pre>\n-<p><tt class=\"docutils literal\">set_dht_storage</tt> set a dht custom storage constructor function\n-to be used internally when the dht is created.</p>\n-<p>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.</p>\n-<p>If you want to make sure the dht is initially created with your\n-custom storage, create a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with the setting\n-<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::enable_dht</span></tt> to false, set your constructor function\n-and call <tt class=\"docutils literal\">apply_settings</tt> with <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::enable_dht</span></tt> to true.</p>\n-<a name=\"add_dht_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_dht_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_dht_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-dht-node\">\n-<h2>add_dht_node()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_dht_node</strong> (std::pair<std::string, int> const& node);\n-</pre>\n-<p><tt class=\"docutils literal\">add_dht_node</tt> 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.</p>\n-<a name=\"dht_get_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-get-item\">\n-<h2>dht_get_item()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_get_item</strong> (sha1_hash const& target);\n-</pre>\n-<p>query the DHT for an immutable item at the <tt class=\"docutils literal\">target</tt> hash.\n-the result is posted as a <a class=\"reference external\" href=\"reference-Alerts.html#dht_immutable_item_alert\">dht_immutable_item_alert</a>.</p>\n-<a name=\"dht_get_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-get-item-1\">\n-<h2>dht_get_item()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_get_item</strong> (std::array<char, 32> key\n- , std::string salt = std::string());\n-</pre>\n-<p>query the DHT for a mutable item under the public key <tt class=\"docutils literal\">key</tt>.\n-this is an ed25519 key. <tt class=\"docutils literal\">salt</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#dht_mutable_item_alert\">dht_mutable_item_alert</a> is\n-posted.</p>\n-<a name=\"dht_put_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_put_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_put_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-put-item\">\n-<h2>dht_put_item()</h2>\n-<pre class=\"literal-block\">\n-sha1_hash <strong>dht_put_item</strong> (entry data);\n-</pre>\n-<p>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.</p>\n-<a name=\"dht_put_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_put_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_put_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-put-item-1\">\n-<h2>dht_put_item()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_put_item</strong> (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-</pre>\n-<p>store a mutable item. The <tt class=\"docutils literal\">key</tt> is the public key the blob is\n-to be stored under. The optional <tt class=\"docutils literal\">salt</tt> 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:</p>\n-<dl class=\"docutils\">\n-<dt>entry& value</dt>\n-<dd>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.</dd>\n-<dt>std::array<char,64>& signature</dt>\n-<dd>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-<tt class=\"docutils literal\">sign_mutable_item</tt> function.</dd>\n-<dt>std::int64_t& seq</dt>\n-<dd>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.</dd>\n-<dt>std::string const& salt</dt>\n-<dd>this is the salt that was used for this put call.</dd>\n-</dl>\n-<p>Since the callback function <tt class=\"docutils literal\">cb</tt> 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 <em>update</em> 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.</p>\n-<a name=\"dht_get_peers()\"></a>\n-<a name=\"dht_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_peers%28%29+dht_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_peers%28%29+dht_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-get-peers-dht-announce\">\n-<h2>dht_get_peers() dht_announce()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n-void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n-</pre>\n-<p><tt class=\"docutils literal\">dht_get_peers()</tt> 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-<a class=\"reference external\" href=\"reference-Alerts.html#dht_get_peers_reply_alert\">dht_get_peers_reply_alert</a>.</p>\n-<p><tt class=\"docutils literal\">dht_announce()</tt> 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-<tt class=\"docutils literal\">dht_announce()</tt> is not affected by the <tt class=\"docutils literal\">announce_port</tt> override setting.</p>\n-<p>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.</p>\n-<p>For possible flags, see <a class=\"reference external\" href=\"reference-DHT.html#announce_flags_t\">announce_flags_t</a>.</p>\n-<a name=\"dht_live_nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_live_nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_live_nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-live-nodes\">\n-<h2>dht_live_nodes()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_live_nodes</strong> (sha1_hash const& nid);\n-</pre>\n-<p>Retrieve all the live DHT (identified by <tt class=\"docutils literal\">nid</tt>) nodes. All the\n-nodes id and endpoint will be returned in the list of nodes in the\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> <tt class=\"docutils literal\">dht_live_nodes_alert</tt>.\n-Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit call, it will always be\n-posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n-<a name=\"dht_sample_infohashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_sample_infohashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_sample_infohashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-sample-infohashes\">\n-<h2>dht_sample_infohashes()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_sample_infohashes</strong> (udp::endpoint const& ep, sha1_hash const& target);\n-</pre>\n-<p>Query the DHT node specified by <tt class=\"docutils literal\">ep</tt> to retrieve a sample of the\n-info-hashes that the node currently have in their storage.\n-The <tt class=\"docutils literal\">target</tt> 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 <tt class=\"docutils literal\">dht_sample_infohashes_alert</tt>.</p>\n-<a name=\"dht_direct_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_direct_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_direct_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-direct-request\">\n-<h2>dht_direct_request()</h2>\n-<pre class=\"literal-block\">\n-void <strong>dht_direct_request</strong> (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#dht_direct_response_alert\">dht_direct_response_alert</a> will be posted\n-with the response (if any) and the userdata pointer passed in here.\n-Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit call, it will always be\n-posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n-<a name=\"add_extension()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_extension%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_extension%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-extension-1\">\n-<h2>add_extension()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_extension</strong> (std::function<std::shared_ptr<torrent_plugin>(\n- torrent_handle const&, client_data_t)> ext);\n-void <strong>add_extension</strong> (std::shared_ptr<plugin> ext);\n-</pre>\n-<p>This function adds an extension to this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The argument is a\n-function object that is called with a <tt class=\"docutils literal\">torrent_handle</tt> and which should\n-return a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr<torrent_plugin></span></tt>. To write custom\n-plugins, see <a class=\"reference external\" href=\"reference-Plugins.html\">libtorrent plugins</a>. For the typical bittorrent client\n-all of these extensions should be added. The main plugins implemented\n-in libtorrent are:</p>\n-<dl class=\"docutils\">\n-<dt>uTorrent metadata</dt>\n-<dd>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.</dd>\n-</dl>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/ut_metadata.hpp></span><span class=\"comment preproc\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_ut_metadata_plugin</span><span class=\"punctuation\">);</span>\n-</pre>\n-<dl class=\"docutils\">\n-<dt>uTorrent peer exchange</dt>\n-<dd>Exchanges peers between clients.</dd>\n-</dl>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/ut_pex.hpp></span><span class=\"comment preproc\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_ut_pex_plugin</span><span class=\"punctuation\">);</span>\n-</pre>\n-<dl class=\"docutils\">\n-<dt>smart ban <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a></dt>\n-<dd>A <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</dd>\n-</dl>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/smart_ban.hpp></span><span class=\"comment preproc\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_smart_ban_plugin</span><span class=\"punctuation\">);</span>\n-</pre>\n-<a name=\"set_ip_filter()\"></a>\n-<a name=\"get_ip_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-ip-filter-get-ip-filter\">\n-<h2>set_ip_filter() get_ip_filter()</h2>\n-<pre class=\"literal-block\">\n-ip_filter <strong>get_ip_filter</strong> () const;\n-void <strong>set_ip_filter</strong> (ip_filter f);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n-<p>Each time a peer is blocked because of the IP filter, a\n-<a class=\"reference external\" href=\"reference-Alerts.html#peer_blocked_alert\">peer_blocked_alert</a> is generated. <tt class=\"docutils literal\">get_ip_filter()</tt> Returns the\n-<a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a> currently in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. See <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n-<a name=\"set_port_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_port_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_port_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-port-filter\">\n-<h2>set_port_filter()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_port_filter</strong> (port_filter const& f);\n-</pre>\n-<p>apply <a class=\"reference external\" href=\"reference-Filter.html#port_filter\">port_filter</a> <tt class=\"docutils literal\">f</tt> 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.</p>\n-<a name=\"listen_port()\"></a>\n-<a name=\"is_listening()\"></a>\n-<a name=\"ssl_listen_port()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Blisten_port%28%29+is_listening%28%29+ssl_listen_port%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Blisten_port%28%29+is_listening%28%29+ssl_listen_port%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"listen-port-is-listening-ssl-listen-port\">\n-<h2>listen_port() is_listening() ssl_listen_port()</h2>\n-<pre class=\"literal-block\">\n-unsigned short <strong>listen_port</strong> () const;\n-bool <strong>is_listening</strong> () const;\n-unsigned short <strong>ssl_listen_port</strong> () const;\n-</pre>\n-<p><tt class=\"docutils literal\">is_listening()</tt> will tell you whether or not the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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-<a class=\"reference external\" href=\"reference-Settings.html#listen_interfaces\">settings_pack::listen_interfaces</a> to try another interface and port to\n-bind to.</p>\n-<p><tt class=\"docutils literal\">listen_port()</tt> returns the port we ended up listening on.</p>\n-<a name=\"get_peer_class_filter()\"></a>\n-<a name=\"set_peer_class_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_peer_class_filter%28%29+set_peer_class_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_peer_class_filter%28%29+set_peer_class_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-peer-class-filter-set-peer-class-filter\">\n-<h2>get_peer_class_filter() set_peer_class_filter()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_peer_class_filter</strong> (ip_filter const& f);\n-ip_filter <strong>get_peer_class_filter</strong> () const;\n-</pre>\n-<p>Sets the peer class filter for this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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.</p>\n-<p>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.</p>\n-<p>For more info, see <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n-<p>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:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">ip_filter</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">get_peer_class_filter</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"name\">peer_class_t</span><span class=\"whitespace\"> </span><span class=\"name\">my_class</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">create_peer_class</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.x.x IP range"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"name\">f</span><span class=\"punctuation\">.</span><span class=\"name\">add_rule</span><span class=\"punctuation\">(</span><span class=\"name\">make_address</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.1.0"</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">make_address</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.255.255"</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">uint32_t</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">my_class</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">set_peer_class_filter</span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">);</span>\n-</pre>\n-<p>This setting only applies to new connections, it won't affect existing\n-peer connections.</p>\n-<p>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.</p>\n-<p>The <tt class=\"docutils literal\">peer_class</tt> argument cannot be greater than 31. The bitmasks\n-representing peer classes in the <tt class=\"docutils literal\">peer_class_filter</tt> are 32 bits.</p>\n-<p>The <tt class=\"docutils literal\">get_peer_class_filter()</tt> function returns the current filter.</p>\n-<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"set_peer_class_type_filter()\"></a>\n-<a name=\"get_peer_class_type_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-peer-class-type-filter-get-peer-class-type-filter\">\n-<h2>set_peer_class_type_filter() get_peer_class_type_filter()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n-peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n-</pre>\n-<p>Sets and gets the <em>peer class type filter</em>. This is controls automatic\n-peer class assignments to peers based on what kind of socket it is.</p>\n-<p>It does not only support assigning peer classes, it also supports\n-removing peer classes based on socket type.</p>\n-<p>The order of these rules being applied are:</p>\n-<ol class=\"arabic simple\">\n-<li>peer-class IP filter</li>\n-<li>peer-class type filter, removing classes</li>\n-<li>peer-class type filter, adding classes</li>\n-</ol>\n-<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"create_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bcreate_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bcreate_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"create-peer-class\">\n-<h2>create_peer_class()</h2>\n-<pre class=\"literal-block\">\n-peer_class_t <strong>create_peer_class</strong> (char const* name);\n-</pre>\n-<p>Creates a new peer class (see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>) 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.</p>\n-<p>Identifiers are assigned from low numbers to higher. So if you plan on\n-using certain peer classes in a call to <a class=\"reference external\" href=\"reference-Session.html#set_peer_class_filter()\">set_peer_class_filter()</a>,\n-make sure to create those early on, to get low identifiers.</p>\n-<p>For more information on peer classes, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"delete_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"delete-peer-class\">\n-<h2>delete_peer_class()</h2>\n-<pre class=\"literal-block\">\n-void <strong>delete_peer_class</strong> (peer_class_t cid);\n-</pre>\n-<p>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 <strong>once</strong> per peer class you create.\n-Calling it more than once for the same class will lead to memory\n-corruption.</p>\n-<p>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.</p>\n-<p>There is no need to call this function for custom peer classes. All\n-peer classes will be properly destructed when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object\n-destructs.</p>\n-<p>For more information on peer classes, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"get_peer_class()\"></a>\n-<a name=\"set_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_peer_class%28%29+set_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_peer_class%28%29+set_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-peer-class-set-peer-class\">\n-<h2>get_peer_class() set_peer_class()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_peer_class</strong> (peer_class_t cid, peer_class_info const& pci);\n-peer_class_info <strong>get_peer_class</strong> (peer_class_t cid) const;\n-</pre>\n-<p>These functions queries information from a peer class and updates the\n-configuration of a peer class, respectively.</p>\n-<p><tt class=\"docutils literal\">cid</tt> must refer to an existing peer class. If it does not, the\n-return value of <tt class=\"docutils literal\">get_peer_class()</tt> is undefined.</p>\n-<p><tt class=\"docutils literal\">set_peer_class()</tt> sets all the information in the\n-<a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_info\">peer_class_info</a> object in the specified peer class. There is no\n-option to only update a single property.</p>\n-<p>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.</p>\n-<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"remove_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bremove_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bremove_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"remove-torrent\">\n-<h2>remove_torrent()</h2>\n-<pre class=\"literal-block\">\n-void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n-</pre>\n-<p><tt class=\"docutils literal\">remove_torrent()</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a>.</p>\n-<p><a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> is non-blocking, but will remove the torrent from the\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> synchronously. Calling <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">session_handle::add_torrent()</a> 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.</p>\n-<p>The optional second argument <tt class=\"docutils literal\">options</tt> can be used to delete all the\n-files downloaded by this torrent. To do so, pass in the value\n-<tt class=\"docutils literal\"><span class=\"pre\">session_handle::delete_files</span></tt>. Once the torrent is deleted, a\n-<a class=\"reference external\" href=\"reference-Alerts.html#torrent_deleted_alert\">torrent_deleted_alert</a> is posted.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> remains valid for some time after <a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> 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-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#is_valid()\">torrent_handle::is_valid()</a> will return true, and other calls such\n-as <a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a> will succeed. Because of this, and because\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#remove_torrent()\">remove_torrent()</a> is non-blocking, the following sequence usually\n-succeeds (does not throw system_error):\n-.. code:: c++</p>\n-<blockquote>\n-session.remove_handle(handle);\n-handle.save_resume_data();</blockquote>\n-<p>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.</p>\n-<a name=\"apply_settings()\"></a>\n-<a name=\"get_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bapply_settings%28%29+get_settings%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bapply_settings%28%29+get_settings%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"apply-settings-get-settings\">\n-<h2>apply_settings() get_settings()</h2>\n-<pre class=\"literal-block\">\n-void <strong>apply_settings</strong> (settings_pack&&);\n-settings_pack <strong>get_settings</strong> () const;\n-void <strong>apply_settings</strong> (settings_pack const&);\n-</pre>\n-<p>Applies the settings specified by the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> <tt class=\"docutils literal\">s</tt>. 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.</p>\n-<a name=\"pop_alerts()\"></a>\n-<a name=\"wait_for_alert()\"></a>\n-<a name=\"set_alert_notify()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpop_alerts%28%29+wait_for_alert%28%29+set_alert_notify%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpop_alerts%28%29+wait_for_alert%28%29+set_alert_notify%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"pop-alerts-wait-for-alert-set-alert-notify\">\n-<h2>pop_alerts() wait_for_alert() set_alert_notify()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n-alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n-void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n-</pre>\n-<p>Alerts is the main mechanism for libtorrent to report errors and\n-events. <tt class=\"docutils literal\">pop_alerts</tt> fills in the vector passed to it with pointers\n-to new alerts. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> still owns these alerts and they will stay\n-valid until the next time <tt class=\"docutils literal\">pop_alerts</tt> is called. You may not delete\n-the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> objects.</p>\n-<p>It is safe to call <tt class=\"docutils literal\">pop_alerts</tt> from multiple different threads, as\n-long as the alerts themselves are not accessed once another thread\n-calls <tt class=\"docutils literal\">pop_alerts</tt>. Doing this requires manual synchronization\n-between the popping threads.</p>\n-<p><tt class=\"docutils literal\">wait_for_alert</tt> will block the current thread for <tt class=\"docutils literal\">max_wait</tt> time\n-duration, or until another <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted. If an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is available\n-at the time of the call, it returns immediately. The returned <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-pointer is the head of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue. <tt class=\"docutils literal\">wait_for_alert</tt> does not\n-pop alerts from the queue, it merely peeks at it. The returned <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-will stay valid until <tt class=\"docutils literal\">pop_alerts</tt> is called twice. The first time\n-will pop it and the second will free it.</p>\n-<p>If there is no <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> in the queue and no <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> arrives within the\n-specified timeout, <tt class=\"docutils literal\">wait_for_alert</tt> returns nullptr.</p>\n-<p>In the python binding, <tt class=\"docutils literal\">wait_for_alert</tt> takes the number of\n-milliseconds to wait as an integer.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, see\n-<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::alert_queue_size</span></tt>.</p>\n-<p>Some alerts are considered so important that they are posted even when\n-the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue is full. Some alerts are considered mandatory and cannot\n-be disabled by the <tt class=\"docutils literal\">alert_mask</tt>. For instance,\n-<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> and <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_failed_alert\">save_resume_data_failed_alert</a> are always\n-posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n-<p>To control which alerts are posted, set the alert_mask\n-(<a class=\"reference external\" href=\"reference-Settings.html#alert_mask\">settings_pack::alert_mask</a>).</p>\n-<p>If the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue fills up to the point where alerts are dropped, this\n-will be indicated by a <a class=\"reference external\" href=\"reference-Alerts.html#alerts_dropped_alert\">alerts_dropped_alert</a>, which contains a bitmask\n-of which types of alerts were dropped. Generally it is a good idea to\n-make sure the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<p>the <tt class=\"docutils literal\">set_alert_notify</tt> function lets the client set a function object\n-to be invoked every time the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue goes from having 0 alerts to\n-1 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. 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 <tt class=\"docutils literal\">pop_alerts()</tt>. If the notify function fails\n-to do so, it won't be called again, until <tt class=\"docutils literal\">pop_alerts</tt> 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.</p>\n-<p>The type of an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is returned by the polymorphic function\n-<tt class=\"docutils literal\"><span class=\"pre\">alert::type()</span></tt> but can also be queries from a concrete type via\n-<tt class=\"docutils literal\"><span class=\"pre\">T::alert_type</span></tt>, as a static constant.</p>\n-<a name=\"add_port_mapping()\"></a>\n-<a name=\"delete_port_mapping()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-port-mapping-delete-port-mapping\">\n-<h2>add_port_mapping() delete_port_mapping()</h2>\n-<pre class=\"literal-block\">\n-void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n-std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The return values are all handles referring to the\n-port mappings that were just created. Pass them to <a class=\"reference external\" href=\"reference-Session.html#delete_port_mapping()\">delete_port_mapping()</a>\n-to remove them.</p>\n-<a name=\"reopen_network_sockets()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Breopen_network_sockets%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Breopen_network_sockets%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reopen-network-sockets\">\n-<h2>reopen_network_sockets()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reopen_network_sockets</strong> (reopen_network_flags_t options = reopen_map_ports);\n-</pre>\n-<p>Instructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> to reopen all listen and outgoing sockets.</p>\n-<p>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.</p>\n-<a name=\"native_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bnative_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bnative_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"native-handle-1\">\n-<h2>native_handle()</h2>\n-<pre class=\"literal-block\">\n-std::shared_ptr<aux::session_impl> <strong>native_handle</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"save_settings\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_settings%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_settings%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_settings</dt>\n-<dd>saves settings (i.e. the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>)</dd>\n-</dl>\n-<a name=\"save_dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_dht_state%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_dht_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_dht_state</dt>\n-<dd>saves dht state such as nodes and node-id, possibly accelerating\n-joining the DHT if provided at next <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> startup.</dd>\n-</dl>\n-<a name=\"save_extension_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_extension_state%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_extension_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_extension_state</dt>\n-<dd>load or save state from plugins</dd>\n-</dl>\n-<a name=\"save_ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_ip_filter%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_ip_filter%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_ip_filter</dt>\n-<dd>load or save the IP filter set on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></dd>\n-</dl>\n-<a name=\"global_peer_class_id\"></a>\n-<a name=\"tcp_peer_class_id\"></a>\n-<a name=\"local_peer_class_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bglobal_peer_class_id+tcp_peer_class_id+local_peer_class_id%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bglobal_peer_class_id+tcp_peer_class_id+local_peer_class_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>global_peer_class_id tcp_peer_class_id local_peer_class_id</dt>\n-<dd>built-in peer classes</dd>\n-</dl>\n-<a name=\"delete_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_files%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>delete_files</dt>\n-<dd>delete the files belonging to the torrent from disk.\n-including the part-file, if there is one</dd>\n-</dl>\n-<a name=\"delete_partfile\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_partfile%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_partfile%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>delete_partfile</dt>\n-<dd>delete just the part-file associated with this torrent</dd>\n-</dl>\n-<a name=\"paused\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpaused%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpaused%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>paused</dt>\n-<dd>when set, the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> will start paused. Call\n-<a class=\"reference external\" href=\"reference-Session.html#resume()\">session_handle::resume()</a> to start</dd>\n-</dl>\n-<a name=\"udp\"></a>\n-<a name=\"tcp\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Budp+tcp%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Budp+tcp%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>udp tcp</dt>\n-<dd>protocols used by <a class=\"reference external\" href=\"reference-Session.html#add_port_mapping()\">add_port_mapping()</a></dd>\n-</dl>\n-<a name=\"reopen_map_ports\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Breopen_map_ports%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Breopen_map_ports%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>reopen_map_ports</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"write_session_params_buf()\"></a>\n-<a name=\"read_session_params()\"></a>\n-<a name=\"write_session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_session_params_buf%28%29+read_session_params%28%29+write_session_params%28%29&labels=documentation&body=Documentation+under+heading+%22write_session_params_buf%28%29+read_session_params%28%29+write_session_params%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"write-session-params-buf-read-session-params-write-session-params\">\n-<h1>write_session_params_buf() read_session_params() write_session_params()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-session_params <strong>read_session_params</strong> (span<char const> buf\n- , save_state_flags_t flags = save_state_flags_t::all());\n-session_params <strong>read_session_params</strong> (bdecode_node const& e\n- , save_state_flags_t flags = save_state_flags_t::all());\n-std::vector<char> <strong>write_session_params_buf</strong> (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-entry <strong>write_session_params</strong> (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-</pre>\n-<p>These functions serialize and de-serialize a <tt class=\"docutils literal\">session_params</tt> object to and\n-from bencoded form. The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object is used to initialize a new\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> using the state from a previous one (or by programmatically configure\n-the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> up-front).\n-The flags parameter can be used to only save and load certain aspects of the\n-session's state.\n-The <tt class=\"docutils literal\">_buf</tt> suffix indicates the function operates on buffer rather than the\n-bencoded structure.\n-The torrents in a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> are not part of the <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> state, they have\n-to be restored separately.</p>\n-<a name=\"stats_metric\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+stats_metric&labels=documentation&body=Documentation+under+heading+%22class+stats_metric%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"stats-metric\">\n-<h1>stats_metric</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n-<p>describes one statistics metric from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information,\n-see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n-<pre class=\"literal-block\">\n-struct stats_metric\n-{\n- char const* name;\n- int value_index;\n- metric_type_t type;\n-};\n-</pre>\n-<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:stats_metric%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22stats_metric%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>name</dt>\n-<dd>the name of the counter or gauge</dd>\n-</dl>\n-<a name=\"value_index\"></a>\n-<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:stats_metric%3A%3A%5Bvalue_index+type%5D&labels=documentation&body=Documentation+under+heading+%22stats_metric%3A%3A%5Bvalue_index+type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>value_index type</dt>\n-<dd>the index into the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array, where the underlying value of\n-this counter or gauge is found. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array is part of the\n-<a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> object.</dd>\n-</dl>\n-<a name=\"counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+counters&labels=documentation&body=Documentation+under+heading+%22class+counters%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"counters\">\n-<h1>counters</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/performance_counters.hpp\">libtorrent/performance_counters.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-struct counters\n-{\n- <strong>counters</strong> () ;\n- <strong>counters</strong> (counters const&) ;\n- counters& <strong>operator=</strong> (counters const&) & ;\n- std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n- std::int64_t <strong>operator[]</strong> (int i) const ;\n- void <strong>blend_stats_counter</strong> (int c, std::int64_t value, int ratio) ;\n- void <strong>set_value</strong> (int c, std::int64_t value) ;\n-};\n-</pre>\n-<a name=\"operator[]()\"></a>\n-<a name=\"inc_stats_counter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-inc-stats-counter\">\n-<h2>operator[]() inc_stats_counter()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n-std::int64_t <strong>operator[]</strong> (int i) const ;\n-</pre>\n-<p>returns the new value</p>\n-<a name=\"session_stats_metrics()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_metrics%28%29&labels=documentation&body=Documentation+under+heading+%22session_stats_metrics%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session-stats-metrics\">\n-<h1>session_stats_metrics()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::vector<stats_metric> <strong>session_stats_metrics</strong> ();\n-</pre>\n-<p>This free function returns the list of available metrics exposed by\n-libtorrent's statistics API. Each metric has a name and a <em>value index</em>.\n-The value index is the index into the array in <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> where\n-this metric's value can be found when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats is sampled (by\n-calling <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a>).</p>\n-<a name=\"find_metric_idx()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:find_metric_idx%28%29&labels=documentation&body=Documentation+under+heading+%22find_metric_idx%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"find-metric-idx\">\n-<h1>find_metric_idx()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-int <strong>find_metric_idx</strong> (string_view name);\n-</pre>\n-<p>given a name of a metric, this function returns the counter index of it,\n-or -1 if it could not be found. The counter index is the index into the\n-values array returned by <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a>.</p>\n-<a name=\"metric_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+metric_type_t&labels=documentation&body=Documentation+under+heading+%22enum+metric_type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-metric-type-t\">\n-<h1>enum metric_type_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"31%\" />\n-<col width=\"24%\" />\n-<col width=\"45%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>counter</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>gauge</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+ip_filter&labels=documentation&body=Documentation+under+heading+%22class+ip_filter%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"ip-filter\">\n-<h1>ip_filter</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">ip_filter</tt> 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).</p>\n-<p>A default constructed <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a> does not filter any address.</p>\n-<pre class=\"literal-block\">\n-struct ip_filter\n-{\n- <strong>ip_filter</strong> ();\n- <strong>ip_filter</strong> (ip_filter&&);\n- <strong>ip_filter</strong> (ip_filter const&);\n- <strong>~ip_filter</strong> ();\n- ip_filter& <strong>operator=</strong> (ip_filter const&);\n- ip_filter& <strong>operator=</strong> (ip_filter&&);\n- bool <strong>empty</strong> () const;\n- void <strong>add_rule</strong> (address const& first, address const& last, std::uint32_t flags);\n- std::uint32_t <strong>access</strong> (address const& addr) const;\n- filter_tuple_t <strong>export_filter</strong> () const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-</pre>\n-<a name=\"empty()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Bempty%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Bempty%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"empty-1\">\n-<h2>empty()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>empty</strong> () const;\n-</pre>\n-<p>returns true if the filter does not contain any rules</p>\n-<a name=\"add_rule()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Badd_rule%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Badd_rule%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-rule\">\n-<h2>add_rule()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_rule</strong> (address const& first, address const& last, std::uint32_t flags);\n-</pre>\n-<p>Adds a rule to the filter. <tt class=\"docutils literal\">first</tt> and <tt class=\"docutils literal\">last</tt> defines a range of\n-ip addresses that will be marked with the given flags. The <tt class=\"docutils literal\">flags</tt>\n-can currently be 0, which means allowed, or <tt class=\"docutils literal\"><span class=\"pre\">ip_filter::blocked</span></tt>, which\n-means disallowed.</p>\n-<p>precondition:\n-<tt class=\"docutils literal\">first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()</tt></p>\n-<p>postcondition:\n-<tt class=\"docutils literal\">access(x) == flags</tt> for every <tt class=\"docutils literal\">x</tt> in the range [<tt class=\"docutils literal\">first</tt>, <tt class=\"docutils literal\">last</tt>]</p>\n-<p>This means that in a case of overlapping ranges, the last one applied takes\n-precedence.</p>\n-<a name=\"access()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Baccess%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Baccess%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"access\">\n-<h2>access()</h2>\n-<pre class=\"literal-block\">\n-std::uint32_t <strong>access</strong> (address const& addr) const;\n-</pre>\n-<p>Returns the access permissions for the given address (<tt class=\"docutils literal\">addr</tt>). The permission\n-can currently be 0 or <tt class=\"docutils literal\"><span class=\"pre\">ip_filter::blocked</span></tt>. The complexity of this operation\n-is O(<tt class=\"docutils literal\">log</tt> n), where n is the minimum number of non-overlapping ranges to describe\n-the current filter.</p>\n-<a name=\"export_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Bexport_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Bexport_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"export-filter\">\n-<h2>export_filter()</h2>\n-<pre class=\"literal-block\">\n-filter_tuple_t <strong>export_filter</strong> () const;\n-</pre>\n-<p>This function will return the current state of the filter in the minimum number of\n-ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n-<a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in the returned vector is a range with the access control specified in its\n-<tt class=\"docutils literal\">flags</tt> field.</p>\n-<p>The return value is a tuple containing two range-lists. One for IPv4 addresses\n-and one for IPv6 addresses.</p>\n-<a name=\"access_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+access_flags&labels=documentation&body=Documentation+under+heading+%22enum+access_flags%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-access-flags\">\n-<h2>enum access_flags</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"12%\" />\n-<col width=\"9%\" />\n-<col width=\"78%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>blocked</td>\n-<td>1</td>\n-<td>indicates that IPs in this range should not be connected\n-to nor accepted as incoming connections</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"port_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+port_filter&labels=documentation&body=Documentation+under+heading+%22class+port_filter%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"port-filter\">\n-<h1>port_filter</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-class port_filter\n-{\n- <strong>~port_filter</strong> ();\n- port_filter& <strong>operator=</strong> (port_filter const&);\n- <strong>port_filter</strong> (port_filter const&);\n- <strong>port_filter</strong> ();\n- port_filter& <strong>operator=</strong> (port_filter&&);\n- <strong>port_filter</strong> (port_filter&&);\n- void <strong>add_rule</strong> (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n- std::uint32_t <strong>access</strong> (std::uint16_t port) const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-</pre>\n-<a name=\"add_rule()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:port_filter%3A%3A%5Badd_rule%28%29%5D&labels=documentation&body=Documentation+under+heading+%22port_filter%3A%3A%5Badd_rule%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"add-rule-1\">\n-<h2>add_rule()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_rule</strong> (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-</pre>\n-<p>set the flags for the specified port range (<tt class=\"docutils literal\">first</tt>, <tt class=\"docutils literal\">last</tt>) to\n-<tt class=\"docutils literal\">flags</tt> overwriting any existing rule for those ports. The range\n-is inclusive, i.e. the port <tt class=\"docutils literal\">last</tt> also has the flag set on it.</p>\n-<a name=\"access()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:port_filter%3A%3A%5Baccess%28%29%5D&labels=documentation&body=Documentation+under+heading+%22port_filter%3A%3A%5Baccess%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"access-1\">\n-<h2>access()</h2>\n-<pre class=\"literal-block\">\n-std::uint32_t <strong>access</strong> (std::uint16_t port) const;\n-</pre>\n-<p>test the specified port (<tt class=\"docutils literal\">port</tt>) for whether it is blocked\n-or not. The returned value is the flags set for this port.\n-see <a class=\"reference external\" href=\"reference-Filter.html#access_flags\">access_flags</a>.</p>\n-<a name=\"access_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+access_flags&labels=documentation&body=Documentation+under+heading+%22enum+access_flags%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-access-flags-1\">\n-<h2>enum access_flags</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"13%\" />\n-<col width=\"10%\" />\n-<col width=\"76%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>blocked</td>\n-<td>1</td>\n-<td>this flag indicates that destination ports in the\n-range should not be connected to</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"client_data_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+client_data_t&labels=documentation&body=Documentation+under+heading+%22class+client_data_t%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"client-data-t\">\n-<h1>client_data_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/client_data.hpp\">libtorrent/client_data.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct client_data_t\n-{\n- <strong>client_data_t</strong> () = default;\n- explicit <strong>client_data_t</strong> (T* v);\n- client_data_t& <strong>operator=</strong> (T* v);\n- explicit operator <strong>T</strong> () const;\n- T* <strong>get</strong> () const;\n- client_data_t& <strong>operator=</strong> (void const*) = delete;\n- client_data_t& <strong>operator=</strong> (void*) = delete;\n- operator <strong>void*</strong> () const = delete;\n- operator void <strong>const*</strong> () const = delete;\n-\n- template <typename T, typename <strong>U</strong> = typename std::enable_if<std::is_pointer<T>::value>::type>\n-};\n-</pre>\n-<a name=\"client_data_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bclient_data_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bclient_data_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"client-data-t-1\">\n-<h2>client_data_t()</h2>\n-<pre class=\"literal-block\">\n-<strong>client_data_t</strong> () = default;\n-</pre>\n-<p>construct a nullptr client data</p>\n-<a name=\"const*()\"></a>\n-<a name=\"void*()\"></a>\n-<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bconst%2A%28%29+void%2A%28%29+operator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bconst%2A%28%29+void%2A%28%29+operator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"const-void-operator\">\n-<h2>const*() void*() operator=()</h2>\n-<pre class=\"literal-block\">\n-client_data_t& <strong>operator=</strong> (void const*) = delete;\n-client_data_t& <strong>operator=</strong> (void*) = delete;\n-operator <strong>void*</strong> () const = delete;\n-operator void <strong>const*</strong> () const = delete;\n-</pre>\n-<p>we don't allow type-unsafe operations</p>\n-<a name=\"add_torrent_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_params&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_params%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"add-torrent-params\">\n-<h1>add_torrent_params</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/add_torrent_params.hpp\">libtorrent/add_torrent_params.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> contains all the information in a .torrent file\n-along with all information necessary to add that torrent to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n-The key fields when adding a torrent are:</p>\n-<ul class=\"simple\">\n-<li>ti - the immutable info-dict part of the torrent</li>\n-<li>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.</li>\n-</ul>\n-<p>In order to add a torrent to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, one of those fields must be set\n-in addition to <tt class=\"docutils literal\">save_path</tt>. The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object can then be\n-passed into one of the <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent()</span></tt> overloads or\n-<tt class=\"docutils literal\"><span class=\"pre\">session::async_add_torrent()</span></tt>.</p>\n-<p>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 (<tt class=\"docutils literal\">TORRENT_DISABLE_EXTENSIONS</tt> must not be defined). It also\n-takes an optional <tt class=\"docutils literal\">name</tt> 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-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::name</span></tt>.</p>\n-<p>The <tt class=\"docutils literal\">add_torrent_params</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For serialization and de-serialization of\n-<tt class=\"docutils literal\">add_torrent_params</tt> objects, see <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> and\n-<a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>.</p>\n-<p>The <tt class=\"docutils literal\">add_torrent_params</tt> is also used to represent a parsed .torrent\n-file. It can be loaded via <a class=\"reference external\" href=\"reference-Core.html#load_torrent_file()\">load_torrent_file()</a>, <a class=\"reference external\" href=\"reference-Core.html#load_torrent_buffer()\">load_torrent_buffer()</a> and\n-<a class=\"reference external\" href=\"reference-Core.html#load_torrent_parsed()\">load_torrent_parsed()</a>. It can be saved via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a>.</p>\n-<pre class=\"literal-block\">\n-struct add_torrent_params\n-{\n- int <strong>version</strong> = 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 <strong>storage_mode</strong> = 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 <strong>flags</strong> = torrent_flags::default_flags;\n- info_hash_t info_hashes;\n- int <strong>max_uploads</strong> = -1;\n- int <strong>max_connections</strong> = -1;\n- int <strong>upload_limit</strong> = -1;\n- int <strong>download_limit</strong> = -1;\n- std::int64_t <strong>total_uploaded</strong> = 0;\n- std::int64_t <strong>total_downloaded</strong> = 0;\n- int <strong>active_time</strong> = 0;\n- int <strong>finished_time</strong> = 0;\n- int <strong>seeding_time</strong> = 0;\n- std::time_t <strong>added_time</strong> = 0;\n- std::time_t <strong>completed_time</strong> = 0;\n- std::time_t <strong>last_seen_complete</strong> = 0;\n- int <strong>num_complete</strong> = -1;\n- int <strong>num_incomplete</strong> = -1;\n- int <strong>num_downloaded</strong> = -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 <strong>last_download</strong> = 0;\n- std::time_t <strong>last_upload</strong> = 0;\n-};\n-</pre>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>filled in by the constructor and should be left untouched. It is used\n-for forward binary compatibility.</dd>\n-</dl>\n-<a name=\"ti\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bti%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bti%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ti</dt>\n-<dd><a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object with the torrent to add. Unless the\n-info_hash is set, this is required to be initialized.</dd>\n-</dl>\n-<a name=\"trackers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>trackers</dt>\n-<dd>If the torrent doesn't have a tracker, but relies on the DHT to find\n-peers, the <tt class=\"docutils literal\">trackers</tt> can specify tracker URLs for the torrent.</dd>\n-</dl>\n-<a name=\"tracker_tiers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btracker_tiers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btracker_tiers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>tracker_tiers</dt>\n-<dd>the tiers the URLs in <tt class=\"docutils literal\">trackers</tt> 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.</dd>\n-</dl>\n-<a name=\"dht_nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bdht_nodes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bdht_nodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dht_nodes</dt>\n-<dd>a list of hostname and port pairs, representing DHT nodes to be added\n-to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (if DHT is enabled). The hostname may be an IP address.</dd>\n-</dl>\n-<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>name</dt>\n-<dd>in case there's no other name in this torrent, this name will be used.\n-The name out of the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object takes precedence if available.</dd>\n-</dl>\n-<a name=\"save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bsave_path%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bsave_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_path</dt>\n-<dd><p class=\"first\">the path where the torrent is or will be stored.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">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 "..".</p>\n-</div>\n-<p class=\"last\">Setting this to an absolute path performs slightly better than a\n-relative path.</p>\n-</dd>\n-</dl>\n-<a name=\"storage_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bstorage_mode%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bstorage_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>storage_mode</dt>\n-<dd>One of the values from <a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a>. For more information, see\n-<a class=\"reference external\" href=\"manual-ref.html#storage-allocation\">storage allocation</a>.</dd>\n-</dl>\n-<a name=\"userdata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Buserdata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>userdata</dt>\n-<dd>The <tt class=\"docutils literal\">userdata</tt> parameter is optional and will be passed on to the\n-extension constructor functions, if any\n-(see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>). It will also be stored in the\n-torrent object and can be retrieved by calling <a class=\"reference external\" href=\"reference-Torrent_Handle.html#userdata()\">userdata()</a>.</dd>\n-</dl>\n-<a name=\"file_priorities\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bfile_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bfile_priorities%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>file_priorities</dt>\n-<dd>can be set to control the initial file priorities when adding a\n-torrent. The semantics are the same as for\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::prioritize_files()</span></tt>. 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.</dd>\n-</dl>\n-<a name=\"trackerid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackerid%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackerid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>trackerid</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flags</dt>\n-<dd><p class=\"first\">flags controlling aspects of this torrent and how it's added. See\n-<a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a> for details.</p>\n-<div class=\"admonition note last\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">The <tt class=\"docutils literal\">flags</tt> 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.</p>\n-</div>\n-</dd>\n-</dl>\n-<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hashes</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a> to populate fields in the\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.</dd>\n-</dl>\n-<a name=\"max_uploads\"></a>\n-<a name=\"max_connections\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>max_uploads max_connections</dt>\n-<dd><p class=\"first\"><tt class=\"docutils literal\">max_uploads</tt>, <tt class=\"docutils literal\">max_connections</tt>, <tt class=\"docutils literal\">upload_limit</tt>,\n-<tt class=\"docutils literal\">download_limit</tt> correspond to the <tt class=\"docutils literal\">set_max_uploads()</tt>,\n-<tt class=\"docutils literal\">set_max_connections()</tt>, <tt class=\"docutils literal\">set_upload_limit()</tt> and\n-<tt class=\"docutils literal\">set_download_limit()</tt> functions on <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>. These values let\n-you initialize these settings when the torrent is added, instead of\n-calling these functions immediately following adding it.</p>\n-<p>-1 means unlimited on these settings just like their counterpart\n-functions on <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a></p>\n-<p class=\"last\">For fine grained control over rate limits, including making them apply\n-to local peers, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-</dd>\n-</dl>\n-<a name=\"upload_limit\"></a>\n-<a name=\"download_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>upload_limit download_limit</dt>\n-<dd>the upload and download rate limits for this torrent, specified in\n-bytes per second. -1 means unlimited.</dd>\n-</dl>\n-<a name=\"total_uploaded\"></a>\n-<a name=\"total_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_uploaded total_downloaded</dt>\n-<dd>the total number of bytes uploaded and downloaded by this torrent so\n-far.</dd>\n-</dl>\n-<a name=\"active_time\"></a>\n-<a name=\"finished_time\"></a>\n-<a name=\"seeding_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>active_time finished_time seeding_time</dt>\n-<dd>the number of seconds this torrent has spent in started, finished and\n-seeding state so far, respectively.</dd>\n-</dl>\n-<a name=\"added_time\"></a>\n-<a name=\"completed_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Badded_time+completed_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Badded_time+completed_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>added_time completed_time</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> is\n-called.</dd>\n-</dl>\n-<a name=\"last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_seen_complete</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"num_complete\"></a>\n-<a name=\"num_incomplete\"></a>\n-<a name=\"num_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_complete num_incomplete num_downloaded</dt>\n-<dd><p class=\"first\">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). <tt class=\"docutils literal\">num_complete</tt> is the number of\n-peers in the swarm that are seeds, or have every piece in the torrent.\n-<tt class=\"docutils literal\">num_incomplete</tt> is the number of peers in the swarm that do not have\n-every piece. <tt class=\"docutils literal\">num_downloaded</tt> is the number of times the torrent has\n-been downloaded (not initiated, but the number of times a download has\n-completed).</p>\n-<p class=\"last\">Leaving any of these values set to -1 indicates we don't know, or we\n-have not received any scrape data.</p>\n-</dd>\n-</dl>\n-<a name=\"http_seeds\"></a>\n-<a name=\"url_seeds\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>http_seeds url_seeds</dt>\n-<dd><p class=\"first\">URLs can be added to these two lists to specify additional web\n-seeds to be used by the torrent. If the <tt class=\"docutils literal\">flag_override_web_seeds</tt>\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.</p>\n-<p>http_seeds expects URLs to web servers implementing the original HTTP\n-seed specification <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a>.</p>\n-<p class=\"last\">url_seeds expects URLs to regular web servers, aka "get right" style,\n-specified in <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n-</dd>\n-</dl>\n-<a name=\"peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpeers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpeers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>peers</dt>\n-<dd>peers to add to the torrent, to be tried to be connected to as\n-bittorrent peers.</dd>\n-</dl>\n-<a name=\"banned_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bbanned_peers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bbanned_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>banned_peers</dt>\n-<dd>peers banned from this torrent. The will not be connected to</dd>\n-</dl>\n-<a name=\"unfinished_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bunfinished_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bunfinished_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>unfinished_pieces</dt>\n-<dd>this is a map of partially downloaded piece. The key is the piece index\n-and the value is a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> where each bit represents a 16 kiB block.\n-A set bit means we have that block.</dd>\n-</dl>\n-<a name=\"have_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhave_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhave_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>have_pieces</dt>\n-<dd>this is a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> indicating which pieces we already have of this\n-torrent.</dd>\n-</dl>\n-<a name=\"verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>verified_pieces</dt>\n-<dd>when in seed_mode, pieces with a set bit in this <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> have been\n-verified to be valid. Other pieces will be verified the first time a\n-peer requests it.</dd>\n-</dl>\n-<a name=\"piece_priorities\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpiece_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpiece_priorities%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_priorities</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"merkle_trees\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_trees%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_trees%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>merkle_trees</dt>\n-<dd>v2 hashes, if known</dd>\n-</dl>\n-<a name=\"merkle_tree_mask\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>merkle_tree_mask</dt>\n-<dd>if set, indicates which hashes are included in the corresponding\n-vector of <tt class=\"docutils literal\">merkle_trees</tt>. 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-<tt class=\"docutils literal\">merkle_trees</tt> is the hash for that node. This is an optimization\n-to avoid storing a lot of zeros.</dd>\n-</dl>\n-<a name=\"verified_leaf_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>verified_leaf_hashes</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"renamed_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Brenamed_files%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Brenamed_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>renamed_files</dt>\n-<dd>this is a map of file indices in the torrent and new filenames to be\n-applied before the torrent is added.</dd>\n-</dl>\n-<a name=\"last_download\"></a>\n-<a name=\"last_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_download+last_upload%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_download+last_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_download last_upload</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"announce_infohash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_infohash&labels=documentation&body=Documentation+under+heading+%22class+announce_infohash%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"announce-infohash\">\n-<h1>announce_infohash</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-struct announce_infohash\n-{\n- std::string message;\n- error_code last_error;\n- int <strong>scrape_incomplete</strong> = -1;\n- int <strong>scrape_complete</strong> = -1;\n- int <strong>scrape_downloaded</strong> = -1;\n- std::uint8_t fails : 7;\n- bool updating : 1;\n- bool start_sent : 1;\n- bool complete_sent : 1;\n-};\n-</pre>\n-<a name=\"message\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bmessage%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bmessage%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>message</dt>\n-<dd>if this tracker has returned an error or warning message\n-that message is stored here</dd>\n-</dl>\n-<a name=\"last_error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Blast_error%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Blast_error%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_error</dt>\n-<dd>if this tracker failed the last time it was contacted\n-this error code specifies what error occurred</dd>\n-</dl>\n-<a name=\"scrape_incomplete\"></a>\n-<a name=\"scrape_complete\"></a>\n-<a name=\"scrape_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bscrape_incomplete+scrape_complete+scrape_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bscrape_incomplete+scrape_complete+scrape_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>scrape_incomplete scrape_complete scrape_downloaded</dt>\n-<dd>if this tracker has returned scrape data, these fields are filled in\n-with valid numbers. Otherwise they are set to -1. <tt class=\"docutils literal\">incomplete</tt> counts\n-the number of current downloaders. <tt class=\"docutils literal\">complete</tt> counts the number of\n-current peers completed the download, or "seeds". <tt class=\"docutils literal\">downloaded</tt> is the\n-cumulative number of completed downloads.</dd>\n-</dl>\n-<a name=\"fails\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bfails%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bfails%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>fails</dt>\n-<dd>the number of times in a row we have failed to announce to this\n-tracker.</dd>\n-</dl>\n-<a name=\"updating\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bupdating%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bupdating%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>updating</dt>\n-<dd>true while we're waiting for a response from the tracker.</dd>\n-</dl>\n-<a name=\"start_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bstart_sent%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bstart_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>start_sent</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"complete_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bcomplete_sent%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bcomplete_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>complete_sent</dt>\n-<dd>set to true when we send a event=completed.</dd>\n-</dl>\n-<a name=\"announce_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_endpoint&labels=documentation&body=Documentation+under+heading+%22class+announce_endpoint%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"announce-endpoint\">\n-<h1>announce_endpoint</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n-<p>announces are sent to each tracker using every listen socket\n-this class holds information about one listen socket for one tracker</p>\n-<pre class=\"literal-block\">\n-struct announce_endpoint\n-{\n- <strong>announce_endpoint</strong> ();\n-\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> local_endpoint;\n- aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n- bool <strong>enabled</strong> = true;\n-};\n-</pre>\n-<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_endpoint</dt>\n-<dd>the local endpoint of the listen interface associated with this endpoint</dd>\n-</dl>\n-<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hashes</dt>\n-<dd>info_hashes[0] is the v1 info hash (SHA1)\n-info_hashes[1] is the v2 info hash (truncated SHA-256)</dd>\n-</dl>\n-<a name=\"enabled\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Benabled%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Benabled%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>enabled</dt>\n-<dd>set to false to not announce from this endpoint</dd>\n-</dl>\n-<a name=\"announce_entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_entry&labels=documentation&body=Documentation+under+heading+%22class+announce_entry%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"announce-entry\">\n-<h1>announce_entry</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n-<p>this class holds information about one bittorrent tracker, as it\n-relates to a specific torrent.</p>\n-<pre class=\"literal-block\">\n-struct announce_entry\n-{\n- <strong>announce_entry</strong> (announce_entry const&);\n- announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n- <strong>~announce_entry</strong> ();\n- <strong>announce_entry</strong> ();\n- explicit <strong>announce_entry</strong> (string_view u);\n-\n- enum tracker_source\n- {\n- source_torrent,\n- source_client,\n- source_magnet_link,\n- source_tex,\n- };\n-\n- std::string url;\n- std::string trackerid;\n- std::vector<announce_endpoint> endpoints;\n- std::uint8_t <strong>tier</strong> = 0;\n- std::uint8_t <strong>fail_limit</strong> = 0;\n- std::uint8_t source:4;\n- bool verified:1;\n-};\n-</pre>\n-<a name=\"operator=()\"></a>\n-<a name=\"~announce_entry()\"></a>\n-<a name=\"announce_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Boperator%3D%28%29+~announce_entry%28%29+announce_entry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Boperator%3D%28%29+~announce_entry%28%29+announce_entry%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-announce-entry-announce-entry\">\n-<h2>operator=() ~announce_entry() announce_entry()</h2>\n-<pre class=\"literal-block\">\n-<strong>announce_entry</strong> (announce_entry const&);\n-announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n-<strong>~announce_entry</strong> ();\n-<strong>announce_entry</strong> ();\n-explicit <strong>announce_entry</strong> (string_view u);\n-</pre>\n-<p>constructs a tracker announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> with <tt class=\"docutils literal\">u</tt> as the URL.</p>\n-<a name=\"tracker_source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+tracker_source&labels=documentation&body=Documentation+under+heading+%22enum+tracker_source%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-tracker-source\">\n-<h2>enum tracker_source</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"20%\" />\n-<col width=\"7%\" />\n-<col width=\"74%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>source_torrent</td>\n-<td>1</td>\n-<td>the tracker was part of the .torrent file</td>\n-</tr>\n-<tr><td>source_client</td>\n-<td>2</td>\n-<td>the tracker was added programmatically via the <a class=\"reference external\" href=\"reference-Create_Torrents.html#add_tracker()\">add_tracker()</a> function</td>\n-</tr>\n-<tr><td>source_magnet_link</td>\n-<td>4</td>\n-<td>the tracker was part of a magnet link</td>\n-</tr>\n-<tr><td>source_tex</td>\n-<td>8</td>\n-<td>the tracker was received from the swarm via tracker exchange</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"url\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Burl%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Burl%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>url</dt>\n-<dd>tracker URL as it appeared in the torrent file</dd>\n-</dl>\n-<a name=\"trackerid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Btrackerid%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Btrackerid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>trackerid</dt>\n-<dd>the current <tt class=\"docutils literal\">&trackerid=</tt> argument passed to the tracker.\n-this is optional and is normally empty (in which case no\n-trackerid is sent).</dd>\n-</dl>\n-<a name=\"endpoints\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bendpoints%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bendpoints%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoints</dt>\n-<dd>each local listen socket (endpoint) will announce to the tracker. This\n-list contains state per endpoint.</dd>\n-</dl>\n-<a name=\"tier\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Btier%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Btier%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>tier</dt>\n-<dd>the tier this tracker belongs to</dd>\n-</dl>\n-<a name=\"fail_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bfail_limit%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bfail_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>fail_limit</dt>\n-<dd>the max number of failures to announce to this tracker in\n-a row, before this tracker is not used anymore. 0 means unlimited</dd>\n-</dl>\n-<a name=\"source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bsource%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bsource%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>source</dt>\n-<dd>a bitmask specifying which sources we got this tracker from.</dd>\n-</dl>\n-<a name=\"verified\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bverified%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bverified%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>verified</dt>\n-<dd>set to true the first time we receive a valid response\n-from this tracker.</dd>\n-</dl>\n-<p>The <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> function on <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is the main interface for retrieving\n-alerts (warnings, messages and errors from libtorrent). If no alerts have\n-been posted by libtorrent <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> will return an empty list.</p>\n-<p>By default, only errors are reported. <a class=\"reference external\" href=\"reference-Settings.html#alert_mask\">settings_pack::alert_mask</a> can be\n-used to specify which kinds of events should be reported. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask is\n-a combination of the <a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a> flags in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> class.</p>\n-<p>Every <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> bitmask to 0 will disable all alerts (except those\n-that are non-discardable). Alerts that are responses to API calls such as\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> and <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> are non-discardable and will be\n-posted even if their category is disabled.</p>\n-<p>There are other <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> base classes that some alerts derive from, all the\n-alerts that are generated for a specific torrent are derived from\n-<a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>, and tracker events derive from <a class=\"reference external\" href=\"reference-Alerts.html#tracker_alert\">tracker_alert</a>.</p>\n-<p>Alerts returned by <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> are only valid until the next call to\n-<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. You may not copy an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> object to access it after the next\n-call to <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. Internal members of alerts also become invalid once\n-<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> is called again.</p>\n-<a name=\"alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alert&labels=documentation&body=Documentation+under+heading+%22class+alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"alert\">\n-<h1>alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">alert</tt> class is the base class that specific messages are derived from.\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">session_handle::pop_alerts()</a>)</p>\n-<pre class=\"literal-block\">\n-struct alert\n-{\n- time_point <strong>timestamp</strong> () const;\n- virtual int <strong>type</strong> () const noexcept = 0;\n- virtual char const* <strong>what</strong> () const noexcept = 0;\n- virtual std::string <strong>message</strong> () const = 0;\n- virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n-\n- static constexpr alert_category_t <strong>error_notification</strong> = 0_bit;\n- static constexpr alert_category_t <strong>peer_notification</strong> = 1_bit;\n- static constexpr alert_category_t <strong>port_mapping_notification</strong> = 2_bit;\n- static constexpr alert_category_t <strong>storage_notification</strong> = 3_bit;\n- static constexpr alert_category_t <strong>tracker_notification</strong> = 4_bit;\n- static constexpr alert_category_t <strong>connect_notification</strong> = 5_bit;\n- static constexpr alert_category_t <strong>status_notification</strong> = 6_bit;\n- static constexpr alert_category_t <strong>ip_block_notification</strong> = 8_bit;\n- static constexpr alert_category_t <strong>performance_warning</strong> = 9_bit;\n- static constexpr alert_category_t <strong>dht_notification</strong> = 10_bit;\n- static constexpr alert_category_t <strong>session_log_notification</strong> = 13_bit;\n- static constexpr alert_category_t <strong>torrent_log_notification</strong> = 14_bit;\n- static constexpr alert_category_t <strong>peer_log_notification</strong> = 15_bit;\n- static constexpr alert_category_t <strong>incoming_request_notification</strong> = 16_bit;\n- static constexpr alert_category_t <strong>dht_log_notification</strong> = 17_bit;\n- static constexpr alert_category_t <strong>dht_operation_notification</strong> = 18_bit;\n- static constexpr alert_category_t <strong>port_mapping_log_notification</strong> = 19_bit;\n- static constexpr alert_category_t <strong>picker_log_notification</strong> = 20_bit;\n- static constexpr alert_category_t <strong>file_progress_notification</strong> = 21_bit;\n- static constexpr alert_category_t <strong>piece_progress_notification</strong> = 22_bit;\n- static constexpr alert_category_t <strong>upload_notification</strong> = 23_bit;\n- static constexpr alert_category_t <strong>block_progress_notification</strong> = 24_bit;\n- static constexpr alert_category_t <strong>all_categories</strong> = alert_category_t::all();\n-};\n-</pre>\n-<a name=\"timestamp()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btimestamp%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btimestamp%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"timestamp\">\n-<h2>timestamp()</h2>\n-<pre class=\"literal-block\">\n-time_point <strong>timestamp</strong> () const;\n-</pre>\n-<p>a timestamp is automatically created in the constructor</p>\n-<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"type\">\n-<h2>type()</h2>\n-<pre class=\"literal-block\">\n-virtual int <strong>type</strong> () const noexcept = 0;\n-</pre>\n-<p>returns an integer that is unique to this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type. It can be\n-compared against a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> by querying a static constant called <tt class=\"docutils literal\">alert_type</tt>\n-in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It can be used to determine the run-time type of an alert* in\n-order to cast to that <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type and access specific members.</p>\n-<p>e.g:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">switch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"operator\">-></span><span class=\"name\">type</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n-\n- </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">read_piece_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">auto</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">read_piece_alert</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">p</span><span class=\"operator\">-></span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// read_piece failed\n-</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// use p\n-</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">file_renamed_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"comment single\">// etc...\n-</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n- </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span>\n-</pre>\n-<a name=\"what()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bwhat%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bwhat%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"what\">\n-<h2>what()</h2>\n-<pre class=\"literal-block\">\n-virtual char const* <strong>what</strong> () const noexcept = 0;\n-</pre>\n-<p>returns a string literal describing the type of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It does\n-not include any information that might be bundled with the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"message\">\n-<h2>message()</h2>\n-<pre class=\"literal-block\">\n-virtual std::string <strong>message</strong> () const = 0;\n-</pre>\n-<p>generate a string describing the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-type individually and extract and render the information from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> depending\n-on the locale.</p>\n-<a name=\"category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bcategory%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bcategory%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"category\">\n-<h2>category()</h2>\n-<pre class=\"literal-block\">\n-virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n-</pre>\n-<p>returns a bitmask specifying which categories this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belong to.</p>\n-<a name=\"dht_routing_bucket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_routing_bucket&labels=documentation&body=Documentation+under+heading+%22class+dht_routing_bucket%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-routing-bucket\">\n-<h1>dht_routing_bucket</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>struct to hold information about a single DHT routing table bucket</p>\n-<pre class=\"literal-block\">\n-struct dht_routing_bucket\n-{\n- int num_nodes;\n- int num_replacements;\n- int last_active;\n-};\n-</pre>\n-<a name=\"num_nodes\"></a>\n-<a name=\"num_replacements\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_nodes num_replacements</dt>\n-<dd>the total number of nodes and replacement nodes\n-in the routing table</dd>\n-</dl>\n-<a name=\"last_active\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Blast_active%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Blast_active%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_active</dt>\n-<dd>number of seconds since last activity</dd>\n-</dl>\n-<a name=\"torrent_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-alert\">\n-<h1>torrent_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is a base class for alerts that are associated with a\n-specific torrent. It contains a handle to the torrent.</p>\n-<p>Note that by the time the client receives a <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>, its\n-<tt class=\"docutils literal\">handle</tt> member may be invalid.</p>\n-<pre class=\"literal-block\">\n-struct torrent_alert : alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>torrent_name</strong> () const;\n-\n- torrent_handle handle;\n-};\n-</pre>\n-<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"message-1\">\n-<h2>message()</h2>\n-<pre class=\"literal-block\">\n-std::string <strong>message</strong> () const override;\n-</pre>\n-<p>returns the message associated with this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a></p>\n-<a name=\"handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bhandle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>handle</dt>\n-<dd>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> pointing to the torrent this\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is associated with.</dd>\n-</dl>\n-<a name=\"peer_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-alert\">\n-<h1>peer_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The peer <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a base class for alerts that refer to a specific peer. It includes all\n-the information to identify the peer. i.e. <tt class=\"docutils literal\">ip</tt> and <tt class=\"docutils literal\"><span class=\"pre\">peer-id</span></tt>.</p>\n-<pre class=\"literal-block\">\n-struct peer_alert : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> endpoint;\n- peer_id pid;\n-};\n-</pre>\n-<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoint</dt>\n-<dd>The peer's IP address and port.</dd>\n-</dl>\n-<a name=\"pid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bpid%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bpid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pid</dt>\n-<dd>the peer ID, if known.</dd>\n-</dl>\n-<a name=\"tracker_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tracker-alert\">\n-<h1>tracker_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is a base class used for alerts that are associated with a\n-specific tracker. It derives from <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a> since a tracker\n-is also associated with a specific torrent.</p>\n-<pre class=\"literal-block\">\n-struct tracker_alert : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>tracker_url</strong> () const;\n-\n- aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> local_endpoint;\n-};\n-</pre>\n-<a name=\"tracker_url()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Btracker_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Btracker_url%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"tracker-url\">\n-<h2>tracker_url()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>tracker_url</strong> () const;\n-</pre>\n-<p>returns a 0-terminated string of the tracker's URL</p>\n-<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_endpoint</dt>\n-<dd>endpoint of the listen interface being announced</dd>\n-</dl>\n-<a name=\"torrent_removed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_removed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_removed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-removed-alert\">\n-<h1>torrent_removed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">torrent_removed_alert</tt> 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 <tt class=\"docutils literal\"><span class=\"pre\">alert_category::status</span></tt> bit is set in the alert_mask.</p>\n-<p>Note that the <tt class=\"docutils literal\">handle</tt> remains valid for some time after\n-<a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a> is posted, as long as some internal libtorrent\n-task (such as an I/O task) refers to it. Additionally, other alerts like\n-<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> may be posted after <a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a>.\n-To synchronize on whether the torrent has been removed or not, call\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#in_session()\">torrent_handle::in_session()</a>. This will return true before\n-<a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a> is posted, and false afterward.</p>\n-<p>Even though the <tt class=\"docutils literal\">handle</tt> 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.</p>\n-<p>The <tt class=\"docutils literal\">torrent_handle</tt> acts as a <tt class=\"docutils literal\">weak_ptr</tt>, 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.</p>\n-<pre class=\"literal-block\">\n-struct torrent_removed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- info_hash_t info_hashes;\n- client_data_t userdata;\n-};\n-</pre>\n-<a name=\"userdata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_removed_alert%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_removed_alert%3A%3A%5Buserdata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>userdata</dt>\n-<dd>'<cite>userdata`</cite> as set in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> 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.</dd>\n-</dl>\n-<a name=\"read_piece_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+read_piece_alert&labels=documentation&body=Documentation+under+heading+%22class+read_piece_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"read-piece-alert\">\n-<h1>read_piece_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the asynchronous read operation initiated by\n-a call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#read_piece()\">torrent_handle::read_piece()</a> is completed. If the read failed, the torrent\n-is paused and an error state is set and the buffer member of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-is 0. If successful, <tt class=\"docutils literal\">buffer</tt> points to a buffer containing all the data\n-of the piece. <tt class=\"docutils literal\">piece</tt> is the piece index that was read. <tt class=\"docutils literal\">size</tt> is the\n-number of bytes that was read.</p>\n-<p>If the operation fails, <tt class=\"docutils literal\">error</tt> will indicate what went wrong.</p>\n-<pre class=\"literal-block\">\n-struct read_piece_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"file_completed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_completed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_completed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-completed-alert\">\n-<h1>file_completed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is posted whenever an individual file completes its download. i.e.\n-All pieces overlapping this file have passed their hash check.</p>\n-<pre class=\"literal-block\">\n-struct file_completed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- file_index_t const index;\n-};\n-</pre>\n-<a name=\"index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_completed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_completed_alert%3A%3A%5Bindex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>index</dt>\n-<dd>refers to the index of the file that completed.</dd>\n-</dl>\n-<a name=\"file_renamed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_renamed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_renamed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-renamed-alert\">\n-<h1>file_renamed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is posted as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#rename_file()\">torrent_handle::rename_file()</a> call, if the rename\n-operation succeeds.</p>\n-<pre class=\"literal-block\">\n-struct file_renamed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>new_name</strong> () const;\n- char const* <strong>old_name</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- file_index_t const index;\n-};\n-</pre>\n-<a name=\"new_name()\"></a>\n-<a name=\"old_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-name-old-name\">\n-<h2>new_name() old_name()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>new_name</strong> () const;\n-char const* <strong>old_name</strong> () const;\n-</pre>\n-<p>returns the new and previous file name, respectively.</p>\n-<a name=\"index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bindex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>index</dt>\n-<dd>refers to the index of the file that was renamed,</dd>\n-</dl>\n-<a name=\"file_rename_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_rename_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_rename_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"file-rename-failed-alert\">\n-<h1>file_rename_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is posted as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#rename_file()\">torrent_handle::rename_file()</a> call, if the rename\n-operation failed.</p>\n-<pre class=\"literal-block\">\n-struct file_rename_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- file_index_t const index;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"index\"></a>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_rename_failed_alert%3A%3A%5Bindex+error%5D&labels=documentation&body=Documentation+under+heading+%22file_rename_failed_alert%3A%3A%5Bindex+error%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>index error</dt>\n-<dd>refers to the index of the file that was supposed to be renamed,\n-<tt class=\"docutils literal\">error</tt> is the error code returned from the filesystem.</dd>\n-</dl>\n-<a name=\"performance_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+performance_alert&labels=documentation&body=Documentation+under+heading+%22class+performance_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"performance-alert\">\n-<h1>performance_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a limit is reached that might have a negative impact on\n-upload or download rate performance.</p>\n-<pre class=\"literal-block\">\n-struct performance_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () 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 <strong>static_category</strong> = alert_category::performance_warning;\n- performance_warning_t const warning_code;\n-};\n-</pre>\n-<a name=\"performance_warning_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+performance_warning_t&labels=documentation&body=Documentation+under+heading+%22enum+performance_warning_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-performance-warning-t\">\n-<h2>enum performance_warning_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"27%\" />\n-<col width=\"5%\" />\n-<col width=\"68%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>outstanding_disk_buffer_limit_reached</td>\n-<td>0</td>\n-<td>This warning means that the number of bytes queued to be written to disk\n-exceeds the max disk byte queue setting (<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_queued_disk_bytes</span></tt>).\n-This might restrict the download rate, by not queuing up enough write jobs\n-to the disk I/O thread. When this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted, peer connections are\n-temporarily stopped from downloading, until the queued disk bytes have fallen\n-below the limit again. Unless your <tt class=\"docutils literal\">max_queued_disk_bytes</tt> setting is already\n-high, you might want to increase it to get better performance.</td>\n-</tr>\n-<tr><td>outstanding_request_limit_reached</td>\n-<td>1</td>\n-<td>This is posted when libtorrent would like to send more requests to a peer,\n-but it's limited by <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_out_request_queue</span></tt>. The queue length\n-libtorrent is trying to achieve is determined by the download rate and the\n-assumed round-trip-time (<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::request_queue_time</span></tt>). 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\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 <tt class=\"docutils literal\">max_out_request_queue</tt>\n-setting.</td>\n-</tr>\n-<tr><td>upload_limit_too_low</td>\n-<td>2</td>\n-<td>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.</td>\n-</tr>\n-<tr><td>download_limit_too_low</td>\n-<td>3</td>\n-<td>This is the same warning as <tt class=\"docutils literal\">upload_limit_too_low</tt> 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.</td>\n-</tr>\n-<tr><td>send_buffer_watermark_too_low</td>\n-<td>4</td>\n-<td><p class=\"first\">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:</p>\n-<pre class=\"code C++ literal-block\">\n-<span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"literal number integer\">512</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">max</span><span class=\"punctuation\">(</span><span class=\"name\">upload_rate</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">send_buffer_watermark_factor</span><span class=\"whitespace\"> </span><span class=\"operator\">/</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">100</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">send_buffer_watermark</span><span class=\"punctuation\">))</span>\n-</pre>\n-<p class=\"last\">If you receive this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you might want to either increase your <tt class=\"docutils literal\">send_buffer_watermark</tt>\n-or <tt class=\"docutils literal\">send_buffer_watermark_factor</tt>.</p>\n-</td>\n-</tr>\n-<tr><td>too_many_optimistic_unchoke_slots</td>\n-<td>5</td>\n-<td>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.</td>\n-</tr>\n-<tr><td>too_high_disk_queue_limit</td>\n-<td>6</td>\n-<td>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 <tt class=\"docutils literal\">max_queued_disk_bytes</tt> or increase <tt class=\"docutils literal\">cache_size</tt>.</td>\n-</tr>\n-<tr><td>aio_limit_reached</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>deprecated_bittyrant_with_no_uplimit</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-<tr><td>too_few_outgoing_ports</td>\n-<td>9</td>\n-<td>This is generated if outgoing peer connections are failing because of <em>address in use</em>\n-errors, indicating that <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::outgoing_ports</span></tt> is set and is too small of\n-a range. Consider not using the <tt class=\"docutils literal\">outgoing_ports</tt> setting at all, or widen the range to\n-include more ports.</td>\n-</tr>\n-<tr><td>too_few_file_descriptors</td>\n-<td>10</td>\n-<td> </td>\n-</tr>\n-<tr><td>num_warnings</td>\n-<td>11</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"state_changed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_changed_alert&labels=documentation&body=Documentation+under+heading+%22class+state_changed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"state-changed-alert\">\n-<h1>state_changed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>Generated whenever a torrent changes its state.</p>\n-<pre class=\"literal-block\">\n-struct state_changed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- torrent_status::state_t const state;\n- torrent_status::state_t const prev_state;\n-};\n-</pre>\n-<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>state</dt>\n-<dd>the new state of the torrent.</dd>\n-</dl>\n-<a name=\"prev_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bprev_state%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bprev_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>prev_state</dt>\n-<dd>the previous state.</dd>\n-</dl>\n-<a name=\"tracker_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_error_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tracker-error-alert\">\n-<h1>tracker_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated on tracker time outs, premature disconnects,\n-invalid response or a HTTP response other than "200 OK". From the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-you can get the handle to the torrent the tracker belongs to.</p>\n-<pre class=\"literal-block\">\n-struct tracker_error_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>failure_reason</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"failure_reason()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"failure-reason\">\n-<h2>failure_reason()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>failure_reason</strong> () const;\n-</pre>\n-<p>if the tracker sent a "failure reason" string, it will be returned\n-here.</p>\n-<a name=\"times_in_row\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Btimes_in_row%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Btimes_in_row%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>times_in_row</dt>\n-<dd>This member says how many times in a row this tracker has failed.</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error code indicating why the tracker announce failed. If it is\n-is <tt class=\"docutils literal\"><span class=\"pre\">lt::errors::tracker_failure</span></tt> the <a class=\"reference external\" href=\"reference-Alerts.html#failure_reason()\">failure_reason()</a> 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.</dd>\n-</dl>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that was announced</dd>\n-</dl>\n-<a name=\"tracker_warning_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_warning_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_warning_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"tracker-warning-alert\">\n-<h1>tracker_warning_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct tracker_warning_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>warning_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker | alert_category::error;\n- protocol_version version;\n-};\n-</pre>\n-<a name=\"warning_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"warning-message\">\n-<h2>warning_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>warning_message</strong> () const;\n-</pre>\n-<p>the message associated with this warning</p>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that was announced</dd>\n-</dl>\n-<a name=\"scrape_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"scrape-reply-alert\">\n-<h1>scrape_reply_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a scrape request succeeds.</p>\n-<pre class=\"literal-block\">\n-struct scrape_reply_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n- int const incomplete;\n- int const complete;\n- protocol_version version;\n-};\n-</pre>\n-<a name=\"incomplete\"></a>\n-<a name=\"complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bincomplete+complete%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bincomplete+complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>incomplete complete</dt>\n-<dd>the data returned in the scrape response. These numbers\n-may be -1 if the response was malformed.</dd>\n-</dl>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that was scraped</dd>\n-</dl>\n-<a name=\"scrape_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"scrape-failed-alert\">\n-<h1>scrape_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>If a scrape request fails, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated. This might be due\n-to the tracker timing out, refusing connection or returning an http response\n-code indicating an error.</p>\n-<pre class=\"literal-block\">\n-struct scrape_failed_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>error_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker | alert_category::error;\n- error_code const error;\n- protocol_version version;\n-};\n-</pre>\n-<a name=\"error_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"error-message\">\n-<h2>error_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>error_message</strong> () const;\n-</pre>\n-<p>if the error indicates there is an associated message, this returns\n-that message. Otherwise and empty string.</p>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error itself. This may indicate that the tracker sent an error\n-message (<tt class=\"docutils literal\"><span class=\"pre\">error::tracker_failure</span></tt>), in which case it can be\n-retrieved by calling <tt class=\"docutils literal\">error_message()</tt>.</dd>\n-</dl>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that was scraped</dd>\n-</dl>\n-<a name=\"tracker_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"tracker-reply-alert\">\n-<h1>tracker_reply_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct tracker_reply_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n- int const num_peers;\n- protocol_version version;\n-};\n-</pre>\n-<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_peers</dt>\n-<dd>tells how many peers the tracker returned in this response. This is\n-not expected to be greater than the <tt class=\"docutils literal\">num_want</tt> settings. These are not necessarily\n-all new peers, some of them may already be connected.</dd>\n-</dl>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that was announced</dd>\n-</dl>\n-<a name=\"dht_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-reply-alert\">\n-<h1>dht_reply_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated each time the DHT receives peers from a node. <tt class=\"docutils literal\">num_peers</tt>\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.</p>\n-<pre class=\"literal-block\">\n-struct dht_reply_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht | alert_category::tracker;\n- int const num_peers;\n-};\n-</pre>\n-<a name=\"tracker_announce_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_announce_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tracker-announce-alert\">\n-<h1>tracker_announce_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated each time a tracker announce is sent (or attempted to be sent).\n-There are no extra data members in this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. The url can be found in the base class\n-however.</p>\n-<pre class=\"literal-block\">\n-struct tracker_announce_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n- event_t const event;\n- protocol_version version;\n-};\n-</pre>\n-<a name=\"event\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bevent%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bevent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>event</dt>\n-<dd>specifies what event was sent to the tracker. See <a class=\"reference external\" href=\"reference-Core.html#event_t\">event_t</a>.</dd>\n-</dl>\n-<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>version</dt>\n-<dd>the bittorrent protocol version that is announced</dd>\n-</dl>\n-<a name=\"hash_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hash_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+hash_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"hash-failed-alert\">\n-<h1>hash_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<pre class=\"literal-block\">\n-struct hash_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"peer_ban_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_ban_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_ban_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-ban-alert\">\n-<h1>peer_ban_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is banned because it has sent too many corrupt pieces\n-to us. <tt class=\"docutils literal\">ip</tt> is the endpoint to the peer that was banned.</p>\n-<pre class=\"literal-block\">\n-struct peer_ban_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n-};\n-</pre>\n-<a name=\"peer_unsnubbed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_unsnubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_unsnubbed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-unsnubbed-alert\">\n-<h1>peer_unsnubbed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct peer_unsnubbed_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n-};\n-</pre>\n-<a name=\"peer_snubbed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_snubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_snubbed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-snubbed-alert\">\n-<h1>peer_snubbed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is snubbed, when it stops sending data when we request\n-it.</p>\n-<pre class=\"literal-block\">\n-struct peer_snubbed_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n-};\n-</pre>\n-<a name=\"peer_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_error_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-error-alert\">\n-<h1>peer_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, to identify it.</p>\n-<pre class=\"literal-block\">\n-struct peer_error_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n- operation_t op;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>a 0-terminated string of the low-level operation that failed, or nullptr if\n-there was no low level disk operation.</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>tells you what error caused this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</dd>\n-</dl>\n-<a name=\"peer_connect_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_connect_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_connect_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-connect-alert\">\n-<h1>peer_connect_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#incoming_connection_alert\">incoming_connection_alert</a>.</p>\n-<pre class=\"literal-block\">\n-struct peer_connect_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- enum direction_t\n- {\n- in,\n- out,\n- };\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::connect;\n- direction_t direction;\n- socket_type_t socket_type;\n-};\n-</pre>\n-<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-direction-t\">\n-<h2>enum direction_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"23%\" />\n-<col width=\"27%\" />\n-<col width=\"50%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>in</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>out</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"direction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_connect_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22peer_connect_alert%3A%3A%5Bdirection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>direction</dt>\n-<dd>Tells you if the peer was incoming or outgoing</dd>\n-</dl>\n-<a name=\"peer_disconnected_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_disconnected_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_disconnected_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-disconnected-alert\">\n-<h1>peer_disconnected_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is disconnected for any reason (other than the ones\n-covered by <a class=\"reference external\" href=\"reference-Alerts.html#peer_error_alert\">peer_error_alert</a> ).</p>\n-<pre class=\"literal-block\">\n-struct peer_disconnected_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>socket_type</dt>\n-<dd>the kind of socket this peer was connected over</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the operation or level where the error occurred. Specified as an\n-value from the <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> enum. Defined in operations.hpp.</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>tells you what error caused peer to disconnect.</dd>\n-</dl>\n-<a name=\"reason\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Breason%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>reason</dt>\n-<dd>the reason the peer disconnected (if specified)</dd>\n-</dl>\n-<a name=\"invalid_request_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+invalid_request_alert&labels=documentation&body=Documentation+under+heading+%22class+invalid_request_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"invalid-request-alert\">\n-<h1>invalid_request_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is a debug <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> that is generated by an incoming invalid piece request.\n-<tt class=\"docutils literal\">ip</tt> is the address of the peer and the <tt class=\"docutils literal\">request</tt> is the actual incoming\n-request from the peer. See <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> for more info.</p>\n-<pre class=\"literal-block\">\n-struct invalid_request_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n- peer_request const request;\n- bool const we_have;\n- bool const peer_interested;\n- bool const withheld;\n-};\n-</pre>\n-<a name=\"request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Brequest%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Brequest%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>request</dt>\n-<dd>the request we received from the peer</dd>\n-</dl>\n-<a name=\"we_have\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwe_have%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwe_have%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>we_have</dt>\n-<dd>true if we have this piece</dd>\n-</dl>\n-<a name=\"peer_interested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bpeer_interested%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bpeer_interested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>peer_interested</dt>\n-<dd>true if the peer indicated that it was interested to download before\n-sending the request</dd>\n-</dl>\n-<a name=\"withheld\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwithheld%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwithheld%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>withheld</dt>\n-<dd>if this is true, the peer is not allowed to download this piece because\n-of super-seeding rules.</dd>\n-</dl>\n-<a name=\"torrent_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-finished-alert\">\n-<h1>torrent_finished_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> to the\n-torrent in question.</p>\n-<pre class=\"literal-block\">\n-struct torrent_finished_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"piece_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-finished-alert\">\n-<h1>piece_finished_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted every time a piece completes downloading\n-and passes the hash check. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> derives from <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>\n-which contains the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#have_piece()\">torrent_handle::have_piece()</a>\n-may still return false</p>\n-<pre class=\"literal-block\">\n-struct piece_finished_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"piece_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_finished_alert%3A%3A%5Bpiece_index%5D&labels=documentation&body=Documentation+under+heading+%22piece_finished_alert%3A%3A%5Bpiece_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_index</dt>\n-<dd>the index of the piece that finished</dd>\n-</dl>\n-<a name=\"request_dropped_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+request_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+request_dropped_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"request-dropped-alert\">\n-<h1>request_dropped_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer rejects or ignores a piece request.</p>\n-<pre class=\"literal-block\">\n-struct request_dropped_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"block_timeout_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_timeout_alert&labels=documentation&body=Documentation+under+heading+%22class+block_timeout_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"block-timeout-alert\">\n-<h1>block_timeout_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request times out.</p>\n-<pre class=\"literal-block\">\n-struct block_timeout_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"block_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+block_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"block-finished-alert\">\n-<h1>block_finished_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request receives a response.</p>\n-<pre class=\"literal-block\">\n-struct block_finished_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"block_downloading_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_downloading_alert&labels=documentation&body=Documentation+under+heading+%22class+block_downloading_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"block-downloading-alert\">\n-<h1>block_downloading_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request is sent to a peer.</p>\n-<pre class=\"literal-block\">\n-struct block_downloading_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"unwanted_block_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+unwanted_block_alert&labels=documentation&body=Documentation+under+heading+%22class+unwanted_block_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"unwanted-block-alert\">\n-<h1>unwanted_block_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block is received that was not requested or\n-whose request timed out.</p>\n-<pre class=\"literal-block\">\n-struct unwanted_block_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"storage_moved_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"storage-moved-alert\">\n-<h1>storage_moved_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">storage_moved_alert</tt> is generated when all the disk IO has\n-completed and the files have been moved, as an effect of a call to\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::move_storage</span></tt>. This is useful to synchronize with the\n-actual disk. The <tt class=\"docutils literal\">storage_path()</tt> member return the new path of the\n-storage.</p>\n-<pre class=\"literal-block\">\n-struct storage_moved_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>storage_path</strong> () const;\n- char const* <strong>old_path</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n-};\n-</pre>\n-<a name=\"storage_path()\"></a>\n-<a name=\"old_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"storage-path-old-path\">\n-<h2>storage_path() old_path()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>storage_path</strong> () const;\n-char const* <strong>old_path</strong> () const;\n-</pre>\n-<p>the path the torrent was moved to and from, respectively.</p>\n-<a name=\"storage_moved_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"storage-moved-failed-alert\">\n-<h1>storage_moved_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">storage_moved_failed_alert</tt> is generated when an attempt to move the storage,\n-via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#move_storage()\">torrent_handle::move_storage()</a>, fails.</p>\n-<pre class=\"literal-block\">\n-struct storage_moved_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>file_path</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- error_code const error;\n- operation_t op;\n-};\n-</pre>\n-<a name=\"file_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"file-path\">\n-<h2>file_path()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>file_path</strong> () const;\n-</pre>\n-<p>If the error happened for a specific file, this returns its path.</p>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>this indicates what underlying operation caused the error</dd>\n-</dl>\n-<a name=\"torrent_deleted_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_deleted_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_deleted_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-deleted-alert\">\n-<h1>torrent_deleted_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a request to delete the files of a torrent complete.</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted in the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::storage</span></tt> category, and that bit\n-needs to be set in the alert_mask.</p>\n-<pre class=\"literal-block\">\n-struct torrent_deleted_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- info_hash_t info_hashes;\n-};\n-</pre>\n-<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_deleted_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_deleted_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hashes</dt>\n-<dd>The info-hash of the torrent that was just deleted. Most of\n-the time the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> in the <tt class=\"docutils literal\">torrent_alert</tt> will be invalid by the time\n-this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> arrives, since the torrent is being deleted. The <tt class=\"docutils literal\">info_hashes</tt> member\n-is hence the main way of identifying which torrent just completed the delete.</dd>\n-</dl>\n-<a name=\"torrent_delete_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_delete_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_delete_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-delete-failed-alert\">\n-<h1>torrent_delete_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a request to delete the files of a torrent fails.\n-Just removing a torrent from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> cannot fail</p>\n-<pre class=\"literal-block\">\n-struct torrent_delete_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage\n- | alert_category::error;\n- error_code const error;\n- info_hash_t info_hashes;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>tells you why it failed.</dd>\n-</dl>\n-<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hashes</dt>\n-<dd>the info hash of the torrent whose files failed to be deleted</dd>\n-</dl>\n-<a name=\"save_resume_data_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"save-resume-data-alert\">\n-<h1>save_resume_data_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::save_resume_data</span></tt> request.\n-It is generated once the disk IO thread is done writing the state for this torrent.</p>\n-<pre class=\"literal-block\">\n-struct save_resume_data_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- add_torrent_params params;\n-};\n-</pre>\n-<a name=\"params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_alert%3A%3A%5Bparams%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>params</dt>\n-<dd><p class=\"first\">the <tt class=\"docutils literal\">params</tt> object is populated with the torrent file whose resume\n-data was saved. It is suitable to be:</p>\n-<ul class=\"last simple\">\n-<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n-<li>saved to disk with <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></li>\n-<li>turned into a magnet link with <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n-<li>saved as a .torrent file with <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n-</ul>\n-</dd>\n-</dl>\n-<a name=\"save_resume_data_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"save-resume-data-failed-alert\">\n-<h1>save_resume_data_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated instead of <tt class=\"docutils literal\">save_resume_data_alert</tt> if there was an error\n-generating the resume data. <tt class=\"docutils literal\">error</tt> describes what went wrong.</p>\n-<pre class=\"literal-block\">\n-struct save_resume_data_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage\n- | alert_category::error;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error code from the resume_data failure</dd>\n-</dl>\n-<a name=\"torrent_paused_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_paused_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_paused_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-paused-alert\">\n-<h1>torrent_paused_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::pause</span></tt> 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.</p>\n-<pre class=\"literal-block\">\n-struct torrent_paused_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"torrent_resumed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_resumed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_resumed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-resumed-alert\">\n-<h1>torrent_resumed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#resume()\">torrent_handle::resume()</a> request. It is\n-generated when a torrent goes from a paused state to an active state.</p>\n-<pre class=\"literal-block\">\n-struct torrent_resumed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"torrent_checked_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_checked_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_checked_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-checked-alert\">\n-<h1>torrent_checked_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when a torrent completes checking. i.e. when it transitions\n-out of the <tt class=\"docutils literal\">checking files</tt> state into a state where it is ready to start downloading</p>\n-<pre class=\"literal-block\">\n-struct torrent_checked_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"url_seed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+url_seed_alert&labels=documentation&body=Documentation+under+heading+%22class+url_seed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"url-seed-alert\">\n-<h1>url_seed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a HTTP seed name lookup fails.</p>\n-<pre class=\"literal-block\">\n-struct url_seed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>server_url</strong> () const;\n- char const* <strong>error_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer | alert_category::error;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"server_url()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Bserver_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Bserver_url%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"server-url\">\n-<h2>server_url()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>server_url</strong> () const;\n-</pre>\n-<p>the URL the error is associated with</p>\n-<a name=\"error_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"error-message-1\">\n-<h2>error_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>error_message</strong> () const;\n-</pre>\n-<p>in case the web server sent an error message, this function returns\n-it.</p>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error the web seed encountered. If this is not set, the server\n-sent an error message, call <tt class=\"docutils literal\">error_message()</tt>.</dd>\n-</dl>\n-<a name=\"file_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_error_alert&labels=documentation&body=Documentation+under+heading+%22class+file_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"file-error-alert\">\n-<h1>file_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>If the storage fails to read or write files that it needs access to, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is\n-generated and the torrent is paused.</p>\n-<pre class=\"literal-block\">\n-struct file_error_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>filename</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status\n- | alert_category::storage;\n- error_code const error;\n- operation_t op;\n-};\n-</pre>\n-<a name=\"filename()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"filename\">\n-<h2>filename()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>filename</strong> () const;\n-</pre>\n-<p>the file that experienced the error</p>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error code describing the error.</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>indicates which underlying operation caused the error</dd>\n-</dl>\n-<a name=\"metadata_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"metadata-failed-alert\">\n-<h1>metadata_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct metadata_failed_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:metadata_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22metadata_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>indicates what failed when parsing the metadata. This error is\n-what's returned from lazy_bdecode().</dd>\n-</dl>\n-<a name=\"metadata_received_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_received_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_received_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"metadata-received-alert\">\n-<h1>metadata_received_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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).</p>\n-<p>There are no additional data members in this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<p>Typically, when receiving this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you would want to save the torrent file in order\n-to load it back up again when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is restarted. Here's an example snippet of\n-code to do that:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">alert</span><span class=\"operator\">-></span><span class=\"name\">handle</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">torrent_info</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">ti</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"punctuation\">.</span><span class=\"name\">torrent_file</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"name\">create_torrent</span><span class=\"whitespace\"> </span><span class=\"name function\">ct</span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"name\">ti</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">te</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ct</span><span class=\"punctuation\">.</span><span class=\"name\">generate</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buffer</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"name\">bencode</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">back_inserter</span><span class=\"punctuation\">(</span><span class=\"name\">buffer</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">te</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"keyword type\">FILE</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">fopen</span><span class=\"punctuation\">((</span><span class=\"name\">to_hex</span><span class=\"punctuation\">(</span><span class=\"name\">ti</span><span class=\"operator\">-></span><span class=\"name\">info_hashes</span><span class=\"punctuation\">().</span><span class=\"name\">get_best</span><span class=\"punctuation\">().</span><span class=\"name\">to_string</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">".torrent"</span><span class=\"punctuation\">).</span><span class=\"name\">c_str</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"literal string\">"wb+"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">fwrite</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">buffer</span><span class=\"punctuation\">[</span><span class=\"literal number integer\">0</span><span class=\"punctuation\">],</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">buffer</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n- </span><span class=\"name\">fclose</span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span>\n-</pre>\n-<pre class=\"literal-block\">\n-struct metadata_received_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"udp_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+udp_error_alert&labels=documentation&body=Documentation+under+heading+%22class+udp_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"udp-error-alert\">\n-<h1>udp_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n-<pre class=\"literal-block\">\n-struct udp_error_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- aux::noexcept_movable<udp::endpoint> endpoint;\n- operation_t operation;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoint</dt>\n-<dd>the source address associated with the error (if any)</dd>\n-</dl>\n-<a name=\"operation\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Boperation%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Boperation%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>operation</dt>\n-<dd>the operation that failed</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error code describing the error</dd>\n-</dl>\n-<a name=\"external_ip_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+external_ip_alert&labels=documentation&body=Documentation+under+heading+%22class+external_ip_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"external-ip-alert\">\n-<h1>external_ip_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>Whenever libtorrent learns about the machines external IP, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">external_address</tt> member.</p>\n-<pre class=\"literal-block\">\n-struct external_ip_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- aux::noexcept_movable<address> external_address;\n-};\n-</pre>\n-<a name=\"external_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:external_ip_alert%3A%3A%5Bexternal_address%5D&labels=documentation&body=Documentation+under+heading+%22external_ip_alert%3A%3A%5Bexternal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>external_address</dt>\n-<dd>the IP address that is believed to be our external IP</dd>\n-</dl>\n-<a name=\"listen_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"listen-failed-alert\">\n-<h1>listen_failed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when none of the ports, given in the port range, to\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> can be opened for listening. The <tt class=\"docutils literal\">listen_interface</tt> member is the\n-interface that failed, <tt class=\"docutils literal\">error</tt> is the error code describing the failure.</p>\n-<p>In the case an endpoint was created before generating the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, it is\n-represented by <tt class=\"docutils literal\">address</tt> and <tt class=\"docutils literal\">port</tt>. 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</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#listen_failed_alert\">listen_failed_alert</a> with port 0 even if you didn't ask to\n-listen on it.</p>\n-<pre class=\"literal-block\">\n-struct listen_failed_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>listen_interface</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"listen_interface()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"listen-interface\">\n-<h2>listen_interface()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>listen_interface</strong> () const;\n-</pre>\n-<p>the network device libtorrent attempted to listen on, or the IP address</p>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error the system returned</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the underlying operation that failed</dd>\n-</dl>\n-<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>socket_type</dt>\n-<dd>the type of listen socket this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> refers to.</dd>\n-</dl>\n-<a name=\"address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Baddress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>address</dt>\n-<dd>the address libtorrent attempted to listen on\n-see <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> documentation for validity of this value</dd>\n-</dl>\n-<a name=\"port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>port</dt>\n-<dd>the port libtorrent attempted to listen on\n-see <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> documentation for validity of this value</dd>\n-</dl>\n-<a name=\"listen_succeeded_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_succeeded_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_succeeded_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"listen-succeeded-alert\">\n-<h1>listen_succeeded_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the listen port succeeds to be opened on a\n-particular interface. <tt class=\"docutils literal\">address</tt> and <tt class=\"docutils literal\">port</tt> is the endpoint that\n-successfully was opened for listening.</p>\n-<pre class=\"literal-block\">\n-struct listen_succeeded_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- aux::noexcept_movable<lt::address> address;\n- int const port;\n- lt::socket_type_t const socket_type;\n-};\n-</pre>\n-<a name=\"address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Baddress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>address</dt>\n-<dd>the address libtorrent ended up listening on. This address\n-refers to the local interface.</dd>\n-</dl>\n-<a name=\"port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>port</dt>\n-<dd>the port libtorrent ended up listening on.</dd>\n-</dl>\n-<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>socket_type</dt>\n-<dd>the type of listen socket this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> refers to.</dd>\n-</dl>\n-<a name=\"portmap_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_error_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"portmap-error-alert\">\n-<h1>portmap_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct portmap_error_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"mapping\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmapping%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>mapping</dt>\n-<dd>refers to the mapping index of the port map that failed, i.e.\n-the index returned from add_mapping().</dd>\n-</dl>\n-<a name=\"map_transport\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmap_transport%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmap_transport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>map_transport</dt>\n-<dd>UPnP or NAT-PMP</dd>\n-</dl>\n-<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_address</dt>\n-<dd>the local network the port mapper is running on</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>tells you what failed.</dd>\n-</dl>\n-<a name=\"portmap_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"portmap-alert\">\n-<h1>portmap_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct portmap_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"mapping\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bmapping%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>mapping</dt>\n-<dd>refers to the mapping index of the port map that failed, i.e.\n-the index returned from add_mapping().</dd>\n-</dl>\n-<a name=\"external_port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bexternal_port%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bexternal_port%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>external_port</dt>\n-<dd>the external port allocated for the mapping.</dd>\n-</dl>\n-<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_address</dt>\n-<dd>the local network the port mapper is running on</dd>\n-</dl>\n-<a name=\"portmap_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_log_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"portmap-log-alert\">\n-<h1>portmap_log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only\n-posted if the alert_category::port_mapping_log flag is enabled in\n-the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n-<pre class=\"literal-block\">\n-struct portmap_log_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>log_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::port_mapping_log;\n- portmap_transport const map_transport;\n- aux::noexcept_movable<address> local_address;\n-};\n-</pre>\n-<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message\">\n-<h2>log_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>log_message</strong> () const;\n-</pre>\n-<p>the message associated with this log line</p>\n-<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_address</dt>\n-<dd>the local network the port mapper is running on</dd>\n-</dl>\n-<a name=\"fastresume_rejected_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+fastresume_rejected_alert&labels=documentation&body=Documentation+under+heading+%22class+fastresume_rejected_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"fastresume-rejected-alert\">\n-<h1>fastresume_rejected_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a fast resume file has been passed to\n-<a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct fastresume_rejected_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>file_path</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status\n- | alert_category::error;\n- error_code error;\n- operation_t op;\n-};\n-</pre>\n-<a name=\"file_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"file-path-1\">\n-<h2>file_path()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>file_path</strong> () const;\n-</pre>\n-<p>If the error happened to a specific file, this returns the path to it.</p>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the underlying operation that failed</dd>\n-</dl>\n-<a name=\"peer_blocked_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_blocked_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_blocked_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-blocked-alert\">\n-<h1>peer_blocked_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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:</p>\n-<ul class=\"simple\">\n-<li>the IP filter</li>\n-<li>i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)</li>\n-<li>the port filter</li>\n-<li>the peer has a low port and <tt class=\"docutils literal\">no_connect_privileged_ports</tt> is enabled</li>\n-<li>the protocol of the peer is blocked (uTP/TCP blocking)</li>\n-</ul>\n-<pre class=\"literal-block\">\n-struct peer_blocked_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () 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 <strong>static_category</strong> = alert_category::ip_block;\n- int const reason;\n-};\n-</pre>\n-<a name=\"reason_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+reason_t&labels=documentation&body=Documentation+under+heading+%22enum+reason_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-reason-t\">\n-<h2>enum reason_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"16%\" />\n-<col width=\"29%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>ip_filter</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>port_filter</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>i2p_mixed</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>privileged_ports</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>utp_disabled</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>tcp_disabled</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>invalid_local_interface</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>ssrf_mitigation</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"reason\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_blocked_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_blocked_alert%3A%3A%5Breason%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>reason</dt>\n-<dd>the reason for the peer being blocked. Is one of the values from the\n-<a class=\"reference external\" href=\"reference-Alerts.html#reason_t\">reason_t</a> enum.</dd>\n-</dl>\n-<a name=\"dht_announce_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_announce_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-announce-alert\">\n-<h1>dht_announce_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a DHT node announces to an info-hash on our\n-DHT node. It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n-<pre class=\"literal-block\">\n-struct dht_announce_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- aux::noexcept_movable<address> ip;\n- int port;\n- sha1_hash info_hash;\n-};\n-</pre>\n-<a name=\"dht_get_peers_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-get-peers-alert\">\n-<h1>dht_get_peers_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a DHT node sends a <tt class=\"docutils literal\">get_peers</tt> message to\n-our DHT node. It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n-<pre class=\"literal-block\">\n-struct dht_get_peers_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- sha1_hash info_hash;\n-};\n-</pre>\n-<a name=\"cache_flushed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+cache_flushed_alert&labels=documentation&body=Documentation+under+heading+%22class+cache_flushed_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"cache-flushed-alert\">\n-<h1>cache_flushed_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the disk cache has been flushed for a specific\n-torrent as a result of a call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#flush_cache()\">torrent_handle::flush_cache()</a>. This\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::storage</span></tt> category, which must be\n-enabled to let this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> through. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is also posted when removing\n-a torrent from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, once the outstanding cache flush is complete\n-and the torrent does no longer have any files open.</p>\n-<pre class=\"literal-block\">\n-struct cache_flushed_alert final : torrent_alert\n-{\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n-};\n-</pre>\n-<a name=\"lsd_peer_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_peer_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_peer_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"lsd-peer-alert\">\n-<h1>lsd_peer_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when we receive a local service discovery message\n-from a peer for a torrent we're currently participating in.</p>\n-<pre class=\"literal-block\">\n-struct lsd_peer_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n-};\n-</pre>\n-<a name=\"trackerid_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+trackerid_alert&labels=documentation&body=Documentation+under+heading+%22class+trackerid_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"trackerid-alert\">\n-<h1>trackerid_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted whenever a tracker responds with a <tt class=\"docutils literal\">trackerid</tt>.\n-The tracker ID is like a cookie. libtorrent will store the tracker ID\n-for this tracker and repeat it in subsequent announces.</p>\n-<pre class=\"literal-block\">\n-struct trackerid_alert final : tracker_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>tracker_id</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"tracker_id()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:trackerid_alert%3A%3A%5Btracker_id%28%29%5D&labels=documentation&body=Documentation+under+heading+%22trackerid_alert%3A%3A%5Btracker_id%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"tracker-id\">\n-<h2>tracker_id()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>tracker_id</strong> () const;\n-</pre>\n-<p>The tracker ID returned by the tracker</p>\n-<a name=\"dht_bootstrap_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_bootstrap_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_bootstrap_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-bootstrap-alert\">\n-<h1>dht_bootstrap_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the initial DHT bootstrap is done.</p>\n-<pre class=\"literal-block\">\n-struct dht_bootstrap_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n-};\n-</pre>\n-<a name=\"torrent_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_error_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-error-alert\">\n-<h1>torrent_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is posted whenever a torrent is transitioned into the error state.\n-If the error code is duplicate_torrent (<a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a>) error, it suggests two magnet\n-links ended up resolving to the same hybrid torrent. For more details,\n-see <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.</p>\n-<pre class=\"literal-block\">\n-struct torrent_error_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>filename</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error | alert_category::status;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"filename()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"filename-1\">\n-<h2>filename()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>filename</strong> () const;\n-</pre>\n-<p>the filename (or object) the error occurred on.</p>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>specifies which error the torrent encountered.</dd>\n-</dl>\n-<a name=\"torrent_need_cert_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_need_cert_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_need_cert_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-need-cert-alert\">\n-<h1>torrent_need_cert_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is always posted for SSL torrents. This is a reminder to the client that\n-the torrent won't work unless <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_ssl_certificate()\">torrent_handle::set_ssl_certificate()</a> is called with\n-a valid certificate. Valid certificates MUST be signed by the SSL certificate\n-in the .torrent file.</p>\n-<pre class=\"literal-block\">\n-struct torrent_need_cert_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n-};\n-</pre>\n-<a name=\"incoming_connection_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_connection_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_connection_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"incoming-connection-alert\">\n-<h1>incoming_connection_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The incoming connection <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct incoming_connection_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n- socket_type_t socket_type;\n- aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> endpoint;\n-};\n-</pre>\n-<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>socket_type</dt>\n-<dd>tells you what kind of socket the connection was accepted</dd>\n-</dl>\n-<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoint</dt>\n-<dd>is the IP address and port the connection came from.</dd>\n-</dl>\n-<a name=\"add_torrent_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-torrent-alert\">\n-<h1>add_torrent_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">handle</tt> member in the base class. If adding\n-the torrent failed, <tt class=\"docutils literal\">error</tt> contains the error code.</p>\n-<pre class=\"literal-block\">\n-struct add_torrent_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- add_torrent_params params;\n- error_code error;\n-};\n-</pre>\n-<a name=\"params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Bparams%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>params</dt>\n-<dd><p class=\"first\">This contains copies of the most important fields from the original\n-<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object, passed to <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or\n-<a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a>. Specifically, these fields are copied:</p>\n-<ul class=\"simple\">\n-<li>version</li>\n-<li>ti</li>\n-<li>name</li>\n-<li>save_path</li>\n-<li>userdata</li>\n-<li>tracker_id</li>\n-<li>flags</li>\n-<li>info_hash</li>\n-</ul>\n-<p class=\"last\">the info_hash field will be updated with the info-hash of the torrent\n-specified by <tt class=\"docutils literal\">ti</tt>.</p>\n-</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>set to the error, if one occurred while adding the torrent.</dd>\n-</dl>\n-<a name=\"state_update_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_update_alert&labels=documentation&body=Documentation+under+heading+%22class+state_update_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"state-update-alert\">\n-<h1>state_update_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only posted when requested by the user, by calling\n-session::post_torrent_updates() on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It contains the torrent\n-status of all torrents that changed since last time this message was\n-posted. Its category is <tt class=\"docutils literal\"><span class=\"pre\">alert_category::status</span></tt>, but it's not subject to\n-filtering, since it's only manually posted anyway.</p>\n-<pre class=\"literal-block\">\n-struct state_update_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- std::vector<torrent_status> status;\n-};\n-</pre>\n-<a name=\"status\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_update_alert%3A%3A%5Bstatus%5D&labels=documentation&body=Documentation+under+heading+%22state_update_alert%3A%3A%5Bstatus%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>status</dt>\n-<dd>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 <tt class=\"docutils literal\">handle</tt> member. The receiving end is\n-suggested to have all torrents sorted by the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> or hashed\n-by it, for efficient updates.</dd>\n-</dl>\n-<a name=\"session_stats_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-stats-alert\">\n-<h1>session_stats_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> is posted when the user requests <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> statistics by\n-calling <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n-<p>the <tt class=\"docutils literal\">message()</tt> member function returns a string representation of the values that\n-properly match the line returned in <tt class=\"docutils literal\"><span class=\"pre\">session_stats_header_alert::message()</span></tt>.</p>\n-<p>this specific output is parsed by tools/parse_session_stats.py\n-if this is changed, that parser should also be changed</p>\n-<pre class=\"literal-block\">\n-struct session_stats_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- span<std::int64_t const> <strong>counters</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = {};\n-};\n-</pre>\n-<a name=\"counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_alert%3A%3A%5Bcounters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_stats_alert%3A%3A%5Bcounters%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"counters-1\">\n-<h2>counters()</h2>\n-<pre class=\"literal-block\">\n-span<std::int64_t const> <strong>counters</strong> () const;\n-</pre>\n-<p>An array are a mix of <em>counters</em> and <em>gauges</em>, which meanings can be\n-queries via the <a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a> function on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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-<a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a>, once on startup, and then use that mapping to\n-interpret these values throughout the process' runtime.</p>\n-<p>For more information, see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n-<a name=\"dht_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_error_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-error-alert\">\n-<h1>dht_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when something fails in the DHT. This is not necessarily a fatal\n-error, but it could prevent proper operation</p>\n-<pre class=\"literal-block\">\n-struct dht_error_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error | alert_category::dht;\n- error_code error;\n- operation_t op;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error code</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the operation that failed</dd>\n-</dl>\n-<a name=\"dht_immutable_item_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_immutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_immutable_item_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-immutable-item-alert\">\n-<h1>dht_immutable_item_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted as a response to a call to session::get_item(),\n-specifically the overload for looking up immutable items in the DHT.</p>\n-<pre class=\"literal-block\">\n-struct dht_immutable_item_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- sha1_hash target;\n- entry item;\n-};\n-</pre>\n-<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>target</dt>\n-<dd>the target hash of the immutable item. This must\n-match the SHA-1 hash of the bencoded form of <tt class=\"docutils literal\">item</tt>.</dd>\n-</dl>\n-<a name=\"item\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>item</dt>\n-<dd>the data for this item</dd>\n-</dl>\n-<a name=\"dht_mutable_item_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_mutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_mutable_item_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-mutable-item-alert\">\n-<h1>dht_mutable_item_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted as a response to a call to session::get_item(),\n-specifically the overload for looking up mutable items in the DHT.</p>\n-<pre class=\"literal-block\">\n-struct dht_mutable_item_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"key\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bkey%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bkey%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>key</dt>\n-<dd>the public key that was looked up</dd>\n-</dl>\n-<a name=\"signature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsignature%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsignature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>signature</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"seq\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bseq%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bseq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>seq</dt>\n-<dd>the sequence number of this item</dd>\n-</dl>\n-<a name=\"salt\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsalt%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsalt%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>salt</dt>\n-<dd>the salt, if any, used to lookup and store this item. If no\n-salt was used, this is an empty string</dd>\n-</dl>\n-<a name=\"item\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>item</dt>\n-<dd>the data for this item</dd>\n-</dl>\n-<a name=\"authoritative\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bauthoritative%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bauthoritative%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>authoritative</dt>\n-<dd>the last response for mutable data is authoritative.</dd>\n-</dl>\n-<a name=\"dht_put_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_put_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_put_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-put-alert\">\n-<h1>dht_put_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct dht_put_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>target</dt>\n-<dd>the target hash the item was stored under if this was an <em>immutable</em>\n-item.</dd>\n-</dl>\n-<a name=\"public_key\"></a>\n-<a name=\"signature\"></a>\n-<a name=\"salt\"></a>\n-<a name=\"seq\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>public_key signature salt seq</dt>\n-<dd>if a mutable item was stored, these are the public key, signature,\n-salt and sequence number the item was stored under.</dd>\n-</dl>\n-<a name=\"num_success\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bnum_success%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bnum_success%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_success</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"i2p_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+i2p_alert&labels=documentation&body=Documentation+under+heading+%22class+i2p_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"i2p-alert\">\n-<h1>i2p_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is used to report errors in the i2p SAM connection</p>\n-<pre class=\"literal-block\">\n-struct i2p_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- error_code error;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22i2p_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error that occurred in the i2p SAM connection</dd>\n-</dl>\n-<a name=\"dht_outgoing_get_peers_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_outgoing_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_outgoing_get_peers_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-outgoing-get-peers-alert\">\n-<h1>dht_outgoing_get_peers_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when we send a get_peers request\n-It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n-<pre class=\"literal-block\">\n-struct dht_outgoing_get_peers_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- sha1_hash info_hash;\n- sha1_hash obfuscated_info_hash;\n- aux::noexcept_movable<udp::endpoint> endpoint;\n-};\n-</pre>\n-<a name=\"info_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hash</dt>\n-<dd>the info_hash of the torrent we're looking for peers for.</dd>\n-</dl>\n-<a name=\"obfuscated_info_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>obfuscated_info_hash</dt>\n-<dd>if this was an obfuscated lookup, this is the info-hash target\n-actually sent to the node.</dd>\n-</dl>\n-<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoint</dt>\n-<dd>the endpoint we're sending this query to</dd>\n-</dl>\n-<a name=\"log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+log_alert&labels=documentation&body=Documentation+under+heading+%22class+log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"log-alert\">\n-<h1>log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted by some <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide event. Its main purpose is\n-trouble shooting and debugging. It's not enabled by the default <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::session_log</span></tt> bit.\n-Furthermore, it's by default disabled as a build configuration.</p>\n-<pre class=\"literal-block\">\n-struct log_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>log_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::session_log;\n-};\n-</pre>\n-<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-1\">\n-<h2>log_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>log_message</strong> () const;\n-</pre>\n-<p>returns the log message</p>\n-<a name=\"torrent_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_log_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-log-alert\">\n-<h1>torrent_log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::torrent_log</span></tt> bit. By\n-default it is disabled as a build configuration.</p>\n-<pre class=\"literal-block\">\n-struct torrent_log_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>log_message</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::torrent_log;\n-};\n-</pre>\n-<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-2\">\n-<h2>log_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>log_message</strong> () const;\n-</pre>\n-<p>returns the log message</p>\n-<a name=\"peer_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_log_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-log-alert\">\n-<h1>peer_log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::peer_log</span></tt> bit. By\n-default it is disabled as a build configuration.</p>\n-<pre class=\"literal-block\">\n-struct peer_log_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>log_message</strong> () 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 <strong>static_category</strong> = alert_category::peer_log;\n- char const* event_type;\n- direction_t direction;\n-};\n-</pre>\n-<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-3\">\n-<h2>log_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>log_message</strong> () const;\n-</pre>\n-<p>returns the log message</p>\n-<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-direction-t-1\">\n-<h2>enum direction_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"47%\" />\n-<col width=\"18%\" />\n-<col width=\"34%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>incoming_message</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>outgoing_message</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>incoming</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>outgoing</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>info</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"event_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Bevent_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Bevent_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>event_type</dt>\n-<dd>string literal indicating the kind of event. For messages, this is the\n-message name.</dd>\n-</dl>\n-<a name=\"lsd_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_error_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"lsd-error-alert\">\n-<h1>lsd_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted if the local service discovery socket fails to start properly.\n-it's categorized as <tt class=\"docutils literal\"><span class=\"pre\">alert_category::error</span></tt>.</p>\n-<pre class=\"literal-block\">\n-struct lsd_error_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- aux::noexcept_movable<address> local_address;\n- error_code error;\n-};\n-</pre>\n-<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_address</dt>\n-<dd>the local network the corresponding local service discovery is running\n-on</dd>\n-</dl>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>The error code</dd>\n-</dl>\n-<a name=\"dht_lookup\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_lookup&labels=documentation&body=Documentation+under+heading+%22class+dht_lookup%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-lookup\">\n-<h1>dht_lookup</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>holds statistics about a current <a class=\"reference external\" href=\"reference-Alerts.html#dht_lookup\">dht_lookup</a> 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</p>\n-<pre class=\"literal-block\">\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-</pre>\n-<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btype%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btype%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>type</dt>\n-<dd>string literal indicating which kind of lookup this is</dd>\n-</dl>\n-<a name=\"outstanding_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Boutstanding_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Boutstanding_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>outstanding_requests</dt>\n-<dd>the number of outstanding request to individual nodes\n-this lookup has right now</dd>\n-</dl>\n-<a name=\"timeouts\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btimeouts%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btimeouts%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>timeouts</dt>\n-<dd>the total number of requests that have timed out so far\n-for this lookup</dd>\n-</dl>\n-<a name=\"responses\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bresponses%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bresponses%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>responses</dt>\n-<dd>the total number of responses we have received for this\n-lookup so far for this lookup</dd>\n-</dl>\n-<a name=\"branch_factor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bbranch_factor%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bbranch_factor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>branch_factor</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"nodes_left\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bnodes_left%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bnodes_left%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nodes_left</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"last_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Blast_sent%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Blast_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_sent</dt>\n-<dd>the number of seconds ago the\n-last message was sent that's still\n-outstanding</dd>\n-</dl>\n-<a name=\"first_timeout\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bfirst_timeout%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bfirst_timeout%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>first_timeout</dt>\n-<dd>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</dd>\n-</dl>\n-<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>target</dt>\n-<dd>the node-id or info-hash target for this lookup</dd>\n-</dl>\n-<a name=\"dht_stats_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_stats_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-stats-alert\">\n-<h1>dht_stats_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>contains current DHT state. Posted in response to session::post_dht_stats().</p>\n-<pre class=\"literal-block\">\n-struct dht_stats_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = {};\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-</pre>\n-<a name=\"active_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bactive_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bactive_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>active_requests</dt>\n-<dd>a vector of the currently running DHT lookups.</dd>\n-</dl>\n-<a name=\"routing_table\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Brouting_table%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Brouting_table%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>routing_table</dt>\n-<dd>contains information about every bucket in the DHT routing\n-table.</dd>\n-</dl>\n-<a name=\"nid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bnid%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bnid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nid</dt>\n-<dd>the node ID of the DHT node instance</dd>\n-</dl>\n-<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>local_endpoint</dt>\n-<dd>the local socket this DHT node is running on</dd>\n-</dl>\n-<a name=\"incoming_request_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_request_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_request_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"incoming-request-alert\">\n-<h1>incoming_request_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted every time an incoming request from a peer is accepted and queued\n-up for being serviced. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only posted if\n-the alert_category::incoming_request flag is enabled in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-mask.</p>\n-<pre class=\"literal-block\">\n-struct incoming_request_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::incoming_request;\n- peer_request req;\n-};\n-</pre>\n-<a name=\"req\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_request_alert%3A%3A%5Breq%5D&labels=documentation&body=Documentation+under+heading+%22incoming_request_alert%3A%3A%5Breq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>req</dt>\n-<dd>the request this peer sent to us</dd>\n-</dl>\n-<a name=\"dht_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_log_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-log-alert\">\n-<h1>dht_log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>debug logging of the DHT when alert_category::dht_log is set in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-mask.</p>\n-<pre class=\"literal-block\">\n-struct dht_log_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- char const* <strong>log_message</strong> () 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 <strong>static_category</strong> = alert_category::dht_log;\n- dht_module_t module;\n-};\n-</pre>\n-<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-4\">\n-<h2>log_message()</h2>\n-<pre class=\"literal-block\">\n-char const* <strong>log_message</strong> () const;\n-</pre>\n-<p>the log message</p>\n-<a name=\"dht_module_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+dht_module_t&labels=documentation&body=Documentation+under+heading+%22enum+dht_module_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-dht-module-t\">\n-<h2>enum dht_module_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"43%\" />\n-<col width=\"20%\" />\n-<col width=\"37%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>tracker</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>node</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>routing_table</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>rpc_manager</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>traversal</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"module\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Bmodule%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Bmodule%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>module</dt>\n-<dd>the module, or part, of the DHT that produced this log message.</dd>\n-</dl>\n-<a name=\"dht_pkt_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_pkt_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_pkt_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-pkt-alert\">\n-<h1>dht_pkt_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted every time a DHT message is sent or received. It is\n-only posted if the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht_log</span></tt> <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> category is\n-enabled. It contains a verbatim copy of the message.</p>\n-<pre class=\"literal-block\">\n-struct dht_pkt_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- span<char const> <strong>pkt_buf</strong> () const;\n-\n- enum direction_t\n- {\n- incoming,\n- outgoing,\n- };\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht_log;\n- direction_t direction;\n- aux::noexcept_movable<udp::endpoint> node;\n-};\n-</pre>\n-<a name=\"pkt_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"pkt-buf\">\n-<h2>pkt_buf()</h2>\n-<pre class=\"literal-block\">\n-span<char const> <strong>pkt_buf</strong> () const;\n-</pre>\n-<p>returns a pointer to the packet buffer and size of the packet,\n-respectively. This buffer is only valid for as long as the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> itself\n-is valid, which is owned by libtorrent and reclaimed whenever\n-<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> is called on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n-<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-direction-t-2\">\n-<h2>enum direction_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"33%\" />\n-<col width=\"23%\" />\n-<col width=\"43%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>incoming</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>outgoing</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"direction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bdirection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>direction</dt>\n-<dd>whether this is an incoming or outgoing packet.</dd>\n-</dl>\n-<a name=\"node\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bnode%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bnode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>node</dt>\n-<dd>the DHT node we received this packet from, or sent this packet to\n-(depending on <tt class=\"docutils literal\">direction</tt>).</dd>\n-</dl>\n-<a name=\"dht_get_peers_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-get-peers-reply-alert\">\n-<h1>dht_get_peers_reply_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>Posted when we receive a response to a DHT get_peers request.</p>\n-<pre class=\"literal-block\">\n-struct dht_get_peers_reply_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- int <strong>num_peers</strong> () const;\n- std::vector<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> <strong>peers</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht_operation;\n- sha1_hash info_hash;\n-};\n-</pre>\n-<a name=\"dht_direct_response_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_direct_response_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_direct_response_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-direct-response-alert\">\n-<h1>dht_direct_response_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This is posted exactly once for every call to session_handle::dht_direct_request.\n-If the request failed, <a class=\"reference external\" href=\"reference-Alerts.html#response()\">response()</a> will return a default constructed <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.</p>\n-<pre class=\"literal-block\">\n-struct dht_direct_response_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- bdecode_node <strong>response</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- client_data_t userdata;\n- aux::noexcept_movable<udp::endpoint> endpoint;\n-};\n-</pre>\n-<a name=\"picker_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+picker_log_alert&labels=documentation&body=Documentation+under+heading+%22class+picker_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"picker-log-alert\">\n-<h1>picker_log_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>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).</p>\n-<pre class=\"literal-block\">\n-struct picker_log_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n- std::vector<piece_block> <strong>blocks</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::picker_log;\n- static constexpr picker_flags_t <strong>partial_ratio</strong> = 0_bit;\n- static constexpr picker_flags_t <strong>prioritize_partials</strong> = 1_bit;\n- static constexpr picker_flags_t <strong>rarest_first_partials</strong> = 2_bit;\n- static constexpr picker_flags_t <strong>rarest_first</strong> = 3_bit;\n- static constexpr picker_flags_t <strong>reverse_rarest_first</strong> = 4_bit;\n- static constexpr picker_flags_t <strong>suggested_pieces</strong> = 5_bit;\n- static constexpr picker_flags_t <strong>prio_sequential_pieces</strong> = 6_bit;\n- static constexpr picker_flags_t <strong>sequential_pieces</strong> = 7_bit;\n- static constexpr picker_flags_t <strong>reverse_pieces</strong> = 8_bit;\n- static constexpr picker_flags_t <strong>time_critical</strong> = 9_bit;\n- static constexpr picker_flags_t <strong>random_pieces</strong> = 10_bit;\n- static constexpr picker_flags_t <strong>prefer_contiguous</strong> = 11_bit;\n- static constexpr picker_flags_t <strong>reverse_sequential</strong> = 12_bit;\n- static constexpr picker_flags_t <strong>backup1</strong> = 13_bit;\n- static constexpr picker_flags_t <strong>backup2</strong> = 14_bit;\n- static constexpr picker_flags_t <strong>end_game</strong> = 15_bit;\n- static constexpr picker_flags_t <strong>extent_affinity</strong> = 16_bit;\n- picker_flags_t const picker_flags;\n-};\n-</pre>\n-<a name=\"picker_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:picker_log_alert%3A%3A%5Bpicker_flags%5D&labels=documentation&body=Documentation+under+heading+%22picker_log_alert%3A%3A%5Bpicker_flags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>picker_flags</dt>\n-<dd>this is a bitmask of which features were enabled for this particular\n-pick. The bits are defined in the picker_flags_t enum.</dd>\n-</dl>\n-<a name=\"session_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_error_alert&labels=documentation&body=Documentation+under+heading+%22class+session_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"session-error-alert\">\n-<h1>session_error_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> encounters a serious error,\n-potentially fatal</p>\n-<pre class=\"literal-block\">\n-struct session_error_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- error_code const error;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22session_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>The error code, if one is associated with this error</dd>\n-</dl>\n-<a name=\"dht_live_nodes_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_live_nodes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_live_nodes_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-live-nodes-alert\">\n-<h1>dht_live_nodes_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct dht_live_nodes_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n- int <strong>num_nodes</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n- sha1_hash node_id;\n-};\n-</pre>\n-<a name=\"num_nodes()\"></a>\n-<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"num-nodes-nodes\">\n-<h2>num_nodes() nodes()</h2>\n-<pre class=\"literal-block\">\n-std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n-int <strong>num_nodes</strong> () const;\n-</pre>\n-<p>the number of nodes in the routing table and the actual nodes.</p>\n-<a name=\"node_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>node_id</dt>\n-<dd>the local DHT node's node-ID this routing table belongs to</dd>\n-</dl>\n-<a name=\"session_stats_header_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_header_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_header_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"session-stats-header-alert\">\n-<h1>session_stats_header_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>The session_stats_header <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted the first time\n-<a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> is called</p>\n-<p>the <tt class=\"docutils literal\">message()</tt> member function returns a string representation of the\n-header that properly match the stats values string returned in\n-<tt class=\"docutils literal\"><span class=\"pre\">session_stats_alert::message()</span></tt>.</p>\n-<p>this specific output is parsed by tools/parse_session_stats.py\n-if this is changed, that parser should also be changed</p>\n-<pre class=\"literal-block\">\n-struct session_stats_header_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = {};\n-};\n-</pre>\n-<a name=\"dht_sample_infohashes_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_sample_infohashes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_sample_infohashes_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dht-sample-infohashes-alert\">\n-<h1>dht_sample_infohashes_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted as a response to a call to session::dht_sample_infohashes() with\n-the information from the DHT response message.</p>\n-<pre class=\"literal-block\">\n-struct dht_sample_infohashes_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- int <strong>num_samples</strong> () const;\n- std::vector<sha1_hash> <strong>samples</strong> () const;\n- int <strong>num_nodes</strong> () const;\n- std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = 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-</pre>\n-<a name=\"samples()\"></a>\n-<a name=\"num_samples()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"samples-num-samples\">\n-<h2>samples() num_samples()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_samples</strong> () const;\n-std::vector<sha1_hash> <strong>samples</strong> () const;\n-</pre>\n-<p>returns the number of info-hashes returned by the node, as well as the\n-actual info-hashes. <tt class=\"docutils literal\">num_samples()</tt> is more efficient than\n-<tt class=\"docutils literal\"><span class=\"pre\">samples().size()</span></tt>.</p>\n-<a name=\"num_nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-nodes\">\n-<h2>num_nodes()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_nodes</strong> () const;\n-</pre>\n-<p>The total number of nodes returned by <tt class=\"docutils literal\">nodes()</tt>.</p>\n-<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"nodes-1\">\n-<h2>nodes()</h2>\n-<pre class=\"literal-block\">\n-std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n-</pre>\n-<p>This is the set of more DHT nodes returned by the request.</p>\n-<p>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.</p>\n-<a name=\"node_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>node_id</dt>\n-<dd>id of the node the request was sent to (and this response was received from)</dd>\n-</dl>\n-<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>endpoint</dt>\n-<dd>the node the request was sent to (and this response was received from)</dd>\n-</dl>\n-<a name=\"interval\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Binterval%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Binterval%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>interval</dt>\n-<dd>the interval to wait before making another request to this node</dd>\n-</dl>\n-<a name=\"num_infohashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_infohashes</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"block_uploaded_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_uploaded_alert&labels=documentation&body=Documentation+under+heading+%22class+block_uploaded_alert%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"block-uploaded-alert\">\n-<h1>block_uploaded_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> may be posted without the bytes having been sent to the peer.\n-It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::upload</span></tt> category.</p>\n-<pre class=\"literal-block\">\n-struct block_uploaded_alert final : peer_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- int const block_index;\n- piece_index_t const piece_index;\n-};\n-</pre>\n-<a name=\"alerts_dropped_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alerts_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+alerts_dropped_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"alerts-dropped-alert\">\n-<h1>alerts_dropped_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted to indicate to the client that some alerts were\n-dropped. Dropped meaning that the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> failed to be delivered to the\n-client. The most common cause of such failure is that the internal <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-queue grew too big (controlled by alert_queue_size).</p>\n-<pre class=\"literal-block\">\n-struct alerts_dropped_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n- <strong>static_assert</strong> (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- std::bitset<abi_alert_count> dropped_alerts;\n-};\n-</pre>\n-<a name=\"dropped_alerts\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D&labels=documentation&body=Documentation+under+heading+%22alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dropped_alerts</dt>\n-<dd>a bitmask indicating which alerts were dropped. Each bit represents the\n-<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type ID, where bit 0 represents whether any <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> of type 0 has\n-been dropped, and so on.</dd>\n-</dl>\n-<a name=\"socks5_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+socks5_alert&labels=documentation&body=Documentation+under+heading+%22class+socks5_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"socks5-alert\">\n-<h1>socks5_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n-configured. It's enabled with the alert_category::error <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> category.</p>\n-<pre class=\"literal-block\">\n-struct socks5_alert final : alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- error_code error;\n- operation_t op;\n- aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> ip;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the operation that failed</dd>\n-</dl>\n-<a name=\"ip\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bip%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bip%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ip</dt>\n-<dd>the endpoint configured as the proxy</dd>\n-</dl>\n-<a name=\"file_prio_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_prio_alert&labels=documentation&body=Documentation+under+heading+%22class+file_prio_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-prio-alert\">\n-<h1>file_prio_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#prioritize_files()\">prioritize_files()</a> or <a class=\"reference external\" href=\"reference-Torrent_Handle.html#file_priority()\">file_priority()</a> update of the file\n-priorities complete, which requires a round-trip to the disk thread.</p>\n-<p>If the disk operation fails this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> won't be posted, but a\n-<a class=\"reference external\" href=\"reference-Alerts.html#file_error_alert\">file_error_alert</a> is posted instead, and the torrent is stopped.</p>\n-<pre class=\"literal-block\">\n-struct file_prio_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n- error_code error;\n- operation_t op;\n-};\n-</pre>\n-<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd>the error</dd>\n-</dl>\n-<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>op</dt>\n-<dd>the operation that failed</dd>\n-</dl>\n-<a name=\"oversized_file_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+oversized_file_alert&labels=documentation&body=Documentation+under+heading+%22class+oversized_file_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"oversized-file-alert\">\n-<h1>oversized_file_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted.\n-the client may want to call <a class=\"reference external\" href=\"reference-Core.html#truncate_files()\">truncate_files()</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct oversized_file_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n-};\n-</pre>\n-<a name=\"torrent_conflict_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_conflict_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_conflict_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-conflict-alert\">\n-<h1>torrent_conflict_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">duplicate_torrent</tt>\n-as the error code. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted containing the metadata. For more\n-information, see <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.\n-The torrent this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> originated from was the one that downloaded the</p>\n-<p>metadata (i.e. the <cite>handle</cite> member from the <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a> base class).</p>\n-<pre class=\"literal-block\">\n-struct torrent_conflict_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n- torrent_handle conflicting_torrent;\n- std::shared_ptr<torrent_info> metadata;\n-};\n-</pre>\n-<a name=\"conflicting_torrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>conflicting_torrent</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bmetadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bmetadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>metadata</dt>\n-<dd>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</dd>\n-</dl>\n-<a name=\"peer_info_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_info_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_info_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-info-alert\">\n-<h1>peer_info_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_peer_info()\">torrent_handle::post_peer_info()</a> is called</p>\n-<pre class=\"literal-block\">\n-struct peer_info_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- std::vector<lt::peer_info> peer_info;\n-};\n-</pre>\n-<a name=\"peer_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info_alert%3A%3A%5Bpeer_info%5D&labels=documentation&body=Documentation+under+heading+%22peer_info_alert%3A%3A%5Bpeer_info%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>peer_info</dt>\n-<dd>the list of the currently connected peers</dd>\n-</dl>\n-<a name=\"file_progress_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_progress_alert&labels=documentation&body=Documentation+under+heading+%22class+file_progress_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-progress-alert\">\n-<h1>file_progress_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_file_progress()\">torrent_handle::post_file_progress()</a> is called</p>\n-<pre class=\"literal-block\">\n-struct file_progress_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::file_progress;\n- aux::vector<std::int64_t, file_index_t> files;\n-};\n-</pre>\n-<a name=\"files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_progress_alert%3A%3A%5Bfiles%5D&labels=documentation&body=Documentation+under+heading+%22file_progress_alert%3A%3A%5Bfiles%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>files</dt>\n-<dd>the list of the files in the torrent</dd>\n-</dl>\n-<a name=\"piece_info_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_info_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_info_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-info-alert\">\n-<h1>piece_info_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_download_queue()\">torrent_handle::post_download_queue()</a> is called</p>\n-<pre class=\"literal-block\">\n-struct piece_info_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::piece_progress;\n- std::vector<partial_piece_info> piece_info;\n- std::vector<block_info> block_data;\n-};\n-</pre>\n-<a name=\"piece_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_info_alert%3A%3A%5Bpiece_info%5D&labels=documentation&body=Documentation+under+heading+%22piece_info_alert%3A%3A%5Bpiece_info%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_info</dt>\n-<dd>info about pieces being downloaded for the torrent</dd>\n-</dl>\n-<a name=\"block_data\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_info_alert%3A%3A%5Bblock_data%5D&labels=documentation&body=Documentation+under+heading+%22piece_info_alert%3A%3A%5Bblock_data%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>block_data</dt>\n-<dd>storage for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_info\">block_info</a> pointers in <a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a> objects</dd>\n-</dl>\n-<a name=\"piece_availability_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_availability_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_availability_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-availability-alert\">\n-<h1>piece_availability_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_piece_availability()\">torrent_handle::post_piece_availability()</a> is called</p>\n-<pre class=\"literal-block\">\n-struct piece_availability_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- std::vector<int> piece_availability;\n-};\n-</pre>\n-<a name=\"piece_availability\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_availability_alert%3A%3A%5Bpiece_availability%5D&labels=documentation&body=Documentation+under+heading+%22piece_availability_alert%3A%3A%5Bpiece_availability%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>piece_availability</dt>\n-<dd>info about pieces being downloaded for the torrent</dd>\n-</dl>\n-<a name=\"tracker_list_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_list_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_list_alert%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tracker-list-alert\">\n-<h1>tracker_list_alert</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_trackers()\">torrent_handle::post_trackers()</a> is called</p>\n-<pre class=\"literal-block\">\n-struct tracker_list_alert final : torrent_alert\n-{\n- std::string <strong>message</strong> () const override;\n-\n- static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n- std::vector<announce_entry> trackers;\n-};\n-</pre>\n-<a name=\"trackers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_list_alert%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_list_alert%3A%3A%5Btrackers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>trackers</dt>\n-<dd>list of trackers and their status for the torrent</dd>\n-</dl>\n-<a name=\"alert_cast()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_cast%28%29&labels=documentation&body=Documentation+under+heading+%22alert_cast%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"alert-cast\">\n-<h1>alert_cast()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-template <typename T> T const* <strong>alert_cast</strong> (alert const* a);\n-template <typename T> T* <strong>alert_cast</strong> (alert* a);\n-</pre>\n-<p>When you get an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you can use <tt class=\"docutils literal\">alert_cast<></tt> to attempt to cast the\n-pointer to a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, in order to query it for more\n-information.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\"><tt class=\"docutils literal\">alert_cast<></tt> can only cast to an exact <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, not a base class</p>\n-</div>\n-<a name=\"operation_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:operation_name%28%29&labels=documentation&body=Documentation+under+heading+%22operation_name%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operation-name\">\n-<h1>operation_name()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/operations.hpp\">libtorrent/operations.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-char const* <strong>operation_name</strong> (operation_t op);\n-</pre>\n-<p>maps an operation id (from <a class=\"reference external\" href=\"reference-Alerts.html#peer_error_alert\">peer_error_alert</a> and <a class=\"reference external\" href=\"reference-Alerts.html#peer_disconnected_alert\">peer_disconnected_alert</a>)\n-to its name. See <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> for the constants</p>\n-<a name=\"operation_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+operation_t&labels=documentation&body=Documentation+under+heading+%22enum+operation_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-operation-t\">\n-<h1>enum operation_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/operations.hpp\">libtorrent/operations.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"21%\" />\n-<col width=\"7%\" />\n-<col width=\"72%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>unknown</td>\n-<td>0</td>\n-<td>the error was unexpected and it is unknown which operation caused it</td>\n-</tr>\n-<tr><td>bittorrent</td>\n-<td>1</td>\n-<td>this is used when the bittorrent logic\n-determines to disconnect</td>\n-</tr>\n-<tr><td>iocontrol</td>\n-<td>2</td>\n-<td>a call to iocontrol failed</td>\n-</tr>\n-<tr><td>getpeername</td>\n-<td>3</td>\n-<td>a call to <tt class=\"docutils literal\">getpeername()</tt> failed (querying the remote IP of a\n-connection)</td>\n-</tr>\n-<tr><td>getname</td>\n-<td>4</td>\n-<td>a call to getname failed (querying the local IP of a\n-connection)</td>\n-</tr>\n-<tr><td>alloc_recvbuf</td>\n-<td>5</td>\n-<td>an attempt to allocate a receive buffer failed</td>\n-</tr>\n-<tr><td>alloc_sndbuf</td>\n-<td>6</td>\n-<td>an attempt to allocate a send buffer failed</td>\n-</tr>\n-<tr><td>file_write</td>\n-<td>7</td>\n-<td>writing to a file failed</td>\n-</tr>\n-<tr><td>file_read</td>\n-<td>8</td>\n-<td>reading from a file failed</td>\n-</tr>\n-<tr><td>file</td>\n-<td>9</td>\n-<td>a non-read and non-write file operation failed</td>\n-</tr>\n-<tr><td>sock_write</td>\n-<td>10</td>\n-<td>a socket write operation failed</td>\n-</tr>\n-<tr><td>sock_read</td>\n-<td>11</td>\n-<td>a socket read operation failed</td>\n-</tr>\n-<tr><td>sock_open</td>\n-<td>12</td>\n-<td>a call to open(), to create a socket socket failed</td>\n-</tr>\n-<tr><td>sock_bind</td>\n-<td>13</td>\n-<td>a call to bind() on a socket failed</td>\n-</tr>\n-<tr><td>available</td>\n-<td>14</td>\n-<td>an attempt to query the number of bytes available to read from a socket\n-failed</td>\n-</tr>\n-<tr><td>encryption</td>\n-<td>15</td>\n-<td>a call related to bittorrent protocol encryption failed</td>\n-</tr>\n-<tr><td>connect</td>\n-<td>16</td>\n-<td>an attempt to connect a socket failed</td>\n-</tr>\n-<tr><td>ssl_handshake</td>\n-<td>17</td>\n-<td>establishing an SSL connection failed</td>\n-</tr>\n-<tr><td>get_interface</td>\n-<td>18</td>\n-<td>a connection failed to satisfy the bind interface setting</td>\n-</tr>\n-<tr><td>sock_listen</td>\n-<td>19</td>\n-<td>a call to listen() on a socket</td>\n-</tr>\n-<tr><td>sock_bind_to_device</td>\n-<td>20</td>\n-<td>a call to the ioctl to bind a socket to a specific network device or\n-adapter</td>\n-</tr>\n-<tr><td>sock_accept</td>\n-<td>21</td>\n-<td>a call to accept() on a socket</td>\n-</tr>\n-<tr><td>parse_address</td>\n-<td>22</td>\n-<td>convert a string into a valid network address</td>\n-</tr>\n-<tr><td>enum_if</td>\n-<td>23</td>\n-<td>enumeration network devices or adapters</td>\n-</tr>\n-<tr><td>file_stat</td>\n-<td>24</td>\n-<td>invoking stat() on a file</td>\n-</tr>\n-<tr><td>file_copy</td>\n-<td>25</td>\n-<td>copying a file</td>\n-</tr>\n-<tr><td>file_fallocate</td>\n-<td>26</td>\n-<td>allocating storage for a file</td>\n-</tr>\n-<tr><td>file_hard_link</td>\n-<td>27</td>\n-<td>creating a hard link</td>\n-</tr>\n-<tr><td>file_remove</td>\n-<td>28</td>\n-<td>removing a file</td>\n-</tr>\n-<tr><td>file_rename</td>\n-<td>29</td>\n-<td>renaming a file</td>\n-</tr>\n-<tr><td>file_open</td>\n-<td>30</td>\n-<td>opening a file</td>\n-</tr>\n-<tr><td>mkdir</td>\n-<td>31</td>\n-<td>creating a directory</td>\n-</tr>\n-<tr><td>check_resume</td>\n-<td>32</td>\n-<td>check fast resume data against files on disk</td>\n-</tr>\n-<tr><td>exception</td>\n-<td>33</td>\n-<td>an unknown exception</td>\n-</tr>\n-<tr><td>alloc_cache_piece</td>\n-<td>34</td>\n-<td>allocate space for a piece in the cache</td>\n-</tr>\n-<tr><td>partfile_move</td>\n-<td>35</td>\n-<td>move a part-file</td>\n-</tr>\n-<tr><td>partfile_read</td>\n-<td>36</td>\n-<td>read from a part file</td>\n-</tr>\n-<tr><td>partfile_write</td>\n-<td>37</td>\n-<td>write to a part-file</td>\n-</tr>\n-<tr><td>hostname_lookup</td>\n-<td>38</td>\n-<td>a hostname lookup</td>\n-</tr>\n-<tr><td>symlink</td>\n-<td>39</td>\n-<td>create or read a symlink</td>\n-</tr>\n-<tr><td>handshake</td>\n-<td>40</td>\n-<td>handshake with a peer or server</td>\n-</tr>\n-<tr><td>sock_option</td>\n-<td>41</td>\n-<td>set socket option</td>\n-</tr>\n-<tr><td>enum_route</td>\n-<td>42</td>\n-<td>enumeration of network routes</td>\n-</tr>\n-<tr><td>file_seek</td>\n-<td>43</td>\n-<td>moving read/write position in a file, <a class=\"reference external\" href=\"reference-Alerts.html#hostname_lookup\">operation_t::hostname_lookup</a></td>\n-</tr>\n-<tr><td>timer</td>\n-<td>44</td>\n-<td>an async wait operation on a timer</td>\n-</tr>\n-<tr><td>file_mmap</td>\n-<td>45</td>\n-<td>call to mmap() (or windows counterpart)</td>\n-</tr>\n-<tr><td>file_truncate</td>\n-<td>46</td>\n-<td>call to ftruncate() (or SetEndOfFile() on windows)</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"alert_category_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_category_t&labels=documentation&body=Documentation+under+heading+%22alert_category_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"alert-category-t\">\n-<h1>alert_category_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n-<a name=\"alert_category_t::error\"></a><dl class=\"docutils\">\n-<dt>error</dt>\n-<dd><p class=\"first\">Enables alerts that report an error. This includes:</p>\n-<ul class=\"last simple\">\n-<li>tracker errors</li>\n-<li>tracker warnings</li>\n-<li>file errors</li>\n-<li>resume data failures</li>\n-<li>web seed errors</li>\n-<li>.torrent files errors</li>\n-<li>listen socket errors</li>\n-<li>port mapping errors</li>\n-</ul>\n-</dd>\n-</dl>\n-<a name=\"alert_category_t::peer\"></a><dl class=\"docutils\">\n-<dt>peer</dt>\n-<dd>Enables alerts when peers send invalid requests, get banned or\n-snubbed.</dd>\n-</dl>\n-<a name=\"alert_category_t::port_mapping\"></a><dl class=\"docutils\">\n-<dt>port_mapping</dt>\n-<dd>Enables alerts for port mapping events. For NAT-PMP and UPnP.</dd>\n-</dl>\n-<a name=\"alert_category_t::storage\"></a><dl class=\"docutils\">\n-<dt>storage</dt>\n-<dd>Enables alerts for events related to the storage. File errors and\n-synchronization events for moving the storage, renaming files etc.</dd>\n-</dl>\n-<a name=\"alert_category_t::tracker\"></a><dl class=\"docutils\">\n-<dt>tracker</dt>\n-<dd>Enables all tracker events. Includes announcing to trackers,\n-receiving responses, warnings and errors.</dd>\n-</dl>\n-<a name=\"alert_category_t::connect\"></a><dl class=\"docutils\">\n-<dt>connect</dt>\n-<dd>Low level alerts for when peers are connected and disconnected.</dd>\n-</dl>\n-<a name=\"alert_category_t::status\"></a><dl class=\"docutils\">\n-<dt>status</dt>\n-<dd>Enables alerts for when a torrent or the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> changes state.</dd>\n-</dl>\n-<a name=\"alert_category_t::ip_block\"></a><dl class=\"docutils\">\n-<dt>ip_block</dt>\n-<dd>Alerts when a peer is blocked by the ip blocker or port blocker.</dd>\n-</dl>\n-<a name=\"alert_category_t::performance_warning\"></a><dl class=\"docutils\">\n-<dt>performance_warning</dt>\n-<dd>Alerts when some limit is reached that might limit the download\n-or upload rate.</dd>\n-</dl>\n-<a name=\"alert_category_t::dht\"></a><dl class=\"docutils\">\n-<dt>dht</dt>\n-<dd>Alerts on events in the DHT node. For incoming searches or\n-bootstrapping being done etc.</dd>\n-</dl>\n-<a name=\"alert_category_t::stats\"></a><dl class=\"docutils\">\n-<dt>stats</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the interval since\n-the lasts stats <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</dd>\n-</dl>\n-<a name=\"alert_category_t::session_log\"></a><dl class=\"docutils\">\n-<dt>session_log</dt>\n-<dd>Enables debug logging alerts. These are available unless libtorrent\n-was built with logging disabled (<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The\n-alerts being posted are <a class=\"reference external\" href=\"reference-Alerts.html#log_alert\">log_alert</a> and are <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide.</dd>\n-</dl>\n-<a name=\"alert_category_t::torrent_log\"></a><dl class=\"docutils\">\n-<dt>torrent_log</dt>\n-<dd>Enables debug logging alerts for torrents. These are available\n-unless libtorrent was built with logging disabled\n-(<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The alerts being posted are\n-<a class=\"reference external\" href=\"reference-Alerts.html#torrent_log_alert\">torrent_log_alert</a> and are torrent wide debug events.</dd>\n-</dl>\n-<a name=\"alert_category_t::peer_log\"></a><dl class=\"docutils\">\n-<dt>peer_log</dt>\n-<dd>Enables debug logging alerts for peers. These are available unless\n-libtorrent was built with logging disabled\n-(<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The alerts being posted are\n-<a class=\"reference external\" href=\"reference-Alerts.html#peer_log_alert\">peer_log_alert</a> and low-level peer events and messages.</dd>\n-</dl>\n-<a name=\"alert_category_t::incoming_request\"></a><dl class=\"docutils\">\n-<dt>incoming_request</dt>\n-<dd>enables the <a class=\"reference external\" href=\"reference-Alerts.html#incoming_request_alert\">incoming_request_alert</a>.</dd>\n-</dl>\n-<a name=\"alert_category_t::dht_log\"></a><dl class=\"docutils\">\n-<dt>dht_log</dt>\n-<dd>enables <a class=\"reference external\" href=\"reference-Alerts.html#dht_log_alert\">dht_log_alert</a>, debug logging for the DHT</dd>\n-</dl>\n-<a name=\"alert_category_t::dht_operation\"></a><dl class=\"docutils\">\n-<dt>dht_operation</dt>\n-<dd>enable events from pure dht operations not related to torrents</dd>\n-</dl>\n-<a name=\"alert_category_t::port_mapping_log\"></a><dl class=\"docutils\">\n-<dt>port_mapping_log</dt>\n-<dd>enables port mapping log events. This log is useful\n-for debugging the UPnP or NAT-PMP implementation</dd>\n-</dl>\n-<a name=\"alert_category_t::picker_log\"></a><dl class=\"docutils\">\n-<dt>picker_log</dt>\n-<dd>enables verbose logging from the piece picker.</dd>\n-</dl>\n-<a name=\"alert_category_t::file_progress\"></a><dl class=\"docutils\">\n-<dt>file_progress</dt>\n-<dd>alerts when files complete downloading</dd>\n-</dl>\n-<a name=\"alert_category_t::piece_progress\"></a><dl class=\"docutils\">\n-<dt>piece_progress</dt>\n-<dd>alerts when pieces complete downloading or fail hash check</dd>\n-</dl>\n-<a name=\"alert_category_t::upload\"></a><dl class=\"docutils\">\n-<dt>upload</dt>\n-<dd>alerts when we upload blocks to other peers</dd>\n-</dl>\n-<a name=\"alert_category_t::block_progress\"></a><dl class=\"docutils\">\n-<dt>block_progress</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"alert_category_t::all\"></a><dl class=\"docutils\">\n-<dt>all</dt>\n-<dd><p class=\"first\">The full bitmask, representing all available categories.</p>\n-<p class=\"last\">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.</p>\n-</dd>\n-</dl>\n-<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"int-1\">\n-<h1>int</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n-<a name=\"int::user_alert_id\"></a><dl class=\"docutils\">\n-<dt>user_alert_id</dt>\n-<dd>user defined alerts should use IDs greater than this</dd>\n-</dl>\n-<a name=\"int::num_alert_types\"></a><dl class=\"docutils\">\n-<dt>num_alert_types</dt>\n-<dd>this constant represents "max_alert_index" + 1</dd>\n-</dl>\n-<a name=\"storage_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_params&labels=documentation&body=Documentation+under+heading+%22class+storage_params%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"storage-params\">\n-<h1>storage_params</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n-<p>a parameter pack used to construct the storage for a torrent, used in\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a></p>\n-<pre class=\"literal-block\">\n-struct storage_params\n-{\n- <strong>storage_params</strong> (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* <strong>mapped_files</strong> = nullptr;\n- std::string const& path;\n- storage_mode_t <strong>mode</strong> {storage_mode_sparse};\n- aux::vector<download_priority_t, file_index_t> const& priorities;\n- sha1_hash info_hash;\n-};\n-</pre>\n-<a name=\"file_slice\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_slice&labels=documentation&body=Documentation+under+heading+%22class+file_slice%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-slice\">\n-<h1>file_slice</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/file_storage.hpp\">libtorrent/file_storage.hpp</a>"</p>\n-<p>represents a window of a file in a torrent.</p>\n-<p>The <tt class=\"docutils literal\">file_index</tt> refers to the index of the file (in the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>).\n-To get the path and filename, use <tt class=\"docutils literal\">file_path()</tt> and give the <tt class=\"docutils literal\">file_index</tt>\n-as argument. The <tt class=\"docutils literal\">offset</tt> is the byte offset in the file where the range\n-starts, and <tt class=\"docutils literal\">size</tt> is the number of bytes this range is. The size + offset\n-will never be greater than the file size.</p>\n-<pre class=\"literal-block\">\n-struct file_slice\n-{\n- file_index_t file_index;\n- std::int64_t offset;\n- std::int64_t size;\n-};\n-</pre>\n-<a name=\"file_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Bfile_index%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Bfile_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>file_index</dt>\n-<dd>the index of the file</dd>\n-</dl>\n-<a name=\"offset\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Boffset%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Boffset%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>offset</dt>\n-<dd>the offset from the start of the file, in bytes</dd>\n-</dl>\n-<a name=\"size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Bsize%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Bsize%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>size</dt>\n-<dd>the size of the window, in bytes</dd>\n-</dl>\n-<a name=\"file_storage\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_storage&labels=documentation&body=Documentation+under+heading+%22class+file_storage%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-storage\">\n-<h1>file_storage</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/file_storage.hpp\">libtorrent/file_storage.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">file_storage</tt> class represents a file list and the piece\n-size. Everything necessary to interpret a regular bittorrent storage\n-file structure.</p>\n-<pre class=\"literal-block\">\n-class file_storage\n-{\n- bool <strong>is_valid</strong> () const;\n- void <strong>reserve</strong> (int num_files);\n- void <strong>add_file_borrow</strong> (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 <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (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 <strong>add_file</strong> (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 <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n- std::vector<file_slice> <strong>map_block</strong> (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n- peer_request <strong>map_file</strong> (file_index_t file, std::int64_t offset, int size) const;\n- int <strong>num_files</strong> () const noexcept;\n- file_index_t <strong>end_file</strong> () const noexcept;\n- index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n- std::int64_t <strong>total_size</strong> () const;\n- int <strong>num_pieces</strong> () const;\n- void <strong>set_num_pieces</strong> (int n);\n- piece_index_t <strong>end_piece</strong> () const;\n- piece_index_t <strong>last_piece</strong> () const;\n- index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n- int <strong>piece_length</strong> () const;\n- void <strong>set_piece_length</strong> (int l);\n- int <strong>piece_size</strong> (piece_index_t index) const;\n- int <strong>piece_size2</strong> (piece_index_t index) const;\n- int <strong>blocks_in_piece2</strong> (piece_index_t index) const;\n- int <strong>blocks_per_piece</strong> () const;\n- std::string const& <strong>name</strong> () const;\n- void <strong>set_name</strong> (std::string const& n);\n- void <strong>swap</strong> (file_storage& ti) noexcept;\n- void <strong>canonicalize</strong> ();\n- bool <strong>pad_file_at</strong> (file_index_t index) const;\n- std::int64_t <strong>file_size</strong> (file_index_t index) const;\n- std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n- std::string <strong>symlink</strong> (file_index_t index) const;\n- sha256_hash <strong>root</strong> (file_index_t index) const;\n- string_view <strong>file_name</strong> (file_index_t index) const;\n- std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n- std::time_t <strong>mtime</strong> (file_index_t index) const;\n- char const* <strong>root_ptr</strong> (file_index_t const index) const;\n- sha1_hash <strong>hash</strong> (file_index_t index) const;\n- index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n- int <strong>file_num_pieces</strong> (file_index_t index) const;\n- int <strong>file_num_blocks</strong> (file_index_t index) const;\n- int <strong>file_first_block_node</strong> (file_index_t index) const;\n- int <strong>file_first_piece_node</strong> (file_index_t index) const;\n- std::uint32_t <strong>file_path_hash</strong> (file_index_t index, std::string const& save_path) const;\n- void <strong>all_path_hashes</strong> (std::unordered_set<std::uint32_t>& table) const;\n- file_flags_t <strong>file_flags</strong> (file_index_t index) const;\n- bool <strong>file_absolute_path</strong> (file_index_t index) const;\n- file_index_t <strong>file_index_at_offset</strong> (std::int64_t offset) const;\n- file_index_t <strong>file_index_at_piece</strong> (piece_index_t piece) const;\n- file_index_t <strong>file_index_for_root</strong> (sha256_hash const& root_hash) const;\n- piece_index_t <strong>piece_index_at_file</strong> (file_index_t f) const;\n- void <strong>sanitize_symlinks</strong> ();\n- bool <strong>v2</strong> () const;\n-\n- static constexpr file_flags_t <strong>flag_pad_file</strong> = 0_bit;\n- static constexpr file_flags_t <strong>flag_hidden</strong> = 1_bit;\n- static constexpr file_flags_t <strong>flag_executable</strong> = 2_bit;\n- static constexpr file_flags_t <strong>flag_symlink</strong> = 3_bit;\n-};\n-</pre>\n-<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"is-valid-3\">\n-<h2>is_valid()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_valid</strong> () const;\n-</pre>\n-<p>returns true if the piece length has been initialized\n-on the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>. This is typically taken as a proxy\n-of whether the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> as a whole is initialized or\n-not.</p>\n-<a name=\"reserve()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Breserve%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Breserve%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reserve\">\n-<h2>reserve()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reserve</strong> (int num_files);\n-</pre>\n-<p>allocates space for <tt class=\"docutils literal\">num_files</tt> 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.</p>\n-<a name=\"add_file()\"></a>\n-<a name=\"add_file_borrow()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Badd_file%28%29+add_file_borrow%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Badd_file%28%29+add_file_borrow%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-file-add-file-borrow\">\n-<h2>add_file() add_file_borrow()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_file_borrow</strong> (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 <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (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 <strong>add_file</strong> (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-</pre>\n-<p>Adds a file to the file storage. The <tt class=\"docutils literal\">add_file_borrow</tt> version\n-expects that <tt class=\"docutils literal\">filename</tt> is the file name (without a path) of\n-the file that's being added.\n-This memory is <em>borrowed</em>, i.e. it is the caller's\n-responsibility to make sure it stays valid throughout the lifetime\n-of this <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object or any copy of it. The same thing applies\n-to <tt class=\"docutils literal\">filehash</tt>, which is an optional pointer to a 20 byte binary\n-SHA-1 hash of the file.</p>\n-<p>if <tt class=\"docutils literal\">filename</tt> is empty, the filename from <tt class=\"docutils literal\">path</tt> is used and not\n-borrowed.</p>\n-<p>The <tt class=\"docutils literal\">path</tt> 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.</p>\n-<p><tt class=\"docutils literal\">file_size</tt> is the size of the file in bytes.</p>\n-<p>The <tt class=\"docutils literal\">file_flags</tt> argument sets attributes on the file. The file\n-attributes is an extension and may not work in all bittorrent clients.</p>\n-<p>For possible file attributes, see file_storage::flags_t.</p>\n-<p>The <tt class=\"docutils literal\">mtime</tt> 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.</p>\n-<p><tt class=\"docutils literal\">symlink_path</tt> is the path the file is a symlink to. To make this a\n-symlink you also need to set the <a class=\"reference external\" href=\"reference-Storage.html#flag_symlink\">file_storage::flag_symlink</a> file flag.</p>\n-<p><tt class=\"docutils literal\">root_hash</tt> 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 <tt class=\"docutils literal\">root hash</tt> is specified for one file, it has to\n-be specified for all, otherwise this function will fail.\n-Note that the buffer <tt class=\"docutils literal\">root_hash</tt> points to must out-live the\n-<a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object, it will not be copied. This parameter is only\n-used when <em>loading</em> torrents, that already have their file hashes\n-computed. When creating torrents, the file hashes will be computed by\n-the piece hashes.</p>\n-<p>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.</p>\n-<p>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 <tt class=\"docutils literal\">set_name</tt>.</p>\n-<p>The overloads that take an <cite>error_code</cite> reference will report failures\n-via that variable, otherwise <cite>system_error</cite> is thrown.</p>\n-<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"rename-file-2\">\n-<h2>rename_file()</h2>\n-<pre class=\"literal-block\">\n-void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n-</pre>\n-<p>renames the file at <tt class=\"docutils literal\">index</tt> to <tt class=\"docutils literal\">new_filename</tt>. Keep in mind\n-that filenames are expected to be UTF-8 encoded.</p>\n-<a name=\"map_block()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bmap_block%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bmap_block%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"map-block-1\">\n-<h2>map_block()</h2>\n-<pre class=\"literal-block\">\n-std::vector<file_slice> <strong>map_block</strong> (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n-</pre>\n-<p>returns a list of <a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a> objects representing the portions of\n-files the specified piece index, byte offset and size range overlaps.\n-this is the inverse mapping of <a class=\"reference external\" href=\"reference-Storage.html#map_file()\">map_file()</a>.</p>\n-<p>Preconditions of this function is that the input range is within the\n-torrents address space. <tt class=\"docutils literal\">piece</tt> may not be negative and</p>\n-<blockquote>\n-<tt class=\"docutils literal\">piece</tt> * piece_size + <tt class=\"docutils literal\">offset</tt> + <tt class=\"docutils literal\">size</tt></blockquote>\n-<p>may not exceed the total size of the torrent.</p>\n-<a name=\"map_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bmap_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bmap_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"map-file-1\">\n-<h2>map_file()</h2>\n-<pre class=\"literal-block\">\n-peer_request <strong>map_file</strong> (file_index_t file, std::int64_t offset, int size) const;\n-</pre>\n-<p>returns a <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> representing the piece index, byte offset\n-and size the specified file range overlaps. This is the inverse\n-mapping over <a class=\"reference external\" href=\"reference-Storage.html#map_block()\">map_block()</a>. Note that the <tt class=\"docutils literal\">peer_request</tt> 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.</p>\n-<a name=\"num_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bnum_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bnum_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-files-1\">\n-<h2>num_files()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_files</strong> () const noexcept;\n-</pre>\n-<p>returns the number of files in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a></p>\n-<a name=\"end_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bend_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bend_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"end-file\">\n-<h2>end_file()</h2>\n-<pre class=\"literal-block\">\n-file_index_t <strong>end_file</strong> () const noexcept;\n-</pre>\n-<p>returns the index of the one-past-end file in the file storage</p>\n-<a name=\"file_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-range\">\n-<h2>file_range()</h2>\n-<pre class=\"literal-block\">\n-index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"total-size-1\">\n-<h2>total_size()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>total_size</strong> () const;\n-</pre>\n-<p>returns the total number of bytes all the files in this torrent spans</p>\n-<a name=\"num_pieces()\"></a>\n-<a name=\"set_num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bnum_pieces%28%29+set_num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bnum_pieces%28%29+set_num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-pieces-set-num-pieces\">\n-<h2>num_pieces() set_num_pieces()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_pieces</strong> () const;\n-void <strong>set_num_pieces</strong> (int n);\n-</pre>\n-<p>set and get the number of pieces in the torrent</p>\n-<a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bend_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bend_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"end-piece\">\n-<h2>end_piece()</h2>\n-<pre class=\"literal-block\">\n-piece_index_t <strong>end_piece</strong> () const;\n-</pre>\n-<p>returns the index of the one-past-end piece in the file storage</p>\n-<a name=\"last_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Blast_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Blast_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"last-piece\">\n-<h2>last_piece()</h2>\n-<pre class=\"literal-block\">\n-piece_index_t <strong>last_piece</strong> () const;\n-</pre>\n-<p>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).</p>\n-<a name=\"piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-range\">\n-<h2>piece_range()</h2>\n-<pre class=\"literal-block\">\n-index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"set_piece_length()\"></a>\n-<a name=\"piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bset_piece_length%28%29+piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bset_piece_length%28%29+piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-piece-length-piece-length\">\n-<h2>set_piece_length() piece_length()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_length</strong> () const;\n-void <strong>set_piece_length</strong> (int l);\n-</pre>\n-<p>set and get the size of each piece in this torrent. It must be a power of two\n-and at least 16 kiB.</p>\n-<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-size-1\">\n-<h2>piece_size()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_size</strong> (piece_index_t index) const;\n-</pre>\n-<p>returns the piece size of <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Create_Torrents.html#piece_length()\">piece_length()</a>, except\n-for the last piece, which may be shorter.</p>\n-<a name=\"piece_size2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-size2\">\n-<h2>piece_size2()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_size2</strong> (piece_index_t index) const;\n-</pre>\n-<p>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.</p>\n-<a name=\"blocks_in_piece2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bblocks_in_piece2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bblocks_in_piece2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"blocks-in-piece2\">\n-<h2>blocks_in_piece2()</h2>\n-<pre class=\"literal-block\">\n-int <strong>blocks_in_piece2</strong> (piece_index_t index) const;\n-</pre>\n-<p>returns the number of blocks in the specified piece, for v2 torrents.</p>\n-<a name=\"blocks_per_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bblocks_per_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bblocks_per_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"blocks-per-piece-1\">\n-<h2>blocks_per_piece()</h2>\n-<pre class=\"literal-block\">\n-int <strong>blocks_per_piece</strong> () const;\n-</pre>\n-<p>returns the number of blocks there are in the typical piece. There\n-may be fewer in the last piece)</p>\n-<a name=\"name()\"></a>\n-<a name=\"set_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"name-set-name\">\n-<h2>name() set_name()</h2>\n-<pre class=\"literal-block\">\n-std::string const& <strong>name</strong> () const;\n-void <strong>set_name</strong> (std::string const& n);\n-</pre>\n-<p>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.</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap-1\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (file_storage& ti) noexcept;\n-</pre>\n-<p>swap all content of <em>this</em> with <em>ti</em>.</p>\n-<a name=\"canonicalize()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bcanonicalize%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bcanonicalize%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"canonicalize\">\n-<h2>canonicalize()</h2>\n-<pre class=\"literal-block\">\n-void <strong>canonicalize</strong> ();\n-</pre>\n-<p>arrange files and padding to match the canonical form required\n-by BEP 52</p>\n-<a name=\"root()\"></a>\n-<a name=\"mtime()\"></a>\n-<a name=\"symlink()\"></a>\n-<a name=\"file_offset()\"></a>\n-<a name=\"hash()\"></a>\n-<a name=\"pad_file_at()\"></a>\n-<a name=\"root_ptr()\"></a>\n-<a name=\"file_name()\"></a>\n-<a name=\"file_path()\"></a>\n-<a name=\"file_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Broot%28%29+mtime%28%29+symlink%28%29+file_offset%28%29+hash%28%29+pad_file_at%28%29+root_ptr%28%29+file_name%28%29+file_path%28%29+file_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Broot%28%29+mtime%28%29+symlink%28%29+file_offset%28%29+hash%28%29+pad_file_at%28%29+root_ptr%28%29+file_name%28%29+file_path%28%29+file_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"root-mtime-symlink-file-offset-hash-pad-file-at-root-ptr-file-name-file-path-file-size\">\n-<h2>root() mtime() symlink() file_offset() hash() pad_file_at() root_ptr() file_name() file_path() file_size()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>pad_file_at</strong> (file_index_t index) const;\n-std::int64_t <strong>file_size</strong> (file_index_t index) const;\n-std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n-std::string <strong>symlink</strong> (file_index_t index) const;\n-sha256_hash <strong>root</strong> (file_index_t index) const;\n-string_view <strong>file_name</strong> (file_index_t index) const;\n-std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n-std::time_t <strong>mtime</strong> (file_index_t index) const;\n-char const* <strong>root_ptr</strong> (file_index_t const index) const;\n-sha1_hash <strong>hash</strong> (file_index_t index) const;\n-</pre>\n-<p>These functions are used to query attributes of files at\n-a given index.</p>\n-<p>The <tt class=\"docutils literal\">hash()</tt> 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.</p>\n-<p><tt class=\"docutils literal\">root()</tt> returns the SHA-256 merkle tree root of the specified file,\n-in case this is a v2 torrent. Otherwise returns zeros.\n-<tt class=\"docutils literal\">root_ptr()</tt> 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.</p>\n-<p>The <tt class=\"docutils literal\">mtime()</tt> 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.</p>\n-<p><tt class=\"docutils literal\">file_path()</tt> returns the full path to a file.</p>\n-<p><tt class=\"docutils literal\">file_size()</tt> returns the size of a file.</p>\n-<p><tt class=\"docutils literal\">pad_file_at()</tt> returns true if the file at the given\n-index is a pad-file.</p>\n-<p><tt class=\"docutils literal\">file_name()</tt> returns <em>just</em> the name of the file, whereas\n-<tt class=\"docutils literal\">file_path()</tt> returns the path (inside the torrent file) with\n-the filename appended.</p>\n-<p><tt class=\"docutils literal\">file_offset()</tt> 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).</p>\n-<a name=\"file_piece_range()\"></a>\n-<a name=\"file_num_blocks()\"></a>\n-<a name=\"file_num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_piece_range%28%29+file_num_blocks%28%29+file_num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_piece_range%28%29+file_num_blocks%28%29+file_num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-piece-range-file-num-blocks-file-num-pieces\">\n-<h2>file_piece_range() file_num_blocks() file_num_pieces()</h2>\n-<pre class=\"literal-block\">\n-index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n-int <strong>file_num_pieces</strong> (file_index_t index) const;\n-int <strong>file_num_blocks</strong> (file_index_t index) const;\n-</pre>\n-<p>Returns the number of pieces or blocks the file at <cite>index</cite> 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.</p>\n-<a name=\"file_first_piece_node()\"></a>\n-<a name=\"file_first_block_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_first_piece_node%28%29+file_first_block_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_first_piece_node%28%29+file_first_block_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-first-piece-node-file-first-block-node\">\n-<h2>file_first_piece_node() file_first_block_node()</h2>\n-<pre class=\"literal-block\">\n-int <strong>file_first_block_node</strong> (file_index_t index) const;\n-int <strong>file_first_piece_node</strong> (file_index_t index) const;\n-</pre>\n-<p>index of first piece node in the merkle tree</p>\n-<a name=\"file_path_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_path_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_path_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-path-hash\">\n-<h2>file_path_hash()</h2>\n-<pre class=\"literal-block\">\n-std::uint32_t <strong>file_path_hash</strong> (file_index_t index, std::string const& save_path) const;\n-</pre>\n-<p>returns the crc32 hash of file_path(index)</p>\n-<a name=\"all_path_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Ball_path_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Ball_path_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"all-path-hashes\">\n-<h2>all_path_hashes()</h2>\n-<pre class=\"literal-block\">\n-void <strong>all_path_hashes</strong> (std::unordered_set<std::uint32_t>& table) const;\n-</pre>\n-<p>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 <tt class=\"docutils literal\">foo/bar/baz</tt>, the CRC32\n-hashes for <tt class=\"docutils literal\">foo</tt>, <tt class=\"docutils literal\">foo/bar</tt> and <tt class=\"docutils literal\">foo/bar/baz</tt> will be added to\n-the set.</p>\n-<a name=\"file_flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-flags\">\n-<h2>file_flags()</h2>\n-<pre class=\"literal-block\">\n-file_flags_t <strong>file_flags</strong> (file_index_t index) const;\n-</pre>\n-<p>returns a bitmask of flags from file_flags_t that apply\n-to file at <tt class=\"docutils literal\">index</tt>.</p>\n-<a name=\"file_absolute_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_absolute_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_absolute_path%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-absolute-path\">\n-<h2>file_absolute_path()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>file_absolute_path</strong> (file_index_t index) const;\n-</pre>\n-<p>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.</p>\n-<a name=\"file_index_at_offset()\"></a>\n-<a name=\"file_index_at_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_index_at_offset%28%29+file_index_at_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_index_at_offset%28%29+file_index_at_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-index-at-offset-file-index-at-piece\">\n-<h2>file_index_at_offset() file_index_at_piece()</h2>\n-<pre class=\"literal-block\">\n-file_index_t <strong>file_index_at_offset</strong> (std::int64_t offset) const;\n-file_index_t <strong>file_index_at_piece</strong> (piece_index_t piece) const;\n-</pre>\n-<p>returns the index of the file at the given offset in the torrent</p>\n-<a name=\"file_index_for_root()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_index_for_root%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_index_for_root%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-index-for-root\">\n-<h2>file_index_for_root()</h2>\n-<pre class=\"literal-block\">\n-file_index_t <strong>file_index_for_root</strong> (sha256_hash const& root_hash) const;\n-</pre>\n-<p>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</p>\n-<a name=\"piece_index_at_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_index_at_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_index_at_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-index-at-file\">\n-<h2>piece_index_at_file()</h2>\n-<pre class=\"literal-block\">\n-piece_index_t <strong>piece_index_at_file</strong> (file_index_t f) const;\n-</pre>\n-<p>returns the piece index the given file starts at</p>\n-<a name=\"sanitize_symlinks()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bsanitize_symlinks%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bsanitize_symlinks%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"sanitize-symlinks\">\n-<h2>sanitize_symlinks()</h2>\n-<pre class=\"literal-block\">\n-void <strong>sanitize_symlinks</strong> ();\n-</pre>\n-<p>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.</p>\n-<a name=\"v2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bv2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bv2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"v2\">\n-<h2>v2()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>v2</strong> () const;\n-</pre>\n-<p>returns true if this torrent contains v2 metadata.</p>\n-<a name=\"flag_pad_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_pad_file%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_pad_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flag_pad_file</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"flag_hidden\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_hidden%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_hidden%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flag_hidden</dt>\n-<dd>this file has the hidden attribute set. This is primarily\n-a windows attribute</dd>\n-</dl>\n-<a name=\"flag_executable\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_executable%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_executable%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flag_executable</dt>\n-<dd>this file has the executable attribute set.</dd>\n-</dl>\n-<a name=\"flag_symlink\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_symlink%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_symlink%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flag_symlink</dt>\n-<dd>this file is a symbolic link. It should have a link\n-target string associated with it.</dd>\n-</dl>\n-<a name=\"default_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22default_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"default-disk-io-constructor\">\n-<h1>default_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>default_disk_io_constructor</strong> (\n- io_context& ios, settings_interface const&, counters& cnt);\n-</pre>\n-<p>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.</p>\n-<a name=\"posix_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:posix_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22posix_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"posix-disk-io-constructor\">\n-<h1>posix_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/posix_disk_io.hpp\">libtorrent/posix_disk_io.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>posix_disk_io_constructor</strong> (\n- io_context& ios, settings_interface const&, counters& cnt);\n-</pre>\n-<p>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.</p>\n-<a name=\"disabled_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disabled_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22disabled_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disabled-disk-io-constructor\">\n-<h1>disabled_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disabled_disk_io.hpp\">libtorrent/disabled_disk_io.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>disabled_disk_io_constructor</strong> (\n- io_context& ios, settings_interface const&, counters& cnt);\n-</pre>\n-<p>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.</p>\n-<a name=\"mmap_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:mmap_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22mmap_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"mmap-disk-io-constructor\">\n-<h1>mmap_disk_io_constructor()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/mmap_disk_io.hpp\">libtorrent/mmap_disk_io.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::unique_ptr<disk_interface> <strong>mmap_disk_io_constructor</strong> (\n- io_context& ios, settings_interface const&, counters& cnt);\n-</pre>\n-<p>constructs a memory mapped file disk I/O object.</p>\n-<a name=\"storage_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+storage_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+storage_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-storage-mode-t\">\n-<h1>enum storage_mode_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"22%\" />\n-<col width=\"7%\" />\n-<col width=\"72%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>storage_mode_allocate</td>\n-<td>0</td>\n-<td>All 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.</td>\n-</tr>\n-<tr><td>storage_mode_sparse</td>\n-<td>1</td>\n-<td>All pieces will be written to the place where they belong and sparse files\n-will be used. This is the recommended, and default mode.</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"status_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+status_t&labels=documentation&body=Documentation+under+heading+%22enum+status_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-status-t\">\n-<h1>enum status_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"19%\" />\n-<col width=\"7%\" />\n-<col width=\"74%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>fatal_disk_error</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>need_full_check</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>file_exist</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>oversized_file</td>\n-<td>16</td>\n-<td>this 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 <a class=\"reference external\" href=\"reference-Storage.html#status_t\">status_t</a> field is used for this to preserve ABI.</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"move_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+move_flags_t&labels=documentation&body=Documentation+under+heading+%22enum+move_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-move-flags-t\">\n-<h1>enum move_flags_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"29%\" />\n-<col width=\"7%\" />\n-<col width=\"64%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>always_replace_files</td>\n-<td>0</td>\n-<td>replace any files in the destination when copying\n-or moving the storage</td>\n-</tr>\n-<tr><td>fail_if_exist</td>\n-<td>1</td>\n-<td>if 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.</td>\n-</tr>\n-<tr><td>dont_replace</td>\n-<td>2</td>\n-<td>if any file exist in the target, take those files instead\n-of the ones we may have in the source.</td>\n-</tr>\n-<tr><td>reset_save_path</td>\n-<td>3</td>\n-<td>don't move any source files, just forget about them\n-and begin checking files at new save path</td>\n-</tr>\n-<tr><td>reset_save_path_unchecked</td>\n-<td>4</td>\n-<td>don't move any source files, just change save path\n-and continue working without any checks</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>libtorrent has a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n-<p>In short, the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> interface makes it possible to:</p>\n-<ul class=\"simple\">\n-<li>register extension messages (sent in the extension handshake), see\n-<a class=\"reference external\" href=\"manual-ref.html#extensions\">extensions</a>.</li>\n-<li>add data and parse data from the extension handshake.</li>\n-<li>send extension messages and standard bittorrent messages.</li>\n-<li>override or block the handling of standard bittorrent messages.</li>\n-<li>save and restore state via the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state</li>\n-<li>see all alerts that are posted</li>\n-</ul>\n-</div>\n-<div class=\"section\" id=\"a-word-of-caution\">\n-<h1>a word of caution</h1>\n-<p>Writing your own <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is a very easy way to introduce serious bugs such as\n-dead locks and race conditions. Since a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has access to internal\n-structures it is also quite easy to sabotage libtorrent's operation.</p>\n-<p>All the callbacks are always called from the libtorrent network thread. In\n-case portions of your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>, 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 <tt class=\"docutils literal\">tick()</tt>.</p>\n-<p>Since the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n-</div>\n-<div class=\"section\" id=\"plugin-interface\">\n-<h1>plugin-interface</h1>\n-<p>The <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> interface consists of three base classes that the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> may\n-implement. These are called <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>, <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> and <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>.\n-They are found in the <tt class=\"docutils literal\"><libtorrent/extensions.hpp></tt> header.</p>\n-<p>These plugins are instantiated for each <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, torrent and possibly each peer,\n-respectively.</p>\n-<p>For plugins that only need per torrent state, it is enough to only implement\n-<tt class=\"docutils literal\">torrent_plugin</tt> and pass a constructor function or function object to\n-<tt class=\"docutils literal\"><span class=\"pre\">session::add_extension()</span></tt> or <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::add_extension()</span></tt> (if the\n-torrent has already been started and you want to hook in the extension at\n-run-time).</p>\n-<p>The signature of the function is:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">torrent_plugin</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"punctuation\">)(</span><span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">client_data_t</span><span class=\"punctuation\">);</span>\n-</pre>\n-<p>The second argument is the userdata passed to <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent()</span></tt> or\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::add_extension()</span></tt>.</p>\n-<p>The function should return a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr<torrent_plugin></span></tt> 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-<tt class=\"docutils literal\">torrent_plugin</tt>), it will be associated with this torrent and callbacks\n-will be made on torrent events.</p>\n-<p>For more elaborate plugins which require <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide state, you would\n-implement <tt class=\"docutils literal\">plugin</tt>, construct an object (in a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr</span></tt>) and pass\n-it in to <tt class=\"docutils literal\"><span class=\"pre\">session::add_extension()</span></tt>.</p>\n-</div>\n-<div class=\"section\" id=\"custom-alerts\">\n-<h1>custom alerts</h1>\n-<p>Since plugins are running within internal libtorrent threads, one convenient\n-way to communicate with the client is to post custom alerts.</p>\n-<p>The expected interface of any <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, apart from deriving from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n-base class, looks like this:</p>\n-<pre class=\"literal-block\">\n-static const int alert_type = <em><unique alert ID></em>;\n-virtual int type() const { return alert_type; }\n-\n-virtual std::string message() const;\n-\n-static const alert_category_t static_category = <em><bitmask of alert::category_t flags></em>;\n-virtual alert_category_t category() const { return static_category; }\n-\n-virtual char const* what() const { return <em><string literal of the name of this alert></em>; }\n-</pre>\n-<p>The <tt class=\"docutils literal\">alert_type</tt> is used for the type-checking in <tt class=\"docutils literal\">alert_cast</tt>. It must\n-not collide with any other <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. The built-in alerts in libtorrent will\n-not use <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type IDs greater than <tt class=\"docutils literal\">user_alert_id</tt>. When defining your\n-own <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, make sure it's greater than this constant.</p>\n-<p><tt class=\"docutils literal\">type()</tt> is the run-time equivalence of the <tt class=\"docutils literal\">alert_type</tt>.</p>\n-<p>The <tt class=\"docutils literal\">message()</tt> virtual function is expected to construct a useful\n-string representation of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> and the event or data it represents.\n-Something convenient to put in a log file for instance.</p>\n-<p><tt class=\"docutils literal\">clone()</tt> is used internally to copy alerts. The suggested implementation\n-of simply allocating a new instance as a copy of <tt class=\"docutils literal\">*this</tt> is all that's\n-expected.</p>\n-<p>The static category is required for checking whether or not the category\n-for a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is enabled or not, without instantiating the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.\n-The <tt class=\"docutils literal\">category</tt> virtual function is the run-time equivalence.</p>\n-<p>The <tt class=\"docutils literal\">what()</tt> virtual function may simply be a string literal of the class\n-name of your <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n-<p>For more information, see the <a class=\"reference external\" href=\"reference-Alerts.html\">alert section</a>.</p>\n-<a name=\"peer_connection_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_connection_handle&labels=documentation&body=Documentation+under+heading+%22class+peer_connection_handle%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-connection-handle\">\n-<h1>peer_connection_handle</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection_handle.hpp\">libtorrent/peer_connection_handle.hpp</a>"</p>\n-<p>the <a class=\"reference external\" href=\"reference-Plugins.html#peer_connection_handle\">peer_connection_handle</a> 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</p>\n-<pre class=\"literal-block\">\n-struct peer_connection_handle\n-{\n- explicit <strong>peer_connection_handle</strong> (std::weak_ptr<peer_connection> impl);\n- connection_type <strong>type</strong> () const;\n- void <strong>add_extension</strong> (std::shared_ptr<peer_plugin>);\n- peer_plugin const* <strong>find_plugin</strong> (string_view type) const;\n- bool <strong>is_seed</strong> () const;\n- bool <strong>upload_only</strong> () const;\n- bool <strong>has_piece</strong> (piece_index_t i) const;\n- peer_id const& <strong>pid</strong> () const;\n- bool <strong>is_choked</strong> () const;\n- bool <strong>is_interesting</strong> () const;\n- bool <strong>has_peer_choked</strong> () const;\n- bool <strong>is_peer_interested</strong> () const;\n- void <strong>maybe_unchoke_this_peer</strong> ();\n- void <strong>choke_this_peer</strong> ();\n- void <strong>get_peer_info</strong> (peer_info& p) const;\n- torrent_handle <strong>associated_torrent</strong> () const;\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> const& <strong>remote</strong> () const;\n- <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>local_endpoint</strong> () const;\n- void <strong>disconnect</strong> (error_code const& ec, operation_t op\n- , disconnect_severity_t = peer_connection_interface::normal);\n- bool <strong>is_outgoing</strong> () const;\n- bool <strong>is_disconnecting</strong> () const;\n- bool <strong>is_connecting</strong> () const;\n- bool <strong>ignore_unchoke_slots</strong> () const;\n- bool <strong>on_local_network</strong> () const;\n- bool <strong>failed</strong> () const;\n- void <strong>peer_log</strong> (peer_log_alert::direction_t direction\n- , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n- bool <strong>should_log</strong> (peer_log_alert::direction_t direction) const;\n- bool <strong>can_disconnect</strong> (error_code const& ec) const;\n- bool <strong>has_metadata</strong> () const;\n- bool <strong>in_handshake</strong> () const;\n- void <strong>send_buffer</strong> (char const* begin, int size);\n- std::time_t <strong>last_seen_complete</strong> () const;\n- time_point <strong>time_of_last_unchoke</strong> () const;\n- bool <strong>operator<</strong> (peer_connection_handle const& o) const;\n- bool <strong>operator!=</strong> (peer_connection_handle const& o) const;\n- bool <strong>operator==</strong> (peer_connection_handle const& o) const;\n- std::shared_ptr<peer_connection> <strong>native_handle</strong> () const;\n-};\n-</pre>\n-<a name=\"bt_peer_connection_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bt_peer_connection_handle&labels=documentation&body=Documentation+under+heading+%22class+bt_peer_connection_handle%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bt-peer-connection-handle\">\n-<h1>bt_peer_connection_handle</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection_handle.hpp\">libtorrent/peer_connection_handle.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Plugins.html#bt_peer_connection_handle\">bt_peer_connection_handle</a> 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.</p>\n-<pre class=\"literal-block\">\n-struct bt_peer_connection_handle : peer_connection_handle\n-{\n- explicit <strong>bt_peer_connection_handle</strong> (peer_connection_handle pc);\n- bool <strong>packet_finished</strong> () const;\n- bool <strong>support_extensions</strong> () const;\n- bool <strong>supports_encryption</strong> () const;\n- void <strong>switch_send_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n- void <strong>switch_recv_crypto</strong> (std::shared_ptr<crypto_plugin> crypto);\n- std::shared_ptr<bt_peer_connection> <strong>native_handle</strong> () const;\n-};\n-</pre>\n-<a name=\"plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+plugin&labels=documentation&body=Documentation+under+heading+%22class+plugin%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"plugin\">\n-<h1>plugin</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n-<p>this is the base class for a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>. One primary feature\n-is that it is notified of all torrents that are added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>,\n-and can add its own torrent_plugins.</p>\n-<pre class=\"literal-block\">\n-struct plugin\n-{\n- virtual feature_flags_t <strong>implemented_features</strong> ();\n- virtual std::shared_ptr<torrent_plugin> <strong>new_torrent</strong> (torrent_handle const&, client_data_t);\n- virtual void <strong>added</strong> (session_handle const&);\n- virtual void <strong>abort</strong> ();\n- virtual bool <strong>on_dht_request</strong> (string_view <em>/* query */</em>\n- , udp::endpoint const& <em>/* source */</em>, bdecode_node const& <em>/* message */</em>\n- , entry& <em>/* response */</em>);\n- virtual void <strong>on_alert</strong> (alert const*);\n- virtual bool <strong>on_unknown_torrent</strong> (info_hash_t const& <em>/* info_hash */</em>\n- , peer_connection_handle const& <em>/* pc */</em>, add_torrent_params& <em>/* p */</em>);\n- virtual void <strong>on_tick</strong> ();\n- virtual uint64_t <strong>get_unchoke_priority</strong> (peer_connection_handle const& <em>/* peer */</em>);\n- virtual std::map<std::string, std::string> <strong>save_state</strong> () const;\n- virtual void <strong>load_state</strong> (std::map<std::string, std::string> const&);\n-\n- static constexpr feature_flags_t <strong>optimistic_unchoke_feature</strong> = 1_bit;\n- static constexpr feature_flags_t <strong>tick_feature</strong> = 2_bit;\n- static constexpr feature_flags_t <strong>dht_request_feature</strong> = 3_bit;\n- static constexpr feature_flags_t <strong>alert_feature</strong> = 4_bit;\n- static constexpr feature_flags_t <strong>unknown_torrent_feature</strong> = 5_bit;\n-};\n-</pre>\n-<a name=\"implemented_features()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bimplemented_features%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bimplemented_features%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"implemented-features\">\n-<h2>implemented_features()</h2>\n-<pre class=\"literal-block\">\n-virtual feature_flags_t <strong>implemented_features</strong> ();\n-</pre>\n-<p>This function is expected to return a bitmask indicating which features\n-this <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n-<a name=\"new_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bnew_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bnew_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"new-torrent\">\n-<h2>new_torrent()</h2>\n-<pre class=\"literal-block\">\n-virtual std::shared_ptr<torrent_plugin> <strong>new_torrent</strong> (torrent_handle const&, client_data_t);\n-</pre>\n-<p>this is called by the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> every time a new torrent is added.\n-The <tt class=\"docutils literal\">torrent*</tt> points to the internal torrent object created\n-for the new torrent. The <a class=\"reference external\" href=\"reference-Add_Torrent.html#client_data_t\">client_data_t</a> is the userdata pointer as\n-passed in via <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.</p>\n-<p>If the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> returns a <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> instance, it will be added\n-to the new torrent. Otherwise, return an empty shared_ptr to a\n-<a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> (the default).</p>\n-<a name=\"added()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Badded%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Badded%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"added\">\n-<h2>added()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>added</strong> (session_handle const&);\n-</pre>\n-<p>called when <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></p>\n-<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"abort-1\">\n-<h2>abort()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>abort</strong> ();\n-</pre>\n-<p>called when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is aborted\n-the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> should perform any cleanup necessary to allow the session's\n-destruction (e.g. cancel outstanding async operations)</p>\n-<a name=\"on_dht_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_dht_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_dht_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-dht-request\">\n-<h2>on_dht_request()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_dht_request</strong> (string_view <em>/* query */</em>\n- , udp::endpoint const& <em>/* source */</em>, bdecode_node const& <em>/* message */</em>\n- , entry& <em>/* response */</em>);\n-</pre>\n-<p>called when a dht request is received.\n-If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n-<tt class=\"docutils literal\">dht_request_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n-<a name=\"on_alert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_alert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_alert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-alert\">\n-<h2>on_alert()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_alert</strong> (alert const*);\n-</pre>\n-<p>called when an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted alerts that are filtered are not posted.\n-If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n-<tt class=\"docutils literal\">alert_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n-<a name=\"on_unknown_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_unknown_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_unknown_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-unknown-torrent\">\n-<h2>on_unknown_torrent()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_unknown_torrent</strong> (info_hash_t const& <em>/* info_hash */</em>\n- , peer_connection_handle const& <em>/* pc */</em>, add_torrent_params& <em>/* p */</em>);\n-</pre>\n-<p>return true if the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> should be added</p>\n-<a name=\"on_tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bon_tick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bon_tick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-tick\">\n-<h2>on_tick()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_tick</strong> ();\n-</pre>\n-<p>called once per second.\n-If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n-<tt class=\"docutils literal\">tick_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.</p>\n-<a name=\"get_unchoke_priority()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bget_unchoke_priority%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bget_unchoke_priority%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-unchoke-priority\">\n-<h2>get_unchoke_priority()</h2>\n-<pre class=\"literal-block\">\n-virtual uint64_t <strong>get_unchoke_priority</strong> (peer_connection_handle const& <em>/* peer */</em>);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has no priority to assign a peer it should return 2^64-1.\n-If your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> expects this to be called, make sure to include the flag\n-<tt class=\"docutils literal\">optimistic_unchoke_feature</tt> in the return value from <a class=\"reference external\" href=\"reference-Plugins.html#implemented_features()\">implemented_features()</a>.\n-If multiple plugins implement this function the lowest return value\n-(i.e. the highest priority) is used.</p>\n-<a name=\"load_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bload_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bload_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"load-state\">\n-<h2>load_state()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>load_state</strong> (std::map<std::string, std::string> const&);\n-</pre>\n-<p>called on startup while loading settings state from the <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a></p>\n-<a name=\"optimistic_unchoke_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Boptimistic_unchoke_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Boptimistic_unchoke_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>optimistic_unchoke_feature</dt>\n-<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to alter the order of the\n-optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n-callback be called.</dd>\n-</dl>\n-<a name=\"tick_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Btick_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Btick_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>tick_feature</dt>\n-<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_tick()\">on_tick()</a> called</dd>\n-</dl>\n-<a name=\"dht_request_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bdht_request_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bdht_request_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>dht_request_feature</dt>\n-<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_dht_request()\">on_dht_request()</a>\n-called</dd>\n-</dl>\n-<a name=\"alert_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Balert_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Balert_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>alert_feature</dt>\n-<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_alert()\">on_alert()</a>\n-called</dd>\n-</dl>\n-<a name=\"unknown_torrent_feature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:plugin%3A%3A%5Bunknown_torrent_feature%5D&labels=documentation&body=Documentation+under+heading+%22plugin%3A%3A%5Bunknown_torrent_feature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>unknown_torrent_feature</dt>\n-<dd>include this bit if your <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> needs to have <a class=\"reference external\" href=\"reference-Plugins.html#on_unknown_torrent()\">on_unknown_torrent()</a>\n-called even if there is no active torrent in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></dd>\n-</dl>\n-<a name=\"torrent_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_plugin&labels=documentation&body=Documentation+under+heading+%22class+torrent_plugin%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"torrent-plugin\">\n-<h1>torrent_plugin</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\n-struct torrent_plugin\n-{\n- virtual std::shared_ptr<peer_plugin> <strong>new_connection</strong> (peer_connection_handle const&);\n- virtual void <strong>on_piece_pass</strong> (piece_index_t);\n- virtual void <strong>on_piece_failed</strong> (piece_index_t);\n- virtual void <strong>tick</strong> ();\n- virtual bool <strong>on_resume</strong> ();\n- virtual bool <strong>on_pause</strong> ();\n- virtual void <strong>on_files_checked</strong> ();\n- virtual void <strong>on_state</strong> (torrent_status::state_t);\n- virtual void <strong>on_add_peer</strong> (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n-\n- static constexpr add_peer_flags_t <strong>first_time</strong> = 1_bit;\n- static constexpr add_peer_flags_t <strong>filtered</strong> = 2_bit;\n-};\n-</pre>\n-<a name=\"new_connection()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bnew_connection%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bnew_connection%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-connection\">\n-<h2>new_connection()</h2>\n-<pre class=\"literal-block\">\n-virtual std::shared_ptr<peer_plugin> <strong>new_connection</strong> (peer_connection_handle const&);\n-</pre>\n-<p>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-<tt class=\"docutils literal\">shared_ptr</tt> (in which case you don't need to override this member\n-function).</p>\n-<p>If you need an extension to the peer connection (which most plugins do) you\n-are supposed to return an instance of your <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a> class. Which in\n-turn will have its hook functions called on event specific to that peer.</p>\n-<p>The <tt class=\"docutils literal\">peer_connection_handle</tt> will be valid as long as the <tt class=\"docutils literal\">shared_ptr</tt>\n-is being held by the torrent object. So, it is generally a good idea to not\n-keep a <tt class=\"docutils literal\">shared_ptr</tt> to your own <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>. If you want to keep references\n-to it, use <tt class=\"docutils literal\">weak_ptr</tt>.</p>\n-<p>If this function throws an exception, the connection will be closed.</p>\n-<a name=\"on_piece_failed()\"></a>\n-<a name=\"on_piece_pass()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-piece-failed-on-piece-pass\">\n-<h2>on_piece_failed() on_piece_pass()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_piece_pass</strong> (piece_index_t);\n-virtual void <strong>on_piece_failed</strong> (piece_index_t);\n-</pre>\n-<p>These hooks are called when a piece passes the hash check or fails the hash\n-check, respectively. The <tt class=\"docutils literal\">index</tt> 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 <tt class=\"docutils literal\">torrent</tt> and the <tt class=\"docutils literal\">piece_picker</tt>.</p>\n-<a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tick\">\n-<h2>tick()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>tick</strong> ();\n-</pre>\n-<p>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.</p>\n-<a name=\"on_resume()\"></a>\n-<a name=\"on_pause()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_resume%28%29+on_pause%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-resume-on-pause\">\n-<h2>on_resume() on_pause()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_resume</strong> ();\n-virtual bool <strong>on_pause</strong> ();\n-</pre>\n-<p>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-<tt class=\"docutils literal\">true</tt> indicates that it was handled, and no other <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</p>\n-<p>Note that if you call <tt class=\"docutils literal\">pause()</tt> or <tt class=\"docutils literal\">resume()</tt> 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.</p>\n-<a name=\"on_files_checked()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_files_checked%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_files_checked%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-files-checked\">\n-<h2>on_files_checked()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_files_checked</strong> ();\n-</pre>\n-<p>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.</p>\n-<p>i.e. This function is always called when the torrent is in a state where it\n-can start downloading.</p>\n-<a name=\"on_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-state\">\n-<h2>on_state()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_state</strong> (torrent_status::state_t);\n-</pre>\n-<p>called when the torrent changes state\n-the state is one of <a class=\"reference external\" href=\"reference-Torrent_Status.html#state_t\">torrent_status::state_t</a>\n-enum members</p>\n-<a name=\"on_add_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bon_add_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bon_add_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-add-peer\">\n-<h2>on_add_peer()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_add_peer</strong> (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n-</pre>\n-<p>called every time a new peer is added to the peer list.\n-This is before the peer is connected to. For <tt class=\"docutils literal\">flags</tt>, see\n-torrent_plugin::flags_t. The <tt class=\"docutils literal\">source</tt> 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.</p>\n-<a name=\"first_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bfirst_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bfirst_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>first_time</dt>\n-<dd>this is the first time we see this peer</dd>\n-</dl>\n-<a name=\"filtered\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_plugin%3A%3A%5Bfiltered%5D&labels=documentation&body=Documentation+under+heading+%22torrent_plugin%3A%3A%5Bfiltered%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>filtered</dt>\n-<dd>this peer was not added because it was\n-filtered by the IP filter</dd>\n-</dl>\n-<a name=\"peer_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_plugin&labels=documentation&body=Documentation+under+heading+%22class+peer_plugin%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-plugin\">\n-<h1>peer_plugin</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n-<p>peer plugins are associated with a specific peer. A peer could be\n-both a regular bittorrent peer (<tt class=\"docutils literal\">bt_peer_connection</tt>) or one of the\n-web seed connections (<tt class=\"docutils literal\">web_peer_connection</tt> or <tt class=\"docutils literal\">http_seed_connection</tt>).\n-In order to only attach to certain peers, make your\n-torrent_plugin::new_connection only return a <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> for certain peer\n-connection types</p>\n-<pre class=\"literal-block\">\n-struct peer_plugin\n-{\n- virtual string_view <strong>type</strong> () const;\n- virtual void <strong>add_handshake</strong> (entry&);\n- virtual void <strong>on_disconnect</strong> (error_code const&);\n- virtual void <strong>on_connected</strong> ();\n- virtual bool <strong>on_handshake</strong> (span<char const>);\n- virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n- virtual bool <strong>on_not_interested</strong> ();\n- virtual bool <strong>on_have</strong> (piece_index_t);\n- virtual bool <strong>on_choke</strong> ();\n- virtual bool <strong>on_interested</strong> ();\n- virtual bool <strong>on_request</strong> (peer_request const&);\n- virtual bool <strong>on_have_none</strong> ();\n- virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n- virtual bool <strong>on_unchoke</strong> ();\n- virtual bool <strong>on_dont_have</strong> (piece_index_t);\n- virtual bool <strong>on_have_all</strong> ();\n- virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n- virtual bool <strong>on_piece</strong> (peer_request const& <em>/*piece*/</em>\n- , span<char const> <em>/*buf*/</em>);\n- virtual bool <strong>on_cancel</strong> (peer_request const&);\n- virtual bool <strong>on_suggest</strong> (piece_index_t);\n- virtual bool <strong>on_reject</strong> (peer_request const&);\n- virtual void <strong>sent_suggest</strong> (piece_index_t);\n- virtual void <strong>sent_cancel</strong> (peer_request const&);\n- virtual void <strong>sent_choke</strong> ();\n- virtual void <strong>sent_request</strong> (peer_request const&);\n- virtual void <strong>sent_allow_fast</strong> (piece_index_t);\n- virtual void <strong>sent_have_none</strong> ();\n- virtual void <strong>sent_reject_request</strong> (peer_request const&);\n- virtual void <strong>sent_have_all</strong> ();\n- virtual void <strong>sent_unchoke</strong> ();\n- virtual void <strong>sent_interested</strong> ();\n- virtual void <strong>sent_piece</strong> (peer_request const&);\n- virtual void <strong>sent_have</strong> (piece_index_t);\n- virtual void <strong>sent_not_interested</strong> ();\n- virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n- virtual bool <strong>can_disconnect</strong> (error_code const& <em>/*ec*/</em>);\n- virtual bool <strong>on_extended</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n- span<char const> <em>/*body*/</em>);\n- virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n- span<char const> <em>/*body*/</em>);\n- virtual void <strong>on_piece_pass</strong> (piece_index_t);\n- virtual void <strong>on_piece_failed</strong> (piece_index_t);\n- virtual void <strong>tick</strong> ();\n- virtual bool <strong>write_request</strong> (peer_request const&);\n-};\n-</pre>\n-<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"type-1\">\n-<h2>type()</h2>\n-<pre class=\"literal-block\">\n-virtual string_view <strong>type</strong> () const;\n-</pre>\n-<p>This function is expected to return the name of\n-the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a>.</p>\n-<a name=\"add_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Badd_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Badd_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-handshake\">\n-<h2>add_handshake()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>add_handshake</strong> (entry&);\n-</pre>\n-<p>can add entries to the extension handshake\n-this is not called for web seeds</p>\n-<a name=\"on_disconnect()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_disconnect%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_disconnect%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-disconnect\">\n-<h2>on_disconnect()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_disconnect</strong> (error_code const&);\n-</pre>\n-<p>called when the peer is being disconnected.</p>\n-<a name=\"on_connected()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_connected%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_connected%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-connected\">\n-<h2>on_connected()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_connected</strong> ();\n-</pre>\n-<p>called when the peer is successfully connected. Note that\n-incoming connections will have been connected by the time\n-the peer <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> is attached to it, and won't have this hook\n-called.</p>\n-<a name=\"on_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-handshake\">\n-<h2>on_handshake()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_handshake</strong> (span<char const>);\n-</pre>\n-<p>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</p>\n-<a name=\"on_extension_handshake()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_extension_handshake%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_extension_handshake%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-extension-handshake\">\n-<h2>on_extension_handshake()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_extension_handshake</strong> (bdecode_node const&);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#peer_plugin\">peer_plugin</a>\n-being removed from the peer_connection and destructed.\n-this is not called for web seeds</p>\n-<a name=\"on_choke()\"></a>\n-<a name=\"on_unchoke()\"></a>\n-<a name=\"on_have_all()\"></a>\n-<a name=\"on_have_none()\"></a>\n-<a name=\"on_bitfield()\"></a>\n-<a name=\"on_not_interested()\"></a>\n-<a name=\"on_request()\"></a>\n-<a name=\"on_have()\"></a>\n-<a name=\"on_dont_have()\"></a>\n-<a name=\"on_interested()\"></a>\n-<a name=\"on_allowed_fast()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_choke%28%29+on_unchoke%28%29+on_have_all%28%29+on_have_none%28%29+on_bitfield%28%29+on_not_interested%28%29+on_request%28%29+on_have%28%29+on_dont_have%28%29+on_interested%28%29+on_allowed_fast%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_choke%28%29+on_unchoke%28%29+on_have_all%28%29+on_have_none%28%29+on_bitfield%28%29+on_not_interested%28%29+on_request%28%29+on_have%28%29+on_dont_have%28%29+on_interested%28%29+on_allowed_fast%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-choke-on-unchoke-on-have-all-on-have-none-on-bitfield-on-not-interested-on-request-on-have-on-dont-have-on-interested-on-allowed-fast\">\n-<h2>on_choke() on_unchoke() on_have_all() on_have_none() on_bitfield() on_not_interested() on_request() on_have() on_dont_have() on_interested() on_allowed_fast()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_not_interested</strong> ();\n-virtual bool <strong>on_have</strong> (piece_index_t);\n-virtual bool <strong>on_choke</strong> ();\n-virtual bool <strong>on_interested</strong> ();\n-virtual bool <strong>on_request</strong> (peer_request const&);\n-virtual bool <strong>on_have_none</strong> ();\n-virtual bool <strong>on_allowed_fast</strong> (piece_index_t);\n-virtual bool <strong>on_unchoke</strong> ();\n-virtual bool <strong>on_dont_have</strong> (piece_index_t);\n-virtual bool <strong>on_have_all</strong> ();\n-virtual bool <strong>on_bitfield</strong> (bitfield const& <em>/*bitfield*/</em>);\n-</pre>\n-<p>returning true from any of the message handlers\n-indicates that the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> has handled the message.\n-it will break the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> chain traversing and not let\n-anyone else handle the message, including the default\n-handler.</p>\n-<a name=\"on_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-piece\">\n-<h2>on_piece()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_piece</strong> (peer_request const& <em>/*piece*/</em>\n- , span<char const> <em>/*buf*/</em>);\n-</pre>\n-<p>This function is called when the peer connection is receiving\n-a piece. <tt class=\"docutils literal\">buf</tt> points (non-owning pointer) to the data in an\n-internal immutable disk buffer. The length of the data is specified\n-in the <tt class=\"docutils literal\">length</tt> member of the <tt class=\"docutils literal\">piece</tt> parameter.\n-returns true to indicate that the piece is handled and the\n-rest of the logic should be ignored.</p>\n-<a name=\"sent_interested()\"></a>\n-<a name=\"sent_have()\"></a>\n-<a name=\"sent_not_interested()\"></a>\n-<a name=\"sent_piece()\"></a>\n-<a name=\"sent_unchoke()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_interested%28%29+sent_have%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_interested%28%29+sent_have%28%29+sent_not_interested%28%29+sent_piece%28%29+sent_unchoke%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"sent-interested-sent-have-sent-not-interested-sent-piece-sent-unchoke\">\n-<h2>sent_interested() sent_have() sent_not_interested() sent_piece() sent_unchoke()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>sent_unchoke</strong> ();\n-virtual void <strong>sent_interested</strong> ();\n-virtual void <strong>sent_piece</strong> (peer_request const&);\n-virtual void <strong>sent_have</strong> (piece_index_t);\n-virtual void <strong>sent_not_interested</strong> ();\n-</pre>\n-<p>called after a choke message has been sent to the peer</p>\n-<a name=\"sent_payload()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bsent_payload%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bsent_payload%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"sent-payload\">\n-<h2>sent_payload()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>sent_payload</strong> (int <em>/* bytes */</em>);\n-</pre>\n-<p>called after piece data has been sent to the peer\n-this can be used for stats book keeping</p>\n-<a name=\"can_disconnect()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bcan_disconnect%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bcan_disconnect%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"can-disconnect\">\n-<h2>can_disconnect()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>can_disconnect</strong> (error_code const& <em>/*ec*/</em>);\n-</pre>\n-<p>called when libtorrent think this peer should be disconnected.\n-if the <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> returns false, the peer will not be disconnected.</p>\n-<a name=\"on_extended()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_extended%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_extended%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-extended\">\n-<h2>on_extended()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_extended</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n- span<char const> <em>/*body*/</em>);\n-</pre>\n-<p>called when an extended message is received. If returning true,\n-the message is not processed by any other <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> and if false\n-is returned the next <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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 <tt class=\"docutils literal\">body</tt> size equal the <tt class=\"docutils literal\">length</tt>.\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.</p>\n-<a name=\"on_unknown_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_unknown_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_unknown_message%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-unknown-message\">\n-<h2>on_unknown_message()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>on_unknown_message</strong> (int <em>/*length*/</em>, int <em>/*msg*/</em>,\n- span<char const> <em>/*body*/</em>);\n-</pre>\n-<p>this is not called for web seeds</p>\n-<a name=\"on_piece_failed()\"></a>\n-<a name=\"on_piece_pass()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece_failed%28%29+on_piece_pass%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"on-piece-failed-on-piece-pass-1\">\n-<h2>on_piece_failed() on_piece_pass()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_piece_pass</strong> (piece_index_t);\n-virtual void <strong>on_piece_failed</strong> (piece_index_t);\n-</pre>\n-<p>called when a piece that this peer participated in either\n-fails or passes the hash_check</p>\n-<a name=\"tick()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Btick%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Btick%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"tick-1\">\n-<h2>tick()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>tick</strong> ();\n-</pre>\n-<p>called approximately once every second</p>\n-<a name=\"write_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bwrite_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bwrite_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"write-request\">\n-<h2>write_request()</h2>\n-<pre class=\"literal-block\">\n-virtual bool <strong>write_request</strong> (peer_request const&);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> will have this function called.</p>\n-<a name=\"crypto_plugin\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+crypto_plugin&labels=documentation&body=Documentation+under+heading+%22class+crypto_plugin%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"crypto-plugin\">\n-<h1>crypto_plugin</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions.hpp\">libtorrent/extensions.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-struct crypto_plugin\n-{\n- virtual void <strong>set_outgoing_key</strong> (span<char const> key) = 0;\n- virtual void <strong>set_incoming_key</strong> (span<char const> key) = 0;\n- <strong>encrypt</strong> (span<span<char>> <em>/*send_vec*/</em>) = 0;\n- virtual std::tuple<int, int, int> <strong>decrypt</strong> (span<span<char>> <em>/*receive_vec*/</em>) = 0;\n-};\n-</pre>\n-<a name=\"decrypt()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:crypto_plugin%3A%3A%5Bdecrypt%28%29%5D&labels=documentation&body=Documentation+under+heading+%22crypto_plugin%3A%3A%5Bdecrypt%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"decrypt\">\n-<h2>decrypt()</h2>\n-<pre class=\"literal-block\">\n-virtual std::tuple<int, int, int> <strong>decrypt</strong> (span<span<char>> <em>/*receive_vec*/</em>) = 0;\n-</pre>\n-<p>decrypt the provided buffers.\n-returns is a tuple representing the values\n-(consume, produce, packet_size)</p>\n-<p>consume is set to the number of bytes which should be trimmed from the\n-head of the buffers, default is 0</p>\n-<p>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</p>\n-<p>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</p>\n-<a name=\"create_smart_ban_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_smart_ban_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_smart_ban_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"create-smart-ban-plugin\">\n-<h1>create_smart_ban_plugin()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/smart_ban.hpp\">libtorrent/extensions/smart_ban.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::shared_ptr<torrent_plugin> <strong>create_smart_ban_plugin</strong> (torrent_handle const&, client_data_t);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n-<a name=\"create_ut_pex_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_pex_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_pex_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"create-ut-pex-plugin\">\n-<h1>create_ut_pex_plugin()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_pex.hpp\">libtorrent/extensions/ut_pex.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::shared_ptr<torrent_plugin> <strong>create_ut_pex_plugin</strong> (torrent_handle const&, client_data_t);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor.</p>\n-<p>This can either be passed in the add_torrent_params::extensions field, or\n-via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n-<a name=\"create_ut_metadata_plugin()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_ut_metadata_plugin%28%29&labels=documentation&body=Documentation+under+heading+%22create_ut_metadata_plugin%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"create-ut-metadata-plugin\">\n-<h1>create_ut_metadata_plugin()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/extensions/ut_metadata.hpp\">libtorrent/extensions/ut_metadata.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::shared_ptr<torrent_plugin> <strong>create_ut_metadata_plugin</strong> (torrent_handle const&, client_data_t);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor.</p>\n-<p>This can either be passed in the add_torrent_params::extensions field, or\n-via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_extension()\">torrent_handle::add_extension()</a>.</p>\n-<a name=\"torrent_status\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_status&labels=documentation&body=Documentation+under+heading+%22class+torrent_status%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"torrent-status\">\n-<h1>torrent_status</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_status.hpp\">libtorrent/torrent_status.hpp</a>"</p>\n-<p>holds a snapshot of the status of a torrent, as queried by\n-<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>.</p>\n-<pre class=\"literal-block\">\n-struct torrent_status\n-{\n- bool <strong>operator==</strong> (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 <strong>error_file</strong> = torrent_status::error_file_none;\n- static constexpr file_index_t <strong>error_file_none</strong> {-1};\n- static constexpr file_index_t <strong>error_file_ssl_ctx</strong> {-3};\n- static constexpr file_index_t <strong>error_file_metadata</strong> {-4};\n- static constexpr file_index_t <strong>error_file_exception</strong> {-5};\n- static constexpr file_index_t <strong>error_file_partfile</strong> {-6};\n- std::string save_path;\n- std::string name;\n- std::weak_ptr<const torrent_info> torrent_file;\n- time_duration <strong>next_announce</strong> = seconds{0};\n- std::string current_tracker;\n- std::int64_t <strong>total_download</strong> = 0;\n- std::int64_t <strong>total_upload</strong> = 0;\n- std::int64_t <strong>total_payload_download</strong> = 0;\n- std::int64_t <strong>total_payload_upload</strong> = 0;\n- std::int64_t <strong>total_failed_bytes</strong> = 0;\n- std::int64_t <strong>total_redundant_bytes</strong> = 0;\n- typed_bitfield<piece_index_t> pieces;\n- typed_bitfield<piece_index_t> verified_pieces;\n- std::int64_t <strong>total_done</strong> = 0;\n- std::int64_t <strong>total</strong> = 0;\n- std::int64_t <strong>total_wanted_done</strong> = 0;\n- std::int64_t <strong>total_wanted</strong> = 0;\n- std::int64_t <strong>all_time_upload</strong> = 0;\n- std::int64_t <strong>all_time_download</strong> = 0;\n- std::time_t <strong>added_time</strong> = 0;\n- std::time_t <strong>completed_time</strong> = 0;\n- std::time_t <strong>last_seen_complete</strong> = 0;\n- storage_mode_t <strong>storage_mode</strong> = storage_mode_sparse;\n- float <strong>progress</strong> = 0.f;\n- int <strong>progress_ppm</strong> = 0;\n- queue_position_t <strong>queue_position</strong> {};\n- int <strong>download_rate</strong> = 0;\n- int <strong>upload_rate</strong> = 0;\n- int <strong>download_payload_rate</strong> = 0;\n- int <strong>upload_payload_rate</strong> = 0;\n- int <strong>num_seeds</strong> = 0;\n- int <strong>num_peers</strong> = 0;\n- int <strong>num_complete</strong> = -1;\n- int <strong>num_incomplete</strong> = -1;\n- int <strong>list_seeds</strong> = 0;\n- int <strong>list_peers</strong> = 0;\n- int <strong>connect_candidates</strong> = 0;\n- int <strong>num_pieces</strong> = 0;\n- int <strong>distributed_full_copies</strong> = 0;\n- int <strong>distributed_fraction</strong> = 0;\n- float <strong>distributed_copies</strong> = 0.f;\n- int <strong>block_size</strong> = 0;\n- int <strong>num_uploads</strong> = 0;\n- int <strong>num_connections</strong> = 0;\n- int <strong>uploads_limit</strong> = 0;\n- int <strong>connections_limit</strong> = 0;\n- int <strong>up_bandwidth_queue</strong> = 0;\n- int <strong>down_bandwidth_queue</strong> = 0;\n- int <strong>seed_rank</strong> = 0;\n- state_t <strong>state</strong> = checking_resume_data;\n- bool <strong>need_save_resume</strong> = false;\n- bool <strong>is_seeding</strong> = false;\n- bool <strong>is_finished</strong> = false;\n- bool <strong>has_metadata</strong> = false;\n- bool <strong>has_incoming</strong> = false;\n- bool <strong>moving_storage</strong> = false;\n- bool <strong>announcing_to_trackers</strong> = false;\n- bool <strong>announcing_to_lsd</strong> = false;\n- bool <strong>announcing_to_dht</strong> = 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 <strong>flags</strong> {};\n-};\n-</pre>\n-<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-3\">\n-<h2>operator==()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>operator==</strong> (torrent_status const& st) const;\n-</pre>\n-<p>compares if the torrent status objects come from the same torrent. i.e.\n-only the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> field is compared.</p>\n-<a name=\"state_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+state_t&labels=documentation&body=Documentation+under+heading+%22enum+state_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-state-t\">\n-<h2>enum state_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_status.hpp\">libtorrent/torrent_status.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"44%\" />\n-<col width=\"6%\" />\n-<col width=\"50%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>checking_files</td>\n-<td>1</td>\n-<td>The torrent has not started its download yet, and is\n-currently checking existing files.</td>\n-</tr>\n-<tr><td>downloading_metadata</td>\n-<td>2</td>\n-<td>The torrent is trying to download metadata from peers.\n-This implies the ut_metadata extension is in use.</td>\n-</tr>\n-<tr><td>downloading</td>\n-<td>3</td>\n-<td>The torrent is being downloaded. This is the state\n-most torrents will be in most of the time. The progress\n-meter will tell how much of the files that has been\n-downloaded.</td>\n-</tr>\n-<tr><td>finished</td>\n-<td>4</td>\n-<td>In this state the torrent has finished downloading but\n-still doesn't have the entire torrent. i.e. some pieces\n-are filtered and won't get downloaded.</td>\n-</tr>\n-<tr><td>seeding</td>\n-<td>5</td>\n-<td>In this state the torrent has finished downloading and\n-is a pure seeder.</td>\n-</tr>\n-<tr><td>unused_enum_for_backwards_compatibility_allocating</td>\n-<td>6</td>\n-<td>If the torrent was started in full allocation mode, this\n-indicates that the (disk) storage for the torrent is\n-allocated.</td>\n-</tr>\n-<tr><td>checking_resume_data</td>\n-<td>7</td>\n-<td>The torrent is currently checking the fast resume data and\n-comparing it to the files on disk. This is typically\n-completed in a fraction of a second, but if you add a\n-large number of torrents at once, they will queue up.</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhandle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>handle</dt>\n-<dd>a handle to the torrent whose status the object represents.</dd>\n-</dl>\n-<a name=\"errc\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berrc%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berrc%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>errc</dt>\n-<dd>may be set to an error code describing why the torrent was paused, in\n-case it was paused by an error. If the torrent is not paused or if it's\n-paused but not because of an error, this error_code is not set.\n-if the error is attributed specifically to a file, error_file is set to\n-the index of that file in the .torrent file.</dd>\n-</dl>\n-<a name=\"error_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file</dt>\n-<dd>if the torrent is stopped because of an disk I/O error, this field\n-contains the index of the file in the torrent that encountered the\n-error. If the error did not originate in a file in the torrent, there\n-are a few special values this can be set to: error_file_none,\n-error_file_ssl_ctx, error_file_exception, error_file_partfile or\n-error_file_metadata;</dd>\n-</dl>\n-<a name=\"error_file_none\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_none%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_none%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file_none</dt>\n-<dd>special values for error_file to describe which file or component\n-encountered the error (<tt class=\"docutils literal\">errc</tt>).\n-the error did not occur on a file</dd>\n-</dl>\n-<a name=\"error_file_ssl_ctx\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_ssl_ctx%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_ssl_ctx%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file_ssl_ctx</dt>\n-<dd>the error occurred setting up the SSL context</dd>\n-</dl>\n-<a name=\"error_file_metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_metadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_metadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file_metadata</dt>\n-<dd>the error occurred while loading the metadata for the torrent</dd>\n-</dl>\n-<a name=\"error_file_exception\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_exception%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_exception%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file_exception</dt>\n-<dd>there was a serious error reported in this torrent. The error code\n-or a torrent log <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> may provide more information.</dd>\n-</dl>\n-<a name=\"error_file_partfile\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_partfile%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_partfile%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>error_file_partfile</dt>\n-<dd>the error occurred with the partfile</dd>\n-</dl>\n-<a name=\"save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bsave_path%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bsave_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>save_path</dt>\n-<dd>the path to the directory where this torrent's files are stored.\n-It's typically the path as was given to <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a> or\n-<a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> when this torrent was started. This field is only\n-included if the torrent status is queried with\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_save_path</span></tt>.</dd>\n-</dl>\n-<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>name</dt>\n-<dd>the name of the torrent. Typically this is derived from the\n-.torrent file. In case the torrent was started without metadata,\n-and hasn't completely received it yet, it returns the name given\n-to it when added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. See <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent</span></tt>.\n-This field is only included if the torrent status is queried\n-with <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_name</span></tt>.</dd>\n-</dl>\n-<a name=\"torrent_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btorrent_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btorrent_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>torrent_file</dt>\n-<dd>set to point to the <tt class=\"docutils literal\">torrent_info</tt> object for this torrent. It's\n-only included if the torrent status is queried with\n-<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_torrent_file</span></tt>.</dd>\n-</dl>\n-<a name=\"next_announce\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnext_announce%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnext_announce%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>next_announce</dt>\n-<dd>the time until the torrent will announce itself to the tracker.</dd>\n-</dl>\n-<a name=\"current_tracker\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bcurrent_tracker%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bcurrent_tracker%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>current_tracker</dt>\n-<dd>the URL of the last working tracker. If no tracker request has\n-been successful yet, it's set to an empty string.</dd>\n-</dl>\n-<a name=\"total_download\"></a>\n-<a name=\"total_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_download+total_upload%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_download+total_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_download total_upload</dt>\n-<dd>the number of bytes downloaded and uploaded to all peers, accumulated,\n-<em>this session</em> only. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is considered to restart when a\n-torrent is paused and restarted again. When a torrent is paused, these\n-<a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are reset to 0. If you want complete, persistent, stats, see\n-<tt class=\"docutils literal\">all_time_upload</tt> and <tt class=\"docutils literal\">all_time_download</tt>.</dd>\n-</dl>\n-<a name=\"total_payload_download\"></a>\n-<a name=\"total_payload_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_payload_download+total_payload_upload%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_payload_download+total_payload_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_payload_download total_payload_upload</dt>\n-<dd>counts the amount of bytes send and received this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, but only\n-the actual payload data (i.e the interesting data), these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>\n-ignore any protocol overhead. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is considered to restart\n-when a torrent is paused and restarted again. When a torrent is\n-paused, these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are reset to 0.</dd>\n-</dl>\n-<a name=\"total_failed_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_failed_bytes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_failed_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_failed_bytes</dt>\n-<dd>the number of bytes that has been downloaded and that has failed the\n-piece hash test. In other words, this is just how much crap that has\n-been downloaded since the torrent was last started. If a torrent is\n-paused and then restarted again, this counter will be reset.</dd>\n-</dl>\n-<a name=\"total_redundant_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_redundant_bytes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_redundant_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_redundant_bytes</dt>\n-<dd>the number of bytes that has been downloaded even though that data\n-already was downloaded. The reason for this is that in some situations\n-the same data can be downloaded by mistake. When libtorrent sends\n-requests to a peer, and the peer doesn't send a response within a\n-certain timeout, libtorrent will re-request that block. Another\n-situation when libtorrent may re-request blocks is when the requests\n-it sends out are not replied in FIFO-order (it will re-request blocks\n-that are skipped by an out of order block). This is supposed to be as\n-low as possible. This only counts bytes since the torrent was last\n-started. If a torrent is paused and then restarted again, this counter\n-will be reset.</dd>\n-</dl>\n-<a name=\"pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bpieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bpieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>pieces</dt>\n-<dd>a bitmask that represents which pieces we have (set to true) and the\n-pieces we don't have. It's a pointer and may be set to 0 if the\n-torrent isn't downloading or seeding.</dd>\n-</dl>\n-<a name=\"verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bverified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bverified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>verified_pieces</dt>\n-<dd>a bitmask representing which pieces has had their hash checked. This\n-only applies to torrents in <em>seed mode</em>. If the torrent is not in seed\n-mode, this bitmask may be empty.</dd>\n-</dl>\n-<a name=\"total_done\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_done%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_done%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_done</dt>\n-<dd>the total number of bytes of the file(s) that we have. All this does\n-not necessarily has to be downloaded during this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (that's\n-<tt class=\"docutils literal\">total_payload_download</tt>).</dd>\n-</dl>\n-<a name=\"total\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total</dt>\n-<dd>the total number of bytes to download for this torrent. This\n-may be less than the size of the torrent in case there are\n-pad files. This number only counts bytes that will actually\n-be requested from peers.</dd>\n-</dl>\n-<a name=\"total_wanted_done\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_wanted_done%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_wanted_done%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_wanted_done</dt>\n-<dd>the number of bytes we have downloaded, only counting the pieces that\n-we actually want to download. i.e. excluding any pieces that we have\n-but have priority 0 (i.e. not wanted).\n-Once a torrent becomes seed, any piece- and file priorities are\n-forgotten and all bytes are considered "wanted".</dd>\n-</dl>\n-<a name=\"total_wanted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_wanted%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_wanted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>total_wanted</dt>\n-<dd>The total number of bytes we want to download. This may be smaller\n-than the total torrent size in case any pieces are prioritized to 0,\n-i.e. not wanted.\n-Once a torrent becomes seed, any piece- and file priorities are\n-forgotten and all bytes are considered "wanted".</dd>\n-</dl>\n-<a name=\"all_time_upload\"></a>\n-<a name=\"all_time_download\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Ball_time_upload+all_time_download%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Ball_time_upload+all_time_download%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>all_time_upload all_time_download</dt>\n-<dd>are accumulated upload and download payload byte <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>. They are\n-saved in and restored from resume data to keep totals across sessions.</dd>\n-</dl>\n-<a name=\"added_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Badded_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Badded_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>added_time</dt>\n-<dd>the posix-time when this torrent was added. i.e. what <tt class=\"docutils literal\">time(nullptr)</tt>\n-returned at the time.</dd>\n-</dl>\n-<a name=\"completed_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bcompleted_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bcompleted_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>completed_time</dt>\n-<dd>the posix-time when this torrent was finished. If the torrent is not\n-yet finished, this is 0.</dd>\n-</dl>\n-<a name=\"last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blast_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blast_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_seen_complete</dt>\n-<dd>the time when we, or one of our peers, last saw a complete copy of\n-this torrent.</dd>\n-</dl>\n-<a name=\"storage_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bstorage_mode%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bstorage_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>storage_mode</dt>\n-<dd>The allocation mode for the torrent. See <a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a> for the\n-options. For more information, see <a class=\"reference external\" href=\"manual-ref.html#storage-allocation\">storage allocation</a>.</dd>\n-</dl>\n-<a name=\"progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bprogress%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bprogress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>progress</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"progress_ppm\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bprogress_ppm%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bprogress_ppm%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>progress_ppm</dt>\n-<dd><p class=\"first\">progress parts per million (progress * 1000000) when disabling\n-floating point operations, this is the only option to query progress</p>\n-<p class=\"last\">reflects the same value as <tt class=\"docutils literal\">progress</tt>, but instead in a range [0,\n-1000000] (ppm = parts per million). When floating point operations are\n-disabled, this is the only alternative to the floating point value in\n-progress.</p>\n-</dd>\n-</dl>\n-<a name=\"queue_position\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bqueue_position%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bqueue_position%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>queue_position</dt>\n-<dd>the position this torrent has in the download\n-queue. If the torrent is a seed or finished, this is -1.</dd>\n-</dl>\n-<a name=\"download_rate\"></a>\n-<a name=\"upload_rate\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdownload_rate+upload_rate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdownload_rate+upload_rate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>download_rate upload_rate</dt>\n-<dd>the total rates for all peers for this torrent. These will usually\n-have better precision than summing the rates from all peers. The rates\n-are given as the number of bytes per second.</dd>\n-</dl>\n-<a name=\"download_payload_rate\"></a>\n-<a name=\"upload_payload_rate\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdownload_payload_rate+upload_payload_rate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdownload_payload_rate+upload_payload_rate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>download_payload_rate upload_payload_rate</dt>\n-<dd>the total transfer rate of payload only, not counting protocol\n-chatter. This might be slightly smaller than the other rates, but if\n-projected over a long time (e.g. when calculating ETA:s) the\n-difference may be noticeable.</dd>\n-</dl>\n-<a name=\"num_seeds\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_seeds%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_seeds%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_seeds</dt>\n-<dd>the number of peers that are seeding that this client is\n-currently connected to.</dd>\n-</dl>\n-<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_peers</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Plugins.html#get_peer_info()\">get_peer_info()</a>.</dd>\n-</dl>\n-<a name=\"num_complete\"></a>\n-<a name=\"num_incomplete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_complete num_incomplete</dt>\n-<dd>if the tracker sends scrape info in its announce reply, these fields\n-will be set to the total number of peers that have the whole file and\n-the total number of peers that are still downloading. set to -1 if the\n-tracker did not send any scrape data in its announce reply.</dd>\n-</dl>\n-<a name=\"list_seeds\"></a>\n-<a name=\"list_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blist_seeds+list_peers%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blist_seeds+list_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>list_seeds list_peers</dt>\n-<dd>the number of seeds in our peer list and the total number of peers\n-(including seeds). We are not necessarily connected to all the peers\n-in our peer list. This is the number of peers we know of in total,\n-including banned peers and peers that we have failed to connect to.</dd>\n-</dl>\n-<a name=\"connect_candidates\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bconnect_candidates%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bconnect_candidates%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>connect_candidates</dt>\n-<dd>the number of peers in this torrent's peer list that is a candidate to\n-be connected to. i.e. It has fewer connect attempts than the max fail\n-count, it is not a seed if we are a seed, it is not banned etc. If\n-this is 0, it means we don't know of any more peers that we can try.</dd>\n-</dl>\n-<a name=\"num_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_pieces</dt>\n-<dd>the number of pieces that has been downloaded. It is equivalent to:\n-<tt class=\"docutils literal\"><span class=\"pre\">std::accumulate(pieces->begin(),</span> <span class=\"pre\">pieces->end())</span></tt>. So you don't have\n-to count yourself. This can be used to see if anything has updated\n-since last time if you want to keep a graph of the pieces up to date.\n-Note that these pieces have not necessarily been written to disk yet,\n-and there is a risk the write to disk will fail.</dd>\n-</dl>\n-<a name=\"distributed_full_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_full_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_full_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>distributed_full_copies</dt>\n-<dd>the number of distributed copies of the torrent. Note that one copy\n-may be spread out among many peers. It tells how many copies there are\n-currently of the rarest piece(s) among the peers this client is\n-connected to.</dd>\n-</dl>\n-<a name=\"distributed_fraction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_fraction%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_fraction%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>distributed_fraction</dt>\n-<dd><p class=\"first\">tells the share of pieces that have more copies than the rarest\n-piece(s). Divide this number by 1000 to get the fraction.</p>\n-<p>For example, if <tt class=\"docutils literal\">distributed_full_copies</tt> is 2 and\n-<tt class=\"docutils literal\">distributed_fraction</tt> is 500, it means that the rarest pieces have\n-only 2 copies among the peers this torrent is connected to, and that\n-50% of all the pieces have more than two copies.</p>\n-<p class=\"last\">If we are a seed, the piece picker is deallocated as an optimization,\n-and piece availability is no longer tracked. In this case the\n-distributed copies members are set to -1.</p>\n-</dd>\n-</dl>\n-<a name=\"distributed_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>distributed_copies</dt>\n-<dd><p class=\"first\">the number of distributed copies of the file. note that one copy may\n-be spread out among many peers. This is a floating point\n-representation of the distributed copies.</p>\n-<dl class=\"last docutils\">\n-<dt>the integer part tells how many copies</dt>\n-<dd>there are of the rarest piece(s)</dd>\n-<dt>the fractional part tells the fraction of pieces that</dt>\n-<dd>have more copies than the rarest piece(s).</dd>\n-</dl>\n-</dd>\n-</dl>\n-<a name=\"block_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bblock_size%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bblock_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>block_size</dt>\n-<dd>the size of a block, in bytes. A block is a sub piece, it is the\n-number of bytes that each piece request asks for and the number of\n-bytes that each bit in the <tt class=\"docutils literal\">partial_piece_info</tt>'s bitset represents,\n-see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_download_queue()\">get_download_queue()</a>. This is typically 16 kB, but it may be\n-smaller, if the pieces are smaller.</dd>\n-</dl>\n-<a name=\"num_uploads\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_uploads%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_uploads%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_uploads</dt>\n-<dd>the number of unchoked peers in this torrent.</dd>\n-</dl>\n-<a name=\"num_connections\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_connections%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_connections%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>num_connections</dt>\n-<dd>the number of peer connections this torrent has, including half-open\n-connections that hasn't completed the bittorrent handshake yet. This\n-is always >= <tt class=\"docutils literal\">num_peers</tt>.</dd>\n-</dl>\n-<a name=\"uploads_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Buploads_limit%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Buploads_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>uploads_limit</dt>\n-<dd>the set limit of upload slots (unchoked peers) for this torrent.</dd>\n-</dl>\n-<a name=\"connections_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bconnections_limit%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bconnections_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>connections_limit</dt>\n-<dd>the set limit of number of connections for this torrent.</dd>\n-</dl>\n-<a name=\"up_bandwidth_queue\"></a>\n-<a name=\"down_bandwidth_queue\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bup_bandwidth_queue+down_bandwidth_queue%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bup_bandwidth_queue+down_bandwidth_queue%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>up_bandwidth_queue down_bandwidth_queue</dt>\n-<dd>the number of peers in this torrent that are waiting for more\n-bandwidth quota from the torrent rate limiter. This can determine if\n-the rate you get from this torrent is bound by the torrents limit or\n-not. If there is no limit set on this torrent, the peers might still\n-be waiting for bandwidth quota from the global limiter, but then they\n-are counted in the <tt class=\"docutils literal\">session_status</tt> object.</dd>\n-</dl>\n-<a name=\"seed_rank\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bseed_rank%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bseed_rank%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>seed_rank</dt>\n-<dd>A rank of how important it is to seed the torrent, it is used to\n-determine which torrents to seed and which to queue. It is based on\n-the peer to seed ratio from the tracker scrape. For more information,\n-see <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>. Higher value means more important to seed</dd>\n-</dl>\n-<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>state</dt>\n-<dd>the main state the torrent is in. See <a class=\"reference external\" href=\"reference-Torrent_Status.html#state_t\">torrent_status::state_t</a>.</dd>\n-</dl>\n-<a name=\"need_save_resume\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bneed_save_resume%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bneed_save_resume%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>need_save_resume</dt>\n-<dd>true if this torrent has unsaved changes\n-to its download state and statistics since the last resume data\n-was saved.</dd>\n-</dl>\n-<a name=\"is_seeding\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bis_seeding%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bis_seeding%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>is_seeding</dt>\n-<dd>true if all pieces have been downloaded.</dd>\n-</dl>\n-<a name=\"is_finished\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bis_finished%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bis_finished%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>is_finished</dt>\n-<dd>true if all pieces that have a priority > 0 are downloaded. There is\n-only a distinction between finished and seeding if some pieces or\n-files have been set to priority 0, i.e. are not downloaded.</dd>\n-</dl>\n-<a name=\"has_metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhas_metadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhas_metadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>has_metadata</dt>\n-<dd>true if this torrent has metadata (either it was started from a\n-.torrent file or the metadata has been downloaded). The only scenario\n-where this can be false is when the torrent was started torrent-less\n-(i.e. with just an info-hash and tracker ip, a magnet link for\n-instance).</dd>\n-</dl>\n-<a name=\"has_incoming\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhas_incoming%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhas_incoming%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>has_incoming</dt>\n-<dd>true if there has ever been an incoming connection attempt to this\n-torrent.</dd>\n-</dl>\n-<a name=\"moving_storage\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bmoving_storage%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bmoving_storage%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>moving_storage</dt>\n-<dd>this is true if this torrent's storage is currently being moved from\n-one location to another. This may potentially be a long operation\n-if a large file ends up being copied from one drive to another.</dd>\n-</dl>\n-<a name=\"announcing_to_trackers\"></a>\n-<a name=\"announcing_to_lsd\"></a>\n-<a name=\"announcing_to_dht\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bannouncing_to_trackers+announcing_to_lsd+announcing_to_dht%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bannouncing_to_trackers+announcing_to_lsd+announcing_to_dht%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>announcing_to_trackers announcing_to_lsd announcing_to_dht</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>info_hashes</dt>\n-<dd>the info-hash for this torrent</dd>\n-</dl>\n-<a name=\"last_upload\"></a>\n-<a name=\"last_download\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blast_upload+last_download%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blast_upload+last_download%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_upload last_download</dt>\n-<dd>the timestamps of the last time this torrent uploaded or downloaded\n-payload to any peer.</dd>\n-</dl>\n-<a name=\"active_duration\"></a>\n-<a name=\"finished_duration\"></a>\n-<a name=\"seeding_duration\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bactive_duration+finished_duration+seeding_duration%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bactive_duration+finished_duration+seeding_duration%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>active_duration finished_duration seeding_duration</dt>\n-<dd>these are cumulative <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> of for how long the torrent has been in\n-different states. active means not paused and added to <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Whether\n-it has found any peers or not is not relevant.\n-finished means all selected files/pieces were downloaded and available\n-to other peers (this is always a subset of active time).\n-seeding means all files/pieces were downloaded and available to\n-peers. Being available to peers does not imply there are other peers\n-asking for the payload.</dd>\n-</dl>\n-<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flags</dt>\n-<dd>reflects several of the torrent's flags. For more\n-information, see <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flags()</span></tt>.</dd>\n-</dl>\n-<a name=\"peer_class_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_class_info&labels=documentation&body=Documentation+under+heading+%22class+peer_class_info%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"peer-class-info\">\n-<h1>peer_class_info</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class.hpp\">libtorrent/peer_class.hpp</a>"</p>\n-<p>holds settings for a peer class. Used in <a class=\"reference external\" href=\"reference-Session.html#set_peer_class()\">set_peer_class()</a> and\n-<a class=\"reference external\" href=\"reference-Session.html#get_peer_class()\">get_peer_class()</a> calls.</p>\n-<pre class=\"literal-block\">\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-</pre>\n-<a name=\"ignore_unchoke_slots\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bignore_unchoke_slots%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bignore_unchoke_slots%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>ignore_unchoke_slots</dt>\n-<dd><tt class=\"docutils literal\">ignore_unchoke_slots</tt> 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 <em>any</em> of the peer classes a peer belongs to has this set to true,\n-that peer will be unchoked at all times.</dd>\n-</dl>\n-<a name=\"connection_limit_factor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bconnection_limit_factor%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bconnection_limit_factor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>connection_limit_factor</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"label\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Blabel%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Blabel%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>label</dt>\n-<dd>not used by libtorrent. It's intended as a potentially user-facing\n-identifier of this peer class.</dd>\n-</dl>\n-<a name=\"upload_limit\"></a>\n-<a name=\"download_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bupload_limit+download_limit%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bupload_limit+download_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>upload_limit download_limit</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"upload_priority\"></a>\n-<a name=\"download_priority\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bupload_priority+download_priority%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bupload_priority+download_priority%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>upload_priority download_priority</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"peer_class_type_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_class_type_filter&labels=documentation&body=Documentation+under+heading+%22class+peer_class_type_filter%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"peer-class-type-filter\">\n-<h1>peer_class_type_filter</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class_type_filter.hpp\">libtorrent/peer_class_type_filter.hpp</a>"</p>\n-<p><tt class=\"docutils literal\">peer_class_type_filter</tt> is a simple container for rules for adding and subtracting\n-peer-classes from peers. It is applied <em>after</em> the peer class filter is applied (which\n-is based on the peer's IP address).</p>\n-<pre class=\"literal-block\">\n-struct peer_class_type_filter\n-{\n- void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n- void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n- void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n- void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n- std::uint32_t <strong>apply</strong> (socket_type_t const st, std::uint32_t peer_class_mask);\n- friend bool <strong>operator==</strong> (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-</pre>\n-<a name=\"remove()\"></a>\n-<a name=\"add()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"remove-add\">\n-<h2>remove() add()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n-void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n-</pre>\n-<p><tt class=\"docutils literal\">add()</tt> and <tt class=\"docutils literal\">remove()</tt> adds and removes a peer class to be added\n-to new peers based on socket type.</p>\n-<a name=\"disallow()\"></a>\n-<a name=\"allow()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bdisallow%28%29+allow%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bdisallow%28%29+allow%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disallow-allow\">\n-<h2>disallow() allow()</h2>\n-<pre class=\"literal-block\">\n-void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n-void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n-</pre>\n-<p><tt class=\"docutils literal\">disallow()</tt> and <tt class=\"docutils literal\">allow()</tt> adds and removes a peer class to be\n-removed from new peers based on socket type.</p>\n-<p>The <tt class=\"docutils literal\">peer_class</tt> argument cannot be greater than 31. The bitmasks representing\n-peer classes in the <tt class=\"docutils literal\">peer_class_type_filter</tt> are 32 bits.</p>\n-<a name=\"apply()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bapply%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bapply%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"apply\">\n-<h2>apply()</h2>\n-<pre class=\"literal-block\">\n-std::uint32_t <strong>apply</strong> (socket_type_t const st, std::uint32_t peer_class_mask);\n-</pre>\n-<p>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-(<tt class=\"docutils literal\">st</tt>).</p>\n-<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-socket-type-t-1\">\n-<h2>enum socket_type_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class_type_filter.hpp\">libtorrent/peer_class_type_filter.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"24%\" />\n-<col width=\"9%\" />\n-<col width=\"67%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>tcp_socket</td>\n-<td>0</td>\n-<td>these match the socket types from socket_type.hpp\n-shifted one down</td>\n-</tr>\n-<tr><td>utp_socket</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>ssl_tcp_socket</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>ssl_utp_socket</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>i2p_socket</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>num_socket_types</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the session::apply_settings()\n-member function. To change one or more configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>\n-object and fill it with the settings to be set and pass it in to session::apply_settings().</p>\n-<p>The <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> object is a collection of settings updates that are applied\n-to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when passed to session::apply_settings(). It's empty when\n-constructed.</p>\n-<p>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.</p>\n-<p>Each configuration option is named with an enum value inside the\n-<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> class. These are the available settings:</p>\n-<a name=\"disk_observer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_observer&labels=documentation&body=Documentation+under+heading+%22class+disk_observer%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"disk-observer\">\n-<h1>disk_observer</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_observer.hpp\">libtorrent/disk_observer.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-struct disk_observer\n-{\n- virtual void <strong>on_disk</strong> () = 0;\n-};\n-</pre>\n-<a name=\"on_disk()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_observer%3A%3A%5Bon_disk%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_observer%3A%3A%5Bon_disk%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"on-disk\">\n-<h2>on_disk()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>on_disk</strong> () = 0;\n-</pre>\n-<p>called when the disk cache size has dropped\n-below the low watermark again and we can\n-resume downloading from peers</p>\n-<a name=\"open_file_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+open_file_state&labels=documentation&body=Documentation+under+heading+%22class+open_file_state%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"open-file-state\">\n-<h1>open_file_state</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n-<p>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.</p>\n-<pre class=\"literal-block\">\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-</pre>\n-<a name=\"file_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Bfile_index%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Bfile_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>file_index</dt>\n-<dd>the index of the file this <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> refers to into the <tt class=\"docutils literal\">file_storage</tt>\n-file list of this torrent. This starts indexing at 0.</dd>\n-</dl>\n-<a name=\"open_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Bopen_mode%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Bopen_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>open_mode</dt>\n-<dd><p class=\"first\"><tt class=\"docutils literal\">open_mode</tt> is a bitmask of the file flags this file is currently\n-opened with. For possible flags, see <a class=\"reference external\" href=\"reference-Custom_Storage.html#file_open_mode_t\">file_open_mode_t</a>.</p>\n-<p class=\"last\">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 <tt class=\"docutils literal\">rw_mask</tt> constant.</p>\n-</dd>\n-</dl>\n-<a name=\"last_use\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:open_file_state%3A%3A%5Blast_use%5D&labels=documentation&body=Documentation+under+heading+%22open_file_state%3A%3A%5Blast_use%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>last_use</dt>\n-<dd>a (high precision) timestamp of when the file was last used.</dd>\n-</dl>\n-<a name=\"disk_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_interface&labels=documentation&body=Documentation+under+heading+%22class+disk_interface%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-interface\">\n-<h1>disk_interface</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n-<p>The <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a> is the customization point for disk I/O in libtorrent.\n-implement this interface and provide a factory function to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> constructor\n-use custom disk I/O. All functions on the disk subsystem (implementing\n-<a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>) 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.</p>\n-<p>Although the functions are called <tt class=\"docutils literal\">async_*</tt>, they do not technically\n-<em>have</em> 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.</p>\n-<pre class=\"literal-block\">\n-struct disk_interface\n-{\n- virtual storage_holder <strong>new_torrent</strong> (storage_params const& p\n- , std::shared_ptr<void> const& torrent) = 0;\n- virtual void <strong>remove_torrent</strong> (storage_index_t) = 0;\n- virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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 <strong>async_hash</strong> (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 <strong>async_hash2</strong> (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 <strong>async_move_storage</strong> (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 <strong>async_release_files</strong> (storage_index_t storage\n- , std::function<void()> handler = std::function<void()>()) = 0;\n- virtual void <strong>async_check_files</strong> (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 <strong>async_stop_torrent</strong> (storage_index_t storage\n- , std::function<void()> handler = std::function<void()>()) = 0;\n- virtual void <strong>async_rename_file</strong> (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 <strong>async_delete_files</strong> (storage_index_t storage, remove_flags_t options\n- , std::function<void(storage_error const&)> handler) = 0;\n- virtual void <strong>async_set_file_priority</strong> (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 <strong>async_clear_piece</strong> (storage_index_t storage, piece_index_t index\n- , std::function<void(piece_index_t)> handler) = 0;\n- virtual void <strong>update_stats_counters</strong> (counters& c) const = 0;\n- virtual std::vector<open_file_state> <strong>get_status</strong> (storage_index_t) const = 0;\n- virtual void <strong>abort</strong> (bool wait) = 0;\n- virtual void <strong>submit_jobs</strong> () = 0;\n- virtual void <strong>settings_updated</strong> () = 0;\n-\n- static constexpr disk_job_flags_t <strong>force_copy</strong> = 0_bit;\n- static constexpr disk_job_flags_t <strong>sequential_access</strong> = 3_bit;\n- static constexpr disk_job_flags_t <strong>volatile_read</strong> = 4_bit;\n- static constexpr disk_job_flags_t <strong>v1_hash</strong> = 5_bit;\n- static constexpr disk_job_flags_t <strong>flush_piece</strong> = 7_bit;\n-};\n-</pre>\n-<a name=\"new_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bnew_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bnew_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-torrent-1\">\n-<h2>new_torrent()</h2>\n-<pre class=\"literal-block\">\n-virtual storage_holder <strong>new_torrent</strong> (storage_params const& p\n- , std::shared_ptr<void> const& torrent) = 0;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#storage_holder\">storage_holder</a> is an owning reference to the underlying\n-storage that was just created. It is fundamentally a storage_index_t</p>\n-<a name=\"remove_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bremove_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bremove_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"remove-torrent-1\">\n-<h2>remove_torrent()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>remove_torrent</strong> (storage_index_t) = 0;\n-</pre>\n-<p>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.</p>\n-<a name=\"async_read()\"></a>\n-<a name=\"async_write()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_read%28%29+async_write%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-read-async-write\">\n-<h2>async_read() async_write()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_read</strong> (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 <strong>async_write</strong> (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-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>, holding the buffer with\n-the result. Flags may be set to affect the read operation. See\n-disk_job_flags_t.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_observer\">disk_observer</a> 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 <tt class=\"docutils literal\">async_write()</tt> returns\n-<tt class=\"docutils literal\">true</tt>, indicating the write queue is full, the peer will stop\n-further writes and wait for the passed-in <tt class=\"docutils literal\">disk_observer</tt> to be\n-notified before resuming.</p>\n-<p>Note that for <tt class=\"docutils literal\">async_read</tt>, the <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> (<tt class=\"docutils literal\">r</tt>) is not\n-necessarily aligned to blocks (but it is most of the time). However,\n-all writes (passed to <tt class=\"docutils literal\">async_write</tt>) are guaranteed to be block\n-aligned.</p>\n-<a name=\"async_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-hash\">\n-<h2>async_hash()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_hash</strong> (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-</pre>\n-<p>Compute hash(es) for the specified piece. Unless the v1_hash flag is\n-set (in <tt class=\"docutils literal\">flags</tt>), the SHA-1 hash of the whole piece does not need\n-to be computed.</p>\n-<p>The <cite>v2</cite> 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.</p>\n-<a name=\"async_hash2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_hash2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_hash2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-hash2\">\n-<h2>async_hash2()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_hash2</strong> (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-</pre>\n-<p>computes the v2 hash (SHA-256) of a single block. The block at\n-<tt class=\"docutils literal\">offset</tt> in piece <tt class=\"docutils literal\">piece</tt>.</p>\n-<a name=\"async_move_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_move_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_move_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-move-storage\">\n-<h2>async_move_storage()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_move_storage</strong> (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-</pre>\n-<p>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 <tt class=\"docutils literal\">flags</tt> (see <a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a>).</p>\n-<a name=\"async_release_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_release_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_release_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-release-files\">\n-<h2>async_release_files()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_release_files</strong> (storage_index_t storage\n- , std::function<void()> handler = std::function<void()>()) = 0;\n-</pre>\n-<p>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.</p>\n-<a name=\"async_check_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_check_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_check_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-check-files\">\n-<h2>async_check_files()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_check_files</strong> (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-</pre>\n-<p>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:</p>\n-<p>if <tt class=\"docutils literal\">links</tt> 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 <tt class=\"docutils literal\">storage</tt>). 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.</p>\n-<p>The <tt class=\"docutils literal\">resume_data</tt> points the resume data passed in by the client.</p>\n-<p>If the <tt class=\"docutils literal\"><span class=\"pre\">resume_data->flags</span></tt> 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.</p>\n-<p>Any file with a piece set in the <tt class=\"docutils literal\"><span class=\"pre\">resume_data->have_pieces</span></tt> bitmask\n-should exist on disk, this should be verified. Pad files and files\n-with zero priority may be skipped.</p>\n-<a name=\"async_stop_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_stop_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_stop_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-stop-torrent\">\n-<h2>async_stop_torrent()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_stop_torrent</strong> (storage_index_t storage\n- , std::function<void()> handler = std::function<void()>()) = 0;\n-</pre>\n-<p>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-<a class=\"reference external\" href=\"reference-Custom_Storage.html#async_release_files()\">async_release_files()</a>.</p>\n-<a name=\"async_rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_rename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_rename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-rename-file\">\n-<h2>async_rename_file()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_rename_file</strong> (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-</pre>\n-<p>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.).</p>\n-<a name=\"async_delete_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_delete_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_delete_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-delete-files\">\n-<h2>async_delete_files()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_delete_files</strong> (storage_index_t storage, remove_flags_t options\n- , std::function<void(storage_error const&)> handler) = 0;\n-</pre>\n-<p>This function is called when some file(s) on disk have been requested\n-to be removed by the client. <tt class=\"docutils literal\">storage</tt> indicates which torrent is\n-referred to. See <a class=\"reference external\" href=\"reference-Session.html#session_handle\">session_handle</a> for <tt class=\"docutils literal\">remove_flags_t</tt> flags\n-indicating which files are to be removed.\n-e.g. <a class=\"reference external\" href=\"reference-Session.html#delete_files\">session_handle::delete_files</a> - delete all files\n-<a class=\"reference external\" href=\"reference-Session.html#delete_partfile\">session_handle::delete_partfile</a> - only delete part file.</p>\n-<a name=\"async_set_file_priority()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_set_file_priority%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_set_file_priority%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-set-file-priority\">\n-<h2>async_set_file_priority()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_set_file_priority</strong> (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-</pre>\n-<p>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.</p>\n-<p><tt class=\"docutils literal\">prio</tt> 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.</p>\n-<a name=\"async_clear_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Basync_clear_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Basync_clear_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"async-clear-piece\">\n-<h2>async_clear_piece()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>async_clear_piece</strong> (storage_index_t storage, piece_index_t index\n- , std::function<void(piece_index_t)> handler) = 0;\n-</pre>\n-<p>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.</p>\n-<a name=\"update_stats_counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bupdate_stats_counters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bupdate_stats_counters%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"update-stats-counters\">\n-<h2>update_stats_counters()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>update_stats_counters</strong> (counters& c) const = 0;\n-</pre>\n-<p><a class=\"reference external\" href=\"reference-Custom_Storage.html#update_stats_counters()\">update_stats_counters()</a> is called to give the disk storage an\n-opportunity to update gauges in the <tt class=\"docutils literal\">c</tt> stats <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, that aren't\n-updated continuously as operations are performed. This is called\n-before a snapshot of the <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are passed to the client.</p>\n-<a name=\"get_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bget_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bget_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-status\">\n-<h2>get_status()</h2>\n-<pre class=\"literal-block\">\n-virtual std::vector<open_file_state> <strong>get_status</strong> (storage_index_t) const = 0;\n-</pre>\n-<p>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.</p>\n-<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"abort-2\">\n-<h2>abort()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>abort</strong> (bool wait) = 0;\n-</pre>\n-<p>this is called when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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-<tt class=\"docutils literal\">wait</tt> 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.</p>\n-<a name=\"submit_jobs()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsubmit_jobs%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsubmit_jobs%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"submit-jobs\">\n-<h2>submit_jobs()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>submit_jobs</strong> () = 0;\n-</pre>\n-<p>This will be called after a batch of disk jobs has been issues (via\n-the <tt class=\"docutils literal\">async_*</tt> ). 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 <tt class=\"docutils literal\">async_*</tt> 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.</p>\n-<a name=\"settings_updated()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsettings_updated%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsettings_updated%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"settings-updated\">\n-<h2>settings_updated()</h2>\n-<pre class=\"literal-block\">\n-virtual void <strong>settings_updated</strong> () = 0;\n-</pre>\n-<p>This is called to notify the disk I/O object that the settings have\n-been updated. In the disk io constructor, a <a class=\"reference external\" href=\"reference-Custom_Storage.html#settings_interface\">settings_interface</a>\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.</p>\n-<a name=\"force_copy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bforce_copy%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bforce_copy%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>force_copy</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"sequential_access\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bsequential_access%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bsequential_access%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>sequential_access</dt>\n-<dd>hint that there may be more disk operations with sequential access to\n-the file</dd>\n-</dl>\n-<a name=\"volatile_read\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bvolatile_read%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bvolatile_read%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>volatile_read</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"v1_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bv1_hash%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bv1_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>v1_hash</dt>\n-<dd>compute a v1 piece hash. This is only used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#async_hash()\">async_hash()</a> call.\n-If this flag is not set in the <a class=\"reference external\" href=\"reference-Custom_Storage.html#async_hash()\">async_hash()</a> call, the SHA-1 piece\n-hash does not need to be computed.</dd>\n-</dl>\n-<a name=\"flush_piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_interface%3A%3A%5Bflush_piece%5D&labels=documentation&body=Documentation+under+heading+%22disk_interface%3A%3A%5Bflush_piece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>flush_piece</dt>\n-<dd>this flag instructs a hash job that we just completed this piece, and\n-it should be flushed to disk</dd>\n-</dl>\n-<a name=\"storage_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_holder&labels=documentation&body=Documentation+under+heading+%22class+storage_holder%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"storage-holder\">\n-<h1>storage_holder</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n-<p>a unique, owning, reference to the storage of a torrent in a disk io\n-subsystem (class that implements <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>). 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, this holder is destructed and will\n-inform the disk object.</p>\n-<pre class=\"literal-block\">\n-struct storage_holder\n-{\n- <strong>~storage_holder</strong> ();\n- <strong>storage_holder</strong> () = default;\n- <strong>storage_holder</strong> (storage_index_t idx, disk_interface& disk_io);\n- explicit operator <strong>bool</strong> () const;\n- operator <strong>storage_index_t</strong> () const;\n- void <strong>reset</strong> ();\n- storage_holder& <strong>operator=</strong> (storage_holder const&) = delete;\n- <strong>storage_holder</strong> (storage_holder const&) = delete;\n- <strong>storage_holder</strong> (storage_holder&& rhs) noexcept;\n- storage_holder& <strong>operator=</strong> (storage_holder&& rhs) noexcept;\n-};\n-</pre>\n-<a name=\"settings_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_interface&labels=documentation&body=Documentation+under+heading+%22class+settings_interface%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"settings-interface\">\n-<h1>settings_interface</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<p>the common interface to <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> and the internal representation of\n-settings.</p>\n-<pre class=\"literal-block\">\n-struct settings_interface\n-{\n- virtual void <strong>set_str</strong> (int name, std::string val) = 0;\n- virtual void <strong>set_int</strong> (int name, int val) = 0;\n- virtual void <strong>set_bool</strong> (int name, bool val) = 0;\n- virtual bool <strong>has_val</strong> (int name) const = 0;\n- virtual bool <strong>get_bool</strong> (int name) const = 0;\n- virtual std::string const& <strong>get_str</strong> (int name) const = 0;\n- virtual int <strong>get_int</strong> (int name) const = 0;\n-};\n-</pre>\n-<a name=\"buffer_allocator_interface\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+buffer_allocator_interface&labels=documentation&body=Documentation+under+heading+%22class+buffer_allocator_interface%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"buffer-allocator-interface\">\n-<h1>buffer_allocator_interface</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n-<p>the interface for freeing disk buffers, used by the <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_buffer_holder\">disk_buffer_holder</a>.\n-when implementing <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>, this must also be implemented in order\n-to return disk buffers back to libtorrent</p>\n-<pre class=\"literal-block\">\n-struct buffer_allocator_interface\n-{\n- virtual void <strong>free_disk_buffer</strong> (char* b) = 0;\n-};\n-</pre>\n-<a name=\"disk_buffer_holder\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+disk_buffer_holder&labels=documentation&body=Documentation+under+heading+%22class+disk_buffer_holder%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder\">\n-<h1>disk_buffer_holder</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_buffer_holder.hpp\">libtorrent/disk_buffer_holder.hpp</a>"</p>\n-<p>The disk buffer holder acts like a <tt class=\"docutils literal\">unique_ptr</tt> that frees a disk buffer\n-when it's destructed</p>\n-<p>If this buffer holder is moved-from, default constructed or reset,\n-<tt class=\"docutils literal\">data()</tt> will return nullptr.</p>\n-<pre class=\"literal-block\">\n-struct disk_buffer_holder\n-{\n- disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder&&) & noexcept;\n- <strong>disk_buffer_holder</strong> (disk_buffer_holder&&) noexcept;\n- disk_buffer_holder& <strong>operator=</strong> (disk_buffer_holder const&) = delete;\n- <strong>disk_buffer_holder</strong> (disk_buffer_holder const&) = delete;\n- <strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n- , char* buf, int sz) noexcept;\n- <strong>disk_buffer_holder</strong> () noexcept = default;\n- <strong>~disk_buffer_holder</strong> ();\n- char* <strong>data</strong> () const noexcept;\n- void <strong>reset</strong> ();\n- void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n- bool <strong>is_mutable</strong> () const noexcept;\n- explicit operator <strong>bool</strong> () const noexcept;\n- std::ptrdiff_t <strong>size</strong> () const;\n-};\n-</pre>\n-<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"disk-buffer-holder-1\">\n-<h2>disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>disk_buffer_holder</strong> (buffer_allocator_interface& alloc\n- , char* buf, int sz) noexcept;\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>)</p>\n-<a name=\"disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdisk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder-2\">\n-<h2>disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>disk_buffer_holder</strong> () noexcept = default;\n-</pre>\n-<p>default construct a holder that does not own any buffer</p>\n-<a name=\"~disk_buffer_holder()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5B~disk_buffer_holder%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"disk-buffer-holder-3\">\n-<h2>~disk_buffer_holder()</h2>\n-<pre class=\"literal-block\">\n-<strong>~disk_buffer_holder</strong> ();\n-</pre>\n-<p>frees disk buffer held by this object</p>\n-<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"data-1\">\n-<h2>data()</h2>\n-<pre class=\"literal-block\">\n-char* <strong>data</strong> () const noexcept;\n-</pre>\n-<p>return a pointer to the held buffer, if any. Otherwise returns nullptr.</p>\n-<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reset-2\">\n-<h2>reset()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reset</strong> ();\n-</pre>\n-<p>free the held disk buffer, if any, and clear the holder. This sets the\n-holder object to a default-constructed state</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap-2\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (disk_buffer_holder& h) noexcept;\n-</pre>\n-<p>swap pointers of two disk buffer holders.</p>\n-<a name=\"is_mutable()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bis_mutable%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"is-mutable\">\n-<h2>is_mutable()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>is_mutable</strong> () const noexcept;\n-</pre>\n-<p>if this returns true, the buffer may not be modified in place</p>\n-<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disk_buffer_holder%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22disk_buffer_holder%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bool\">\n-<h2>bool()</h2>\n-<pre class=\"literal-block\">\n-explicit operator <strong>bool</strong> () const noexcept;\n-</pre>\n-<p>implicitly convertible to true if the object is currently holding a\n-buffer</p>\n-<a name=\"file_open_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_open_mode_t&labels=documentation&body=Documentation+under+heading+%22file_open_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"file-open-mode-t\">\n-<h1>file_open_mode_t</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disk_interface.hpp\">libtorrent/disk_interface.hpp</a>"</p>\n-<a name=\"file_open_mode_t::read_only\"></a><dl class=\"docutils\">\n-<dt>read_only</dt>\n-<dd>open the file for reading only</dd>\n-</dl>\n-<a name=\"file_open_mode_t::write_only\"></a><dl class=\"docutils\">\n-<dt>write_only</dt>\n-<dd>open the file for writing only</dd>\n-</dl>\n-<a name=\"file_open_mode_t::read_write\"></a><dl class=\"docutils\">\n-<dt>read_write</dt>\n-<dd>open the file for reading and writing</dd>\n-</dl>\n-<a name=\"file_open_mode_t::rw_mask\"></a><dl class=\"docutils\">\n-<dt>rw_mask</dt>\n-<dd>the mask for the bits determining read or write mode</dd>\n-</dl>\n-<a name=\"file_open_mode_t::sparse\"></a><dl class=\"docutils\">\n-<dt>sparse</dt>\n-<dd>open the file in sparse mode (if supported by the\n-filesystem).</dd>\n-</dl>\n-<a name=\"file_open_mode_t::no_atime\"></a><dl class=\"docutils\">\n-<dt>no_atime</dt>\n-<dd>don't update the access timestamps on the file (if\n-supported by the operating system and filesystem).\n-this generally improves disk performance.</dd>\n-</dl>\n-<a name=\"file_open_mode_t::random_access\"></a><dl class=\"docutils\">\n-<dt>random_access</dt>\n-<dd>When this is not set, the kernel is hinted that access to this file will\n-be made sequentially.</dd>\n-</dl>\n-<a name=\"file_open_mode_t::mmapped\"></a><dl class=\"docutils\">\n-<dt>mmapped</dt>\n-<dd>the file is memory mapped</dd>\n-</dl>\n-<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the session::apply_settings()\n-member function. To change one or more configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>\n-object and fill it with the settings to be set and pass it in to session::apply_settings().</p>\n-<p>The <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> object is a collection of settings updates that are applied\n-to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when passed to session::apply_settings(). It's empty when\n-constructed.</p>\n-<p>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.</p>\n-<p>Each configuration option is named with an enum value inside the\n-<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> class. These are the available settings:</p>\n-<a name=\"settings_pack\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+settings_pack&labels=documentation&body=Documentation+under+heading+%22class+settings_pack%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"settings-pack\">\n-<h1>settings_pack</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">settings_pack</tt> struct, contains the names of all settings as\n-enum values. These values are passed in to the <tt class=\"docutils literal\">set_str()</tt>,\n-<tt class=\"docutils literal\">set_int()</tt>, <tt class=\"docutils literal\">set_bool()</tt> functions, to specify the setting to\n-change.</p>\n-<p>The <tt class=\"docutils literal\">settings_pack</tt> 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.</p>\n-<a name=\"user_agent\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"36%\" />\n-<col width=\"24%\" />\n-<col width=\"39%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>user_agent</td>\n-<td>string</td>\n-<td>libtorrent/</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"announce_ip\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"43%\" />\n-<col width=\"27%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>announce_ip</td>\n-<td>string</td>\n-<td>nullptr</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">announce_ip</tt> is the ip address passed along to trackers as the\n-<tt class=\"docutils literal\">&ip=</tt> parameter. If left as the default, that parameter is\n-omitted.</p>\n-<div class=\"admonition note\">\n-<p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">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.</p>\n+<p><tt class=\"docutils literal\">announce_ip</tt> is the ip address passed along to trackers as the\n+<tt class=\"docutils literal\">&ip=</tt> parameter. If left as the default, that parameter is\n+omitted.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">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.</p>\n </div>\n <a name=\"handshake_client_version\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"60%\" />\n <col width=\"19%\" />\n <col width=\"21%\" />\n </colgroup>\n@@ -13385,4395 +3619,15836 @@\n parameters to private trackers.</li>\n <li>If announce_ip is configured, it will not be sent to trackers</li>\n <li>The client version will not be sent to peers in the extension\n handshake.</li>\n </ul>\n <a name=\"report_web_seed_downloads\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"64%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n+<col width=\"64%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>report_web_seed_downloads</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"seeding_outgoing_connections\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>seeding_outgoing_connections</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">seeding_outgoing_connections</tt> 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.</p>\n+<a name=\"no_connect_privileged_ports\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"66%\" />\n+<col width=\"14%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_connect_privileged_ports</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"smooth_connects\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>smooth_connects</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">smooth_connects</tt> means the number of\n+connection attempts per second may be limited to below the\n+<tt class=\"docutils literal\">connection_speed</tt>, 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.</p>\n+<a name=\"always_send_user_agent\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>always_send_user_agent</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>always send user-agent in every web seed request. If false, only\n+the first request per http connection will include the user agent</p>\n+<a name=\"apply_ip_filter_to_trackers\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"66%\" />\n+<col width=\"14%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>apply_ip_filter_to_trackers</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">apply_ip_filter_to_trackers</tt> 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.</p>\n+<a name=\"ban_web_seeds\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>ban_web_seeds</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>when true, web seeds sending bad data will be banned</p>\n+<a name=\"support_share_mode\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>support_share_mode</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if false, prevents libtorrent to advertise share-mode support</p>\n+<a name=\"report_redundant_bytes\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>report_redundant_bytes</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if this is true, the number of redundant bytes is sent to the\n+tracker</p>\n+<a name=\"listen_system_port_fallback\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"66%\" />\n+<col width=\"14%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>listen_system_port_fallback</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"announce_crypto_support\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>announce_crypto_support</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>when this is true, and incoming encrypted connections are enabled,\n+&supportcrypt=1 is included in http tracker announces</p>\n+<a name=\"enable_upnp\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"21%\" />\n+<col width=\"32%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_upnp</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<p>The upnp object returned by <tt class=\"docutils literal\">start_upnp()</tt> can be used to add and\n+remove arbitrary port mappings. Mapping status is returned through\n+the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_alert\">portmap_alert</a> and the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_error_alert\">portmap_error_alert</a>. The object will be\n+valid until <tt class=\"docutils literal\">stop_upnp()</tt> is called. See <a class=\"reference external\" href=\"manual-ref.html#upnp-and-nat-pmp\">upnp and nat pmp</a>.</p>\n+<a name=\"enable_natpmp\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_natpmp</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<p>The natpmp object returned by <tt class=\"docutils literal\">start_natpmp()</tt> can be used to add\n+and remove arbitrary port mappings. Mapping status is returned\n+through the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_alert\">portmap_alert</a> and the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_error_alert\">portmap_error_alert</a>. The object\n+will be valid until <tt class=\"docutils literal\">stop_natpmp()</tt> is called. See\n+<a class=\"reference external\" href=\"manual-ref.html#upnp-and-nat-pmp\">upnp and nat pmp</a>.</p>\n+<a name=\"enable_lsd\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_lsd</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"enable_dht\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_dht</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>starts the dht node and makes the trackerless service available to\n+torrents.</p>\n+<a name=\"prefer_rc4\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>prefer_rc4</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if the allowed encryption level is both, setting this to true will\n+prefer RC4 if both methods are offered, plain text otherwise</p>\n+<a name=\"proxy_hostnames\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>proxy_hostnames</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if true, hostname lookups are done via the configured proxy (if\n+any). This is only supported by SOCKS5 and HTTP.</p>\n+<a name=\"proxy_peer_connections\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>proxy_peer_connections</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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).</p>\n+<a name=\"auto_sequential\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>auto_sequential</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"proxy_tracker_connections\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"64%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>proxy_tracker_connections</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if true, tracker connections are made over the configured proxy, if\n+any.</p>\n+<a name=\"enable_ip_notifier\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_ip_notifier</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>Starts and stops the internal IP table route changes notifier.</p>\n+<p>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+<tt class=\"docutils literal\"><span class=\"pre\">session_handle::reopen_network_sockets</span></tt> to ensure network\n+changes are taken in consideration.</p>\n+<a name=\"dht_prefer_verified_node_ids\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_prefer_verified_node_ids</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>when this is true, nodes whose IDs are derived from their source\n+IP according to <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0042.html\">BEP 42</a> are preferred in the routing table.</p>\n+<a name=\"dht_restrict_routing_ips\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_restrict_routing_ips</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in the whole routing table</p>\n+<a name=\"dht_restrict_search_ips\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_restrict_search_ips</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"dht_extended_routing_table\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"65%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_extended_routing_table</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"dht_aggressive_lookups\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_aggressive_lookups</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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 <em>branch factor</em> 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.</p>\n+<a name=\"dht_privacy_lookups\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_privacy_lookups</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>when set, perform lookups in a way that is slightly more expensive,\n+but which minimizes the amount of information leaked about you.</p>\n+<a name=\"dht_enforce_node_id\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_enforce_node_id</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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".</p>\n+<a name=\"dht_ignore_dark_internet\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_ignore_dark_internet</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>ignore DHT messages from parts of the internet we wouldn't expect to\n+see any traffic from</p>\n+<a name=\"dht_read_only\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_read_only</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"piece_extent_affinity\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>piece_extent_affinity</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"validate_https_trackers\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>validate_https_trackers</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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).</p>\n+<a name=\"ssrf_mitigation\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>ssrf_mitigation</td>\n+<td>bool</td>\n+<td>true</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>when enabled, tracker and web seed requests are subject to\n+certain restrictions.</p>\n+<p>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.</p>\n+<p>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.</p>\n+<p>Web seeds on global IPs (i.e. not local network) may not redirect\n+to a local network address</p>\n+<a name=\"allow_idna\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>allow_idna</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"enable_set_file_valid_data\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"65%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>enable_set_file_valid_data</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"socks5_udp_send_local_ep\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>socks5_udp_send_local_ep</td>\n+<td>bool</td>\n+<td>false</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"tracker_completion_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"65%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tracker_completion_timeout</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">tracker_completion_timeout</tt> 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.</p>\n+<a name=\"tracker_receive_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tracker_receive_timeout</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">tracker_receive_timeout</tt> 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.</p>\n+<a name=\"stop_tracker_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>stop_tracker_timeout</td>\n+<td>int</td>\n+<td>5</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">stop_tracker_timeout</tt> 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.</p>\n+<a name=\"tracker_maximum_response_length\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"66%\" />\n+<col width=\"12%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tracker_maximum_response_length</td>\n+<td>int</td>\n+<td>1024*1024</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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).</p>\n+<a name=\"piece_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>piece_timeout</td>\n+<td>int</td>\n+<td>20</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>the number of seconds from a request is sent until it times out if\n+no piece response is returned.</p>\n+<a name=\"request_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>request_timeout</td>\n+<td>int</td>\n+<td>60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"request_queue_time\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>request_queue_time</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"max_allowed_in_request_queue\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_allowed_in_request_queue</td>\n+<td>int</td>\n+<td>2000</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"max_out_request_queue\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_out_request_queue</td>\n+<td>int</td>\n+<td>500</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_out_request_queue</tt> is the maximum number of outstanding\n+requests to send to a peer. This limit takes precedence over\n+<tt class=\"docutils literal\">request_queue_time</tt>. i.e. no matter the download speed, the\n+number of outstanding requests will never exceed this limit.</p>\n+<a name=\"whole_pieces_threshold\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>whole_pieces_threshold</td>\n+<td>int</td>\n+<td>20</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"peer_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"48%\" />\n+<col width=\"21%\" />\n+<col width=\"31%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>peer_timeout</td>\n+<td>int</td>\n+<td>120</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">peer_timeout</tt> 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.</p>\n+<a name=\"urlseed_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>urlseed_timeout</td>\n+<td>int</td>\n+<td>20</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"urlseed_pipeline_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>urlseed_pipeline_size</td>\n+<td>int</td>\n+<td>5</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"urlseed_wait_retry\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>urlseed_wait_retry</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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 <tt class=\"docutils literal\"><span class=\"pre\">retry-after</span></tt> header.</p>\n+<a name=\"file_pool_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"52%\" />\n+<col width=\"19%\" />\n+<col width=\"29%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>file_pool_size</td>\n+<td>int</td>\n+<td>40</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>sets the upper limit on the total number of files this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n+<a name=\"max_failcount\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_failcount</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_failcount</tt> 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.</p>\n+<a name=\"min_reconnect_time\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>min_reconnect_time</td>\n+<td>int</td>\n+<td>60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>the number of seconds to wait to reconnect to a peer. this time is\n+multiplied with the failcount.</p>\n+<a name=\"peer_connect_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>peer_connect_timeout</td>\n+<td>int</td>\n+<td>15</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">peer_connect_timeout</tt> 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.</p>\n+<a name=\"connection_speed\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"55%\" />\n+<col width=\"18%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>connection_speed</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">connection_speed</tt> 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.</p>\n+<a name=\"inactivity_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>inactivity_timeout</td>\n+<td>int</td>\n+<td>600</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>if a peer is uninteresting and uninterested for longer than this\n+number of seconds, it will be disconnected.</p>\n+<a name=\"unchoke_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"55%\" />\n+<col width=\"18%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>unchoke_interval</td>\n+<td>int</td>\n+<td>15</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">unchoke_interval</tt> 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.</p>\n+<a name=\"optimistic_unchoke_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"66%\" />\n+<col width=\"14%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>optimistic_unchoke_interval</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">optimistic_unchoke_interval</tt> is the number of seconds between\n+each <em>optimistic</em> unchoke. On this timer, the currently\n+optimistically unchoked peer will change.</p>\n+<a name=\"num_want\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"40%\" />\n+<col width=\"24%\" />\n+<col width=\"36%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>num_want</td>\n+<td>int</td>\n+<td>200</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">num_want</tt> is the number of peers we want from each tracker\n+request. It defines what is sent as the <tt class=\"docutils literal\">&num_want=</tt> parameter to\n+the tracker.</p>\n+<a name=\"initial_picker_threshold\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>initial_picker_threshold</td>\n+<td>int</td>\n+<td>4</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">initial_picker_threshold</tt> specifies the number of pieces we need\n+before we switch to rarest first picking. The first\n+<tt class=\"docutils literal\">initial_picker_threshold</tt> pieces in any torrent are picked at random\n+, the following pieces are picked in rarest first order.</p>\n+<a name=\"allowed_fast_set_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>allowed_fast_set_size</td>\n+<td>int</td>\n+<td>5</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>the number of allowed pieces to send to peers that supports the\n+fast extensions</p>\n+<a name=\"suggest_mode\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"25%\" />\n+<col width=\"11%\" />\n+<col width=\"65%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>suggest_mode</td>\n+<td>int</td>\n+<td>settings_pack::no_piece_suggestions</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">suggest_mode</tt> 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:</p>\n+<ul class=\"simple\">\n+<li><tt class=\"docutils literal\">no_piece_suggestions</tt> which will not send out suggest messages.</li>\n+<li><tt class=\"docutils literal\">suggest_read_cache</tt> which will send out suggest messages for\n+the most recent pieces that are in the read cache.</li>\n+</ul>\n+<a name=\"max_queued_disk_bytes\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"55%\" />\n+<col width=\"14%\" />\n+<col width=\"31%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_queued_disk_bytes</td>\n+<td>int</td>\n+<td>1024 * 1024</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_queued_disk_bytes</tt> 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.</p>\n+<a name=\"handshake_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>handshake_timeout</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"send_buffer_low_watermark\"></a>\n+<a name=\"send_buffer_watermark\"></a>\n+<a name=\"send_buffer_watermark_factor\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"13%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>send_buffer_low_watermark</td>\n+<td>int</td>\n+<td>10 * 1024</td>\n+</tr>\n+<tr><td>send_buffer_watermark</td>\n+<td>int</td>\n+<td>500 * 1024</td>\n+</tr>\n+<tr><td>send_buffer_watermark_factor</td>\n+<td>int</td>\n+<td>50</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">send_buffer_low_watermark</tt> 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</p>\n+<p>if the send buffer has fewer bytes than <tt class=\"docutils literal\">send_buffer_watermark</tt>,\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.</p>\n+<p>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+<tt class=\"docutils literal\">send_buffer_watermark</tt> 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.</p>\n+<a name=\"choking_algorithm\"></a>\n+<a name=\"seed_choking_algorithm\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"37%\" />\n+<col width=\"9%\" />\n+<col width=\"54%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>choking_algorithm</td>\n+<td>int</td>\n+<td>settings_pack::fixed_slots_choker</td>\n+</tr>\n+<tr><td>seed_choking_algorithm</td>\n+<td>int</td>\n+<td>settings_pack::round_robin</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">choking_algorithm</tt> 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.</p>\n+<p>The options for choking algorithms are defined in the\n+<a class=\"reference external\" href=\"reference-Settings.html#choking_algorithm_t\">choking_algorithm_t</a> enum.</p>\n+<p><tt class=\"docutils literal\">seed_choking_algorithm</tt> 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 <a class=\"reference external\" href=\"reference-Settings.html#seed_choking_algorithm_t\">seed_choking_algorithm_t</a> enum.</p>\n+<a name=\"disk_io_write_mode\"></a>\n+<a name=\"disk_io_read_mode\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"34%\" />\n+<col width=\"10%\" />\n+<col width=\"55%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>disk_io_write_mode</td>\n+<td>int</td>\n+<td>DISK_WRITE_MODE</td>\n+</tr>\n+<tr><td>disk_io_read_mode</td>\n+<td>int</td>\n+<td>settings_pack::enable_os_cache</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>determines how files are opened when they're in read only mode\n+versus read and write mode. The options are:</p>\n+<dl class=\"docutils\">\n+<dt>enable_os_cache</dt>\n+<dd>Files are opened normally, with the OS caching reads and writes.</dd>\n+<dt>disable_os_cache</dt>\n+<dd>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.</dd>\n+<dt>write_through</dt>\n+<dd>flush pieces to disk as they complete validation.</dd>\n+</dl>\n+<p>One reason to disable caching is that it may help the operating\n+system from growing its file cache indefinitely.</p>\n+<a name=\"outgoing_port\"></a>\n+<a name=\"num_outgoing_ports\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>outgoing_port</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+<tr><td>num_outgoing_ports</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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, <tt class=\"docutils literal\">num_outgoing_ports</tt> is the size of the range. It should\n+be more than a few</p>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">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.</p>\n+</div>\n+<p>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 <tt class=\"docutils literal\">TIME_WAIT</tt> state.</p>\n+<a name=\"peer_dscp\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"42%\" />\n+<col width=\"23%\" />\n+<col width=\"35%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>peer_dscp</td>\n+<td>int</td>\n+<td>0x04</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">peer_dscp</tt> determines the DSCP field in the IP header of every\n+packet sent to peers (including web seeds). <tt class=\"docutils literal\">0x0</tt> means no marking,\n+<tt class=\"docutils literal\">0x04</tt> represents Lower Effort. For more details see <a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc8622.html\">RFC 8622</a>.</p>\n+<p><tt class=\"docutils literal\">peer_tos</tt> is the backwards compatible name for this setting.</p>\n+<a name=\"active_downloads\"></a>\n+<a name=\"active_seeds\"></a>\n+<a name=\"active_checking\"></a>\n+<a name=\"active_dht_limit\"></a>\n+<a name=\"active_tracker_limit\"></a>\n+<a name=\"active_lsd_limit\"></a>\n+<a name=\"active_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>active_downloads</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+<tr><td>active_seeds</td>\n+<td>int</td>\n+<td>5</td>\n+</tr>\n+<tr><td>active_checking</td>\n+<td>int</td>\n+<td>1</td>\n+</tr>\n+<tr><td>active_dht_limit</td>\n+<td>int</td>\n+<td>88</td>\n+</tr>\n+<tr><td>active_tracker_limit</td>\n+<td>int</td>\n+<td>1600</td>\n+</tr>\n+<tr><td>active_lsd_limit</td>\n+<td>int</td>\n+<td>60</td>\n+</tr>\n+<tr><td>active_limit</td>\n+<td>int</td>\n+<td>500</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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. <tt class=\"docutils literal\">active_downloads</tt> and\n+<tt class=\"docutils literal\">active_seeds</tt> controls how many active seeding and downloading\n+torrents the queuing mechanism allows. The target number of active\n+torrents is <tt class=\"docutils literal\">min(active_downloads + active_seeds, active_limit)</tt>.\n+<tt class=\"docutils literal\">active_downloads</tt> and <tt class=\"docutils literal\">active_seeds</tt> are upper limits on the\n+number of downloading torrents and seeding torrents respectively.\n+Setting the value to -1 means unlimited.</p>\n+<p>For example if there are 10 seeding torrents and 10 downloading\n+torrents, and <tt class=\"docutils literal\">active_downloads</tt> is 4 and <tt class=\"docutils literal\">active_seeds</tt> is 4,\n+there will be 4 seeds active and 4 downloading torrents. If the\n+settings are <tt class=\"docutils literal\">active_downloads</tt> = 2 and <tt class=\"docutils literal\">active_seeds</tt> = 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.</p>\n+<p><tt class=\"docutils literal\">active_checking</tt> is the limit of number of simultaneous checking\n+torrents.</p>\n+<p><tt class=\"docutils literal\">active_limit</tt> is a hard limit on the number of active (auto\n+managed) torrents. This limit also applies to slow torrents.</p>\n+<p><tt class=\"docutils literal\">active_dht_limit</tt> is the max number of torrents to announce to\n+the DHT.</p>\n+<p><tt class=\"docutils literal\">active_tracker_limit</tt> is the max number of torrents to announce\n+to their trackers.</p>\n+<p><tt class=\"docutils literal\">active_lsd_limit</tt> is the max number of torrents to announce to\n+the local network over the local service discovery protocol.</p>\n+<p>You can have more torrents <em>active</em>, 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.</p>\n+<a name=\"auto_manage_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>auto_manage_interval</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">auto_manage_interval</tt> is the number of seconds between the\n+torrent queue is updated, and rotated.</p>\n+<a name=\"seed_time_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"16%\" />\n+<col width=\"38%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>seed_time_limit</td>\n+<td>int</td>\n+<td>24 * 60 * 60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n+<a name=\"auto_scrape_interval\"></a>\n+<a name=\"auto_scrape_min_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>auto_scrape_interval</td>\n+<td>int</td>\n+<td>1800</td>\n+</tr>\n+<tr><td>auto_scrape_min_interval</td>\n+<td>int</td>\n+<td>300</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">auto_scrape_interval</tt> 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.</p>\n+<p><tt class=\"docutils literal\">auto_scrape_min_interval</tt> 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.</p>\n+<a name=\"max_peerlist_size\"></a>\n+<a name=\"max_paused_peerlist_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_peerlist_size</td>\n+<td>int</td>\n+<td>3000</td>\n+</tr>\n+<tr><td>max_paused_peerlist_size</td>\n+<td>int</td>\n+<td>1000</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_peerlist_size</tt> 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.</p>\n+<p><tt class=\"docutils literal\">max_paused_peerlist_size</tt> 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.</p>\n+<a name=\"min_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>min_announce_interval</td>\n+<td>int</td>\n+<td>5 * 60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"auto_manage_startup\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>auto_manage_startup</td>\n+<td>int</td>\n+<td>60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"seeding_piece_quota\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>seeding_piece_quota</td>\n+<td>int</td>\n+<td>20</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">seeding_piece_quota</tt> is the number of pieces to send to a peer,\n+when seeding, before rotating in another peer to the unchoke set.</p>\n+<a name=\"max_rejects\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"21%\" />\n+<col width=\"32%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_rejects</td>\n+<td>int</td>\n+<td>50</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_rejects</tt> 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.</p>\n+<a name=\"recv_socket_buffer_size\"></a>\n+<a name=\"send_socket_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>recv_socket_buffer_size</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+<tr><td>send_socket_buffer_size</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<p>Note that uTP peers share a single UDP socket buffer for each of the\n+<tt class=\"docutils literal\">listen_interfaces</tt>, 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.</p>\n+<a name=\"max_peer_recv_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"54%\" />\n+<col width=\"12%\" />\n+<col width=\"34%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_peer_recv_buffer_size</td>\n+<td>int</td>\n+<td>2 * 1024 * 1024</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>the max number of bytes a single peer connection's receive buffer is\n+allowed to grow to.</p>\n+<a name=\"optimistic_disk_retry\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>optimistic_disk_retry</td>\n+<td>int</td>\n+<td>10 * 60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">optimistic_disk_retry</tt> 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.</p>\n+<p>libtorrent will only do this automatically for auto managed\n+torrents.</p>\n+<p>You can explicitly take a torrent out of upload only mode using\n+set_upload_mode().</p>\n+<a name=\"max_suggest_pieces\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_suggest_pieces</td>\n+<td>int</td>\n+<td>16</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_suggest_pieces</tt> 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.</p>\n+<a name=\"local_service_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"69%\" />\n+<col width=\"13%\" />\n+<col width=\"19%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>local_service_announce_interval</td>\n+<td>int</td>\n+<td>5 * 60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">local_service_announce_interval</tt> is the time between local\n+network announces for a torrent.\n+This interval is specified in seconds.</p>\n+<a name=\"dht_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_announce_interval</td>\n+<td>int</td>\n+<td>15 * 60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">dht_announce_interval</tt> is the number of seconds between\n+announcing torrents to the distributed hash table (DHT).</p>\n+<a name=\"udp_tracker_token_expiry\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>udp_tracker_token_expiry</td>\n+<td>int</td>\n+<td>60</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">udp_tracker_token_expiry</tt> 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.</p>\n+<a name=\"num_optimistic_unchoke_slots\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>num_optimistic_unchoke_slots</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">num_optimistic_unchoke_slots</tt> 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.</p>\n+<a name=\"max_pex_peers\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_pex_peers</td>\n+<td>int</td>\n+<td>50</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"tick_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tick_interval</td>\n+<td>int</td>\n+<td>500</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">tick_interval</tt> 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.</p>\n+<a name=\"share_mode_target\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>share_mode_target</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">share_mode_target</tt> 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.</p>\n+<a name=\"upload_rate_limit\"></a>\n+<a name=\"download_rate_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>upload_rate_limit</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+<tr><td>download_rate_limit</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">upload_rate_limit</tt> and <tt class=\"docutils literal\">download_rate_limit</tt> 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.</p>\n+<p>A value of 0 means unlimited.</p>\n+<p>For fine grained control over rate limits, including making them apply\n+to local peers, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"dht_upload_rate_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>dht_upload_rate_limit</td>\n+<td>int</td>\n+<td>8000</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"unchoke_slots_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>unchoke_slots_limit</td>\n+<td>int</td>\n+<td>8</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">unchoke_slots_limit</tt> is the max number of unchoked peers in the\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The number of unchoke slots may be ignored depending on\n+what <tt class=\"docutils literal\">choking_algorithm</tt> is set to. Setting this limit to -1\n+means unlimited, i.e. all peers will always be unchoked.</p>\n+<a name=\"connections_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>connections_limit</td>\n+<td>int</td>\n+<td>200</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">connections_limit</tt> 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.</p>\n+<a name=\"connections_slack\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>connections_slack</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">connections_slack</tt> is the number of incoming connections\n+exceeding the connection limit to accept in order to potentially\n+replace existing ones.</p>\n+<a name=\"utp_target_delay\"></a>\n+<a name=\"utp_gain_factor\"></a>\n+<a name=\"utp_min_timeout\"></a>\n+<a name=\"utp_syn_resends\"></a>\n+<a name=\"utp_fin_resends\"></a>\n+<a name=\"utp_num_resends\"></a>\n+<a name=\"utp_connect_timeout\"></a>\n+<a name=\"utp_loss_multiplier\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>utp_target_delay</td>\n+<td>int</td>\n+<td>100</td>\n+</tr>\n+<tr><td>utp_gain_factor</td>\n+<td>int</td>\n+<td>3000</td>\n+</tr>\n+<tr><td>utp_min_timeout</td>\n+<td>int</td>\n+<td>500</td>\n+</tr>\n+<tr><td>utp_syn_resends</td>\n+<td>int</td>\n+<td>2</td>\n+</tr>\n+<tr><td>utp_fin_resends</td>\n+<td>int</td>\n+<td>2</td>\n+</tr>\n+<tr><td>utp_num_resends</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+<tr><td>utp_connect_timeout</td>\n+<td>int</td>\n+<td>3000</td>\n+</tr>\n+<tr><td>utp_loss_multiplier</td>\n+<td>int</td>\n+<td>50</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">utp_target_delay</tt> 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+<tt class=\"docutils literal\">utp_gain_factor</tt> 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.</p>\n+<p><tt class=\"docutils literal\">utp_min_timeout</tt> 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).</p>\n+<p>The shorter the timeout is, the faster the connection will recover\n+from this situation, assuming the RTT is low enough.\n+<tt class=\"docutils literal\">utp_syn_resends</tt> is the number of SYN packets that are sent (and\n+timed out) before giving up and closing the socket.\n+<tt class=\"docutils literal\">utp_num_resends</tt> is the number of times a packet is sent (and\n+lost or timed out) before giving up and closing the connection.\n+<tt class=\"docutils literal\">utp_connect_timeout</tt> 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. <tt class=\"docutils literal\">utp_loss_multiplier</tt>\n+controls how the congestion window is changed when a packet loss is\n+experienced. It's specified as a percentage multiplier for\n+<tt class=\"docutils literal\">cwnd</tt>. Do not change this value unless you know what you're doing.\n+Never set it higher than 100.</p>\n+<a name=\"mixed_mode_algorithm\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"35%\" />\n+<col width=\"10%\" />\n+<col width=\"55%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>mixed_mode_algorithm</td>\n+<td>int</td>\n+<td>settings_pack::peer_proportional</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>The <tt class=\"docutils literal\">mixed_mode_algorithm</tt> 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 <tt class=\"docutils literal\">prefer_tcp</tt>. The <tt class=\"docutils literal\">peer_proportional</tt>\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).</p>\n+<a name=\"listen_queue_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>listen_queue_size</td>\n+<td>int</td>\n+<td>5</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">listen_queue_size</tt> 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 <tt class=\"docutils literal\">listen_interfaces</tt> settings is updated.</p>\n+<a name=\"torrent_connect_boost\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>torrent_connect_boost</td>\n+<td>int</td>\n+<td>30</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">torrent_connect_boost</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> tick to trigger connections.\n+This may not be set higher than 255.</p>\n+<a name=\"alert_queue_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"55%\" />\n+<col width=\"18%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>alert_queue_size</td>\n+<td>int</td>\n+<td>2000</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">alert_queue_size</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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().</p>\n+<a name=\"max_metadata_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"14%\" />\n+<col width=\"42%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_metadata_size</td>\n+<td>int</td>\n+<td>3 * 1024 * 10240</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">max_metadata_size</tt> is the maximum allowed size (in bytes) to be\n+received by the metadata extension, i.e. magnet links.</p>\n+<a name=\"hashing_threads\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>hashing_threads</td>\n+<td>int</td>\n+<td>1</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">hashing_threads</tt> is the number of disk I/O threads to use for\n+piece hash verification. These threads are <em>in addition</em> to the\n+regular disk I/O threads specified by <a class=\"reference external\" href=\"reference-Settings.html#aio_threads\">settings_pack::aio_threads</a>.\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 <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> 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.</p>\n+<a name=\"checking_mem_usage\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>checking_mem_usage</td>\n+<td>int</td>\n+<td>256</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"predictive_piece_announce\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"64%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>predictive_piece_announce</td>\n+<td>int</td>\n+<td>0</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"aio_threads\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"21%\" />\n+<col width=\"32%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>aio_threads</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>for some aio back-ends, <tt class=\"docutils literal\">aio_threads</tt> specifies the number of\n+io-threads to use.</p>\n+<a name=\"tracker_backoff\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"53%\" />\n+<col width=\"19%\" />\n+<col width=\"28%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>tracker_backoff</td>\n+<td>int</td>\n+<td>250</td>\n+</tr>\n+</tbody>\n+</table>\n+<p><tt class=\"docutils literal\">tracker_backoff</tt> determines how aggressively to back off from\n+retrying failing trackers. This value determines <em>x</em> in the\n+following formula, determining the number of seconds to wait until\n+the next retry:</p>\n+<blockquote>\n+delay = 5 + 5 * x / 100 * fails^2</blockquote>\n+<p>This setting may be useful to make libtorrent more or less\n+aggressive in hitting trackers.</p>\n+<a name=\"share_ratio_limit\"></a>\n+<a name=\"seed_time_ratio_limit\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>share_ratio_limit</td>\n+<td>int</td>\n+<td>200</td>\n+</tr>\n+<tr><td>seed_time_ratio_limit</td>\n+<td>int</td>\n+<td>700</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n+<a name=\"peer_turnover\"></a>\n+<a name=\"peer_turnover_cutoff\"></a>\n+<a name=\"peer_turnover_interval\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"62%\" />\n+<col width=\"15%\" />\n+<col width=\"23%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>peer_turnover</td>\n+<td>int</td>\n+<td>4</td>\n+</tr>\n+<tr><td>peer_turnover_cutoff</td>\n+<td>int</td>\n+<td>90</td>\n+</tr>\n+<tr><td>peer_turnover_interval</td>\n+<td>int</td>\n+<td>300</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"connect_seed_every_n_download\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>connect_seed_every_n_download</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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.</p>\n+<a name=\"max_http_recv_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"60%\" />\n+<col width=\"13%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_http_recv_buffer_size</td>\n+<td>int</td>\n+<td>4*1024*204</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>the max number of bytes to allow an HTTP response to be when\n+announcing to trackers or downloading .torrent files via the\n+<tt class=\"docutils literal\">url</tt> provided in <tt class=\"docutils literal\">add_torrent_params</tt>.</p>\n+<a name=\"max_retry_port_bind\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>max_retry_port_bind</td>\n+<td>int</td>\n+<td>10</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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</p>\n+<a name=\"alert_mask\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>alert_mask</td>\n+<td>int</td>\n+<td>int</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>a bitmask combining flags from <a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a> defining which\n+kinds of alerts to receive</p>\n+<a name=\"out_enc_policy\"></a>\n+<a name=\"in_enc_policy\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"33%\" />\n+<col width=\"12%\" />\n+<col width=\"55%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>out_enc_policy</td>\n+<td>int</td>\n+<td>settings_pack::pe_enabled</td>\n+</tr>\n+<tr><td>in_enc_policy</td>\n+<td>int</td>\n+<td>settings_pack::pe_enabled</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>control the settings for incoming and outgoing connections\n+respectively. see <a class=\"reference external\" href=\"reference-Settings.html#enc_policy\">enc_policy</a> enum for the available options.\n+Keep in mind that protocol encryption degrades performance in\n+several respects:</p>\n+<ol class=\"arabic simple\">\n+<li>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.</li>\n+<li>The encryption itself requires more CPU than plain bittorrent\n+protocol. The highest cost is the Diffie Hellman exchange on\n+connection setup.</li>\n+<li>The encryption handshake adds several round-trips to the\n+connection setup, and delays transferring data.</li>\n+</ol>\n+<a name=\"allowed_enc_level\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"39%\" />\n+<col width=\"12%\" />\n+<col width=\"49%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>allowed_enc_level</td>\n+<td>int</td>\n+<td>settings_pack::pe_both</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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+<a class=\"reference external\" href=\"reference-Settings.html#enc_level\">enc_level</a> enum for options.</p>\n+<a name=\"inactive_down_rate\"></a>\n+<a name=\"inactive_up_rate\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">type</th>\n+<th class=\"head\">default</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>inactive_down_rate</td>\n+<td>int</td>\n+<td>2048</td>\n+</tr>\n+<tr><td>inactive_up_rate</td>\n+<td>int</td>\n+<td>2048</td>\n+</tr>\n+</tbody>\n+</table>\n+<p>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 <tt class=\"docutils literal\">inactive_down_rate</tt> and whose upload rate is less than\n+<tt class=\"docutils literal\">inactive_up_rate</tt> for <tt class=\"docutils literal\">auto_manage_startup</tt> seconds, is\n+considered inactive, and another queued torrent may be started.\n+This logic is disabled if <tt class=\"docutils literal\">dont_count_slow_torrents</tt> is false.</p>\n+<a name=\"proxy_type\"></a><table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"31%\" />\n+<col width=\"15%\" />\n+<col width=\"54%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>report_web_seed_downloads</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>proxy_type</td>\n+<td>int</td>\n+<td>settings_pack::none</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"seeding_outgoing_connections\"></a><table border=\"1\" class=\"docutils\">\n+<p>proxy to use. see <a class=\"reference external\" href=\"reference-Settings.html#proxy_type_t\">proxy_type_t</a>.</p>\n+<a name=\"proxy_port\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n+<col width=\"44%\" />\n+<col width=\"22%\" />\n+<col width=\"33%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>seeding_outgoing_connections</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>proxy_port</td>\n+<td>int</td>\n+<td>0</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">seeding_outgoing_connections</tt> 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.</p>\n-<a name=\"no_connect_privileged_ports\"></a><table border=\"1\" class=\"docutils\">\n+<p>the port of the proxy server</p>\n+<a name=\"i2p_port\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"66%\" />\n-<col width=\"14%\" />\n-<col width=\"20%\" />\n+<col width=\"40%\" />\n+<col width=\"24%\" />\n+<col width=\"36%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>no_connect_privileged_ports</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>i2p_port</td>\n+<td>int</td>\n+<td>0</td>\n </tr>\n </tbody>\n </table>\n-<p>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</p>\n-<a name=\"smooth_connects\"></a><table border=\"1\" class=\"docutils\">\n+<p>sets the <a class=\"reference external\" href=\"http://www.i2p2.de\">i2p</a> SAM bridge port to connect to. set the hostname with\n+the <tt class=\"docutils literal\">i2p_hostname</tt> setting.</p>\n+<a name=\"urlseed_max_request_bytes\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n+<col width=\"12%\" />\n+<col width=\"35%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>smooth_connects</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>urlseed_max_request_bytes</td>\n+<td>int</td>\n+<td>16 * 1024 * 1024</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">smooth_connects</tt> means the number of\n-connection attempts per second may be limited to below the\n-<tt class=\"docutils literal\">connection_speed</tt>, 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.</p>\n-<a name=\"always_send_user_agent\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"web_seed_name_lookup_retry\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"65%\" />\n+<col width=\"14%\" />\n+<col width=\"21%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>always_send_user_agent</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>web_seed_name_lookup_retry</td>\n+<td>int</td>\n+<td>1800</td>\n </tr>\n </tbody>\n </table>\n-<p>always send user-agent in every web seed request. If false, only\n-the first request per http connection will include the user agent</p>\n-<a name=\"apply_ip_filter_to_trackers\"></a><table border=\"1\" class=\"docutils\">\n+<p>time to wait until a new retry of a web seed name lookup</p>\n+<a name=\"close_file_interval\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"66%\" />\n-<col width=\"14%\" />\n-<col width=\"20%\" />\n+<col width=\"44%\" />\n+<col width=\"13%\" />\n+<col width=\"44%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>apply_ip_filter_to_trackers</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>close_file_interval</td>\n+<td>int</td>\n+<td>CLOSE_FILE_INTERVAL</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">apply_ip_filter_to_trackers</tt> 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.</p>\n-<a name=\"ban_web_seeds\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"utp_cwnd_reduce_timer\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>ban_web_seeds</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>utp_cwnd_reduce_timer</td>\n+<td>int</td>\n+<td>100</td>\n </tr>\n </tbody>\n </table>\n-<p>when true, web seeds sending bad data will be banned</p>\n-<a name=\"support_share_mode\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"max_web_seed_connections\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n+<col width=\"63%\" />\n+<col width=\"15%\" />\n+<col width=\"22%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>support_share_mode</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>max_web_seed_connections</td>\n+<td>int</td>\n+<td>3</td>\n </tr>\n </tbody>\n </table>\n-<p>if false, prevents libtorrent to advertise share-mode support</p>\n-<a name=\"report_redundant_bytes\"></a><table border=\"1\" class=\"docutils\">\n+<p>the max number of web seeds to have connected per torrent at any\n+given time.</p>\n+<a name=\"resolver_cache_timeout\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"62%\" />\n <col width=\"15%\" />\n <col width=\"23%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>report_redundant_bytes</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>resolver_cache_timeout</td>\n+<td>int</td>\n+<td>1200</td>\n </tr>\n </tbody>\n </table>\n-<p>if this is true, the number of redundant bytes is sent to the\n-tracker</p>\n-<a name=\"listen_system_port_fallback\"></a><table border=\"1\" class=\"docutils\">\n+<p>the number of seconds before the internal host name resolver\n+considers a cache value timed out, negative values are interpreted\n+as zero.</p>\n+<a name=\"send_not_sent_low_watermark\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"66%\" />\n <col width=\"14%\" />\n <col width=\"20%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>listen_system_port_fallback</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>send_not_sent_low_watermark</td>\n+<td>int</td>\n+<td>16384</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"announce_crypto_support\"></a><table border=\"1\" class=\"docutils\">\n+<p>specify the not-sent low watermark for socket send buffers. This\n+corresponds to the, Linux-specific, <tt class=\"docutils literal\">TCP_NOTSENT_LOWAT</tt> TCP socket\n+option.</p>\n+<a name=\"rate_choker_initial_threshold\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>announce_crypto_support</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>rate_choker_initial_threshold</td>\n+<td>int</td>\n+<td>1024</td>\n </tr>\n </tbody>\n </table>\n-<p>when this is true, and incoming encrypted connections are enabled,\n-&supportcrypt=1 is included in http tracker announces</p>\n-<a name=\"enable_upnp\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"upnp_lease_duration\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"46%\" />\n-<col width=\"21%\" />\n-<col width=\"32%\" />\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_upnp</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>upnp_lease_duration</td>\n+<td>int</td>\n+<td>3600</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<p>The upnp object returned by <tt class=\"docutils literal\">start_upnp()</tt> can be used to add and\n-remove arbitrary port mappings. Mapping status is returned through\n-the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_alert\">portmap_alert</a> and the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_error_alert\">portmap_error_alert</a>. The object will be\n-valid until <tt class=\"docutils literal\">stop_upnp()</tt> is called. See <a class=\"reference external\" href=\"manual-ref.html#upnp-and-nat-pmp\">upnp and nat pmp</a>.</p>\n-<a name=\"enable_natpmp\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"max_concurrent_http_announces\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"50%\" />\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n <col width=\"20%\" />\n-<col width=\"30%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_natpmp</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>max_concurrent_http_announces</td>\n+<td>int</td>\n+<td>50</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<p>The natpmp object returned by <tt class=\"docutils literal\">start_natpmp()</tt> can be used to add\n-and remove arbitrary port mappings. Mapping status is returned\n-through the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_alert\">portmap_alert</a> and the <a class=\"reference external\" href=\"reference-Alerts.html#portmap_error_alert\">portmap_error_alert</a>. The object\n-will be valid until <tt class=\"docutils literal\">stop_natpmp()</tt> is called. See\n-<a class=\"reference external\" href=\"manual-ref.html#upnp-and-nat-pmp\">upnp and nat pmp</a>.</p>\n-<a name=\"enable_lsd\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"dht_max_peers_reply\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_lsd</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_peers_reply</td>\n+<td>int</td>\n+<td>100</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"enable_dht\"></a><table border=\"1\" class=\"docutils\">\n+<p>the maximum number of peers to send in a reply to <tt class=\"docutils literal\">get_peers</tt></p>\n+<a name=\"dht_search_branching\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_dht</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_search_branching</td>\n+<td>int</td>\n+<td>5</td>\n </tr>\n </tbody>\n </table>\n-<p>starts the dht node and makes the trackerless service available to\n-torrents.</p>\n-<a name=\"prefer_rc4\"></a><table border=\"1\" class=\"docutils\">\n+<p>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</p>\n+<a name=\"dht_max_fail_count\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n+<col width=\"57%\" />\n+<col width=\"17%\" />\n+<col width=\"26%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>prefer_rc4</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>dht_max_fail_count</td>\n+<td>int</td>\n+<td>20</td>\n </tr>\n </tbody>\n </table>\n-<p>if the allowed encryption level is both, setting this to true will\n-prefer RC4 if both methods are offered, plain text otherwise</p>\n-<a name=\"proxy_hostnames\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"dht_max_torrents\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n+<col width=\"55%\" />\n+<col width=\"18%\" />\n+<col width=\"27%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>proxy_hostnames</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_torrents</td>\n+<td>int</td>\n+<td>2000</td>\n </tr>\n </tbody>\n </table>\n-<p>if true, hostname lookups are done via the configured proxy (if\n-any). This is only supported by SOCKS5 and HTTP.</p>\n-<a name=\"proxy_peer_connections\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"dht_max_dht_items\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>proxy_peer_connections</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_dht_items</td>\n+<td>int</td>\n+<td>700</td>\n </tr>\n </tbody>\n </table>\n-<p>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).</p>\n-<a name=\"auto_sequential\"></a><table border=\"1\" class=\"docutils\">\n+<p>max number of items the DHT will store</p>\n+<a name=\"dht_max_peers\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>auto_sequential</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_peers</td>\n+<td>int</td>\n+<td>500</td>\n </tr>\n </tbody>\n </table>\n-<p>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</p>\n-<a name=\"proxy_tracker_connections\"></a><table border=\"1\" class=\"docutils\">\n+<p>the max number of peers to store per torrent (for the DHT)</p>\n+<a name=\"dht_max_torrent_search_reply\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"64%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n+<col width=\"67%\" />\n+<col width=\"13%\" />\n+<col width=\"20%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>proxy_tracker_connections</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_torrent_search_reply</td>\n+<td>int</td>\n+<td>20</td>\n </tr>\n </tbody>\n </table>\n-<p>if true, tracker connections are made over the configured proxy, if\n-any.</p>\n-<a name=\"enable_ip_notifier\"></a><table border=\"1\" class=\"docutils\">\n+<p>the max number of torrents to return in a torrent search query to the\n+DHT</p>\n+<a name=\"dht_block_timeout\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n <col width=\"26%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_ip_notifier</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_block_timeout</td>\n+<td>int</td>\n+<td>5 * 60</td>\n </tr>\n </tbody>\n </table>\n-<p>Starts and stops the internal IP table route changes notifier.</p>\n-<p>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-<tt class=\"docutils literal\"><span class=\"pre\">session_handle::reopen_network_sockets</span></tt> to ensure network\n-changes are taken in consideration.</p>\n-<a name=\"dht_prefer_verified_node_ids\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"dht_block_ratelimit\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n+<col width=\"58%\" />\n+<col width=\"17%\" />\n+<col width=\"25%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_prefer_verified_node_ids</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_block_ratelimit</td>\n+<td>int</td>\n+<td>5</td>\n </tr>\n </tbody>\n </table>\n-<p>when this is true, nodes whose IDs are derived from their source\n-IP according to <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0042.html\">BEP 42</a> are preferred in the routing table.</p>\n-<a name=\"dht_restrict_routing_ips\"></a><table border=\"1\" class=\"docutils\">\n+<p>the max number of packets per second a DHT node is allowed to send\n+without getting banned.</p>\n+<a name=\"dht_item_lifetime\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n+<col width=\"56%\" />\n+<col width=\"18%\" />\n+<col width=\"26%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_restrict_routing_ips</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_item_lifetime</td>\n+<td>int</td>\n+<td>0</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<p>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 <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in the whole routing table</p>\n-<a name=\"dht_restrict_search_ips\"></a><table border=\"1\" class=\"docutils\">\n+<p>the number of seconds a immutable/mutable item will be expired.\n+default is 0, means never expires.</p>\n+<a name=\"dht_sample_infohashes_interval\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"68%\" />\n+<col width=\"13%\" />\n+<col width=\"19%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_restrict_search_ips</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_sample_infohashes_interval</td>\n+<td>int</td>\n+<td>21600</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"dht_extended_routing_table\"></a><table border=\"1\" class=\"docutils\">\n+<p>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).</p>\n+<a name=\"dht_max_infohashes_sample_count\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"65%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n+<col width=\"69%\" />\n+<col width=\"13%\" />\n+<col width=\"19%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_extended_routing_table</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>dht_max_infohashes_sample_count</td>\n+<td>int</td>\n+<td>20</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"dht_aggressive_lookups\"></a><table border=\"1\" class=\"docutils\">\n+<p>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</p>\n+<a name=\"max_piece_count\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"52%\" />\n+<col width=\"18%\" />\n+<col width=\"30%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_aggressive_lookups</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>max_piece_count</td>\n+<td>int</td>\n+<td>0x200000</td>\n </tr>\n </tbody>\n </table>\n-<p>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 <em>branch factor</em> 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.</p>\n-<a name=\"dht_privacy_lookups\"></a><table border=\"1\" class=\"docutils\">\n+<p><tt class=\"docutils literal\">max_piece_count</tt> 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 <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> and\n+<a class=\"reference external\" href=\"reference-Torrent_Info.html#parse_info_section()\">torrent_info::parse_info_section()</a>, if those are used.</p>\n+<a name=\"metadata_token_limit\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n+<col width=\"59%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_privacy_lookups</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>metadata_token_limit</td>\n+<td>int</td>\n+<td>2500000</td>\n </tr>\n </tbody>\n </table>\n-<p>when set, perform lookups in a way that is slightly more expensive,\n-but which minimizes the amount of information leaked about you.</p>\n-<a name=\"dht_enforce_node_id\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"disk_write_mode\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n+<col width=\"23%\" />\n+<col width=\"8%\" />\n+<col width=\"69%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_enforce_node_id</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>disk_write_mode</td>\n+<td>int</td>\n+<td>settings_pack::mmap_write_mode_t::auto_mmap_write</td>\n </tr>\n </tbody>\n </table>\n-<p>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".</p>\n-<a name=\"dht_ignore_dark_internet\"></a><table border=\"1\" class=\"docutils\">\n+<p>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 <a class=\"reference external\" href=\"reference-Settings.html#mmap_write_mode_t\">mmap_write_mode_t</a>.</p>\n+<a name=\"mmap_file_size_cutoff\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_ignore_dark_internet</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>mmap_file_size_cutoff</td>\n+<td>int</td>\n+<td>40</td>\n </tr>\n </tbody>\n </table>\n-<p>ignore DHT messages from parts of the internet we wouldn't expect to\n-see any traffic from</p>\n-<a name=\"dht_read_only\"></a><table border=\"1\" class=\"docutils\">\n+<p>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.</p>\n+<a name=\"i2p_inbound_quantity\"></a>\n+<a name=\"i2p_outbound_quantity\"></a>\n+<a name=\"i2p_inbound_length\"></a>\n+<a name=\"i2p_outbound_length\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n+<col width=\"61%\" />\n+<col width=\"16%\" />\n+<col width=\"24%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>dht_read_only</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>i2p_inbound_quantity</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+<tr><td>i2p_outbound_quantity</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+<tr><td>i2p_inbound_length</td>\n+<td>int</td>\n+<td>3</td>\n+</tr>\n+<tr><td>i2p_outbound_length</td>\n+<td>int</td>\n+<td>3</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"piece_extent_affinity\"></a><table border=\"1\" class=\"docutils\">\n+<p>Configures the SAM <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\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).</p>\n+<a name=\"announce_port\"></a><table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n+<col width=\"50%\" />\n+<col width=\"20%\" />\n+<col width=\"30%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">type</th>\n <th class=\"head\">default</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>piece_extent_affinity</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>announce_port</td>\n+<td>int</td>\n+<td>0</td>\n </tr>\n </tbody>\n </table>\n-<p>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</p>\n-<a name=\"validate_https_trackers\"></a><table border=\"1\" class=\"docutils\">\n+<p><tt class=\"docutils literal\">announce_port</tt> is the port passed along as the <tt class=\"docutils literal\">port</tt> parameter\n+to remote trackers such as HTTP or DHT. This setting does not affect\n+the effective listening port nor local service discovery announcements.\n+If left as zero (default), the listening port value is used.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">This setting is only meant for very special cases where a\n+seed's listening port differs from the external port. As an\n+example, if a local proxy is used and that the proxy supports\n+reverse tunnels through NAT-PMP, the tracker must connect to\n+the external NAT-PMP port (configured using <tt class=\"docutils literal\">announce_port</tt>)\n+instead of the actual local listening port.</p>\n+</div>\n+<pre class=\"literal-block\">\n+struct settings_pack final : settings_interface\n+{\n+ friend void <strong>apply_pack_impl</strong> (settings_pack const*\n+ , aux::session_settings_single_thread&\n+ , std::vector<void(aux::session_impl::*)()>*);\n+ void <strong>set_int</strong> (int name, int val) override;\n+ void <strong>set_bool</strong> (int name, bool val) override;\n+ void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n+ void <strong>set_str</strong> (int name, std::string val) override;\n+ bool <strong>has_val</strong> (int name) const override;\n+ void <strong>clear</strong> ();\n+ void <strong>clear</strong> (int name);\n+ std::string const& <strong>get_str</strong> (int name) const override;\n+ int <strong>get_int</strong> (int name) const override;\n+ bool <strong>get_bool</strong> (int name) const override;\n+ void <strong>for_each</strong> (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+</pre>\n+<a name=\"set_str()\"></a>\n+<a name=\"set_int()\"></a>\n+<a name=\"set_bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bset_str%28%29+set_int%28%29+set_bool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bset_str%28%29+set_int%28%29+set_bool%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"set-str-set-int-set-bool\">\n+<h2>set_str() set_int() set_bool()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_int</strong> (int name, int val) override;\n+void <strong>set_bool</strong> (int name, bool val) override;\n+void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n+void <strong>set_str</strong> (int name, std::string val) override;\n+</pre>\n+<p>set a configuration option in the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>. <tt class=\"docutils literal\">name</tt> 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.</p>\n+<a name=\"has_val()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bhas_val%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bhas_val%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"has-val\">\n+<h2>has_val()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>has_val</strong> (int name) const override;\n+</pre>\n+<p>queries whether the specified configuration option has a value set in\n+this pack. <tt class=\"docutils literal\">name</tt> can be any enumeration value from string_types,\n+int_types or bool_types.</p>\n+<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear\">\n+<h2>clear()</h2>\n+<pre class=\"literal-block\">\n+void <strong>clear</strong> ();\n+</pre>\n+<p>clear the settings pack from all settings</p>\n+<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-1\">\n+<h2>clear()</h2>\n+<pre class=\"literal-block\">\n+void <strong>clear</strong> (int name);\n+</pre>\n+<p>clear a specific setting from the pack</p>\n+<a name=\"get_int()\"></a>\n+<a name=\"get_bool()\"></a>\n+<a name=\"get_str()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bget_int%28%29+get_bool%28%29+get_str%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bget_int%28%29+get_bool%28%29+get_str%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-int-get-bool-get-str\">\n+<h2>get_int() get_bool() get_str()</h2>\n+<pre class=\"literal-block\">\n+std::string const& <strong>get_str</strong> (int name) const override;\n+int <strong>get_int</strong> (int name) const override;\n+bool <strong>get_bool</strong> (int name) const override;\n+</pre>\n+<p>queries the current configuration option from the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.\n+<tt class=\"docutils literal\">name</tt> 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.</p>\n+<a name=\"type_bases\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_bases&labels=documentation&body=Documentation+under+heading+%22enum+type_bases%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-type-bases\">\n+<h2>enum type_bases</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"47%\" />\n+<col width=\"18%\" />\n+<col width=\"34%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>validate_https_trackers</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>string_type_base</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>int_type_base</td>\n+<td>16384</td>\n+<td> </td>\n+</tr>\n+<tr><td>bool_type_base</td>\n+<td>32768</td>\n+<td> </td>\n+</tr>\n+<tr><td>type_mask</td>\n+<td>49152</td>\n+<td> </td>\n+</tr>\n+<tr><td>index_mask</td>\n+<td>16383</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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).</p>\n-<a name=\"ssrf_mitigation\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"mmap_write_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+mmap_write_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+mmap_write_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-mmap-write-mode-t\">\n+<h2>enum mmap_write_mode_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n+<col width=\"21%\" />\n+<col width=\"8%\" />\n+<col width=\"71%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>ssrf_mitigation</td>\n-<td>bool</td>\n-<td>true</td>\n+<tr><td>always_pwrite</td>\n+<td>0</td>\n+<td>disable writing to disk via mmap, always use normal write calls</td>\n+</tr>\n+<tr><td>always_mmap_write</td>\n+<td>1</td>\n+<td>prefer using memory mapped files for disk writes (at least for\n+large files where it might make sense)</td>\n+</tr>\n+<tr><td>auto_mmap_write</td>\n+<td>2</td>\n+<td>determine whether to use pwrite or memory mapped files for disk\n+writes depending on the kind of storage behind the save path</td>\n </tr>\n </tbody>\n </table>\n-<p>when enabled, tracker and web seed requests are subject to\n-certain restrictions.</p>\n-<p>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.</p>\n-<p>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.</p>\n-<p>Web seeds on global IPs (i.e. not local network) may not redirect\n-to a local network address</p>\n-<a name=\"allow_idna\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"suggest_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+suggest_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+suggest_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-suggest-mode-t\">\n+<h2>enum suggest_mode_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n+<col width=\"52%\" />\n+<col width=\"17%\" />\n+<col width=\"31%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>allow_idna</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>no_piece_suggestions</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>suggest_read_cache</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"enable_set_file_valid_data\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"choking_algorithm_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+choking_algorithm_t&labels=documentation&body=Documentation+under+heading+%22enum+choking_algorithm_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-choking-algorithm-t\">\n+<h2>enum choking_algorithm_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n+<col width=\"28%\" />\n+<col width=\"7%\" />\n <col width=\"65%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_set_file_valid_data</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>fixed_slots_choker</td>\n+<td>0</td>\n+<td>This is the traditional choker with a fixed number of unchoke\n+slots (as specified by <a class=\"reference external\" href=\"reference-Settings.html#unchoke_slots_limit\">settings_pack::unchoke_slots_limit</a>).</td>\n+</tr>\n+<tr><td>rate_based_choker</td>\n+<td>2</td>\n+<td><p class=\"first\">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 <a class=\"reference external\" href=\"reference-Settings.html#rate_choker_initial_threshold\">settings_pack::rate_choker_initial_threshold</a>.</p>\n+<p class=\"last\">For more information, see <a class=\"reference external\" href=\"manual-ref.html#rate-based-choking\">rate based choking</a>.</p>\n+</td>\n+</tr>\n+<tr><td>deprecated_bittyrant_choker</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"socks5_udp_send_local_ep\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"seed_choking_algorithm_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+seed_choking_algorithm_t&labels=documentation&body=Documentation+under+heading+%22enum+seed_choking_algorithm_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-seed-choking-algorithm-t\">\n+<h2>enum seed_choking_algorithm_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n+<col width=\"18%\" />\n+<col width=\"8%\" />\n+<col width=\"75%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>socks5_udp_send_local_ep</td>\n-<td>bool</td>\n-<td>false</td>\n+<tr><td>round_robin</td>\n+<td>0</td>\n+<td>which 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.</td>\n+</tr>\n+<tr><td>fastest_upload</td>\n+<td>1</td>\n+<td>unchokes the peers we can send to the fastest. This might be a\n+bit more reliable in utilizing all available capacity.</td>\n+</tr>\n+<tr><td>anti_leech</td>\n+<td>2</td>\n+<td>prioritizes 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.</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"tracker_completion_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"io_buffer_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+io_buffer_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+io_buffer_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-io-buffer-mode-t\">\n+<h2>enum io_buffer_mode_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"65%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n+<col width=\"70%\" />\n+<col width=\"10%\" />\n+<col width=\"19%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>tracker_completion_timeout</td>\n-<td>int</td>\n-<td>30</td>\n+<tr><td>enable_os_cache</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>deprecated_disable_os_cache_for_aligned_files</td>\n+<td>1</td>\n+<td> </td>\n+</tr>\n+<tr><td>disable_os_cache</td>\n+<td>2</td>\n+<td> </td>\n+</tr>\n+<tr><td>write_through</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">tracker_completion_timeout</tt> 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.</p>\n-<a name=\"tracker_receive_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"bandwidth_mixed_algo_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+bandwidth_mixed_algo_t&labels=documentation&body=Documentation+under+heading+%22enum+bandwidth_mixed_algo_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-bandwidth-mixed-algo-t\">\n+<h2>enum bandwidth_mixed_algo_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"22%\" />\n+<col width=\"8%\" />\n+<col width=\"70%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>tracker_receive_timeout</td>\n-<td>int</td>\n-<td>10</td>\n+<tr><td>prefer_tcp</td>\n+<td>0</td>\n+<td>disables the mixed mode bandwidth balancing</td>\n+</tr>\n+<tr><td>peer_proportional</td>\n+<td>1</td>\n+<td>does not throttle uTP, throttles TCP to the same proportion\n+of throughput as there are TCP connections</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">tracker_receive_timeout</tt> 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.</p>\n-<a name=\"stop_tracker_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"enc_policy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+enc_policy&labels=documentation&body=Documentation+under+heading+%22enum+enc_policy%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-enc-policy\">\n+<h2>enum enc_policy</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n+<col width=\"15%\" />\n+<col width=\"8%\" />\n+<col width=\"78%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>stop_tracker_timeout</td>\n-<td>int</td>\n-<td>5</td>\n+<tr><td>pe_forced</td>\n+<td>0</td>\n+<td>Only 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.</td>\n+</tr>\n+<tr><td>pe_enabled</td>\n+<td>1</td>\n+<td>encrypted 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.</td>\n+</tr>\n+<tr><td>pe_disabled</td>\n+<td>2</td>\n+<td>only non-encrypted connections are allowed.</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">stop_tracker_timeout</tt> 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.</p>\n-<a name=\"tracker_maximum_response_length\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"enc_level\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+enc_level&labels=documentation&body=Documentation+under+heading+%22enum+enc_level%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-enc-level\">\n+<h2>enum enc_level</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"66%\" />\n-<col width=\"12%\" />\n-<col width=\"22%\" />\n+<col width=\"26%\" />\n+<col width=\"13%\" />\n+<col width=\"60%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>tracker_maximum_response_length</td>\n-<td>int</td>\n-<td>1024*1024</td>\n+<tr><td>pe_plaintext</td>\n+<td>1</td>\n+<td>use only plain text encryption</td>\n+</tr>\n+<tr><td>pe_rc4</td>\n+<td>2</td>\n+<td>use only RC4 encryption</td>\n+</tr>\n+<tr><td>pe_both</td>\n+<td>3</td>\n+<td>allow both</td>\n </tr>\n </tbody>\n </table>\n-<p>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).</p>\n-<a name=\"piece_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"proxy_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+proxy_type_t&labels=documentation&body=Documentation+under+heading+%22enum+proxy_type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-proxy-type-t\">\n+<h2>enum proxy_type_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n+<col width=\"11%\" />\n+<col width=\"7%\" />\n+<col width=\"81%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>piece_timeout</td>\n-<td>int</td>\n-<td>20</td>\n+<tr><td>none</td>\n+<td>0</td>\n+<td>No proxy server is used and all other fields are ignored.</td>\n+</tr>\n+<tr><td>socks4</td>\n+<td>1</td>\n+<td>The server is assumed to be a <a class=\"reference external\" href=\"http://www.ufasoft.com/doc/socks4_protocol.htm\">SOCKS4 server</a> that requires a\n+username.</td>\n+</tr>\n+<tr><td>socks5</td>\n+<td>2</td>\n+<td>The server is assumed to be a SOCKS5 server (<a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc1928.html\">RFC 1928</a>) that does\n+not require any authentication. The username and password are\n+ignored.</td>\n+</tr>\n+<tr><td>socks5_pw</td>\n+<td>3</td>\n+<td>The server is assumed to be a SOCKS5 server that supports plain\n+text username and password authentication (<a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc1929.html\">RFC 1929</a>). The\n+username and password specified may be sent to the proxy if it\n+requires.</td>\n+</tr>\n+<tr><td>http</td>\n+<td>4</td>\n+<td>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 <a class=\"reference external\" href=\"http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01\">CONNECT</a> 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.</td>\n+</tr>\n+<tr><td>http_pw</td>\n+<td>5</td>\n+<td>The server is assumed to be an HTTP proxy that requires user\n+authorization. The username and password will be sent to the proxy.</td>\n </tr>\n </tbody>\n </table>\n-<p>the number of seconds from a request is sent until it times out if\n-no piece response is returned.</p>\n-<a name=\"request_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"setting_by_name()\"></a>\n+<a name=\"name_for_setting()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:setting_by_name%28%29+name_for_setting%28%29&labels=documentation&body=Documentation+under+heading+%22setting_by_name%28%29+name_for_setting%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"setting-by-name-name-for-setting\">\n+<h1>setting_by_name() name_for_setting()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+char const* <strong>name_for_setting</strong> (int s);\n+int <strong>setting_by_name</strong> (string_view name);\n+</pre>\n+<p>converts a setting integer (from the enums string_types, int_types or\n+bool_types) to a string, and vice versa.</p>\n+<a name=\"default_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_settings%28%29&labels=documentation&body=Documentation+under+heading+%22default_settings%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"default-settings\">\n+<h1>default_settings()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+settings_pack <strong>default_settings</strong> ();\n+</pre>\n+<p>returns a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> with every setting set to its default value</p>\n+<a name=\"high_performance_seed()\"></a>\n+<a name=\"min_memory_usage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:high_performance_seed%28%29+min_memory_usage%28%29&labels=documentation&body=Documentation+under+heading+%22high_performance_seed%28%29+min_memory_usage%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"high-performance-seed-min-memory-usage\">\n+<h1>high_performance_seed() min_memory_usage()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+settings_pack <strong>min_memory_usage</strong> ();\n+settings_pack <strong>high_performance_seed</strong> ();\n+</pre>\n+<p>The default values of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> settings are set for a regular\n+bittorrent client running on a desktop system. There are functions that\n+can set the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n+<p><tt class=\"docutils literal\">min_memory_usage</tt> 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.</p>\n+<p>This configuration is intended to be the starting point for embedded\n+devices. It will significantly reduce memory usage.</p>\n+<p><tt class=\"docutils literal\">high_performance_seed</tt> 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.</p>\n+<a name=\"generate_fingerprint()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:generate_fingerprint%28%29&labels=documentation&body=Documentation+under+heading+%22generate_fingerprint%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"generate-fingerprint\">\n+<h1>generate_fingerprint()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/fingerprint.hpp\">libtorrent/fingerprint.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::string <strong>generate_fingerprint</strong> (std::string name\n+ , int major, int minor = 0, int revision = 0, int tag = 0);\n+</pre>\n+<p>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+<tt class=\"docutils literal\">peer_fingerprint</tt> setting, in <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n+<p>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:</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n+<col width=\"30%\" />\n+<col width=\"70%\" />\n </colgroup>\n <thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><th class=\"head\">id chars</th>\n+<th class=\"head\">client</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>request_timeout</td>\n-<td>int</td>\n-<td>60</td>\n+<tr><td>LT</td>\n+<td>libtorrent (default)</td>\n+</tr>\n+<tr><td>UT</td>\n+<td>uTorrent</td>\n+</tr>\n+<tr><td>UM</td>\n+<td>uTorrent Mac</td>\n+</tr>\n+<tr><td>qB</td>\n+<td>qBittorrent</td>\n+</tr>\n+<tr><td>BP</td>\n+<td>BitTorrent Pro</td>\n+</tr>\n+<tr><td>BT</td>\n+<td>BitTorrent</td>\n+</tr>\n+<tr><td>DE</td>\n+<td>Deluge</td>\n+</tr>\n+<tr><td>AZ</td>\n+<td>Azureus</td>\n+</tr>\n+<tr><td>TL</td>\n+<td>Tribler</td>\n </tr>\n </tbody>\n </table>\n-<p>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</p>\n-<a name=\"request_queue_time\"></a><table border=\"1\" class=\"docutils\">\n+<p>There's an informal directory of client id's <a class=\"reference external\" href=\"http://wiki.theory.org/BitTorrentSpecification#peer_id\">here</a>.</p>\n+<p>The <tt class=\"docutils literal\">major</tt>, <tt class=\"docutils literal\">minor</tt>, <tt class=\"docutils literal\">revision</tt> and <tt class=\"docutils literal\">tag</tt> parameters are used to\n+identify the version of your client.</p>\n+<p>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:</p>\n+<ol class=\"arabic simple\">\n+<li>first the files that will be part of the torrent are determined.</li>\n+<li>the torrent properties are set, such as tracker url, web seeds,\n+DHT nodes etc.</li>\n+<li>Read through all the files in the torrent, SHA-1 all the data\n+and set the piece hashes.</li>\n+<li>The torrent is bencoded into a file or buffer.</li>\n+</ol>\n+<p>If there are a lot of files and or deep directory hierarchies to\n+traverse, step one can be time consuming.</p>\n+<p>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.</p>\n+<p>All of these classes and functions are declared by including\n+<tt class=\"docutils literal\">libtorrent/create_torrent.hpp</tt>.</p>\n+<p>example:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"name\">fs</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+</span><span class=\"comment single\">// recursively adds files in directories\n+</span><span class=\"name\">add_files</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal string\">"./my_torrent"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+</span><span class=\"name\">create_torrent</span><span class=\"whitespace\"> </span><span class=\"name function\">t</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">add_tracker</span><span class=\"punctuation\">(</span><span class=\"literal string\">"http://my.tracker.com/announce"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">set_creator</span><span class=\"punctuation\">(</span><span class=\"literal string\">"libtorrent example"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+</span><span class=\"comment single\">// reads the files and calculates the hashes\n+</span><span class=\"name\">set_piece_hashes</span><span class=\"punctuation\">(</span><span class=\"name\">t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal string\">"."</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+</span><span class=\"name\">ofstream</span><span class=\"whitespace\"> </span><span class=\"name\">out</span><span class=\"punctuation\">(</span><span class=\"literal string\">"my_torrent.torrent"</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ios_base</span><span class=\"operator\">::</span><span class=\"name\">binary</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">generate_buf</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"name\">out</span><span class=\"punctuation\">.</span><span class=\"name\">write</span><span class=\"punctuation\">(</span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+\n+</span><span class=\"comment single\">// alternatively, generate an entry and encode it directly to an ostream\n+// iterator\n+</span><span class=\"name\">bencode</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ostream_iterator</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">out</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">generate</span><span class=\"punctuation\">());</span>\n+</pre>\n+<a name=\"create_torrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+create_torrent&labels=documentation&body=Documentation+under+heading+%22class+create_torrent%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"create-torrent\">\n+<h1>create_torrent</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n+<p>This class holds state for creating a torrent. After having added\n+all information to it, call <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">create_torrent::generate()</a> to generate\n+the torrent. The <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> that's returned can then be bencoded into a\n+.torrent file using <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a>.</p>\n+<pre class=\"literal-block\">\n+struct create_torrent\n+{\n+ explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n+ , create_flags_t flags = {});\n+ explicit <strong>create_torrent</strong> (torrent_info const& ti);\n+ entry <strong>generate</strong> () const;\n+ std::vector<char> <strong>generate_buf</strong> () const;\n+ file_storage const& <strong>files</strong> () const;\n+ void <strong>set_comment</strong> (char const* str);\n+ void <strong>set_creator</strong> (char const* str);\n+ void <strong>set_creation_date</strong> (std::time_t timestamp);\n+ void <strong>set_hash</strong> (piece_index_t index, sha1_hash const& h);\n+ void <strong>set_hash2</strong> (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n+ void <strong>add_http_seed</strong> (string_view url);\n+ void <strong>add_url_seed</strong> (string_view url);\n+ void <strong>add_node</strong> (std::pair<std::string, int> node);\n+ void <strong>add_tracker</strong> (string_view url, int tier = 0);\n+ void <strong>set_root_cert</strong> (string_view cert);\n+ bool <strong>priv</strong> () const;\n+ void <strong>set_priv</strong> (bool p);\n+ bool <strong>is_v2_only</strong> () const;\n+ bool <strong>is_v1_only</strong> () const;\n+ int <strong>num_pieces</strong> () const;\n+ piece_index_t <strong>end_piece</strong> () const;\n+ index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n+ file_index_t <strong>end_file</strong> () const;\n+ index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n+ index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t f);\n+ std::int64_t <strong>total_size</strong> () const;\n+ int <strong>piece_size</strong> (piece_index_t i) const;\n+ int <strong>piece_length</strong> () const;\n+ void <strong>add_collection</strong> (string_view c);\n+ void <strong>add_similar_torrent</strong> (sha1_hash ih);\n+\n+ static constexpr create_flags_t <strong>modification_time</strong> = 2_bit;\n+ static constexpr create_flags_t <strong>symlinks</strong> = 3_bit;\n+ static constexpr create_flags_t <strong>v2_only</strong> = 5_bit;\n+ static constexpr create_flags_t <strong>v1_only</strong> = 6_bit;\n+ static constexpr create_flags_t <strong>canonical_files</strong> = 7_bit;\n+ static constexpr create_flags_t <strong>no_attributes</strong> = 8_bit;\n+ static constexpr create_flags_t <strong>canonical_files_no_tail_padding</strong> = 9_bit;\n+};\n+</pre>\n+<a name=\"create_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcreate_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcreate_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"create-torrent-1\">\n+<h2>create_torrent()</h2>\n+<pre class=\"literal-block\">\n+explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n+ , create_flags_t flags = {});\n+explicit <strong>create_torrent</strong> (torrent_info const& ti);\n+</pre>\n+<p>The <tt class=\"docutils literal\">piece_size</tt> is the size of each piece in bytes. It must be a\n+power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n+specified, a piece_size will be set automatically.\n+Piece sizes greater than 128 MiB are considered unreasonable and will\n+be rejected (with an lt::system_error exception).</p>\n+<p>The <tt class=\"docutils literal\">flags</tt> arguments specifies options for the torrent creation. It can\n+be any combination of the flags defined by create_flags_t.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> (<tt class=\"docutils literal\">fs</tt>) 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> constructor.</p>\n+<p>The overload that takes a <tt class=\"docutils literal\">torrent_info</tt> 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">create_torrent::generate()</a>. This means\n+that none of the member functions of <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> that affects\n+the content of the info dictionary (such as <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>), will\n+have any affect. Instead of using this overload, consider using\n+<a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a> instead.</p>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> and <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> objects must stay alive for the\n+entire duration of the <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> object.</p>\n+</div>\n+<a name=\"generate()\"></a>\n+<a name=\"generate_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"generate-generate-buf\">\n+<h2>generate() generate_buf()</h2>\n+<pre class=\"literal-block\">\n+entry <strong>generate</strong> () const;\n+std::vector<char> <strong>generate_buf</strong> () const;\n+</pre>\n+<p>This function will generate the .torrent file as a bencode tree, or a\n+bencoded into a buffer.\n+In order to encode the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> into a flat file, use the <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a> function.</p>\n+<p>The function returning an <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> may be useful to add custom entries\n+to the torrent file before bencoding it and saving it to disk.</p>\n+<p>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.</p>\n+<p>Any failure will cause this function to throw system_error, with an\n+appropriate error message. These are the reasons this call may throw:</p>\n+<ul class=\"simple\">\n+<li>the file storage has 0 files</li>\n+<li>the total size of the file storage is 0 bytes (i.e. it only has\n+empty files)</li>\n+<li>not all v1 hashes (<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>) and not all v2 hashes (<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a>)\n+were set</li>\n+<li>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, <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>\n+fails.</li>\n+</ul>\n+<a name=\"files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfiles%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfiles%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"files\">\n+<h2>files()</h2>\n+<pre class=\"literal-block\">\n+file_storage const& <strong>files</strong> () const;\n+</pre>\n+<p>returns an immutable reference to the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> used to create\n+the torrent from.</p>\n+<a name=\"set_comment()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_comment%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_comment%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-comment\">\n+<h2>set_comment()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_comment</strong> (char const* str);\n+</pre>\n+<p>Sets the comment for the torrent. The string <tt class=\"docutils literal\">str</tt> should be utf-8 encoded.\n+The comment in a torrent file is optional.</p>\n+<a name=\"set_creator()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_creator%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_creator%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-creator\">\n+<h2>set_creator()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_creator</strong> (char const* str);\n+</pre>\n+<p>Sets the creator of the torrent. The string <tt class=\"docutils literal\">str</tt> should be utf-8 encoded.\n+This is optional.</p>\n+<a name=\"set_creation_date()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_creation_date%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_creation_date%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-creation-date\">\n+<h2>set_creation_date()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_creation_date</strong> (std::time_t timestamp);\n+</pre>\n+<p>sets the "creation time" field. Defaults to the system clock at the\n+time of construction of the <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> 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.</p>\n+<a name=\"set_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-hash\">\n+<h2>set_hash()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_hash</strong> (piece_index_t index, sha1_hash const& h);\n+</pre>\n+<p>This sets the SHA-1 hash for the specified piece (<tt class=\"docutils literal\">index</tt>). 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_piece_hashes()\">set_piece_hashes()</a>.\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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>.\n+This function will throw <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> if it is called on an\n+object constructed with the v2_only flag.</p>\n+<a name=\"set_hash2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_hash2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_hash2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-hash2\">\n+<h2>set_hash2()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_hash2</strong> (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n+</pre>\n+<p>sets the bittorrent v2 hash for file <cite>file</cite> of the piece <cite>piece</cite>.\n+<cite>piece</cite> is relative to the first piece of the file, starting at 0. The\n+first piece in the file can be computed with\n+<a class=\"reference external\" href=\"reference-Storage.html#file_index_at_piece()\">file_storage::file_index_at_piece()</a>.\n+The hash, <cite>h</cite>, 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>.\n+This function will throw <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> if it is called on an\n+object constructed with the v1_only flag.</p>\n+<a name=\"add_url_seed()\"></a>\n+<a name=\"add_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_url_seed%28%29+add_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-url-seed-add-http-seed\">\n+<h2>add_url_seed() add_http_seed()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_http_seed</strong> (string_view url);\n+void <strong>add_url_seed</strong> (string_view url);\n+</pre>\n+<p>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.</p>\n+<p>The second function, <tt class=\"docutils literal\">add_http_seed()</tt> adds an HTTP seed instead.</p>\n+<a name=\"add_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-node\">\n+<h2>add_node()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_node</strong> (std::pair<std::string, int> node);\n+</pre>\n+<p>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.</p>\n+<a name=\"add_tracker()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_tracker%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_tracker%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-tracker\">\n+<h2>add_tracker()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_tracker</strong> (string_view url, int tier = 0);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"http://\">http://</a> 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.</p>\n+<a name=\"set_root_cert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_root_cert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_root_cert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-root-cert\">\n+<h2>set_root_cert()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_root_cert</strong> (string_view cert);\n+</pre>\n+<p>This function sets an X.509 certificate in PEM format to the torrent. This makes the\n+torrent an <em>SSL torrent</em>. 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 <a class=\"reference external\" href=\"manual-ref.html#ssl-torrents\">ssl torrents</a>.</p>\n+<p>The string is not the path to the cert, it's the actual content of the\n+certificate.</p>\n+<a name=\"priv()\"></a>\n+<a name=\"set_priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpriv%28%29+set_priv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpriv%28%29+set_priv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"priv-set-priv\">\n+<h2>priv() set_priv()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>priv</strong> () const;\n+void <strong>set_priv</strong> (bool p);\n+</pre>\n+<p>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.</p>\n+<a name=\"num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bnum_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bnum_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-pieces\">\n+<h2>num_pieces()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_pieces</strong> () const;\n+</pre>\n+<p>returns the number of pieces in the associated <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object.</p>\n+<a name=\"piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-range\">\n+<h2>piece_range()</h2>\n+<pre class=\"literal-block\">\n+index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n+</pre>\n+<p>all piece indices in the torrent to be created</p>\n+<a name=\"file_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfile_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfile_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-range\">\n+<h2>file_range()</h2>\n+<pre class=\"literal-block\">\n+index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n+</pre>\n+<p>all file indices in the torrent to be created</p>\n+<a name=\"file_piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfile_piece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfile_piece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-piece-range\">\n+<h2>file_piece_range()</h2>\n+<pre class=\"literal-block\">\n+index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t f);\n+</pre>\n+<p>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.</p>\n+<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"total-size\">\n+<h2>total_size()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>total_size</strong> () const;\n+</pre>\n+<p>the total number of bytes of all files and pad files</p>\n+<a name=\"piece_length()\"></a>\n+<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-length-piece-size\">\n+<h2>piece_length() piece_size()</h2>\n+<pre class=\"literal-block\">\n+int <strong>piece_size</strong> (piece_index_t i) const;\n+int <strong>piece_length</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">piece_length()</tt> returns the piece size of all pieces but the\n+last one. <tt class=\"docutils literal\">piece_size()</tt> returns the size of the specified piece.\n+these functions are just forwarding to the associated <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n+<a name=\"add_collection()\"></a>\n+<a name=\"add_similar_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_collection%28%29+add_similar_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_collection%28%29+add_similar_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-collection-add-similar-torrent\">\n+<h2>add_collection() add_similar_torrent()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_collection</strong> (string_view c);\n+void <strong>add_similar_torrent</strong> (sha1_hash ih);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a>.</p>\n+<a name=\"modification_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bmodification_time%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bmodification_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>modification_time</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"symlinks\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bsymlinks%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bsymlinks%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>symlinks</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"v2_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bv2_only%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bv2_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>v2_only</dt>\n+<dd>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+<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a> before calling <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>. Setting v1 hashes (with\n+<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>) is an error with this flag set.</dd>\n+</dl>\n+<a name=\"v1_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bv1_only%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bv1_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>v1_only</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>, before calling\n+<a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>. Setting v2 hashes (with <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a>) is an error with\n+this flag set.</dd>\n+</dl>\n+<a name=\"canonical_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcanonical_files%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcanonical_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>canonical_files</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"no_attributes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bno_attributes%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bno_attributes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>no_attributes</dt>\n+<dd>passing this flag to <a class=\"reference external\" href=\"reference-Create_Torrents.html#add_files()\">add_files()</a> 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.</dd>\n+</dl>\n+<a name=\"canonical_files_no_tail_padding\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcanonical_files_no_tail_padding%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcanonical_files_no_tail_padding%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>canonical_files_no_tail_padding</dt>\n+<dd>this flag enforces the file layout to be canonical according to the\n+bittorrent v2 specification (just like the <tt class=\"docutils literal\">canonical_files</tt> 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.</dd>\n+</dl>\n+<a name=\"add_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_files%28%29&labels=documentation&body=Documentation+under+heading+%22add_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"add-files\">\n+<h1>add_files()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+void <strong>add_files</strong> (file_storage& fs, std::string const& file\n+ , std::function<bool(std::string)> p, create_flags_t flags = {});\n+void <strong>add_files</strong> (file_storage& fs, std::string const& file\n+ , create_flags_t flags = {});\n+</pre>\n+<p>Adds the file specified by <tt class=\"docutils literal\">path</tt> to the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object. In case <tt class=\"docutils literal\">path</tt>\n+refers to a directory, files will be added recursively from the directory.</p>\n+<p>If specified, the predicate <tt class=\"docutils literal\">p</tt> is called once for every file and directory that\n+is encountered. Files for which <tt class=\"docutils literal\">p</tt> returns true are added, and directories for\n+which <tt class=\"docutils literal\">p</tt> returns true are traversed. <tt class=\"docutils literal\">p</tt> must have the following signature:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"keyword type\">bool</span><span class=\"whitespace\"> </span><span class=\"name function\">Pred</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"punctuation\">);</span>\n+</pre>\n+<p>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.</p>\n+<p>The ".." directory is never traversed.</p>\n+<p>The <tt class=\"docutils literal\">flags</tt> argument should be the same as the flags passed to the <a class=\"reference internal\" href=\"#create-torrent\">create_torrent</a>\n+constructor.</p>\n+<a name=\"set_piece_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:set_piece_hashes%28%29&labels=documentation&body=Documentation+under+heading+%22set_piece_hashes%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-piece-hashes\">\n+<h1>set_piece_hashes()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , std::function<void(piece_index_t)> const& f, error_code& ec);\n+void <strong>set_piece_hashes</strong> (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 <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function<void(piece_index_t)> const& f);\n+inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , std::function<void(piece_index_t)> const& f);\n+void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n+ , settings_interface const& settings, disk_io_constructor_type disk_io\n+ , std::function<void(piece_index_t)> const& f, error_code& ec);\n+inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p, error_code& ec);\n+inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p);\n+</pre>\n+<p>This function will assume that the files added to the torrent file exists at path\n+<tt class=\"docutils literal\">p</tt>, read those files and hash the content and set the hashes in the <tt class=\"docutils literal\">create_torrent</tt>\n+object. The optional function <tt class=\"docutils literal\">f</tt> is called in between every hash that is set. <tt class=\"docutils literal\">f</tt>\n+must have the following signature:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name function\">Fun</span><span class=\"punctuation\">(</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">);</span>\n+</pre>\n+<p>The overloads taking a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> may be used to configure the\n+underlying disk access. Such as <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::aio_threads</span></tt>.</p>\n+<p>The overloads that don't take an <tt class=\"docutils literal\">error_code&</tt> may throw an exception in case of a\n+file error, the other overloads sets the error code to reflect the error, if any.</p>\n+<a name=\"web_seed_entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+web_seed_entry&labels=documentation&body=Documentation+under+heading+%22class+web_seed_entry%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"web-seed-entry\">\n+<h1>web_seed_entry</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n+<p>the <a class=\"reference external\" href=\"reference-Torrent_Info.html#web_seed_entry\">web_seed_entry</a> 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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> and <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n+<pre class=\"literal-block\">\n+struct web_seed_entry\n+{\n+ bool <strong>operator==</strong> (web_seed_entry const& e) const;\n+ bool <strong>operator<</strong> (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+</pre>\n+<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator\">\n+<h2>operator==()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator==</strong> (web_seed_entry const& e) const;\n+</pre>\n+<p>URL and type comparison</p>\n+<a name=\"operator<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Boperator%3C%28%29%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Boperator%3C%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-1\">\n+<h2>operator<()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator<</strong> (web_seed_entry const& e) const;\n+</pre>\n+<p>URL and type less-than comparison</p>\n+<a name=\"type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_t&labels=documentation&body=Documentation+under+heading+%22enum+type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-type-t\">\n+<h2>enum type_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n+<col width=\"35%\" />\n+<col width=\"23%\" />\n+<col width=\"42%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>request_queue_time</td>\n-<td>int</td>\n-<td>3</td>\n+<tr><td>url_seed</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>http_seed</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"max_allowed_in_request_queue\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"url\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Burl%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Burl%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>url</dt>\n+<dd>The URL of the web seed</dd>\n+</dl>\n+<a name=\"auth\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Bauth%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Bauth%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>auth</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"extra_headers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Bextra_headers%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Bextra_headers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>extra_headers</dt>\n+<dd>Any extra HTTP headers that need to be passed to the web seed</dd>\n+</dl>\n+<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:web_seed_entry%3A%3A%5Btype%5D&labels=documentation&body=Documentation+under+heading+%22web_seed_entry%3A%3A%5Btype%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>type</dt>\n+<dd>The type of web seed (see <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>)</dd>\n+</dl>\n+<a name=\"load_torrent_limits\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+load_torrent_limits&labels=documentation&body=Documentation+under+heading+%22class+load_torrent_limits%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"load-torrent-limits\">\n+<h1>load_torrent_limits</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n+<p>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.</p>\n+<pre class=\"literal-block\">\n+struct load_torrent_limits\n+{\n+ int <strong>max_buffer_size</strong> = 10000000;\n+ int <strong>max_pieces</strong> = 0x200000;\n+ int <strong>max_decode_depth</strong> = 100;\n+ int <strong>max_decode_tokens</strong> = 3000000;\n+};\n+</pre>\n+<a name=\"max_buffer_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_buffer_size%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_buffer_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>max_buffer_size</dt>\n+<dd>the max size of a .torrent file to load into RAM</dd>\n+</dl>\n+<a name=\"max_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_pieces%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>max_pieces</dt>\n+<dd>the max number of pieces allowed in the torrent</dd>\n+</dl>\n+<a name=\"max_decode_depth\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_decode_depth%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_decode_depth%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>max_decode_depth</dt>\n+<dd>the max recursion depth in the bdecoded structure</dd>\n+</dl>\n+<a name=\"max_decode_tokens\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_limits%3A%3A%5Bmax_decode_tokens%5D&labels=documentation&body=Documentation+under+heading+%22load_torrent_limits%3A%3A%5Bmax_decode_tokens%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>max_decode_tokens</dt>\n+<dd>the max number of bdecode tokens</dd>\n+</dl>\n+<a name=\"torrent_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_info&labels=documentation&body=Documentation+under+heading+%22class+torrent_info%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-info\">\n+<h1>torrent_info</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_info.hpp\">libtorrent/torrent_info.hpp</a>"</p>\n+<p>the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> class holds the information found in a .torrent file.</p>\n+<pre class=\"literal-block\">\n+class torrent_info\n+{\n+ <strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n+ explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n+ <strong>torrent_info</strong> (char const* buffer, int size);\n+ <strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n+ <strong>torrent_info</strong> (torrent_info const& t);\n+ explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n+ explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n+ <strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n+ <strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+ explicit <strong>torrent_info</strong> (std::string const& filename);\n+ <strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n+ <strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+ <strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+ <strong>~torrent_info</strong> ();\n+ file_storage const& <strong>files</strong> () const;\n+ file_storage const& <strong>orig_files</strong> () const;\n+ void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n+ void <strong>remap_files</strong> (file_storage const& f);\n+ void <strong>add_tracker</strong> (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+ void <strong>clear_trackers</strong> ();\n+ void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n+ std::vector<announce_entry> const& <strong>trackers</strong> () const;\n+ std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n+ std::vector<std::string> <strong>collections</strong> () const;\n+ void <strong>add_url_seed</strong> (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+ std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n+ void <strong>add_http_seed</strong> (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+ void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n+ std::int64_t <strong>total_size</strong> () const;\n+ int <strong>num_pieces</strong> () const;\n+ int <strong>piece_length</strong> () const;\n+ int <strong>blocks_per_piece</strong> () const;\n+ piece_index_t <strong>end_piece</strong> () const;\n+ index_range<piece_index_t> <strong>piece_range</strong> () const;\n+ piece_index_t <strong>last_piece</strong> () const;\n+ info_hash_t const& <strong>info_hashes</strong> () const;\n+ sha1_hash <strong>info_hash</strong> () const noexcept;\n+ bool <strong>v1</strong> () const;\n+ bool <strong>v2</strong> () const;\n+ int <strong>num_files</strong> () const;\n+ std::vector<file_slice> <strong>map_block</strong> (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+ peer_request <strong>map_file</strong> (file_index_t const file, std::int64_t offset, int size) const;\n+ string_view <strong>ssl_cert</strong> () const;\n+ bool <strong>is_valid</strong> () const;\n+ bool <strong>priv</strong> () const;\n+ bool <strong>is_i2p</strong> () const;\n+ int <strong>piece_size</strong> (piece_index_t index) const;\n+ char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n+ sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n+ bool <strong>is_loaded</strong> () const;\n+ const std::string& <strong>name</strong> () const;\n+ std::time_t <strong>creation_date</strong> () const;\n+ const std::string& <strong>creator</strong> () const;\n+ const std::string& <strong>comment</strong> () const;\n+ std::vector<std::pair<std::string, int>> const& <strong>nodes</strong> () const;\n+ void <strong>add_node</strong> (std::pair<std::string, int> const& node);\n+ bool <strong>parse_info_section</strong> (bdecode_node const& info, error_code& ec, int max_pieces);\n+ bdecode_node <strong>info</strong> (char const* key) const;\n+ span<char const> <strong>info_section</strong> () const;\n+ span<char const> <strong>piece_layer</strong> (file_index_t) const;\n+ void <strong>free_piece_layers</strong> ();\n+};\n+</pre>\n+<a name=\"torrent_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Btorrent_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Btorrent_info%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"torrent-info-1\">\n+<h2>torrent_info()</h2>\n+<pre class=\"literal-block\">\n+<strong>torrent_info</strong> (char const* buffer, int size, error_code& ec);\n+explicit <strong>torrent_info</strong> (span<char const> buffer, from_span_t);\n+<strong>torrent_info</strong> (char const* buffer, int size);\n+<strong>torrent_info</strong> (std::string const& filename, error_code& ec);\n+<strong>torrent_info</strong> (torrent_info const& t);\n+explicit <strong>torrent_info</strong> (bdecode_node const& torrent_file);\n+explicit <strong>torrent_info</strong> (info_hash_t const& info_hash);\n+<strong>torrent_info</strong> (bdecode_node const& torrent_file, error_code& ec);\n+<strong>torrent_info</strong> (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+explicit <strong>torrent_info</strong> (std::string const& filename);\n+<strong>torrent_info</strong> (span<char const> buffer, error_code& ec, from_span_t);\n+<strong>torrent_info</strong> (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+<strong>torrent_info</strong> (std::string const& filename, load_torrent_limits const& cfg);\n+</pre>\n+<p>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.</p>\n+<p>The constructor that takes a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> will create a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n+object from the information found in the given torrent_file. The\n+<a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> represents a tree node in an bencoded file. To load an\n+ordinary .torrent file into a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>, use <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>.</p>\n+<p>The version that takes a buffer pointer and a size will decode it as a\n+.torrent file and initialize the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object for you.</p>\n+<p>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.</p>\n+<p>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.</p>\n+<p>The overloads that takes an <tt class=\"docutils literal\">error_code const&</tt> 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 <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n+<p>The overload that takes a <tt class=\"docutils literal\">span</tt> also needs an extra parameter of\n+type <tt class=\"docutils literal\">from_span_t</tt> to disambiguate the <tt class=\"docutils literal\"><span class=\"pre\">std::string</span></tt> overload for\n+string literals. There is an object in the libtorrent namespace of this\n+type called <tt class=\"docutils literal\">from_span</tt>.</p>\n+<a name=\"~torrent_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5B~torrent_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5B~torrent_info%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-info-2\">\n+<h2>~torrent_info()</h2>\n+<pre class=\"literal-block\">\n+<strong>~torrent_info</strong> ();\n+</pre>\n+<p>frees all storage associated with this <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object</p>\n+<a name=\"files()\"></a>\n+<a name=\"orig_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bfiles%28%29+orig_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bfiles%28%29+orig_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"files-orig-files\">\n+<h2>files() orig_files()</h2>\n+<pre class=\"literal-block\">\n+file_storage const& <strong>files</strong> () const;\n+file_storage const& <strong>orig_files</strong> () const;\n+</pre>\n+<p>The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object contains the information on how to map the\n+pieces to files. It is separated from the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> in order to make its\n+mapping differ from the one in the torrent file.</p>\n+<p><tt class=\"docutils literal\">orig_files()</tt> 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+<tt class=\"docutils literal\"><span class=\"pre\">torrent_info::rename_file()</span></tt>.</p>\n+<p>For more information on the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object, see the separate\n+document on how to create torrents.</p>\n+<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"rename-file\">\n+<h2>rename_file()</h2>\n+<pre class=\"literal-block\">\n+void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n+</pre>\n+<p>Renames the file with the specified index to the new name. The new\n+filename is reflected by the <tt class=\"docutils literal\">file_storage</tt> returned by <tt class=\"docutils literal\">files()</tt>\n+but not by the one returned by <tt class=\"docutils literal\">orig_files()</tt>.</p>\n+<p>If you want to rename the base name of the torrent (for a multi file\n+torrent), you can copy the <tt class=\"docutils literal\">file_storage</tt> (see <a class=\"reference external\" href=\"reference-Torrent_Info.html#files()\">files()</a> and\n+<a class=\"reference external\" href=\"reference-Torrent_Info.html#orig_files()\">orig_files()</a> ), change the name, and then use <a class=\"reference internal\" href=\"#remap-files\">remap_files()</a>.</p>\n+<p>The <tt class=\"docutils literal\">new_filename</tt> can both be a relative path, in which case the\n+file name is relative to the <tt class=\"docutils literal\">save_path</tt> of the torrent. If the\n+<tt class=\"docutils literal\">new_filename</tt> is an absolute path (i.e. <tt class=\"docutils literal\">is_complete(new_filename)\n+== true</tt>), then the file is detached from the <tt class=\"docutils literal\">save_path</tt> of the\n+torrent. In this case the file is not moved when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#move_storage()\">move_storage()</a> is\n+invoked.</p>\n+<a name=\"remap_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bremap_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bremap_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"remap-files\">\n+<h2>remap_files()</h2>\n+<pre class=\"literal-block\">\n+void <strong>remap_files</strong> (file_storage const& f);\n+</pre>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">Using <cite>remap_files()</cite> 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 <a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a>\n+to customize how to store files.</p>\n+</div>\n+<p>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.</p>\n+<p>The new specified <tt class=\"docutils literal\">file_storage</tt> must have the exact same size as\n+the current one.</p>\n+<a name=\"clear_trackers()\"></a>\n+<a name=\"add_tracker()\"></a>\n+<a name=\"trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bclear_trackers%28%29+add_tracker%28%29+trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bclear_trackers%28%29+add_tracker%28%29+trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-trackers-add-tracker-trackers\">\n+<h2>clear_trackers() add_tracker() trackers()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_tracker</strong> (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+void <strong>clear_trackers</strong> ();\n+void <strong>add_tracker</strong> (std::string const& url, int tier = 0);\n+std::vector<announce_entry> const& <strong>trackers</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">add_tracker()</tt> adds a tracker to the announce-list. The <tt class=\"docutils literal\">tier</tt>\n+determines the order in which the trackers are to be tried.\n+The <tt class=\"docutils literal\">trackers()</tt> function will return a sorted vector of\n+<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>. Each announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> 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 <a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n+<p><tt class=\"docutils literal\">trackers()</tt> returns all entries from announce-list.</p>\n+<p><tt class=\"docutils literal\">clear_trackers()</tt> removes all trackers from announce-list.</p>\n+<a name=\"collections()\"></a>\n+<a name=\"similar_torrents()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcollections%28%29+similar_torrents%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcollections%28%29+similar_torrents%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"collections-similar-torrents\">\n+<h2>collections() similar_torrents()</h2>\n+<pre class=\"literal-block\">\n+std::vector<sha1_hash> <strong>similar_torrents</strong> () const;\n+std::vector<std::string> <strong>collections</strong> () const;\n+</pre>\n+<p>These two functions are related to <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a> (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.</p>\n+<a name=\"add_url_seed()\"></a>\n+<a name=\"web_seeds()\"></a>\n+<a name=\"set_web_seeds()\"></a>\n+<a name=\"add_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_url_seed%28%29+web_seeds%28%29+set_web_seeds%28%29+add_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_url_seed%28%29+web_seeds%28%29+set_web_seeds%28%29+add_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-url-seed-web-seeds-set-web-seeds-add-http-seed\">\n+<h2>add_url_seed() web_seeds() set_web_seeds() add_http_seed()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_url_seed</strong> (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+std::vector<web_seed_entry> const& <strong>web_seeds</strong> () const;\n+void <strong>add_http_seed</strong> (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+void <strong>set_web_seeds</strong> (std::vector<web_seed_entry> seeds);\n+</pre>\n+<p><tt class=\"docutils literal\">web_seeds()</tt> returns all url seeds and http seeds in the torrent.\n+Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is a <tt class=\"docutils literal\">web_seed_entry</tt> and may refer to either a url seed\n+or http seed.</p>\n+<p><tt class=\"docutils literal\">add_url_seed()</tt> and <tt class=\"docutils literal\">add_http_seed()</tt> adds one url to the list of\n+url/http seeds.</p>\n+<p><tt class=\"docutils literal\">set_web_seeds()</tt> replaces all web seeds with the ones specified in\n+the <tt class=\"docutils literal\">seeds</tt> vector.</p>\n+<p>The <tt class=\"docutils literal\">extern_auth</tt> 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").</p>\n+<p>The <tt class=\"docutils literal\">extra_headers</tt> 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.</p>\n+<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n+<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"total-size-1\">\n+<h2>total_size()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>total_size</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">total_size()</tt> 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.</p>\n+<a name=\"piece_length()\"></a>\n+<a name=\"num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_length%28%29+num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_length%28%29+num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-length-num-pieces\">\n+<h2>piece_length() num_pieces()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_pieces</strong> () const;\n+int <strong>piece_length</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">piece_length()</tt> and <tt class=\"docutils literal\">num_pieces()</tt> returns the number of byte\n+for each piece and the total number of pieces, respectively. The\n+difference between <tt class=\"docutils literal\">piece_size()</tt> and <tt class=\"docutils literal\">piece_length()</tt> is that\n+<tt class=\"docutils literal\">piece_size()</tt> takes the piece index as argument and gives you the\n+exact size of that piece. It will always be the same as\n+<tt class=\"docutils literal\">piece_length()</tt> except in the case of the last piece, which may be\n+smaller.</p>\n+<a name=\"blocks_per_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bblocks_per_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bblocks_per_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"blocks-per-piece\">\n+<h2>blocks_per_piece()</h2>\n+<pre class=\"literal-block\">\n+int <strong>blocks_per_piece</strong> () const;\n+</pre>\n+<p>returns the number of blocks there are in the typical piece. There\n+may be fewer in the last piece)</p>\n+<a name=\"piece_range()\"></a>\n+<a name=\"last_piece()\"></a>\n+<a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_range%28%29+last_piece%28%29+end_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_range%28%29+last_piece%28%29+end_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-range-last-piece-end-piece\">\n+<h2>piece_range() last_piece() end_piece()</h2>\n+<pre class=\"literal-block\">\n+piece_index_t <strong>end_piece</strong> () const;\n+index_range<piece_index_t> <strong>piece_range</strong> () const;\n+piece_index_t <strong>last_piece</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">last_piece()</tt> returns the index to the last piece in the torrent and\n+<tt class=\"docutils literal\">end_piece()</tt> returns the index to the one-past-end piece in the\n+torrent\n+<tt class=\"docutils literal\">piece_range()</tt> 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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n+<a name=\"info_hashes()\"></a>\n+<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info-hashes-info-hash\">\n+<h2>info_hashes() info_hash()</h2>\n+<pre class=\"literal-block\">\n+info_hash_t const& <strong>info_hashes</strong> () const;\n+sha1_hash <strong>info_hash</strong> () const noexcept;\n+</pre>\n+<p>returns the info-hash of the torrent. For BitTorrent v2 support, use\n+<tt class=\"docutils literal\">info_hashes()</tt> to get an object that may hold both a v1 and v2\n+info-hash</p>\n+<a name=\"v1()\"></a>\n+<a name=\"v2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bv1%28%29+v2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"v1-v2\">\n+<h2>v1() v2()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>v1</strong> () const;\n+bool <strong>v2</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"num_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnum_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnum_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-files\">\n+<h2>num_files()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_files</strong> () const;\n+</pre>\n+<p>If you need index-access to files you can use the <tt class=\"docutils literal\">num_files()</tt> along\n+with the <tt class=\"docutils literal\">file_path()</tt>, <tt class=\"docutils literal\">file_size()</tt>-family of functions to access\n+files using indices.</p>\n+<a name=\"map_block()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bmap_block%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bmap_block%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"map-block\">\n+<h2>map_block()</h2>\n+<pre class=\"literal-block\">\n+std::vector<file_slice> <strong>map_block</strong> (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a>.</p>\n+<a name=\"map_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bmap_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bmap_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"map-file\">\n+<h2>map_file()</h2>\n+<pre class=\"literal-block\">\n+peer_request <strong>map_file</strong> (file_index_t const file, std::int64_t offset, int size) const;\n+</pre>\n+<p>This function will map a range in a specific file into a range in the\n+torrent. The <tt class=\"docutils literal\">file_offset</tt> parameter is the offset in the file,\n+given in bytes, where 0 is the start of the file. See <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a>.</p>\n+<p>The input range is assumed to be valid within the torrent.\n+<tt class=\"docutils literal\">file_offset</tt> + <tt class=\"docutils literal\">size</tt> is not allowed to be greater than the file\n+size. <tt class=\"docutils literal\">file_index</tt> must refer to a valid file, i.e. it cannot be >=\n+<tt class=\"docutils literal\">num_files()</tt>.</p>\n+<a name=\"ssl_cert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bssl_cert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bssl_cert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"ssl-cert\">\n+<h2>ssl_cert()</h2>\n+<pre class=\"literal-block\">\n+string_view <strong>ssl_cert</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-valid\">\n+<h2>is_valid()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_valid</strong> () const;\n+</pre>\n+<p>returns true if this <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n+<a name=\"priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpriv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpriv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"priv\">\n+<h2>priv()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>priv</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"is_i2p()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bis_i2p%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bis_i2p%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-i2p\">\n+<h2>is_i2p()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_i2p</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-size\">\n+<h2>piece_size()</h2>\n+<pre class=\"literal-block\">\n+int <strong>piece_size</strong> (piece_index_t index) const;\n+</pre>\n+<p>returns the piece size of file with <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Storage.html#piece_length()\">piece_length()</a>,\n+except for the last piece, which may be shorter.</p>\n+<a name=\"hash_for_piece_ptr()\"></a>\n+<a name=\"hash_for_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bhash_for_piece_ptr%28%29+hash_for_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bhash_for_piece_ptr%28%29+hash_for_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"hash-for-piece-ptr-hash-for-piece\">\n+<h2>hash_for_piece_ptr() hash_for_piece()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>hash_for_piece_ptr</strong> (piece_index_t const index) const;\n+sha1_hash <strong>hash_for_piece</strong> (piece_index_t index) const;\n+</pre>\n+<p><tt class=\"docutils literal\">hash_for_piece()</tt> takes a piece-index and returns the 20-bytes\n+sha1-hash for that piece and <tt class=\"docutils literal\">info_hash()</tt> returns the 20-bytes\n+sha1-hash for the info-section of the torrent file.\n+<tt class=\"docutils literal\">hash_for_piece_ptr()</tt> returns a pointer to the 20 byte sha1 digest\n+for the piece. Note that the string is not 0-terminated.</p>\n+<a name=\"name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bname%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bname%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"name\">\n+<h2>name()</h2>\n+<pre class=\"literal-block\">\n+const std::string& <strong>name</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">name()</tt> returns the name of the torrent.\n+name contains UTF-8 encoded string.</p>\n+<a name=\"creation_date()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcreation_date%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcreation_date%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"creation-date\">\n+<h2>creation_date()</h2>\n+<pre class=\"literal-block\">\n+std::time_t <strong>creation_date</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">creation_date()</tt> returns the creation date of the torrent as time_t\n+(<a class=\"reference internal\" href=\"#posix-time\">posix time</a>). If there's no time stamp in the torrent file, 0 is\n+returned.\n+.. <span class=\"target\" id=\"posix-time\">posix time</span>: <a class=\"reference external\" href=\"http://www.opengroup.org/onlinepubs/009695399/functions/time.html\">http://www.opengroup.org/onlinepubs/009695399/functions/time.html</a></p>\n+<a name=\"creator()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcreator%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcreator%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"creator\">\n+<h2>creator()</h2>\n+<pre class=\"literal-block\">\n+const std::string& <strong>creator</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">creator()</tt> returns the creator string in the torrent. If there is\n+no creator string it will return an empty string.</p>\n+<a name=\"comment()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bcomment%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bcomment%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"comment\">\n+<h2>comment()</h2>\n+<pre class=\"literal-block\">\n+const std::string& <strong>comment</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">comment()</tt> 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.</p>\n+<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bnodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bnodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"nodes\">\n+<h2>nodes()</h2>\n+<pre class=\"literal-block\">\n+std::vector<std::pair<std::string, int>> const& <strong>nodes</strong> () const;\n+</pre>\n+<p>If this torrent contains any DHT nodes, they are put in this vector in\n+their original form (host name and port number).</p>\n+<a name=\"add_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Badd_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Badd_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-node-1\">\n+<h2>add_node()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_node</strong> (std::pair<std::string, int> const& node);\n+</pre>\n+<p>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.</p>\n+<a name=\"parse_info_section()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bparse_info_section%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bparse_info_section%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"parse-info-section\">\n+<h2>parse_info_section()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>parse_info_section</strong> (bdecode_node const& info, error_code& ec, int max_pieces);\n+</pre>\n+<p>populates the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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 <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> <tt class=\"docutils literal\">e</tt> points to a\n+parsed info-dictionary. <tt class=\"docutils literal\">ec</tt> returns an error code if something\n+fails (typically if the info dictionary is malformed).\n+The <cite>max_pieces</cite> 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 <a class=\"reference external\" href=\"reference-Settings.html#max_piece_count\">settings_pack::max_piece_count</a> and in calls to\n+<a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a>.</p>\n+<a name=\"info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info\">\n+<h2>info()</h2>\n+<pre class=\"literal-block\">\n+bdecode_node <strong>info</strong> (char const* key) const;\n+</pre>\n+<p>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.</p>\n+<a name=\"info_section()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Binfo_section%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Binfo_section%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info-section\">\n+<h2>info_section()</h2>\n+<pre class=\"literal-block\">\n+span<char const> <strong>info_section</strong> () const;\n+</pre>\n+<p>returns a the raw info section of the torrent file.\n+The underlying buffer is still owned by the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object</p>\n+<a name=\"piece_layer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bpiece_layer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bpiece_layer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-layer\">\n+<h2>piece_layer()</h2>\n+<pre class=\"literal-block\">\n+span<char const> <strong>piece_layer</strong> (file_index_t) const;\n+</pre>\n+<p>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.</p>\n+<a name=\"free_piece_layers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_info%3A%3A%5Bfree_piece_layers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_info%3A%3A%5Bfree_piece_layers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"free-piece-layers\">\n+<h2>free_piece_layers()</h2>\n+<pre class=\"literal-block\">\n+void <strong>free_piece_layers</strong> ();\n+</pre>\n+<p>clears the piece layers from the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>. This is done by the\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n+<a name=\"ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+ip_filter&labels=documentation&body=Documentation+under+heading+%22class+ip_filter%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"ip-filter\">\n+<h1>ip_filter</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">ip_filter</tt> 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).</p>\n+<p>A default constructed <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a> does not filter any address.</p>\n+<pre class=\"literal-block\">\n+struct ip_filter\n+{\n+ <strong>ip_filter</strong> ();\n+ ip_filter& <strong>operator=</strong> (ip_filter const&);\n+ <strong>ip_filter</strong> (ip_filter const&);\n+ <strong>ip_filter</strong> (ip_filter&&);\n+ ip_filter& <strong>operator=</strong> (ip_filter&&);\n+ <strong>~ip_filter</strong> ();\n+ bool <strong>empty</strong> () const;\n+ void <strong>add_rule</strong> (address const& first, address const& last, std::uint32_t flags);\n+ std::uint32_t <strong>access</strong> (address const& addr) const;\n+ filter_tuple_t <strong>export_filter</strong> () const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n+</pre>\n+<a name=\"empty()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Bempty%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Bempty%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"empty\">\n+<h2>empty()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>empty</strong> () const;\n+</pre>\n+<p>returns true if the filter does not contain any rules</p>\n+<a name=\"add_rule()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Badd_rule%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Badd_rule%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-rule\">\n+<h2>add_rule()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_rule</strong> (address const& first, address const& last, std::uint32_t flags);\n+</pre>\n+<p>Adds a rule to the filter. <tt class=\"docutils literal\">first</tt> and <tt class=\"docutils literal\">last</tt> defines a range of\n+ip addresses that will be marked with the given flags. The <tt class=\"docutils literal\">flags</tt>\n+can currently be 0, which means allowed, or <tt class=\"docutils literal\"><span class=\"pre\">ip_filter::blocked</span></tt>, which\n+means disallowed.</p>\n+<p>precondition:\n+<tt class=\"docutils literal\">first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()</tt></p>\n+<p>postcondition:\n+<tt class=\"docutils literal\">access(x) == flags</tt> for every <tt class=\"docutils literal\">x</tt> in the range [<tt class=\"docutils literal\">first</tt>, <tt class=\"docutils literal\">last</tt>]</p>\n+<p>This means that in a case of overlapping ranges, the last one applied takes\n+precedence.</p>\n+<a name=\"access()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Baccess%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Baccess%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"access\">\n+<h2>access()</h2>\n+<pre class=\"literal-block\">\n+std::uint32_t <strong>access</strong> (address const& addr) const;\n+</pre>\n+<p>Returns the access permissions for the given address (<tt class=\"docutils literal\">addr</tt>). The permission\n+can currently be 0 or <tt class=\"docutils literal\"><span class=\"pre\">ip_filter::blocked</span></tt>. The complexity of this operation\n+is O(<tt class=\"docutils literal\">log</tt> n), where n is the minimum number of non-overlapping ranges to describe\n+the current filter.</p>\n+<a name=\"export_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ip_filter%3A%3A%5Bexport_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22ip_filter%3A%3A%5Bexport_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"export-filter\">\n+<h2>export_filter()</h2>\n+<pre class=\"literal-block\">\n+filter_tuple_t <strong>export_filter</strong> () const;\n+</pre>\n+<p>This function will return the current state of the filter in the minimum number of\n+ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n+<a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in the returned vector is a range with the access control specified in its\n+<tt class=\"docutils literal\">flags</tt> field.</p>\n+<p>The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.</p>\n+<a name=\"access_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+access_flags&labels=documentation&body=Documentation+under+heading+%22enum+access_flags%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-access-flags\">\n+<h2>enum access_flags</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n+<col width=\"12%\" />\n+<col width=\"9%\" />\n+<col width=\"78%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>max_allowed_in_request_queue</td>\n-<td>int</td>\n-<td>2000</td>\n+<tr><td>blocked</td>\n+<td>1</td>\n+<td>indicates that IPs in this range should not be connected\n+to nor accepted as incoming connections</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"max_out_request_queue\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"port_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+port_filter&labels=documentation&body=Documentation+under+heading+%22class+port_filter%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"port-filter\">\n+<h1>port_filter</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n+<p>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.</p>\n+<pre class=\"literal-block\">\n+class port_filter\n+{\n+ <strong>port_filter</strong> (port_filter const&);\n+ <strong>~port_filter</strong> ();\n+ port_filter& <strong>operator=</strong> (port_filter const&);\n+ port_filter& <strong>operator=</strong> (port_filter&&);\n+ <strong>port_filter</strong> (port_filter&&);\n+ <strong>port_filter</strong> ();\n+ void <strong>add_rule</strong> (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+ std::uint32_t <strong>access</strong> (std::uint16_t port) const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n+</pre>\n+<a name=\"add_rule()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:port_filter%3A%3A%5Badd_rule%28%29%5D&labels=documentation&body=Documentation+under+heading+%22port_filter%3A%3A%5Badd_rule%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"add-rule-1\">\n+<h2>add_rule()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_rule</strong> (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+</pre>\n+<p>set the flags for the specified port range (<tt class=\"docutils literal\">first</tt>, <tt class=\"docutils literal\">last</tt>) to\n+<tt class=\"docutils literal\">flags</tt> overwriting any existing rule for those ports. The range\n+is inclusive, i.e. the port <tt class=\"docutils literal\">last</tt> also has the flag set on it.</p>\n+<a name=\"access()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:port_filter%3A%3A%5Baccess%28%29%5D&labels=documentation&body=Documentation+under+heading+%22port_filter%3A%3A%5Baccess%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"access-1\">\n+<h2>access()</h2>\n+<pre class=\"literal-block\">\n+std::uint32_t <strong>access</strong> (std::uint16_t port) const;\n+</pre>\n+<p>test the specified port (<tt class=\"docutils literal\">port</tt>) for whether it is blocked\n+or not. The returned value is the flags set for this port.\n+see <a class=\"reference external\" href=\"reference-Filter.html#access_flags\">access_flags</a>.</p>\n+<a name=\"access_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+access_flags&labels=documentation&body=Documentation+under+heading+%22enum+access_flags%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-access-flags-1\">\n+<h2>enum access_flags</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/ip_filter.hpp\">libtorrent/ip_filter.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n+<col width=\"13%\" />\n+<col width=\"10%\" />\n+<col width=\"76%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>max_out_request_queue</td>\n-<td>int</td>\n-<td>500</td>\n+<tr><td>blocked</td>\n+<td>1</td>\n+<td>this flag indicates that destination ports in the\n+range should not be connected to</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">max_out_request_queue</tt> is the maximum number of outstanding\n-requests to send to a peer. This limit takes precedence over\n-<tt class=\"docutils literal\">request_queue_time</tt>. i.e. no matter the download speed, the\n-number of outstanding requests will never exceed this limit.</p>\n-<a name=\"whole_pieces_threshold\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"block_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_info&labels=documentation&body=Documentation+under+heading+%22class+block_info%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"block-info\">\n+<h1>block_info</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n+<p>holds the state of a block in a piece. Who we requested\n+it from and how far along we are at downloading it.</p>\n+<pre class=\"literal-block\">\n+struct block_info\n+{\n+ void <strong>set_peer</strong> (tcp::endpoint const& ep);\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () 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+</pre>\n+<a name=\"peer()\"></a>\n+<a name=\"set_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bpeer%28%29+set_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bpeer%28%29+set_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"peer-set-peer\">\n+<h2>peer() set_peer()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_peer</strong> (tcp::endpoint const& ep);\n+<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> <strong>peer</strong> () const;\n+</pre>\n+<p>The peer is the ip address of the peer this block was downloaded from.</p>\n+<a name=\"block_state_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+block_state_t&labels=documentation&body=Documentation+under+heading+%22enum+block_state_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-block-state-t\">\n+<h2>enum block_state_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"13%\" />\n+<col width=\"8%\" />\n+<col width=\"79%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>whole_pieces_threshold</td>\n-<td>int</td>\n-<td>20</td>\n+<tr><td>none</td>\n+<td>0</td>\n+<td>This block has not been downloaded or requested form any peer.</td>\n+</tr>\n+<tr><td>requested</td>\n+<td>1</td>\n+<td>The block has been requested, but not completely downloaded yet.</td>\n+</tr>\n+<tr><td>writing</td>\n+<td>2</td>\n+<td>The block has been downloaded and is currently queued for being\n+written to disk.</td>\n+</tr>\n+<tr><td>finished</td>\n+<td>3</td>\n+<td>The block has been written to disk.</td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"peer_timeout\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"bytes_progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bbytes_progress%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bbytes_progress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>bytes_progress</dt>\n+<dd>the number of bytes that have been received for this block</dd>\n+</dl>\n+<a name=\"block_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bblock_size%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bblock_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>block_size</dt>\n+<dd>the total number of bytes in this block.</dd>\n+</dl>\n+<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>state</dt>\n+<dd>the state this block is in (see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_state_t\">block_state_t</a>)</dd>\n+</dl>\n+<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:block_info%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22block_info%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_peers</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"partial_piece_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+partial_piece_info&labels=documentation&body=Documentation+under+heading+%22class+partial_piece_info%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"partial-piece-info\">\n+<h1>partial_piece_info</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n+<p>This class holds information about pieces that have outstanding requests\n+or outstanding writes</p>\n+<pre class=\"literal-block\">\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+</pre>\n+<a name=\"piece_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bpiece_index%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bpiece_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_index</dt>\n+<dd>the index of the piece in question. <tt class=\"docutils literal\">blocks_in_piece</tt> 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.</dd>\n+</dl>\n+<a name=\"blocks_in_piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bblocks_in_piece%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bblocks_in_piece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>blocks_in_piece</dt>\n+<dd>the number of blocks in this piece</dd>\n+</dl>\n+<a name=\"finished\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bfinished%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bfinished%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>finished</dt>\n+<dd>the number of blocks that are in the finished state</dd>\n+</dl>\n+<a name=\"writing\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bwriting%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bwriting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>writing</dt>\n+<dd>the number of blocks that are in the writing state</dd>\n+</dl>\n+<a name=\"requested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Brequested%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Brequested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>requested</dt>\n+<dd>the number of blocks that are in the requested state</dd>\n+</dl>\n+<a name=\"blocks\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:partial_piece_info%3A%3A%5Bblocks%5D&labels=documentation&body=Documentation+under+heading+%22partial_piece_info%3A%3A%5Bblocks%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>blocks</dt>\n+<dd><p class=\"first\">this is an array of <tt class=\"docutils literal\">blocks_in_piece</tt> number of\n+items. One for each block in the piece.</p>\n+<div class=\"admonition warning last\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">This is a pointer that points to an array\n+that's owned by the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. The next time\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_download_queue()\">get_download_queue()</a> is called, it will be invalidated.\n+In the case of <a class=\"reference external\" href=\"reference-Alerts.html#piece_info_alert\">piece_info_alert</a>, these pointers point into the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+object itself, and will be invalidated when the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> destruct.</p>\n+</div>\n+</dd>\n+</dl>\n+<a name=\"torrent_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_handle&labels=documentation&body=Documentation+under+heading+%22class+torrent_handle%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-handle\">\n+<h1>torrent_handle</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n+<p>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.</p>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">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+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a> call.</p>\n+</div>\n+<p>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 <tt class=\"docutils literal\">invalid_handle</tt>.</p>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">All operations on a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> may throw system_error\n+exception, in case the handle is no longer referring to a torrent.\n+There is one exception <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> 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.</p>\n+</div>\n+<pre class=\"literal-block\">\n+struct torrent_handle\n+{\n+ friend std::size_t <strong>hash_value</strong> (torrent_handle const& th);\n+ <strong>torrent_handle</strong> () noexcept = default;\n+ void <strong>add_piece</strong> (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n+ void <strong>add_piece</strong> (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+ void <strong>read_piece</strong> (piece_index_t piece) const;\n+ bool <strong>have_piece</strong> (piece_index_t piece) const;\n+ void <strong>post_peer_info</strong> () const;\n+ void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n+ torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n+ void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n+ std::vector<partial_piece_info> <strong>get_download_queue</strong> () const;\n+ void <strong>post_download_queue</strong> () const;\n+ void <strong>get_download_queue</strong> (std::vector<partial_piece_info>& queue) const;\n+ void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n+ void <strong>clear_piece_deadlines</strong> () const;\n+ void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n+ void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n+ std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n+ void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n+ std::vector<open_file_state> <strong>file_status</strong> () const;\n+ void <strong>clear_error</strong> () const;\n+ void <strong>post_trackers</strong> () const;\n+ void <strong>add_tracker</strong> (announce_entry const&) const;\n+ std::vector<announce_entry> <strong>trackers</strong> () const;\n+ void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n+ void <strong>remove_url_seed</strong> (std::string const& url) const;\n+ std::set<std::string> <strong>url_seeds</strong> () const;\n+ void <strong>add_url_seed</strong> (std::string const& url) const;\n+ void <strong>remove_http_seed</strong> (std::string const& url) const;\n+ std::set<std::string> <strong>http_seeds</strong> () const;\n+ void <strong>add_http_seed</strong> (std::string const& url) const;\n+ void <strong>add_extension</strong> (\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 <strong>set_metadata</strong> (span<char const> metadata) const;\n+ bool <strong>is_valid</strong> () const;\n+ void <strong>resume</strong> () const;\n+ void <strong>pause</strong> (pause_flags_t flags = {}) const;\n+ void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n+ void <strong>set_flags</strong> (torrent_flags_t flags) const;\n+ void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n+ torrent_flags_t <strong>flags</strong> () const;\n+ void <strong>flush_cache</strong> () const;\n+ void <strong>force_recheck</strong> () const;\n+ void <strong>save_resume_data</strong> (resume_data_flags_t flags = {}) const;\n+ bool <strong>need_save_resume_data</strong> (resume_data_flags_t flags) const;\n+ bool <strong>need_save_resume_data</strong> () const;\n+ void <strong>queue_position_bottom</strong> () const;\n+ void <strong>queue_position_top</strong> () const;\n+ void <strong>queue_position_down</strong> () const;\n+ queue_position_t <strong>queue_position</strong> () const;\n+ void <strong>queue_position_up</strong> () const;\n+ void <strong>queue_position_set</strong> (queue_position_t p) const;\n+ void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n+ void <strong>set_ssl_certificate</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params\n+ , std::string const& passphrase = "");\n+ std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n+ std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n+ std::vector<std::vector<sha256_hash>> <strong>piece_layers</strong> () const;\n+ void <strong>post_piece_availability</strong> () const;\n+ void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n+ void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n+ download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n+ void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n+ void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+ std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n+ download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n+ void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n+ void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n+ std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n+ void <strong>force_lsd_announce</strong> () const;\n+ void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+ void <strong>force_dht_announce</strong> () const;\n+ void <strong>scrape_tracker</strong> (int idx = -1) const;\n+ void <strong>set_upload_limit</strong> (int limit) const;\n+ void <strong>set_download_limit</strong> (int limit) const;\n+ int <strong>upload_limit</strong> () const;\n+ int <strong>download_limit</strong> () const;\n+ void <strong>connect_peer</strong> (tcp::endpoint const& adr, peer_source_flags_t source = {}\n+ , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n+ void <strong>clear_peers</strong> ();\n+ void <strong>set_max_uploads</strong> (int max_uploads) const;\n+ int <strong>max_uploads</strong> () const;\n+ int <strong>max_connections</strong> () const;\n+ void <strong>set_max_connections</strong> (int max_connections) const;\n+ void <strong>move_storage</strong> (std::string const& save_path\n+ , move_flags_t flags = move_flags_t::always_replace_files\n+ ) const;\n+ void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n+ info_hash_t <strong>info_hashes</strong> () const;\n+ sha1_hash <strong>info_hash</strong> () const;\n+ bool <strong>operator<</strong> (const torrent_handle& h) const;\n+ bool <strong>operator==</strong> (const torrent_handle& h) const;\n+ bool <strong>operator!=</strong> (const torrent_handle& h) const;\n+ std::uint32_t <strong>id</strong> () const;\n+ std::shared_ptr<torrent> <strong>native_handle</strong> () const;\n+ client_data_t <strong>userdata</strong> () const;\n+ bool <strong>in_session</strong> () const;\n+\n+ static constexpr add_piece_flags_t <strong>overwrite_existing</strong> = 0_bit;\n+ static constexpr status_flags_t <strong>query_distributed_copies</strong> = 0_bit;\n+ static constexpr status_flags_t <strong>query_accurate_download_counters</strong> = 1_bit;\n+ static constexpr status_flags_t <strong>query_last_seen_complete</strong> = 2_bit;\n+ static constexpr status_flags_t <strong>query_pieces</strong> = 3_bit;\n+ static constexpr status_flags_t <strong>query_verified_pieces</strong> = 4_bit;\n+ static constexpr status_flags_t <strong>query_torrent_file</strong> = 5_bit;\n+ static constexpr status_flags_t <strong>query_name</strong> = 6_bit;\n+ static constexpr status_flags_t <strong>query_save_path</strong> = 7_bit;\n+ static constexpr deadline_flags_t <strong>alert_when_available</strong> = 0_bit;\n+ static constexpr file_progress_flags_t <strong>piece_granularity</strong> = 0_bit;\n+ static constexpr pause_flags_t <strong>graceful_pause</strong> = 0_bit;\n+ static constexpr resume_data_flags_t <strong>flush_disk_cache</strong> = 0_bit;\n+ static constexpr resume_data_flags_t <strong>save_info_dict</strong> = 1_bit;\n+ static constexpr resume_data_flags_t <strong>only_if_modified</strong> = 2_bit;\n+ static constexpr resume_data_flags_t <strong>if_counters_changed</strong> = 3_bit;\n+ static constexpr resume_data_flags_t <strong>if_download_progress</strong> = 4_bit;\n+ static constexpr resume_data_flags_t <strong>if_config_changed</strong> = 5_bit;\n+ static constexpr resume_data_flags_t <strong>if_state_changed</strong> = 6_bit;\n+ static constexpr resume_data_flags_t <strong>if_metadata_changed</strong> = 7_bit;\n+ static constexpr reannounce_flags_t <strong>ignore_min_interval</strong> = 0_bit;\n+};\n+</pre>\n+<a name=\"torrent_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"torrent-handle-1\">\n+<h2>torrent_handle()</h2>\n+<pre class=\"literal-block\">\n+<strong>torrent_handle</strong> () noexcept = default;\n+</pre>\n+<p>constructs a torrent handle that does not refer to a torrent.\n+i.e. <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> will return false.</p>\n+<a name=\"add_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-piece\">\n+<h2>add_piece()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_piece</strong> (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n+void <strong>add_piece</strong> (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+</pre>\n+<p>This function will write <tt class=\"docutils literal\">data</tt> to the storage as piece <tt class=\"docutils literal\">piece</tt>,\n+as if it had been downloaded from a peer.</p>\n+<p>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.</p>\n+<p>Since the data is written asynchronously, you may know that is passed\n+or failed the hash check by waiting for <a class=\"reference external\" href=\"reference-Alerts.html#piece_finished_alert\">piece_finished_alert</a> or\n+<a class=\"reference external\" href=\"reference-Alerts.html#hash_failed_alert\">hash_failed_alert</a>.</p>\n+<p>Adding pieces while the torrent is being checked (i.e. in\n+<a class=\"reference external\" href=\"reference-Torrent_Status.html#checking_files\">torrent_status::checking_files</a> state) is not supported.</p>\n+<p>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. <tt class=\"docutils literal\">data</tt> is expected to point to a buffer of as\n+many bytes as the size of the specified piece. See\n+<a class=\"reference external\" href=\"reference-Storage.html#piece_size()\">file_storage::piece_size()</a>.</p>\n+<p>The data in the buffer is copied and passed on to the disk IO thread\n+to be written at a later point.</p>\n+<p>The overload taking a <tt class=\"docutils literal\"><span class=\"pre\">std::vector<char></span></tt> is not blocking, it will\n+send the buffer to the main thread and return immediately.</p>\n+<a name=\"read_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bread_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bread_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"read-piece\">\n+<h2>read_piece()</h2>\n+<pre class=\"literal-block\">\n+void <strong>read_piece</strong> (piece_index_t piece) const;\n+</pre>\n+<p>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.</p>\n+<p>When the read operation is completed, it is passed back through an\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, <a class=\"reference external\" href=\"reference-Alerts.html#read_piece_alert\">read_piece_alert</a>. Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit\n+call, it will always be posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n+<p>Note that if you read multiple pieces, the read operations are not\n+guaranteed to finish in the same order as you initiated them.</p>\n+<a name=\"have_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bhave_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bhave_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"have-piece\">\n+<h2>have_piece()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>have_piece</strong> (piece_index_t piece) const;\n+</pre>\n+<p>Returns true if this piece has been completely downloaded and written\n+to disk, and false otherwise.</p>\n+<a name=\"get_peer_info()\"></a>\n+<a name=\"post_peer_info()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_peer_info%28%29+post_peer_info%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_peer_info%28%29+post_peer_info%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-peer-info-post-peer-info\">\n+<h2>get_peer_info() post_peer_info()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_peer_info</strong> () const;\n+void <strong>get_peer_info</strong> (std::vector<peer_info>& v) const;\n+</pre>\n+<p>Query information about connected peers for this torrent. If the\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw a system_error exception.</p>\n+<p><tt class=\"docutils literal\">post_peer_info()</tt> is asynchronous and will trigger the posting of\n+a <a class=\"reference external\" href=\"reference-Alerts.html#peer_info_alert\">peer_info_alert</a>. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> contain a list of <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a> objects, one\n+for each connected peer.</p>\n+<p><tt class=\"docutils literal\">get_peer_info()</tt> is synchronous and takes a reference to a vector\n+that will be cleared and filled with one <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> for each peer\n+connected to this torrent, given the handle is valid. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> in\n+the vector contains information about that particular peer. See\n+<a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a>.</p>\n+<a name=\"post_status()\"></a>\n+<a name=\"status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_status%28%29+status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-status-status\">\n+<h2>post_status() status()</h2>\n+<pre class=\"literal-block\">\n+torrent_status <strong>status</strong> (status_flags_t flags = status_flags_t::all()) const;\n+void <strong>post_status</strong> (status_flags_t flags = status_flags_t::all()) const;\n+</pre>\n+<p><tt class=\"docutils literal\">status()</tt> will return a structure with information about the status\n+of this torrent. If the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is invalid, it will throw\n+system_error exception. See <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>. The <tt class=\"docutils literal\">flags</tt>\n+argument filters what information is returned in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.\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.</p>\n+<p>The <tt class=\"docutils literal\">status()</tt> function will block until the internal libtorrent\n+thread responds with the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object. To avoid blocking,\n+instead call <tt class=\"docutils literal\">post_status()</tt>. It will trigger posting of a\n+<a class=\"reference external\" href=\"reference-Alerts.html#state_update_alert\">state_update_alert</a> with a single <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object for this\n+torrent.</p>\n+<p>In order to get regular updates for torrents whose status changes,\n+consider calling session::post_torrent_updates()`` instead.</p>\n+<p>By default everything is included. The flags you can use to decide\n+what to <em>include</em> are defined in this class.</p>\n+<a name=\"post_download_queue()\"></a>\n+<a name=\"get_download_queue()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_download_queue%28%29+get_download_queue%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_download_queue%28%29+get_download_queue%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-download-queue-get-download-queue\">\n+<h2>post_download_queue() get_download_queue()</h2>\n+<pre class=\"literal-block\">\n+std::vector<partial_piece_info> <strong>get_download_queue</strong> () const;\n+void <strong>post_download_queue</strong> () const;\n+void <strong>get_download_queue</strong> (std::vector<partial_piece_info>& queue) const;\n+</pre>\n+<p><tt class=\"docutils literal\">post_download_queue()</tt> triggers a download_queue_alert to be\n+posted.\n+<tt class=\"docutils literal\">get_download_queue()</tt> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a> for the\n+fields in the returned vector.</p>\n+<a name=\"set_piece_deadline()\"></a>\n+<a name=\"reset_piece_deadline()\"></a>\n+<a name=\"clear_piece_deadlines()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_piece_deadline%28%29+reset_piece_deadline%28%29+clear_piece_deadlines%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_piece_deadline%28%29+reset_piece_deadline%28%29+clear_piece_deadlines%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-piece-deadline-reset-piece-deadline-clear-piece-deadlines\">\n+<h2>set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reset_piece_deadline</strong> (piece_index_t index) const;\n+void <strong>clear_piece_deadlines</strong> () const;\n+void <strong>set_piece_deadline</strong> (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n+</pre>\n+<p>This function sets or resets the deadline associated with a specific\n+piece index (<tt class=\"docutils literal\">index</tt>). 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.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#read_piece()\">read_piece()</a> for <tt class=\"docutils literal\">index</tt>.</p>\n+<p><tt class=\"docutils literal\">deadline</tt> is the number of milliseconds until this piece should be\n+completed.</p>\n+<p><tt class=\"docutils literal\">reset_piece_deadline</tt> removes the deadline from the piece. If it\n+hasn't already been downloaded, it will no longer be considered a\n+priority.</p>\n+<p><tt class=\"docutils literal\">clear_piece_deadlines()</tt> removes deadlines on all pieces in\n+the torrent. As if <a class=\"reference external\" href=\"reference-Torrent_Handle.html#reset_piece_deadline()\">reset_piece_deadline()</a> was called on all pieces.</p>\n+<a name=\"file_progress()\"></a>\n+<a name=\"post_file_progress()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_progress%28%29+post_file_progress%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-progress-post-file-progress\">\n+<h2>file_progress() post_file_progress()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_file_progress</strong> (file_progress_flags_t flags) const;\n+std::vector<std::int64_t> <strong>file_progress</strong> (file_progress_flags_t flags = {}) const;\n+void <strong>file_progress</strong> (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n+</pre>\n+<p>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+<a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>.</p>\n+<p>This operation is not very cheap. Its complexity is <em>O(n + mj)</em>.\n+Where <em>n</em> is the number of files, <em>m</em> is the number of currently\n+downloading pieces and <em>j</em> is the number of blocks in a piece.</p>\n+<p>The <tt class=\"docutils literal\">flags</tt> 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+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::piece_granularity</span></tt> 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.</p>\n+<a name=\"file_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bfile_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bfile_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-status\">\n+<h2>file_status()</h2>\n+<pre class=\"literal-block\">\n+std::vector<open_file_state> <strong>file_status</strong> () const;\n+</pre>\n+<p>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.</p>\n+<p>See <a class=\"reference external\" href=\"reference-Custom_Storage.html#open_file_state\">open_file_state</a></p>\n+<a name=\"clear_error()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_error%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_error%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-error\">\n+<h2>clear_error()</h2>\n+<pre class=\"literal-block\">\n+void <strong>clear_error</strong> () const;\n+</pre>\n+<p>If the torrent is in an error state (i.e. <tt class=\"docutils literal\"><span class=\"pre\">torrent_status::error</span></tt> is\n+non-empty), this will clear the error and start the torrent again.</p>\n+<a name=\"add_tracker()\"></a>\n+<a name=\"replace_trackers()\"></a>\n+<a name=\"trackers()\"></a>\n+<a name=\"post_trackers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_tracker%28%29+replace_trackers%28%29+trackers%28%29+post_trackers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-tracker-replace-trackers-trackers-post-trackers\">\n+<h2>add_tracker() replace_trackers() trackers() post_trackers()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_trackers</strong> () const;\n+void <strong>add_tracker</strong> (announce_entry const&) const;\n+std::vector<announce_entry> <strong>trackers</strong> () const;\n+void <strong>replace_trackers</strong> (std::vector<announce_entry> const&) const;\n+</pre>\n+<p><tt class=\"docutils literal\">trackers()</tt> returns the list of trackers for this torrent. The\n+announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> contains both a string <tt class=\"docutils literal\">url</tt> which specify the\n+announce url for the tracker as well as an <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> <tt class=\"docutils literal\">tier</tt>, 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 <tt class=\"docutils literal\">replace_trackers()</tt> which takes a list of the same form as the\n+one returned from <tt class=\"docutils literal\">trackers()</tt> and will replace it. If you want an\n+immediate effect, you have to call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#force_reannounce()\">force_reannounce()</a>. See\n+<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n+<p><tt class=\"docutils literal\">post_trackers()</tt> is the asynchronous version of <tt class=\"docutils literal\">trackers()</tt>. It\n+will trigger a <a class=\"reference external\" href=\"reference-Alerts.html#tracker_list_alert\">tracker_list_alert</a> to be posted.</p>\n+<p><tt class=\"docutils literal\">add_tracker()</tt> 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+<a class=\"reference external\" href=\"reference-Trackers.html#announce_entry\">announce_entry</a>.</p>\n+<p>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.</p>\n+<a name=\"remove_url_seed()\"></a>\n+<a name=\"add_url_seed()\"></a>\n+<a name=\"url_seeds()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bremove_url_seed%28%29+add_url_seed%28%29+url_seeds%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bremove_url_seed%28%29+add_url_seed%28%29+url_seeds%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"remove-url-seed-add-url-seed-url-seeds\">\n+<h2>remove_url_seed() add_url_seed() url_seeds()</h2>\n+<pre class=\"literal-block\">\n+void <strong>remove_url_seed</strong> (std::string const& url) const;\n+std::set<std::string> <strong>url_seeds</strong> () const;\n+void <strong>add_url_seed</strong> (std::string const& url) const;\n+</pre>\n+<p><tt class=\"docutils literal\">add_url_seed()</tt> 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+<tt class=\"docutils literal\">remove_url_seed()</tt> removes the given url if it exists already.\n+<tt class=\"docutils literal\">url_seeds()</tt> 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.</p>\n+<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n+<a name=\"http_seeds()\"></a>\n+<a name=\"remove_http_seed()\"></a>\n+<a name=\"add_http_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bhttp_seeds%28%29+remove_http_seed%28%29+add_http_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bhttp_seeds%28%29+remove_http_seed%28%29+add_http_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"http-seeds-remove-http-seed-add-http-seed\">\n+<h2>http_seeds() remove_http_seed() add_http_seed()</h2>\n+<pre class=\"literal-block\">\n+void <strong>remove_http_seed</strong> (std::string const& url) const;\n+std::set<std::string> <strong>http_seeds</strong> () const;\n+void <strong>add_http_seed</strong> (std::string const& url) const;\n+</pre>\n+<p>These functions are identical as the <tt class=\"docutils literal\">*_url_seed()</tt> variants, but\n+they operate on <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> web seeds instead of <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a>.</p>\n+<p>See <a class=\"reference external\" href=\"manual-ref.html#http-seeding\">http seeding</a> for more information.</p>\n+<a name=\"add_extension()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Badd_extension%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Badd_extension%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-extension\">\n+<h2>add_extension()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_extension</strong> (\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+</pre>\n+<p>add the specified extension to this torrent. The <tt class=\"docutils literal\">ext</tt> 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 <a class=\"reference external\" href=\"reference-Plugins.html#torrent_plugin\">torrent_plugin</a> instance.</p>\n+<a name=\"set_metadata()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_metadata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_metadata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-metadata\">\n+<h2>set_metadata()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>set_metadata</strong> (span<char const> metadata) const;\n+</pre>\n+<p><tt class=\"docutils literal\">set_metadata</tt> expects the <em>info</em> section of metadata. i.e. The\n+buffer passed in will be hashed and verified against the info-hash. If\n+it fails, a <tt class=\"docutils literal\">metadata_failed_alert</tt> will be generated. If it passes,\n+a <tt class=\"docutils literal\">metadata_received_alert</tt> 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.</p>\n+<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-valid-1\">\n+<h2>is_valid()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_valid</strong> () const;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> AND destructed.</p>\n+<p>To tell if the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, use\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#in_session()\">torrent_handle::in_session()</a>. This will return true before\n+<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">session_handle::remove_torrent()</a> is called, and false\n+afterward.</p>\n+<p>Clients should only use <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> to determine if the result of\n+session::find_torrent() was successful.</p>\n+<p>Unlike other member functions which return a value, <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a>\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.</p>\n+<a name=\"pause()\"></a>\n+<a name=\"resume()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpause%28%29+resume%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpause%28%29+resume%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"pause-resume\">\n+<h2>pause() resume()</h2>\n+<pre class=\"literal-block\">\n+void <strong>resume</strong> () const;\n+void <strong>pause</strong> (pause_flags_t flags = {}) const;\n+</pre>\n+<p><tt class=\"docutils literal\">pause()</tt>, and <tt class=\"docutils literal\">resume()</tt> 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+<a class=\"reference external\" href=\"reference-Alerts.html#file_error_alert\">file_error_alert</a>.</p>\n+<p>For possible values of the <tt class=\"docutils literal\">flags</tt> parameter, see pause_flags_t.</p>\n+<p>To know if a torrent is paused or not, call\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flags()</span></tt> and check for the\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_status::paused</span></tt> flag.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information, see <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n+</div>\n+<a name=\"set_flags()\"></a>\n+<a name=\"unset_flags()\"></a>\n+<a name=\"flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_flags%28%29+unset_flags%28%29+flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_flags%28%29+unset_flags%28%29+flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-flags-unset-flags-flags\">\n+<h2>set_flags() unset_flags() flags()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_flags</strong> (torrent_flags_t flags, torrent_flags_t mask) const;\n+void <strong>set_flags</strong> (torrent_flags_t flags) const;\n+void <strong>unset_flags</strong> (torrent_flags_t flags) const;\n+torrent_flags_t <strong>flags</strong> () const;\n+</pre>\n+<p>sets and gets the torrent state flags. See <a class=\"reference external\" href=\"reference-Core.html#torrent_flags_t\">torrent_flags_t</a>.\n+The <tt class=\"docutils literal\">set_flags</tt> overload that take a mask will affect all\n+flags part of the mask, and set their values to what the\n+<tt class=\"docutils literal\">flags</tt> argument is set to. This allows clearing and\n+setting flags in a single function call.\n+The <tt class=\"docutils literal\">set_flags</tt> overload that just takes flags, sets all\n+the specified flags and leave any other flags unchanged.\n+<tt class=\"docutils literal\">unset_flags</tt> clears the specified flags, while leaving\n+any other flags unchanged.</p>\n+<p>The <cite>seed_mode</cite> 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+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> flags, when adding the torrent.</p>\n+<a name=\"flush_cache()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflush_cache%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflush_cache%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"flush-cache\">\n+<h2>flush_cache()</h2>\n+<pre class=\"literal-block\">\n+void <strong>flush_cache</strong> () const;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#cache_flushed_alert\">cache_flushed_alert</a>.</p>\n+<p>Note that by the time you get the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, 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+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flush_cache()</span></tt> has been written to disk.</p>\n+<a name=\"force_recheck()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_recheck%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_recheck%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"force-recheck\">\n+<h2>force_recheck()</h2>\n+<pre class=\"literal-block\">\n+void <strong>force_recheck</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">force_recheck</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n+<a name=\"save_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bsave_resume_data%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bsave_resume_data%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"save-resume-data\">\n+<h2>save_resume_data()</h2>\n+<pre class=\"literal-block\">\n+void <strong>save_resume_data</strong> (resume_data_flags_t flags = {}) const;\n+</pre>\n+<p><tt class=\"docutils literal\">save_resume_data()</tt> asks libtorrent to generate fast-resume data for\n+this torrent. The fast resume data (stored in an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n+object) can be used to resume a torrent in the next <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>.</p>\n+<p>This operation is asynchronous, <tt class=\"docutils literal\">save_resume_data</tt> will return\n+immediately. The resume data is delivered when it's done through a\n+<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.</p>\n+<p>The operation will fail, and post a <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_failed_alert\">save_resume_data_failed_alert</a>\n+instead, in the following cases:</p>\n+<blockquote>\n+<ol class=\"arabic simple\">\n+<li>The torrent is in the process of being removed.</li>\n+<li>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 <a class=\"reference external\" href=\"manual-ref.html#metadata-from-peers\">metadata from peers</a> extension)</li>\n+</ol>\n+</blockquote>\n+<p>Note that some <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> may be outdated by the time you receive the fast resume data</p>\n+<p>When saving resume data because of shutting down, make sure not to\n+<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> before you receive the <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>.\n+There's no need to pause the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> or torrent when saving resume\n+data.</p>\n+<p>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.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">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.</p>\n+</div>\n+<p>Example code to pause and save resume data for all torrents and wait\n+for the alerts:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"keyword\">extern</span><span class=\"whitespace\"> </span><span class=\"keyword type\">int</span><span class=\"whitespace\"> </span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\"> </span><span class=\"comment single\">// global counter of outstanding resume data\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">torrent_handle</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">handles</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">get_torrents</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">handles</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">try</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">h</span><span class=\"punctuation\">.</span><span class=\"name\">save_resume_data</span><span class=\"punctuation\">(</span><span class=\"name\">torrent_handle</span><span class=\"operator\">::</span><span class=\"name\">only_if_modified</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">++</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">catch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">system_error</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">e</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// the handle was invalid, ignore this one and move to the next\n+</span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+</span><span class=\"keyword\">while</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">outstanding_resume_data</span><span class=\"whitespace\"> </span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"literal number integer\">0</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">alert</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">wait_for_alert</span><span class=\"punctuation\">(</span><span class=\"name\">seconds</span><span class=\"punctuation\">(</span><span class=\"literal number integer\">30</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+\n+ </span><span class=\"comment single\">// if we don't get an alert within 30 seconds, abort\n+</span><span class=\"whitespace\"> </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"keyword\">nullptr</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert_cast</span><span class=\"operator\"><</span><span class=\"name\">save_resume_data_failed_alert</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">))</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">process_alert</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">--</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">continue</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">save_resume_data_alert</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">rd</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">alert_cast</span><span class=\"operator\"><</span><span class=\"name\">save_resume_data_alert</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">rd</span><span class=\"whitespace\"> </span><span class=\"operator\">==</span><span class=\"whitespace\"> </span><span class=\"keyword\">nullptr</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">process_alert</span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">continue</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ofstream</span><span class=\"whitespace\"> </span><span class=\"name\">out</span><span class=\"punctuation\">((</span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">save_path</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">"/"</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">.</span><span class=\"name\">name</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">".fastresume"</span><span class=\"punctuation\">).</span><span class=\"name\">c_str</span><span class=\"punctuation\">()</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ios_base</span><span class=\"operator\">::</span><span class=\"name\">binary</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">write_resume_data_buf</span><span class=\"punctuation\">(</span><span class=\"name\">rd</span><span class=\"operator\">-></span><span class=\"name\">params</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">out</span><span class=\"punctuation\">.</span><span class=\"name\">write</span><span class=\"punctuation\">(</span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n+ </span><span class=\"operator\">--</span><span class=\"name\">outstanding_resume_data</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">Note how <tt class=\"docutils literal\">outstanding_resume_data</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, 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.</p>\n+</div>\n+<a name=\"need_save_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bneed_save_resume_data%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bneed_save_resume_data%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"need-save-resume-data\">\n+<h2>need_save_resume_data()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>need_save_resume_data</strong> (resume_data_flags_t flags) const;\n+bool <strong>need_save_resume_data</strong> () const;\n+</pre>\n+<p>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 <tt class=\"docutils literal\">flags</tt> let you ask if specific categories\n+of properties have changed. These flags have the same behavior as in\n+the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> call.</p>\n+<p>This is a <em>blocking</em> call. It will wait for a response from\n+libtorrent's main thread. A way to avoid blocking is to instead\n+call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> directly, specifying the conditions under\n+which resume data should be saved.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">A torrent's resume data is considered saved as soon as the\n+<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> is posted. It is important to make sure this\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is received and handled in order for this function to be\n+meaningful.</p>\n+</div>\n+<a name=\"queue_position_top()\"></a>\n+<a name=\"queue_position_down()\"></a>\n+<a name=\"queue_position_bottom()\"></a>\n+<a name=\"queue_position_up()\"></a>\n+<a name=\"queue_position()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_top%28%29+queue_position_down%28%29+queue_position_bottom%28%29+queue_position_up%28%29+queue_position%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_top%28%29+queue_position_down%28%29+queue_position_bottom%28%29+queue_position_up%28%29+queue_position%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"queue-position-top-queue-position-down-queue-position-bottom-queue-position-up-queue-position\">\n+<h2>queue_position_top() queue_position_down() queue_position_bottom() queue_position_up() queue_position()</h2>\n+<pre class=\"literal-block\">\n+void <strong>queue_position_bottom</strong> () const;\n+void <strong>queue_position_top</strong> () const;\n+void <strong>queue_position_down</strong> () const;\n+queue_position_t <strong>queue_position</strong> () const;\n+void <strong>queue_position_up</strong> () const;\n+</pre>\n+<p>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.</p>\n+<p>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.</p>\n+<p><tt class=\"docutils literal\">queue_position()</tt> 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.</p>\n+<p>The queue position is also available in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.</p>\n+<p>The <tt class=\"docutils literal\"><span class=\"pre\">queue_position_*()</span></tt> 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.</p>\n+<a name=\"queue_position_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bqueue_position_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bqueue_position_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"queue-position-set\">\n+<h2>queue_position_set()</h2>\n+<pre class=\"literal-block\">\n+void <strong>queue_position_set</strong> (queue_position_t p) const;\n+</pre>\n+<p>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</p>\n+<a name=\"set_ssl_certificate()\"></a>\n+<a name=\"set_ssl_certificate_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_ssl_certificate%28%29+set_ssl_certificate_buffer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_ssl_certificate%28%29+set_ssl_certificate_buffer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-ssl-certificate-set-ssl-certificate-buffer\">\n+<h2>set_ssl_certificate() set_ssl_certificate_buffer()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_ssl_certificate_buffer</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n+void <strong>set_ssl_certificate</strong> (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params\n+ , std::string const& passphrase = "");\n+</pre>\n+<p>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.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_ssl_certificate_buffer()\">set_ssl_certificate_buffer()</a> overload takes the actual certificate,\n+private key and DH params as strings, rather than paths to files.</p>\n+<p><tt class=\"docutils literal\">cert</tt> is a path to the (signed) certificate in .pem format\n+corresponding to this torrent.</p>\n+<p><tt class=\"docutils literal\">private_key</tt> is a path to the private key for the specified\n+certificate. This must be in .pem format.</p>\n+<p><tt class=\"docutils literal\">dh_params</tt> 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: <tt class=\"docutils literal\">openssl dhparam <span class=\"pre\">-outform</span> PEM <span class=\"pre\">-out</span>\n+dhparams.pem 512</tt>.</p>\n+<p><tt class=\"docutils literal\">passphrase</tt> may be specified if the private key is encrypted and\n+requires a passphrase to be decrypted.</p>\n+<p>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.</p>\n+<p>If you receive a <a class=\"reference external\" href=\"reference-Alerts.html#torrent_need_cert_alert\">torrent_need_cert_alert</a>, 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.</p>\n+<a name=\"torrent_file_with_hashes()\"></a>\n+<a name=\"torrent_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Btorrent_file_with_hashes%28%29+torrent_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Btorrent_file_with_hashes%28%29+torrent_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-file-with-hashes-torrent-file\">\n+<h2>torrent_file_with_hashes() torrent_file()</h2>\n+<pre class=\"literal-block\">\n+std::shared_ptr<torrent_info> <strong>torrent_file_with_hashes</strong> () const;\n+std::shared_ptr<const torrent_info> <strong>torrent_file</strong> () const;\n+</pre>\n+<p><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file()\">torrent_file()</a> returns a pointer to the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object\n+associated with this torrent. The <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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.</p>\n+<p>Note that the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object returned here may be a different\n+instance than the one added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, with different attributes\n+like piece layers, dht nodes and trackers. A <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object does\n+not round-trip cleanly when added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n+<p>If you want to save a .torrent file from the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>, instead\n+call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> and <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a> the\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object passed back in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<p><a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a> returns a <em>copy</em> of the internal\n+<a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> 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+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file()\">torrent_file()</a> since it needs to make copies of this information.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a> is here for backwards compatibility\n+when constructing a <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> object from a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> that's\n+in a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Prefer <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> + <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a>.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> returned from <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_file_with_hashes()\">torrent_file_with_hashes()</a>. Once the\n+torrent completes downloading all files, becoming a seed, you can\n+make a .torrent file from it.</p>\n+<a name=\"piece_layers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_layers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_layers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-layers\">\n+<h2>piece_layers()</h2>\n+<pre class=\"literal-block\">\n+std::vector<std::vector<sha256_hash>> <strong>piece_layers</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"post_piece_availability()\"></a>\n+<a name=\"piece_availability()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpost_piece_availability%28%29+piece_availability%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpost_piece_availability%28%29+piece_availability%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-piece-availability-piece-availability\">\n+<h2>post_piece_availability() piece_availability()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_piece_availability</strong> () const;\n+void <strong>piece_availability</strong> (std::vector<int>& avail) const;\n+</pre>\n+<p>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.</p>\n+<p><tt class=\"docutils literal\">post_piece_availability()</tt> will trigger a <a class=\"reference external\" href=\"reference-Alerts.html#piece_availability_alert\">piece_availability_alert</a>\n+to be posted.</p>\n+<p><tt class=\"docutils literal\">piece_availability()</tt> fills the specified <tt class=\"docutils literal\"><span class=\"pre\">std::vector<int></span></tt>\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.</p>\n+<a name=\"piece_priority()\"></a>\n+<a name=\"prioritize_pieces()\"></a>\n+<a name=\"get_piece_priorities()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_priority%28%29+prioritize_pieces%28%29+get_piece_priorities%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_priority%28%29+prioritize_pieces%28%29+get_piece_priorities%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-priority-prioritize-pieces-get-piece-priorities\">\n+<h2>piece_priority() prioritize_pieces() get_piece_priorities()</h2>\n+<pre class=\"literal-block\">\n+void <strong>piece_priority</strong> (piece_index_t index, download_priority_t priority) const;\n+download_priority_t <strong>piece_priority</strong> (piece_index_t index) const;\n+void <strong>prioritize_pieces</strong> (std::vector<download_priority_t> const& pieces) const;\n+void <strong>prioritize_pieces</strong> (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+std::vector<download_priority_t> <strong>get_piece_priorities</strong> () const;\n+</pre>\n+<p>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.</p>\n+<p>The default priority of pieces is 4.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#metadata_received_alert\">metadata_received_alert</a>.</p>\n+<p><tt class=\"docutils literal\">piece_priority</tt> sets or gets the priority for an individual piece,\n+specified by <tt class=\"docutils literal\">index</tt>.</p>\n+<p><tt class=\"docutils literal\">prioritize_pieces</tt> 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 <tt class=\"docutils literal\">prioritize_pieces</tt> 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.</p>\n+<p><tt class=\"docutils literal\">get_piece_priorities</tt> returns a vector with one element for each piece\n+in the torrent. Each element is the current priority of that piece.</p>\n+<p>It's possible to cancel the effect of <em>file</em> priorities by setting the\n+priorities for the affected pieces. Care has to be taken when mixing\n+usage of file- and piece priorities.</p>\n+<a name=\"get_file_priorities()\"></a>\n+<a name=\"prioritize_files()\"></a>\n+<a name=\"file_priority()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bget_file_priorities%28%29+prioritize_files%28%29+file_priority%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bget_file_priorities%28%29+prioritize_files%28%29+file_priority%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-file-priorities-prioritize-files-file-priority\">\n+<h2>get_file_priorities() prioritize_files() file_priority()</h2>\n+<pre class=\"literal-block\">\n+download_priority_t <strong>file_priority</strong> (file_index_t index) const;\n+void <strong>prioritize_files</strong> (std::vector<download_priority_t> const& files) const;\n+void <strong>file_priority</strong> (file_index_t index, download_priority_t priority) const;\n+std::vector<download_priority_t> <strong>get_file_priorities</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">index</tt> must be in the range [0, number_of_files).</p>\n+<p><tt class=\"docutils literal\">file_priority()</tt> queries or sets the priority of file <tt class=\"docutils literal\">index</tt>.</p>\n+<p><tt class=\"docutils literal\">prioritize_files()</tt> takes a vector that has at as many elements as\n+there are files in the torrent. Each <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> is the priority of that\n+file. The function sets the priorities of all the pieces in the\n+torrent based on the vector.</p>\n+<p><tt class=\"docutils literal\">get_file_priorities()</tt> returns a vector with the priorities of all\n+files.</p>\n+<p>The priority values are the same as for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#piece_priority()\">piece_priority()</a>. See\n+<a class=\"reference external\" href=\"reference-Core.html#download_priority_t\">download_priority_t</a>.</p>\n+<p>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, <a class=\"reference external\" href=\"reference-Torrent_Handle.html#piece_priority()\">piece_priority()</a> has to be called\n+again for those pieces.</p>\n+<p>You cannot set the file priorities on a torrent that does not yet have\n+metadata or a torrent that is a seed. <tt class=\"docutils literal\">file_priority(int, int)</tt> and\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#prioritize_files()\">prioritize_files()</a> are both no-ops for such torrents.</p>\n+<p>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+<a class=\"reference external\" href=\"reference-Alerts.html#file_prio_alert\">file_prio_alert</a>.</p>\n+<p>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.</p>\n+<p>Moving data from a file into the part file is currently not\n+supported. If a file has its priority set to 0 <em>after</em> it has already\n+been created, it will not be moved into the partfile.</p>\n+<a name=\"force_lsd_announce()\"></a>\n+<a name=\"force_reannounce()\"></a>\n+<a name=\"force_dht_announce()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bforce_lsd_announce%28%29+force_reannounce%28%29+force_dht_announce%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bforce_lsd_announce%28%29+force_reannounce%28%29+force_dht_announce%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"force-lsd-announce-force-reannounce-force-dht-announce\">\n+<h2>force_lsd_announce() force_reannounce() force_dht_announce()</h2>\n+<pre class=\"literal-block\">\n+void <strong>force_lsd_announce</strong> () const;\n+void <strong>force_reannounce</strong> (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+void <strong>force_dht_announce</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">force_reannounce()</tt> will force this torrent to do another tracker\n+request, to receive new peers. The <tt class=\"docutils literal\">seconds</tt> argument specifies how\n+many seconds from now to issue the tracker announces.</p>\n+<p>If the tracker's <tt class=\"docutils literal\">min_interval</tt> has not passed since the last\n+announce, the forced announce will be scheduled to happen immediately\n+as the <tt class=\"docutils literal\">min_interval</tt> expires. This is to honor trackers minimum\n+re-announce interval settings.</p>\n+<p>The <tt class=\"docutils literal\">tracker_index</tt> argument specifies which tracker to re-announce.\n+If set to -1 (which is the default), all trackers are re-announce.</p>\n+<p>The <tt class=\"docutils literal\">flags</tt> argument can be used to affect the re-announce. See\n+ignore_min_interval.</p>\n+<p><tt class=\"docutils literal\">force_dht_announce</tt> will announce the torrent to the DHT\n+immediately.</p>\n+<p><tt class=\"docutils literal\">force_lsd_announce</tt> will announce the torrent on LSD\n+immediately.</p>\n+<a name=\"scrape_tracker()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bscrape_tracker%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bscrape_tracker%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"scrape-tracker\">\n+<h2>scrape_tracker()</h2>\n+<pre class=\"literal-block\">\n+void <strong>scrape_tracker</strong> (int idx = -1) const;\n+</pre>\n+<p><tt class=\"docutils literal\">scrape_tracker()</tt> will send a scrape request to a tracker. By\n+default (<tt class=\"docutils literal\">idx</tt> = -1) it will scrape the last working tracker. If\n+<tt class=\"docutils literal\">idx</tt> is >= 0, the tracker with the specified index will scraped.</p>\n+<p>A scrape request queries the tracker for statistics such as total\n+number of incomplete peers, complete peers, number of downloads etc.</p>\n+<p>This request will specifically update the <tt class=\"docutils literal\">num_complete</tt> and\n+<tt class=\"docutils literal\">num_incomplete</tt> fields in the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> struct once it\n+completes. When it completes, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_reply_alert\">scrape_reply_alert</a>.\n+If it fails, it will generate a <a class=\"reference external\" href=\"reference-Alerts.html#scrape_failed_alert\">scrape_failed_alert</a>.</p>\n+<a name=\"set_download_limit()\"></a>\n+<a name=\"set_upload_limit()\"></a>\n+<a name=\"upload_limit()\"></a>\n+<a name=\"download_limit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_download_limit%28%29+set_upload_limit%28%29+upload_limit%28%29+download_limit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_download_limit%28%29+set_upload_limit%28%29+upload_limit%28%29+download_limit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-download-limit-set-upload-limit-upload-limit-download-limit\">\n+<h2>set_download_limit() set_upload_limit() upload_limit() download_limit()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_upload_limit</strong> (int limit) const;\n+void <strong>set_download_limit</strong> (int limit) const;\n+int <strong>upload_limit</strong> () const;\n+int <strong>download_limit</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">set_upload_limit</tt> 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+<tt class=\"docutils literal\">set_download_limit</tt> 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+(<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::upload_rate_limit</span></tt>) will not override the global\n+rate limit. The torrent can never upload more than the global rate\n+limit.</p>\n+<p><tt class=\"docutils literal\">upload_limit</tt> and <tt class=\"docutils literal\">download_limit</tt> will return the current limit\n+setting, for upload and download, respectively.</p>\n+<p>Local peers are not rate limited by default. see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"connect_peer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bconnect_peer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bconnect_peer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"connect-peer\">\n+<h2>connect_peer()</h2>\n+<pre class=\"literal-block\">\n+void <strong>connect_peer</strong> (tcp::endpoint const& adr, peer_source_flags_t source = {}\n+ , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n+</pre>\n+<p><tt class=\"docutils literal\">connect_peer()</tt> 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 <a class=\"reference external\" href=\"reference-Core.html#peer_info\">peer_info</a>. i.e.\n+<tt class=\"docutils literal\">tracker</tt>, <tt class=\"docutils literal\">pex</tt>, <tt class=\"docutils literal\">dht</tt> etc.</p>\n+<p>For possible values of <tt class=\"docutils literal\">flags</tt>, see <a class=\"reference external\" href=\"reference-Core.html#pex_flags_t\">pex_flags_t</a>.</p>\n+<a name=\"clear_peers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bclear_peers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bclear_peers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-peers\">\n+<h2>clear_peers()</h2>\n+<pre class=\"literal-block\">\n+void <strong>clear_peers</strong> ();\n+</pre>\n+<p>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.</p>\n+<a name=\"set_max_uploads()\"></a>\n+<a name=\"max_uploads()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bset_max_uploads%28%29+max_uploads%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bset_max_uploads%28%29+max_uploads%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-max-uploads-max-uploads\">\n+<h2>set_max_uploads() max_uploads()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_max_uploads</strong> (int max_uploads) const;\n+int <strong>max_uploads</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">set_max_uploads()</tt> 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+<a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n+<p><tt class=\"docutils literal\">max_uploads()</tt> returns the current settings.</p>\n+<a name=\"max_connections()\"></a>\n+<a name=\"set_max_connections()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bmax_connections%28%29+set_max_connections%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bmax_connections%28%29+set_max_connections%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"max-connections-set-max-connections\">\n+<h2>max_connections() set_max_connections()</h2>\n+<pre class=\"literal-block\">\n+int <strong>max_connections</strong> () const;\n+void <strong>set_max_connections</strong> (int max_connections) const;\n+</pre>\n+<p><tt class=\"docutils literal\">set_max_connections()</tt> 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+<tt class=\"docutils literal\">connections_limit</tt> in <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n+<p><tt class=\"docutils literal\">max_connections()</tt> returns the current settings.</p>\n+<a name=\"move_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bmove_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bmove_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"move-storage\">\n+<h2>move_storage()</h2>\n+<pre class=\"literal-block\">\n+void <strong>move_storage</strong> (std::string const& save_path\n+ , move_flags_t flags = move_flags_t::always_replace_files\n+ ) const;\n+</pre>\n+<p>Moves the file(s) that this torrent are currently seeding from or\n+downloading to. If the given <tt class=\"docutils literal\">save_path</tt> 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.</p>\n+<p>Since disk IO is performed in a separate thread, this operation is\n+also asynchronous. Once the operation completes, the\n+<tt class=\"docutils literal\">storage_moved_alert</tt> is generated, with the new path as the\n+message. If the move fails for some reason,\n+<tt class=\"docutils literal\">storage_moved_failed_alert</tt> is generated instead, containing the\n+error message.</p>\n+<p>The <tt class=\"docutils literal\">flags</tt> argument determines the behavior of the copying/moving\n+of the files in the torrent. see <a class=\"reference external\" href=\"reference-Storage.html#move_flags_t\">move_flags_t</a>.</p>\n+<p><tt class=\"docutils literal\">always_replace_files</tt> is the default and replaces any file that\n+exist in both the source directory and the target directory.</p>\n+<p><tt class=\"docutils literal\">fail_if_exist</tt> 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 <tt class=\"docutils literal\">always_replace_files</tt> 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 <tt class=\"docutils literal\">error</tt> of\n+<tt class=\"docutils literal\">move_storage_failed_alert</tt> is set to\n+<tt class=\"docutils literal\"><span class=\"pre\">boost::system::errc::file_exists</span></tt>.</p>\n+<p>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 <tt class=\"docutils literal\">move_storage</tt> call with one of the other modes.</p>\n+<p><tt class=\"docutils literal\">dont_replace</tt> 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.</p>\n+<p>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.</p>\n+<p>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.</p>\n+<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"rename-file-1\">\n+<h2>rename_file()</h2>\n+<pre class=\"literal-block\">\n+void <strong>rename_file</strong> (file_index_t index, std::string const& new_name) const;\n+</pre>\n+<p>Renames the file with the given index asynchronously. The rename\n+operation is complete when either a <a class=\"reference external\" href=\"reference-Alerts.html#file_renamed_alert\">file_renamed_alert</a> or\n+<a class=\"reference external\" href=\"reference-Alerts.html#file_rename_failed_alert\">file_rename_failed_alert</a> is posted.</p>\n+<a name=\"info_hashes()\"></a>\n+<a name=\"info_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Binfo_hashes%28%29+info_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"info-hashes-info-hash-1\">\n+<h2>info_hashes() info_hash()</h2>\n+<pre class=\"literal-block\">\n+info_hash_t <strong>info_hashes</strong> () const;\n+sha1_hash <strong>info_hash</strong> () const;\n+</pre>\n+<p>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 <tt class=\"docutils literal\">info_hash()</tt> 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+<tt class=\"docutils literal\">info_hashes()</tt> instead.</p>\n+<a name=\"operator!=()\"></a>\n+<a name=\"operator==()\"></a>\n+<a name=\"operator<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3D%3D%28%29+operator%3C%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boperator%21%3D%28%29+operator%3D%3D%28%29+operator%3C%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-operator-operator\">\n+<h2>operator!=() operator==() operator<()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator<</strong> (const torrent_handle& h) const;\n+bool <strong>operator==</strong> (const torrent_handle& h) const;\n+bool <strong>operator!=</strong> (const torrent_handle& h) const;\n+</pre>\n+<p>comparison operators. The order of the torrents is unspecified\n+but stable.</p>\n+<a name=\"id()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bid%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"id\">\n+<h2>id()</h2>\n+<pre class=\"literal-block\">\n+std::uint32_t <strong>id</strong> () const;\n+</pre>\n+<p>returns a unique identifier for this torrent. It's not a dense index.\n+It's not preserved across sessions.</p>\n+<a name=\"native_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bnative_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bnative_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"native-handle\">\n+<h2>native_handle()</h2>\n+<pre class=\"literal-block\">\n+std::shared_ptr<torrent> <strong>native_handle</strong> () const;\n+</pre>\n+<p>This function is intended only for use by plugins and the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\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 <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> callbacks).\n+The <tt class=\"docutils literal\">torrent</tt> 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 <tt class=\"docutils literal\">TORRENT_</tt> macros must match between libtorrent and the\n+client builds.</p>\n+<a name=\"userdata()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Buserdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Buserdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"userdata\">\n+<h2>userdata()</h2>\n+<pre class=\"literal-block\">\n+client_data_t <strong>userdata</strong> () const;\n+</pre>\n+<p>returns the userdata pointer as set in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a></p>\n+<a name=\"in_session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bin_session%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bin_session%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"in-session\">\n+<h2>in_session()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>in_session</strong> () const;\n+</pre>\n+<p>Returns true if the torrent is in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It returns true before\n+session::remove_torrent() is called, and false afterward.</p>\n+<p>Note that this is a blocking function, unlike <a class=\"reference external\" href=\"reference-Torrent_Handle.html#is_valid()\">torrent_handle::is_valid()</a>\n+which returns immediately.</p>\n+<a name=\"overwrite_existing\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Boverwrite_existing%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Boverwrite_existing%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>overwrite_existing</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"query_distributed_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_distributed_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_distributed_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_distributed_copies</dt>\n+<dd>calculates <tt class=\"docutils literal\">distributed_copies</tt>, <tt class=\"docutils literal\">distributed_full_copies</tt> and\n+<tt class=\"docutils literal\">distributed_fraction</tt>.</dd>\n+</dl>\n+<a name=\"query_accurate_download_counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_accurate_download_counters%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_accurate_download_counters%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_accurate_download_counters</dt>\n+<dd>includes partial downloaded blocks in <tt class=\"docutils literal\">total_done</tt> and\n+<tt class=\"docutils literal\">total_wanted_done</tt>.</dd>\n+</dl>\n+<a name=\"query_last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_last_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_last_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_last_seen_complete</dt>\n+<dd>includes <tt class=\"docutils literal\">last_seen_complete</tt>.</dd>\n+</dl>\n+<a name=\"query_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_pieces</dt>\n+<dd>populate the <tt class=\"docutils literal\">pieces</tt> field in <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.</dd>\n+</dl>\n+<a name=\"query_verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_verified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_verified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_verified_pieces</dt>\n+<dd>includes <tt class=\"docutils literal\">verified_pieces</tt> (only applies to torrents in <em>seed\n+mode</em>).</dd>\n+</dl>\n+<a name=\"query_torrent_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_torrent_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_torrent_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_torrent_file</dt>\n+<dd>includes <tt class=\"docutils literal\">torrent_file</tt>, which is all the static information from\n+the .torrent file.</dd>\n+</dl>\n+<a name=\"query_name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_name%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_name%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_name</dt>\n+<dd>includes <tt class=\"docutils literal\">name</tt>, the name of the torrent. This is either derived\n+from the .torrent file, or from the <tt class=\"docutils literal\">&dn=</tt> magnet link argument\n+or possibly some other source. If the name of the torrent is not\n+known, this is an empty string.</dd>\n+</dl>\n+<a name=\"query_save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bquery_save_path%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bquery_save_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>query_save_path</dt>\n+<dd>includes <tt class=\"docutils literal\">save_path</tt>, the path to the directory the files of the\n+torrent are saved to.</dd>\n+</dl>\n+<a name=\"alert_when_available\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Balert_when_available%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Balert_when_available%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>alert_when_available</dt>\n+<dd>used to ask libtorrent to send an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> once the piece has been\n+downloaded, by passing alert_when_available. When set, the\n+<a class=\"reference external\" href=\"reference-Alerts.html#read_piece_alert\">read_piece_alert</a> <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> will be delivered, with the piece data, when\n+it's downloaded.</dd>\n+</dl>\n+<a name=\"piece_granularity\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bpiece_granularity%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bpiece_granularity%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_granularity</dt>\n+<dd>only calculate file progress at piece granularity. This makes\n+the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#file_progress()\">file_progress()</a> call cheaper and also only takes bytes that\n+have passed the hash check into account, so progress cannot\n+regress in this mode.</dd>\n+</dl>\n+<a name=\"graceful_pause\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bgraceful_pause%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bgraceful_pause%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>graceful_pause</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"flush_disk_cache\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bflush_disk_cache%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bflush_disk_cache%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flush_disk_cache</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"save_info_dict\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bsave_info_dict%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bsave_info_dict%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_info_dict</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"only_if_modified\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bonly_if_modified%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bonly_if_modified%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>only_if_modified</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"if_counters_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_counters_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_counters_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>if_counters_changed</dt>\n+<dd>save resume data if any <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> has changed since the last time\n+resume data was saved. This includes upload/download <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, active\n+time <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> and scrape data. A torrent that is not paused will have\n+its active time <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> incremented continuously.</dd>\n+</dl>\n+<a name=\"if_download_progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_download_progress%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_download_progress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>if_download_progress</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"if_config_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_config_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_config_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>if_config_changed</dt>\n+<dd>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)</dd>\n+</dl>\n+<a name=\"if_state_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_state_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_state_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>if_state_changed</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"if_metadata_changed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bif_metadata_changed%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bif_metadata_changed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>if_metadata_changed</dt>\n+<dd>save the resume data if any <em>metadata</em> 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</dd>\n+</dl>\n+<a name=\"ignore_min_interval\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_handle%3A%3A%5Bignore_min_interval%5D&labels=documentation&body=Documentation+under+heading+%22torrent_handle%3A%3A%5Bignore_min_interval%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ignore_min_interval</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"hash_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hash_value%28%29&labels=documentation&body=Documentation+under+heading+%22hash_value%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"hash-value\">\n+<h1>hash_value()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_handle.hpp\">libtorrent/torrent_handle.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::size_t <strong>hash_value</strong> (torrent_handle const& h);\n+</pre>\n+<p>for std::hash (and to support using this type in unordered_map etc.)</p>\n+<a name=\"session_proxy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_proxy&labels=documentation&body=Documentation+under+heading+%22class+session_proxy%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-proxy\">\n+<h1>session_proxy</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n+<p>this is a holder for the internal <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> implementation object. Once the\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destruction is explicitly initiated, this holder is used to\n+synchronize the completion of the shutdown. The lifetime of this object\n+may outlive <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, causing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destructor to not block. The\n+<a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> destructor will block however, until the underlying <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n+is done shutting down.</p>\n+<pre class=\"literal-block\">\n+struct session_proxy\n+{\n+ <strong>session_proxy</strong> ();\n+ session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n+ <strong>~session_proxy</strong> ();\n+ session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n+ <strong>session_proxy</strong> (session_proxy const&);\n+ <strong>session_proxy</strong> (session_proxy&&) noexcept;\n+};\n+</pre>\n+<a name=\"operator=()\"></a>\n+<a name=\"session_proxy()\"></a>\n+<a name=\"~session_proxy()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_proxy%3A%3A%5Boperator%3D%28%29+session_proxy%28%29+~session_proxy%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_proxy%3A%3A%5Boperator%3D%28%29+session_proxy%28%29+~session_proxy%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-session-proxy-session-proxy\">\n+<h2>operator=() session_proxy() ~session_proxy()</h2>\n+<pre class=\"literal-block\">\n+<strong>session_proxy</strong> ();\n+session_proxy& <strong>operator=</strong> (session_proxy const&) &;\n+<strong>~session_proxy</strong> ();\n+session_proxy& <strong>operator=</strong> (session_proxy&&) & noexcept;\n+<strong>session_proxy</strong> (session_proxy const&);\n+<strong>session_proxy</strong> (session_proxy&&) noexcept;\n+</pre>\n+<p>default constructor, does not refer to any <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n+implementation object.</p>\n+<a name=\"session\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session&labels=documentation&body=Documentation+under+heading+%22class+session%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"session\">\n+<h1>session</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n+<p>You have some control over <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> configuration through the\n+<tt class=\"docutils literal\"><span class=\"pre\">session_handle::apply_settings()</span></tt> member function. To change one or more\n+configuration options, create a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>. object and fill it with\n+the settings to be set and pass it in to <tt class=\"docutils literal\"><span class=\"pre\">session::apply_settings()</span></tt>.</p>\n+<p>see <a class=\"reference external\" href=\"reference-Session.html#apply_settings()\">apply_settings()</a>.</p>\n+<pre class=\"literal-block\">\n+struct session : session_handle\n+{\n+ <strong>session</strong> (session_params const& params, session_flags_t flags);\n+ <strong>session</strong> (session_params&& params, session_flags_t flags);\n+ explicit <strong>session</strong> (session_params const& params);\n+ explicit <strong>session</strong> (session_params&& params);\n+ <strong>session</strong> ();\n+ <strong>session</strong> (session_params const& params, io_context& ios);\n+ <strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n+ <strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n+ <strong>session</strong> (session_params&& params, io_context& ios);\n+ <strong>~session</strong> ();\n+ session_proxy <strong>abort</strong> ();\n+};\n+</pre>\n+<a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-1\">\n+<h2>session()</h2>\n+<pre class=\"literal-block\">\n+<strong>session</strong> (session_params const& params, session_flags_t flags);\n+<strong>session</strong> (session_params&& params, session_flags_t flags);\n+explicit <strong>session</strong> (session_params const& params);\n+explicit <strong>session</strong> (session_params&& params);\n+<strong>session</strong> ();\n+</pre>\n+<p>Constructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> objects which acts as the container of torrents.\n+In order to avoid a race condition between starting the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> and\n+configuring it, you can pass in a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. Its settings\n+will take effect before the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts up.</p>\n+<p>The overloads taking <tt class=\"docutils literal\">flags</tt> can be used to start a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> in\n+paused mode (by passing in <tt class=\"docutils literal\"><span class=\"pre\">session::paused</span></tt>). Note that\n+<tt class=\"docutils literal\">add_default_plugins</tt> do not have an affect on constructors that\n+take a <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object. It already contains the plugins to use.</p>\n+<a name=\"session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Bsession%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Bsession%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-2\">\n+<h2>session()</h2>\n+<pre class=\"literal-block\">\n+<strong>session</strong> (session_params const& params, io_context& ios);\n+<strong>session</strong> (session_params&& params, io_context& ios, session_flags_t);\n+<strong>session</strong> (session_params const& params, io_context& ios, session_flags_t);\n+<strong>session</strong> (session_params&& params, io_context& ios);\n+</pre>\n+<p>Overload of the constructor that takes an external io_context to run\n+the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n+<div class=\"admonition warning\">\n+<p class=\"first admonition-title\">Warning</p>\n+<p class=\"last\">The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object does not cleanly terminate with an external\n+<tt class=\"docutils literal\">io_context</tt>. The <tt class=\"docutils literal\"><span class=\"pre\">io_context::run()</span></tt> call <em>must</em> have returned\n+before it's safe to destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Which means you <em>MUST</em>\n+call <a class=\"reference external\" href=\"reference-Session.html#abort()\">session::abort()</a> and save the <a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> first, then\n+destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object, then sync with the io_context, then\n+destruct the <a class=\"reference external\" href=\"reference-Session.html#session_proxy\">session_proxy</a> object.</p>\n+</div>\n+<a name=\"~session()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5B~session%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5B~session%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-3\">\n+<h2>~session()</h2>\n+<pre class=\"literal-block\">\n+<strong>~session</strong> ();\n+</pre>\n+<p>The destructor of <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> returns. So, it's advised\n+that any kind of interface (such as windows) are closed before\n+destructing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. Because it can take a few second for\n+it to finish. The timeout can be set with <a class=\"reference external\" href=\"reference-Session.html#apply_settings()\">apply_settings()</a>.</p>\n+<a name=\"abort()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session%3A%3A%5Babort%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session%3A%3A%5Babort%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"abort-2\">\n+<h2>abort()</h2>\n+<pre class=\"literal-block\">\n+session_proxy <strong>abort</strong> ();\n+</pre>\n+<p>In case you want to destruct the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> asynchronously, you can\n+request a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> destruction proxy. If you don't do this, the\n+destructor of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object will block while the trackers are\n+contacted. If you keep one <tt class=\"docutils literal\">session_proxy</tt> to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> when\n+destructing it, the destructor will not block, but start to close down\n+the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, the destructor of the proxy will then synchronize the\n+threads. So, the destruction of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is performed from the\n+<tt class=\"docutils literal\">session</tt> destructor call until the <tt class=\"docutils literal\">session_proxy</tt> destructor\n+call. The <tt class=\"docutils literal\">session_proxy</tt> does not have any operations on it (since\n+the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is being closed down, no operations are allowed on it).\n+The only valid operation is calling the destructor:</p>\n+<pre class=\"literal-block\">\n+struct session_proxy {};\n+</pre>\n+<a name=\"session_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_params&labels=documentation&body=Documentation+under+heading+%22class+session_params%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"session-params\">\n+<h1>session_params</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> is a parameters pack for configuring the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\n+before it's started.</p>\n+<pre class=\"literal-block\">\n+struct session_params\n+{\n+ <strong>session_params</strong> ();\n+ <strong>session_params</strong> (settings_pack&& sp);\n+ <strong>session_params</strong> (settings_pack const& sp);\n+ <strong>session_params</strong> (settings_pack&& sp\n+ , std::vector<std::shared_ptr<plugin>> exts);\n+ <strong>session_params</strong> (settings_pack const& sp\n+ , std::vector<std::shared_ptr<plugin>> exts);\n+\n+ settings_pack settings;\n+ std::vector<std::shared_ptr<plugin>> extensions;\n+ dht::dht_state dht_state;\n+ dht::dht_storage_constructor_type dht_storage_constructor;\n+ disk_io_constructor_type disk_io_constructor;\n+ std::map<std::string, std::string> ext_state;\n+ libtorrent::ip_filter ip_filter;\n+};\n+</pre>\n+<a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"session-params-1\">\n+<h2>session_params()</h2>\n+<pre class=\"literal-block\">\n+<strong>session_params</strong> ();\n+<strong>session_params</strong> (settings_pack&& sp);\n+<strong>session_params</strong> (settings_pack const& sp);\n+</pre>\n+<p>This constructor can be used to start with the default plugins\n+(ut_metadata, ut_pex and smart_ban). Pass a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> to set the\n+initial settings when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> starts.</p>\n+<a name=\"session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsession_params%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsession_params%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-params-2\">\n+<h2>session_params()</h2>\n+<pre class=\"literal-block\">\n+<strong>session_params</strong> (settings_pack&& sp\n+ , std::vector<std::shared_ptr<plugin>> exts);\n+<strong>session_params</strong> (settings_pack const& sp\n+ , std::vector<std::shared_ptr<plugin>> exts);\n+</pre>\n+<p>This constructor helps to configure the set of initial plugins\n+to be added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> before it's started.</p>\n+<a name=\"settings\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bsettings%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bsettings%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>settings</dt>\n+<dd>The settings to configure the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with</dd>\n+</dl>\n+<a name=\"extensions\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bextensions%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bextensions%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>extensions</dt>\n+<dd>the plugins to add to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> as it is constructed</dd>\n+</dl>\n+<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdht_state%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdht_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dht_state</dt>\n+<dd>DHT node ID and node addresses to bootstrap the DHT with.</dd>\n+</dl>\n+<a name=\"dht_storage_constructor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdht_storage_constructor%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdht_storage_constructor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dht_storage_constructor</dt>\n+<dd>function object to construct the storage object for DHT items.</dd>\n+</dl>\n+<a name=\"disk_io_constructor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bdisk_io_constructor%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bdisk_io_constructor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>disk_io_constructor</dt>\n+<dd>function object to create the disk I/O subsystem. Defaults to\n+default_disk_io_constructor.</dd>\n+</dl>\n+<a name=\"ext_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bext_state%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bext_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ext_state</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a> and <a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a>.</dd>\n+</dl>\n+<a name=\"ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_params%3A%3A%5Bip_filter%5D&labels=documentation&body=Documentation+under+heading+%22session_params%3A%3A%5Bip_filter%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ip_filter</dt>\n+<dd>the IP filter to use for the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. This restricts which peers are allowed\n+to connect. As if passed to <a class=\"reference external\" href=\"reference-Session.html#set_ip_filter()\">set_ip_filter()</a>.</dd>\n+</dl>\n+<a name=\"session_handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_handle&labels=documentation&body=Documentation+under+heading+%22class+session_handle%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"session-handle\">\n+<h1>session_handle</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_handle.hpp\">libtorrent/session_handle.hpp</a>"</p>\n+<p>this class provides a non-owning handle to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> and a subset of the\n+interface of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> class. If the underlying <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is destructed\n+any handle to it will no longer be valid. <a class=\"reference external\" href=\"reference-Session.html#is_valid()\">is_valid()</a> will return false and\n+any operation on it will throw a system_error exception, with error code\n+invalid_session_handle.</p>\n+<pre class=\"literal-block\">\n+struct session_handle\n+{\n+ bool <strong>is_valid</strong> () const;\n+ session_params <strong>session_state</strong> (save_state_flags_t flags = save_state_flags_t::all()) const;\n+ void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n+ std::vector<torrent_status> <strong>get_torrent_status</strong> (\n+ std::function<bool(torrent_status const&)> const& pred\n+ , status_flags_t flags = {}) const;\n+ void <strong>post_torrent_updates</strong> (status_flags_t flags = status_flags_t::all());\n+ void <strong>post_session_stats</strong> ();\n+ void <strong>post_dht_stats</strong> ();\n+ void <strong>set_dht_state</strong> (dht::dht_state const& st);\n+ void <strong>set_dht_state</strong> (dht::dht_state&& st);\n+ std::vector<torrent_handle> <strong>get_torrents</strong> () const;\n+ torrent_handle <strong>find_torrent</strong> (sha1_hash const& info_hash) const;\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n+ void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n+ void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n+ torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n+ void <strong>resume</strong> ();\n+ void <strong>pause</strong> ();\n+ bool <strong>is_paused</strong> () const;\n+ bool <strong>is_dht_running</strong> () const;\n+ void <strong>set_dht_storage</strong> (dht::dht_storage_constructor_type sc);\n+ void <strong>add_dht_node</strong> (std::pair<std::string, int> const& node);\n+ void <strong>dht_get_item</strong> (sha1_hash const& target);\n+ void <strong>dht_get_item</strong> (std::array<char, 32> key\n+ , std::string salt = std::string());\n+ sha1_hash <strong>dht_put_item</strong> (entry data);\n+ void <strong>dht_put_item</strong> (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 <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n+ void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+ void <strong>dht_live_nodes</strong> (sha1_hash const& nid);\n+ void <strong>dht_sample_infohashes</strong> (udp::endpoint const& ep, sha1_hash const& target);\n+ void <strong>dht_direct_request</strong> (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+ void <strong>add_extension</strong> (std::shared_ptr<plugin> ext);\n+ void <strong>add_extension</strong> (std::function<std::shared_ptr<torrent_plugin>(\n+ torrent_handle const&, client_data_t)> ext);\n+ void <strong>set_ip_filter</strong> (ip_filter f);\n+ ip_filter <strong>get_ip_filter</strong> () const;\n+ void <strong>set_port_filter</strong> (port_filter const& f);\n+ unsigned short <strong>ssl_listen_port</strong> () const;\n+ bool <strong>is_listening</strong> () const;\n+ unsigned short <strong>listen_port</strong> () const;\n+ ip_filter <strong>get_peer_class_filter</strong> () const;\n+ void <strong>set_peer_class_filter</strong> (ip_filter const& f);\n+ peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n+ void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n+ peer_class_t <strong>create_peer_class</strong> (char const* name);\n+ void <strong>delete_peer_class</strong> (peer_class_t cid);\n+ void <strong>set_peer_class</strong> (peer_class_t cid, peer_class_info const& pci);\n+ peer_class_info <strong>get_peer_class</strong> (peer_class_t cid) const;\n+ void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n+ void <strong>apply_settings</strong> (settings_pack&&);\n+ void <strong>apply_settings</strong> (settings_pack const&);\n+ settings_pack <strong>get_settings</strong> () const;\n+ void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n+ alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n+ void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n+ std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n+ void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n+ void <strong>reopen_network_sockets</strong> (reopen_network_flags_t options = reopen_map_ports);\n+ std::shared_ptr<aux::session_impl> <strong>native_handle</strong> () const;\n+\n+ static constexpr save_state_flags_t <strong>save_settings</strong> = 0_bit;\n+ static constexpr save_state_flags_t <strong>save_dht_state</strong> = 2_bit;\n+ static constexpr save_state_flags_t <strong>save_extension_state</strong> = 11_bit;\n+ static constexpr save_state_flags_t <strong>save_ip_filter</strong> = 12_bit;\n+ static constexpr peer_class_t <strong>global_peer_class_id</strong> {0};\n+ static constexpr peer_class_t <strong>tcp_peer_class_id</strong> {1};\n+ static constexpr peer_class_t <strong>local_peer_class_id</strong> {2};\n+ static constexpr remove_flags_t <strong>delete_files</strong> = 0_bit;\n+ static constexpr remove_flags_t <strong>delete_partfile</strong> = 1_bit;\n+ static constexpr session_flags_t <strong>paused</strong> = 2_bit;\n+ static constexpr portmap_protocol <strong>udp</strong> = portmap_protocol::udp;\n+ static constexpr portmap_protocol <strong>tcp</strong> = portmap_protocol::tcp;\n+ static constexpr reopen_network_flags_t <strong>reopen_map_ports</strong> = 0_bit;\n+};\n+</pre>\n+<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"is-valid-2\">\n+<h2>is_valid()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_valid</strong> () const;\n+</pre>\n+<p>returns true if this handle refers to a valid <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. If the\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> has been destroyed, all <a class=\"reference external\" href=\"reference-Session.html#session_handle\">session_handle</a> objects will expire and\n+not be valid.</p>\n+<a name=\"session_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsession_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsession_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-state\">\n+<h2>session_state()</h2>\n+<pre class=\"literal-block\">\n+session_params <strong>session_state</strong> (save_state_flags_t flags = save_state_flags_t::all()) const;\n+</pre>\n+<p>returns the current <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state. This can be passed to\n+<a class=\"reference external\" href=\"reference-Session.html#write_session_params()\">write_session_params()</a> to save the state to disk and restored using\n+<a class=\"reference external\" href=\"reference-Session.html#read_session_params()\">read_session_params()</a> when constructing a new <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state</p>\n+<a name=\"get_torrent_status()\"></a>\n+<a name=\"refresh_torrent_status()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_torrent_status%28%29+refresh_torrent_status%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_torrent_status%28%29+refresh_torrent_status%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-torrent-status-refresh-torrent-status\">\n+<h2>get_torrent_status() refresh_torrent_status()</h2>\n+<pre class=\"literal-block\">\n+void <strong>refresh_torrent_status</strong> (std::vector<torrent_status>* ret\n+ , status_flags_t flags = {}) const;\n+std::vector<torrent_status> <strong>get_torrent_status</strong> (\n+ std::function<bool(torrent_status const&)> const& pred\n+ , status_flags_t flags = {}) const;\n+</pre>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\">these calls are potentially expensive and won't scale well with\n+lots of torrents. If you're concerned about performance, consider\n+using <tt class=\"docutils literal\">post_torrent_updates()</tt> instead.</p>\n+</div>\n+<p><tt class=\"docutils literal\">get_torrent_status</tt> returns a vector of the <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> for\n+every torrent which satisfies <tt class=\"docutils literal\">pred</tt>, 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 <tt class=\"docutils literal\">flags</tt> argument is the same as to\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>. Since <tt class=\"docutils literal\">pred</tt> 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.</p>\n+<p><tt class=\"docutils literal\">refresh_torrent_status</tt> takes a vector of <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> structs\n+(for instance the same vector that was returned by\n+<a class=\"reference external\" href=\"reference-Session.html#get_torrent_status()\">get_torrent_status()</a> ) and refreshes the status based on the\n+<tt class=\"docutils literal\">handle</tt> member. It is possible to use this function by first\n+setting up a vector of default constructed <tt class=\"docutils literal\">torrent_status</tt> objects,\n+only initializing the <tt class=\"docutils literal\">handle</tt> 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.</p>\n+<p>Any <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a> object whose <tt class=\"docutils literal\">handle</tt> member is not referring to\n+a valid torrent are ignored.</p>\n+<p>The intended use of these functions is to start off by calling\n+<tt class=\"docutils literal\">get_torrent_status()</tt> to get a list of all torrents that match your\n+criteria. Then call <tt class=\"docutils literal\">refresh_torrent_status()</tt> 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 <tt class=\"docutils literal\">get_torrent_status()</tt> 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.</p>\n+<a name=\"post_torrent_updates()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_torrent_updates%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_torrent_updates%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-torrent-updates\">\n+<h2>post_torrent_updates()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_torrent_updates</strong> (status_flags_t flags = status_flags_t::all());\n+</pre>\n+<p>This functions instructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> to post the <a class=\"reference external\" href=\"reference-Alerts.html#state_update_alert\">state_update_alert</a>,\n+containing the status of all torrents whose state changed since the\n+last time this function was called.</p>\n+<p>Only torrents who has the state subscription flag set will be\n+included. This flag is on by default. See <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.\n+the <tt class=\"docutils literal\">flags</tt> argument is the same as for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>.\n+see status_flags_t in <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>.</p>\n+<a name=\"post_session_stats()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_session_stats%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_session_stats%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-session-stats\">\n+<h2>post_session_stats()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_session_stats</strong> ();\n+</pre>\n+<p>This function will post a <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> object, containing a\n+snapshot of the performance <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> from the internals of libtorrent.\n+To interpret these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>, query the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via\n+<a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a>.</p>\n+<p>For more information, see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n+<a name=\"post_dht_stats()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpost_dht_stats%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpost_dht_stats%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"post-dht-stats\">\n+<h2>post_dht_stats()</h2>\n+<pre class=\"literal-block\">\n+void <strong>post_dht_stats</strong> ();\n+</pre>\n+<p>This will cause a <a class=\"reference external\" href=\"reference-Alerts.html#dht_stats_alert\">dht_stats_alert</a> to be posted.</p>\n+<a name=\"set_dht_state()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_dht_state%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_dht_state%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-dht-state\">\n+<h2>set_dht_state()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_dht_state</strong> (dht::dht_state const& st);\n+void <strong>set_dht_state</strong> (dht::dht_state&& st);\n+</pre>\n+<p>set the DHT state for the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. This will be taken into account the\n+next time the DHT is started, as if it had been passed in via the\n+<a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> on startup.</p>\n+<a name=\"find_torrent()\"></a>\n+<a name=\"get_torrents()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bfind_torrent%28%29+get_torrents%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bfind_torrent%28%29+get_torrents%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"find-torrent-get-torrents\">\n+<h2>find_torrent() get_torrents()</h2>\n+<pre class=\"literal-block\">\n+std::vector<torrent_handle> <strong>get_torrents</strong> () const;\n+torrent_handle <strong>find_torrent</strong> (sha1_hash const& info_hash) const;\n+</pre>\n+<p><tt class=\"docutils literal\">find_torrent()</tt> looks for a torrent with the given info-hash. In\n+case there is such a torrent in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> to that\n+torrent is returned. In case the torrent cannot be found, an invalid\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is returned.</p>\n+<p>See <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::is_valid()</span></tt> to know if the torrent was found or\n+not.</p>\n+<p><tt class=\"docutils literal\">get_torrents()</tt> returns a vector of torrent_handles to all the\n+torrents currently in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n+<a name=\"async_add_torrent()\"></a>\n+<a name=\"add_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Basync_add_torrent%28%29+add_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Basync_add_torrent%28%29+add_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"async-add-torrent-add-torrent\">\n+<h2>async_add_torrent() add_torrent()</h2>\n+<pre class=\"literal-block\">\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params, error_code& ec);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params, error_code& ec);\n+void <strong>async_add_torrent</strong> (add_torrent_params&& params);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params&& params);\n+void <strong>async_add_torrent</strong> (add_torrent_params const& params);\n+torrent_handle <strong>add_torrent</strong> (add_torrent_params const& params);\n+</pre>\n+<p>You add torrents through the <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> function where you give an\n+object with all the parameters. The <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> overloads will block\n+until the torrent has been added (or failed to be added) and returns\n+an error code and a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a>. In order to add torrents more\n+efficiently, consider using <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a> which returns\n+immediately, without waiting for the torrent to add. Notification of\n+the torrent being added is sent as <a class=\"reference external\" href=\"reference-Alerts.html#add_torrent_alert\">add_torrent_alert</a>.</p>\n+<p>The <tt class=\"docutils literal\">save_path</tt> field in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> must be set to a valid\n+path where the files for the torrent will be saved. Even when using a\n+custom storage, this needs to be set to something. If the save_path\n+is empty, the call to <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> will throw a system_error\n+exception.</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> returned by <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> can be used to retrieve\n+information about the torrent's progress, its peers etc. It is also\n+used to abort a torrent.</p>\n+<p>If the torrent you are trying to add already exists in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (is\n+either queued for checking, being checked or downloading)\n+<tt class=\"docutils literal\">add_torrent()</tt> will throw system_error which derives from\n+<tt class=\"docutils literal\"><span class=\"pre\">std::exception</span></tt> unless duplicate_is_error is set to false. In that\n+case, <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> will return the handle to the existing torrent.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> 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.</p>\n+<p>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 <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.</p>\n+<a name=\"is_paused()\"></a>\n+<a name=\"pause()\"></a>\n+<a name=\"resume()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_paused%28%29+pause%28%29+resume%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_paused%28%29+pause%28%29+resume%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-paused-pause-resume\">\n+<h2>is_paused() pause() resume()</h2>\n+<pre class=\"literal-block\">\n+void <strong>resume</strong> ();\n+void <strong>pause</strong> ();\n+bool <strong>is_paused</strong> () const;\n+</pre>\n+<p>Pausing the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> pause state is separate from the torrent pause\n+state. A torrent is inactive if it is paused or if the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is\n+paused.</p>\n+<a name=\"is_dht_running()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bis_dht_running%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bis_dht_running%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"is-dht-running\">\n+<h2>is_dht_running()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_dht_running</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">is_dht_running()</tt> returns true if the DHT support has been started\n+and false otherwise.</p>\n+<a name=\"set_dht_storage()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_dht_storage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_dht_storage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-dht-storage\">\n+<h2>set_dht_storage()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_dht_storage</strong> (dht::dht_storage_constructor_type sc);\n+</pre>\n+<p><tt class=\"docutils literal\">set_dht_storage</tt> set a dht custom storage constructor function\n+to be used internally when the dht is created.</p>\n+<p>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.</p>\n+<p>If you want to make sure the dht is initially created with your\n+custom storage, create a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with the setting\n+<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::enable_dht</span></tt> to false, set your constructor function\n+and call <tt class=\"docutils literal\">apply_settings</tt> with <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::enable_dht</span></tt> to true.</p>\n+<a name=\"add_dht_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_dht_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_dht_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-dht-node\">\n+<h2>add_dht_node()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_dht_node</strong> (std::pair<std::string, int> const& node);\n+</pre>\n+<p><tt class=\"docutils literal\">add_dht_node</tt> 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.</p>\n+<a name=\"dht_get_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-get-item\">\n+<h2>dht_get_item()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_get_item</strong> (sha1_hash const& target);\n+</pre>\n+<p>query the DHT for an immutable item at the <tt class=\"docutils literal\">target</tt> hash.\n+the result is posted as a <a class=\"reference external\" href=\"reference-Alerts.html#dht_immutable_item_alert\">dht_immutable_item_alert</a>.</p>\n+<a name=\"dht_get_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_get_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_get_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-get-item-1\">\n+<h2>dht_get_item()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_get_item</strong> (std::array<char, 32> key\n+ , std::string salt = std::string());\n+</pre>\n+<p>query the DHT for a mutable item under the public key <tt class=\"docutils literal\">key</tt>.\n+this is an ed25519 key. <tt class=\"docutils literal\">salt</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#dht_mutable_item_alert\">dht_mutable_item_alert</a> is\n+posted.</p>\n+<a name=\"dht_put_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_put_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_put_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-put-item\">\n+<h2>dht_put_item()</h2>\n+<pre class=\"literal-block\">\n+sha1_hash <strong>dht_put_item</strong> (entry data);\n+</pre>\n+<p>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.</p>\n+<a name=\"dht_put_item()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_put_item%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_put_item%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-put-item-1\">\n+<h2>dht_put_item()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_put_item</strong> (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+</pre>\n+<p>store a mutable item. The <tt class=\"docutils literal\">key</tt> is the public key the blob is\n+to be stored under. The optional <tt class=\"docutils literal\">salt</tt> 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:</p>\n+<dl class=\"docutils\">\n+<dt>entry& value</dt>\n+<dd>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.</dd>\n+<dt>std::array<char,64>& signature</dt>\n+<dd>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+<tt class=\"docutils literal\">sign_mutable_item</tt> function.</dd>\n+<dt>std::int64_t& seq</dt>\n+<dd>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.</dd>\n+<dt>std::string const& salt</dt>\n+<dd>this is the salt that was used for this put call.</dd>\n+</dl>\n+<p>Since the callback function <tt class=\"docutils literal\">cb</tt> 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 <em>update</em> 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.</p>\n+<a name=\"dht_announce()\"></a>\n+<a name=\"dht_get_peers()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_announce%28%29+dht_get_peers%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_announce%28%29+dht_get_peers%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-announce-dht-get-peers\">\n+<h2>dht_announce() dht_get_peers()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_get_peers</strong> (sha1_hash const& info_hash);\n+void <strong>dht_announce</strong> (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+</pre>\n+<p><tt class=\"docutils literal\">dht_get_peers()</tt> 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+<a class=\"reference external\" href=\"reference-Alerts.html#dht_get_peers_reply_alert\">dht_get_peers_reply_alert</a>.</p>\n+<p><tt class=\"docutils literal\">dht_announce()</tt> 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+<tt class=\"docutils literal\">dht_announce()</tt> is not affected by the <tt class=\"docutils literal\">announce_port</tt> override setting.</p>\n+<p>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.</p>\n+<p>For possible flags, see <a class=\"reference external\" href=\"reference-DHT.html#announce_flags_t\">announce_flags_t</a>.</p>\n+<a name=\"dht_live_nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_live_nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_live_nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-live-nodes\">\n+<h2>dht_live_nodes()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_live_nodes</strong> (sha1_hash const& nid);\n+</pre>\n+<p>Retrieve all the live DHT (identified by <tt class=\"docutils literal\">nid</tt>) nodes. All the\n+nodes id and endpoint will be returned in the list of nodes in the\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> <tt class=\"docutils literal\">dht_live_nodes_alert</tt>.\n+Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit call, it will always be\n+posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n+<a name=\"dht_sample_infohashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_sample_infohashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_sample_infohashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-sample-infohashes\">\n+<h2>dht_sample_infohashes()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_sample_infohashes</strong> (udp::endpoint const& ep, sha1_hash const& target);\n+</pre>\n+<p>Query the DHT node specified by <tt class=\"docutils literal\">ep</tt> to retrieve a sample of the\n+info-hashes that the node currently have in their storage.\n+The <tt class=\"docutils literal\">target</tt> 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 <tt class=\"docutils literal\">dht_sample_infohashes_alert</tt>.</p>\n+<a name=\"dht_direct_request()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdht_direct_request%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdht_direct_request%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-direct-request\">\n+<h2>dht_direct_request()</h2>\n+<pre class=\"literal-block\">\n+void <strong>dht_direct_request</strong> (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#dht_direct_response_alert\">dht_direct_response_alert</a> will be posted\n+with the response (if any) and the userdata pointer passed in here.\n+Since this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a response to an explicit call, it will always be\n+posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n+<a name=\"add_extension()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_extension%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_extension%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-extension-1\">\n+<h2>add_extension()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_extension</strong> (std::shared_ptr<plugin> ext);\n+void <strong>add_extension</strong> (std::function<std::shared_ptr<torrent_plugin>(\n+ torrent_handle const&, client_data_t)> ext);\n+</pre>\n+<p>This function adds an extension to this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The argument is a\n+function object that is called with a <tt class=\"docutils literal\">torrent_handle</tt> and which should\n+return a <tt class=\"docutils literal\"><span class=\"pre\">std::shared_ptr<torrent_plugin></span></tt>. To write custom\n+plugins, see <a class=\"reference external\" href=\"reference-Plugins.html\">libtorrent plugins</a>. For the typical bittorrent client\n+all of these extensions should be added. The main plugins implemented\n+in libtorrent are:</p>\n+<dl class=\"docutils\">\n+<dt>uTorrent metadata</dt>\n+<dd>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.</dd>\n+</dl>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/ut_metadata.hpp></span><span class=\"comment preproc\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_ut_metadata_plugin</span><span class=\"punctuation\">);</span>\n+</pre>\n+<dl class=\"docutils\">\n+<dt>uTorrent peer exchange</dt>\n+<dd>Exchanges peers between clients.</dd>\n+</dl>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/ut_pex.hpp></span><span class=\"comment preproc\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_ut_pex_plugin</span><span class=\"punctuation\">);</span>\n+</pre>\n+<dl class=\"docutils\">\n+<dt>smart ban <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a></dt>\n+<dd>A <a class=\"reference external\" href=\"reference-Plugins.html#plugin\">plugin</a> 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.</dd>\n+</dl>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"comment preproc\">#include</span><span class=\"whitespace\"> </span><span class=\"comment preprocfile\"><libtorrent/extensions/smart_ban.hpp></span><span class=\"comment preproc\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">add_extension</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">lt</span><span class=\"operator\">::</span><span class=\"name\">create_smart_ban_plugin</span><span class=\"punctuation\">);</span>\n+</pre>\n+<a name=\"set_ip_filter()\"></a>\n+<a name=\"get_ip_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_ip_filter%28%29+get_ip_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-ip-filter-get-ip-filter\">\n+<h2>set_ip_filter() get_ip_filter()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_ip_filter</strong> (ip_filter f);\n+ip_filter <strong>get_ip_filter</strong> () const;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n+<p>Each time a peer is blocked because of the IP filter, a\n+<a class=\"reference external\" href=\"reference-Alerts.html#peer_blocked_alert\">peer_blocked_alert</a> is generated. <tt class=\"docutils literal\">get_ip_filter()</tt> Returns the\n+<a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a> currently in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. See <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n+<a name=\"set_port_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_port_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_port_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-port-filter\">\n+<h2>set_port_filter()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_port_filter</strong> (port_filter const& f);\n+</pre>\n+<p>apply <a class=\"reference external\" href=\"reference-Filter.html#port_filter\">port_filter</a> <tt class=\"docutils literal\">f</tt> 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.</p>\n+<a name=\"ssl_listen_port()\"></a>\n+<a name=\"is_listening()\"></a>\n+<a name=\"listen_port()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bssl_listen_port%28%29+is_listening%28%29+listen_port%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bssl_listen_port%28%29+is_listening%28%29+listen_port%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"ssl-listen-port-is-listening-listen-port\">\n+<h2>ssl_listen_port() is_listening() listen_port()</h2>\n+<pre class=\"literal-block\">\n+unsigned short <strong>ssl_listen_port</strong> () const;\n+bool <strong>is_listening</strong> () const;\n+unsigned short <strong>listen_port</strong> () const;\n+</pre>\n+<p><tt class=\"docutils literal\">is_listening()</tt> will tell you whether or not the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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+<a class=\"reference external\" href=\"reference-Settings.html#listen_interfaces\">settings_pack::listen_interfaces</a> to try another interface and port to\n+bind to.</p>\n+<p><tt class=\"docutils literal\">listen_port()</tt> returns the port we ended up listening on.</p>\n+<a name=\"get_peer_class_filter()\"></a>\n+<a name=\"set_peer_class_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_peer_class_filter%28%29+set_peer_class_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_peer_class_filter%28%29+set_peer_class_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-peer-class-filter-set-peer-class-filter\">\n+<h2>get_peer_class_filter() set_peer_class_filter()</h2>\n+<pre class=\"literal-block\">\n+ip_filter <strong>get_peer_class_filter</strong> () const;\n+void <strong>set_peer_class_filter</strong> (ip_filter const& f);\n+</pre>\n+<p>Sets the peer class filter for this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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.</p>\n+<p>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.</p>\n+<p>For more info, see <a class=\"reference external\" href=\"reference-Filter.html#ip_filter\">ip_filter</a>.</p>\n+<p>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:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">ip_filter</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">get_peer_class_filter</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"name\">peer_class_t</span><span class=\"whitespace\"> </span><span class=\"name\">my_class</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">create_peer_class</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.x.x IP range"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"name\">f</span><span class=\"punctuation\">.</span><span class=\"name\">add_rule</span><span class=\"punctuation\">(</span><span class=\"name\">make_address</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.1.0"</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">make_address</span><span class=\"punctuation\">(</span><span class=\"literal string\">"200.1.255.255"</span><span class=\"punctuation\">)</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"keyword type\">uint32_t</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">my_class</span><span class=\"punctuation\">));</span><span class=\"whitespace\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">set_peer_class_filter</span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">);</span>\n+</pre>\n+<p>This setting only applies to new connections, it won't affect existing\n+peer connections.</p>\n+<p>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.</p>\n+<p>The <tt class=\"docutils literal\">peer_class</tt> argument cannot be greater than 31. The bitmasks\n+representing peer classes in the <tt class=\"docutils literal\">peer_class_filter</tt> are 32 bits.</p>\n+<p>The <tt class=\"docutils literal\">get_peer_class_filter()</tt> function returns the current filter.</p>\n+<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"set_peer_class_type_filter()\"></a>\n+<a name=\"get_peer_class_type_filter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bset_peer_class_type_filter%28%29+get_peer_class_type_filter%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-peer-class-type-filter-get-peer-class-type-filter\">\n+<h2>set_peer_class_type_filter() get_peer_class_type_filter()</h2>\n+<pre class=\"literal-block\">\n+peer_class_type_filter <strong>get_peer_class_type_filter</strong> () const;\n+void <strong>set_peer_class_type_filter</strong> (peer_class_type_filter const& f);\n+</pre>\n+<p>Sets and gets the <em>peer class type filter</em>. This is controls automatic\n+peer class assignments to peers based on what kind of socket it is.</p>\n+<p>It does not only support assigning peer classes, it also supports\n+removing peer classes based on socket type.</p>\n+<p>The order of these rules being applied are:</p>\n+<ol class=\"arabic simple\">\n+<li>peer-class IP filter</li>\n+<li>peer-class type filter, removing classes</li>\n+<li>peer-class type filter, adding classes</li>\n+</ol>\n+<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"create_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bcreate_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bcreate_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"create-peer-class\">\n+<h2>create_peer_class()</h2>\n+<pre class=\"literal-block\">\n+peer_class_t <strong>create_peer_class</strong> (char const* name);\n+</pre>\n+<p>Creates a new peer class (see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>) 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.</p>\n+<p>Identifiers are assigned from low numbers to higher. So if you plan on\n+using certain peer classes in a call to <a class=\"reference external\" href=\"reference-Session.html#set_peer_class_filter()\">set_peer_class_filter()</a>,\n+make sure to create those early on, to get low identifiers.</p>\n+<p>For more information on peer classes, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"delete_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"delete-peer-class\">\n+<h2>delete_peer_class()</h2>\n+<pre class=\"literal-block\">\n+void <strong>delete_peer_class</strong> (peer_class_t cid);\n+</pre>\n+<p>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 <strong>once</strong> per peer class you create.\n+Calling it more than once for the same class will lead to memory\n+corruption.</p>\n+<p>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.</p>\n+<p>There is no need to call this function for custom peer classes. All\n+peer classes will be properly destructed when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object\n+destructs.</p>\n+<p>For more information on peer classes, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"get_peer_class()\"></a>\n+<a name=\"set_peer_class()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bget_peer_class%28%29+set_peer_class%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bget_peer_class%28%29+set_peer_class%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-peer-class-set-peer-class\">\n+<h2>get_peer_class() set_peer_class()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_peer_class</strong> (peer_class_t cid, peer_class_info const& pci);\n+peer_class_info <strong>get_peer_class</strong> (peer_class_t cid) const;\n+</pre>\n+<p>These functions queries information from a peer class and updates the\n+configuration of a peer class, respectively.</p>\n+<p><tt class=\"docutils literal\">cid</tt> must refer to an existing peer class. If it does not, the\n+return value of <tt class=\"docutils literal\">get_peer_class()</tt> is undefined.</p>\n+<p><tt class=\"docutils literal\">set_peer_class()</tt> sets all the information in the\n+<a class=\"reference external\" href=\"reference-PeerClass.html#peer_class_info\">peer_class_info</a> object in the specified peer class. There is no\n+option to only update a single property.</p>\n+<p>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.</p>\n+<p>For more information, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n+<a name=\"remove_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bremove_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bremove_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"remove-torrent-1\">\n+<h2>remove_torrent()</h2>\n+<pre class=\"literal-block\">\n+void <strong>remove_torrent</strong> (const torrent_handle&, remove_flags_t = {});\n+</pre>\n+<p><tt class=\"docutils literal\">remove_torrent()</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a>.</p>\n+<p><a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> is non-blocking, but will remove the torrent from the\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> synchronously. Calling <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">session_handle::add_torrent()</a> 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.</p>\n+<p>The optional second argument <tt class=\"docutils literal\">options</tt> can be used to delete all the\n+files downloaded by this torrent. To do so, pass in the value\n+<tt class=\"docutils literal\"><span class=\"pre\">session_handle::delete_files</span></tt>. Once the torrent is deleted, a\n+<a class=\"reference external\" href=\"reference-Alerts.html#torrent_deleted_alert\">torrent_deleted_alert</a> is posted.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> remains valid for some time after <a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> 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+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#is_valid()\">torrent_handle::is_valid()</a> will return true, and other calls such\n+as <a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a> will succeed. Because of this, and because\n+<a class=\"reference external\" href=\"reference-Session.html#remove_torrent()\">remove_torrent()</a> is non-blocking, the following sequence usually\n+succeeds (does not throw system_error):\n+.. code:: c++</p>\n+<blockquote>\n+session.remove_handle(handle);\n+handle.save_resume_data();</blockquote>\n+<p>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.</p>\n+<a name=\"apply_settings()\"></a>\n+<a name=\"get_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bapply_settings%28%29+get_settings%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bapply_settings%28%29+get_settings%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"apply-settings-get-settings\">\n+<h2>apply_settings() get_settings()</h2>\n+<pre class=\"literal-block\">\n+void <strong>apply_settings</strong> (settings_pack&&);\n+void <strong>apply_settings</strong> (settings_pack const&);\n+settings_pack <strong>get_settings</strong> () const;\n+</pre>\n+<p>Applies the settings specified by the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> <tt class=\"docutils literal\">s</tt>. 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.</p>\n+<a name=\"pop_alerts()\"></a>\n+<a name=\"set_alert_notify()\"></a>\n+<a name=\"wait_for_alert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpop_alerts%28%29+set_alert_notify%28%29+wait_for_alert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpop_alerts%28%29+set_alert_notify%28%29+wait_for_alert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"pop-alerts-set-alert-notify-wait-for-alert\">\n+<h2>pop_alerts() set_alert_notify() wait_for_alert()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_alert_notify</strong> (std::function<void()> const& fun);\n+alert* <strong>wait_for_alert</strong> (time_duration max_wait);\n+void <strong>pop_alerts</strong> (std::vector<alert*>* alerts);\n+</pre>\n+<p>Alerts is the main mechanism for libtorrent to report errors and\n+events. <tt class=\"docutils literal\">pop_alerts</tt> fills in the vector passed to it with pointers\n+to new alerts. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> still owns these alerts and they will stay\n+valid until the next time <tt class=\"docutils literal\">pop_alerts</tt> is called. You may not delete\n+the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> objects.</p>\n+<p>It is safe to call <tt class=\"docutils literal\">pop_alerts</tt> from multiple different threads, as\n+long as the alerts themselves are not accessed once another thread\n+calls <tt class=\"docutils literal\">pop_alerts</tt>. Doing this requires manual synchronization\n+between the popping threads.</p>\n+<p><tt class=\"docutils literal\">wait_for_alert</tt> will block the current thread for <tt class=\"docutils literal\">max_wait</tt> time\n+duration, or until another <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted. If an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is available\n+at the time of the call, it returns immediately. The returned <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+pointer is the head of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue. <tt class=\"docutils literal\">wait_for_alert</tt> does not\n+pop alerts from the queue, it merely peeks at it. The returned <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+will stay valid until <tt class=\"docutils literal\">pop_alerts</tt> is called twice. The first time\n+will pop it and the second will free it.</p>\n+<p>If there is no <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> in the queue and no <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> arrives within the\n+specified timeout, <tt class=\"docutils literal\">wait_for_alert</tt> returns nullptr.</p>\n+<p>In the python binding, <tt class=\"docutils literal\">wait_for_alert</tt> takes the number of\n+milliseconds to wait as an integer.</p>\n+<p>The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, see\n+<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::alert_queue_size</span></tt>.</p>\n+<p>Some alerts are considered so important that they are posted even when\n+the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue is full. Some alerts are considered mandatory and cannot\n+be disabled by the <tt class=\"docutils literal\">alert_mask</tt>. For instance,\n+<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> and <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_failed_alert\">save_resume_data_failed_alert</a> are always\n+posted, regardless of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n+<p>To control which alerts are posted, set the alert_mask\n+(<a class=\"reference external\" href=\"reference-Settings.html#alert_mask\">settings_pack::alert_mask</a>).</p>\n+<p>If the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue fills up to the point where alerts are dropped, this\n+will be indicated by a <a class=\"reference external\" href=\"reference-Alerts.html#alerts_dropped_alert\">alerts_dropped_alert</a>, which contains a bitmask\n+of which types of alerts were dropped. Generally it is a good idea to\n+make sure the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<p>the <tt class=\"docutils literal\">set_alert_notify</tt> function lets the client set a function object\n+to be invoked every time the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> queue goes from having 0 alerts to\n+1 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. 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 <tt class=\"docutils literal\">pop_alerts()</tt>. If the notify function fails\n+to do so, it won't be called again, until <tt class=\"docutils literal\">pop_alerts</tt> 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.</p>\n+<p>The type of an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is returned by the polymorphic function\n+<tt class=\"docutils literal\"><span class=\"pre\">alert::type()</span></tt> but can also be queries from a concrete type via\n+<tt class=\"docutils literal\"><span class=\"pre\">T::alert_type</span></tt>, as a static constant.</p>\n+<a name=\"add_port_mapping()\"></a>\n+<a name=\"delete_port_mapping()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Badd_port_mapping%28%29+delete_port_mapping%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-port-mapping-delete-port-mapping\">\n+<h2>add_port_mapping() delete_port_mapping()</h2>\n+<pre class=\"literal-block\">\n+std::vector<port_mapping_t> <strong>add_port_mapping</strong> (portmap_protocol t, int external_port, int local_port);\n+void <strong>delete_port_mapping</strong> (port_mapping_t handle);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The return values are all handles referring to the\n+port mappings that were just created. Pass them to <a class=\"reference external\" href=\"reference-Session.html#delete_port_mapping()\">delete_port_mapping()</a>\n+to remove them.</p>\n+<a name=\"reopen_network_sockets()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Breopen_network_sockets%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Breopen_network_sockets%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reopen-network-sockets\">\n+<h2>reopen_network_sockets()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reopen_network_sockets</strong> (reopen_network_flags_t options = reopen_map_ports);\n+</pre>\n+<p>Instructs the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> to reopen all listen and outgoing sockets.</p>\n+<p>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.</p>\n+<a name=\"native_handle()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bnative_handle%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bnative_handle%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"native-handle-1\">\n+<h2>native_handle()</h2>\n+<pre class=\"literal-block\">\n+std::shared_ptr<aux::session_impl> <strong>native_handle</strong> () const;\n+</pre>\n+<p>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.</p>\n+<a name=\"save_settings\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_settings%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_settings%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_settings</dt>\n+<dd>saves settings (i.e. the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>)</dd>\n+</dl>\n+<a name=\"save_dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_dht_state%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_dht_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_dht_state</dt>\n+<dd>saves dht state such as nodes and node-id, possibly accelerating\n+joining the DHT if provided at next <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> startup.</dd>\n+</dl>\n+<a name=\"save_extension_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_extension_state%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_extension_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_extension_state</dt>\n+<dd>load or save state from plugins</dd>\n+</dl>\n+<a name=\"save_ip_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bsave_ip_filter%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bsave_ip_filter%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_ip_filter</dt>\n+<dd>load or save the IP filter set on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a></dd>\n+</dl>\n+<a name=\"global_peer_class_id\"></a>\n+<a name=\"tcp_peer_class_id\"></a>\n+<a name=\"local_peer_class_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bglobal_peer_class_id+tcp_peer_class_id+local_peer_class_id%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bglobal_peer_class_id+tcp_peer_class_id+local_peer_class_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>global_peer_class_id tcp_peer_class_id local_peer_class_id</dt>\n+<dd>built-in peer classes</dd>\n+</dl>\n+<a name=\"delete_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_files%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>delete_files</dt>\n+<dd>delete the files belonging to the torrent from disk.\n+including the part-file, if there is one</dd>\n+</dl>\n+<a name=\"delete_partfile\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bdelete_partfile%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bdelete_partfile%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>delete_partfile</dt>\n+<dd>delete just the part-file associated with this torrent</dd>\n+</dl>\n+<a name=\"paused\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Bpaused%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Bpaused%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>paused</dt>\n+<dd>when set, the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> will start paused. Call\n+<a class=\"reference external\" href=\"reference-Session.html#resume()\">session_handle::resume()</a> to start</dd>\n+</dl>\n+<a name=\"udp\"></a>\n+<a name=\"tcp\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Budp+tcp%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Budp+tcp%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>udp tcp</dt>\n+<dd>protocols used by <a class=\"reference external\" href=\"reference-Session.html#add_port_mapping()\">add_port_mapping()</a></dd>\n+</dl>\n+<a name=\"reopen_map_ports\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_handle%3A%3A%5Breopen_map_ports%5D&labels=documentation&body=Documentation+under+heading+%22session_handle%3A%3A%5Breopen_map_ports%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>reopen_map_ports</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"read_session_params()\"></a>\n+<a name=\"write_session_params_buf()\"></a>\n+<a name=\"write_session_params()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:read_session_params%28%29+write_session_params_buf%28%29+write_session_params%28%29&labels=documentation&body=Documentation+under+heading+%22read_session_params%28%29+write_session_params_buf%28%29+write_session_params%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"read-session-params-write-session-params-buf-write-session-params\">\n+<h1>read_session_params() write_session_params_buf() write_session_params()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_params.hpp\">libtorrent/session_params.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+session_params <strong>read_session_params</strong> (span<char const> buf\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params <strong>read_session_params</strong> (bdecode_node const& e\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+std::vector<char> <strong>write_session_params_buf</strong> (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+entry <strong>write_session_params</strong> (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+</pre>\n+<p>These functions serialize and de-serialize a <tt class=\"docutils literal\">session_params</tt> object to and\n+from bencoded form. The <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> object is used to initialize a new\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> using the state from a previous one (or by programmatically configure\n+the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> up-front).\n+The flags parameter can be used to only save and load certain aspects of the\n+session's state.\n+The <tt class=\"docutils literal\">_buf</tt> suffix indicates the function operates on buffer rather than the\n+bencoded structure.\n+The torrents in a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> are not part of the <a class=\"reference external\" href=\"reference-Session.html#session_params\">session_params</a> state, they have\n+to be restored separately.</p>\n+<a name=\"counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+counters&labels=documentation&body=Documentation+under+heading+%22class+counters%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"counters\">\n+<h1>counters</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/performance_counters.hpp\">libtorrent/performance_counters.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+struct counters\n+{\n+ <strong>counters</strong> () ;\n+ counters& <strong>operator=</strong> (counters const&) & ;\n+ <strong>counters</strong> (counters const&) ;\n+ std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n+ std::int64_t <strong>operator[]</strong> (int i) const ;\n+ void <strong>blend_stats_counter</strong> (int c, std::int64_t value, int ratio) ;\n+ void <strong>set_value</strong> (int c, std::int64_t value) ;\n+};\n+</pre>\n+<a name=\"operator[]()\"></a>\n+<a name=\"inc_stats_counter()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D&labels=documentation&body=Documentation+under+heading+%22counters%3A%3A%5Boperator%5B%5D%28%29+inc_stats_counter%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-inc-stats-counter\">\n+<h2>operator[]() inc_stats_counter()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>inc_stats_counter</strong> (int c, std::int64_t value = 1) ;\n+std::int64_t <strong>operator[]</strong> (int i) const ;\n+</pre>\n+<p>returns the new value</p>\n+<a name=\"stats_metric\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+stats_metric&labels=documentation&body=Documentation+under+heading+%22class+stats_metric%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"stats-metric\">\n+<h1>stats_metric</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n+<p>describes one statistics metric from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. For more information,\n+see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n+<pre class=\"literal-block\">\n+struct stats_metric\n+{\n+ char const* name;\n+ int value_index;\n+ metric_type_t type;\n+};\n+</pre>\n+<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:stats_metric%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22stats_metric%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>name</dt>\n+<dd>the name of the counter or gauge</dd>\n+</dl>\n+<a name=\"value_index\"></a>\n+<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:stats_metric%3A%3A%5Bvalue_index+type%5D&labels=documentation&body=Documentation+under+heading+%22stats_metric%3A%3A%5Bvalue_index+type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>value_index type</dt>\n+<dd>the index into the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array, where the underlying value of\n+this counter or gauge is found. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats array is part of the\n+<a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> object.</dd>\n+</dl>\n+<a name=\"session_stats_metrics()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_metrics%28%29&labels=documentation&body=Documentation+under+heading+%22session_stats_metrics%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-stats-metrics\">\n+<h1>session_stats_metrics()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::vector<stats_metric> <strong>session_stats_metrics</strong> ();\n+</pre>\n+<p>This free function returns the list of available metrics exposed by\n+libtorrent's statistics API. Each metric has a name and a <em>value index</em>.\n+The value index is the index into the array in <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> where\n+this metric's value can be found when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> stats is sampled (by\n+calling <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a>).</p>\n+<a name=\"find_metric_idx()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:find_metric_idx%28%29&labels=documentation&body=Documentation+under+heading+%22find_metric_idx%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"find-metric-idx\">\n+<h1>find_metric_idx()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+int <strong>find_metric_idx</strong> (string_view name);\n+</pre>\n+<p>given a name of a metric, this function returns the counter index of it,\n+or -1 if it could not be found. The counter index is the index into the\n+values array returned by <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a>.</p>\n+<a name=\"metric_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+metric_type_t&labels=documentation&body=Documentation+under+heading+%22enum+metric_type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-metric-type-t\">\n+<h1>enum metric_type_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session_stats.hpp\">libtorrent/session_stats.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"48%\" />\n-<col width=\"21%\" />\n <col width=\"31%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>peer_timeout</td>\n-<td>int</td>\n-<td>120</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">peer_timeout</tt> 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.</p>\n-<a name=\"urlseed_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>urlseed_timeout</td>\n-<td>int</td>\n-<td>20</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"urlseed_pipeline_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>urlseed_pipeline_size</td>\n-<td>int</td>\n-<td>5</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"urlseed_wait_retry\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>urlseed_wait_retry</td>\n-<td>int</td>\n-<td>30</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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 <tt class=\"docutils literal\"><span class=\"pre\">retry-after</span></tt> header.</p>\n-<a name=\"file_pool_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"52%\" />\n-<col width=\"19%\" />\n-<col width=\"29%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>file_pool_size</td>\n-<td>int</td>\n-<td>40</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>sets the upper limit on the total number of files this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n-<a name=\"max_failcount\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_failcount</td>\n-<td>int</td>\n-<td>3</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_failcount</tt> 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.</p>\n-<a name=\"min_reconnect_time\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>min_reconnect_time</td>\n-<td>int</td>\n-<td>60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>the number of seconds to wait to reconnect to a peer. this time is\n-multiplied with the failcount.</p>\n-<a name=\"peer_connect_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n <col width=\"24%\" />\n+<col width=\"45%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>peer_connect_timeout</td>\n-<td>int</td>\n-<td>15</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">peer_connect_timeout</tt> 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.</p>\n-<a name=\"connection_speed\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"55%\" />\n-<col width=\"18%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>connection_speed</td>\n-<td>int</td>\n-<td>30</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">connection_speed</tt> 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.</p>\n-<a name=\"inactivity_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>inactivity_timeout</td>\n-<td>int</td>\n-<td>600</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>if a peer is uninteresting and uninterested for longer than this\n-number of seconds, it will be disconnected.</p>\n-<a name=\"unchoke_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"55%\" />\n-<col width=\"18%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>counter</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>unchoke_interval</td>\n-<td>int</td>\n-<td>15</td>\n+<tr><td>gauge</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">unchoke_interval</tt> 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.</p>\n-<a name=\"optimistic_unchoke_interval\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"announce_infohash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_infohash&labels=documentation&body=Documentation+under+heading+%22class+announce_infohash%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"announce-infohash\">\n+<h1>announce_infohash</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+struct announce_infohash\n+{\n+ std::string message;\n+ error_code last_error;\n+ int <strong>scrape_incomplete</strong> = -1;\n+ int <strong>scrape_complete</strong> = -1;\n+ int <strong>scrape_downloaded</strong> = -1;\n+ std::uint8_t fails : 7;\n+ bool updating : 1;\n+ bool start_sent : 1;\n+ bool complete_sent : 1;\n+};\n+</pre>\n+<a name=\"message\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bmessage%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bmessage%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>message</dt>\n+<dd>if this tracker has returned an error or warning message\n+that message is stored here</dd>\n+</dl>\n+<a name=\"last_error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Blast_error%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Blast_error%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_error</dt>\n+<dd>if this tracker failed the last time it was contacted\n+this error code specifies what error occurred</dd>\n+</dl>\n+<a name=\"scrape_incomplete\"></a>\n+<a name=\"scrape_complete\"></a>\n+<a name=\"scrape_downloaded\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bscrape_incomplete+scrape_complete+scrape_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bscrape_incomplete+scrape_complete+scrape_downloaded%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>scrape_incomplete scrape_complete scrape_downloaded</dt>\n+<dd>if this tracker has returned scrape data, these fields are filled in\n+with valid numbers. Otherwise they are set to -1. <tt class=\"docutils literal\">incomplete</tt> counts\n+the number of current downloaders. <tt class=\"docutils literal\">complete</tt> counts the number of\n+current peers completed the download, or "seeds". <tt class=\"docutils literal\">downloaded</tt> is the\n+cumulative number of completed downloads.</dd>\n+</dl>\n+<a name=\"fails\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bfails%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bfails%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>fails</dt>\n+<dd>the number of times in a row we have failed to announce to this\n+tracker.</dd>\n+</dl>\n+<a name=\"updating\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bupdating%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bupdating%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>updating</dt>\n+<dd>true while we're waiting for a response from the tracker.</dd>\n+</dl>\n+<a name=\"start_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bstart_sent%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bstart_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>start_sent</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"complete_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_infohash%3A%3A%5Bcomplete_sent%5D&labels=documentation&body=Documentation+under+heading+%22announce_infohash%3A%3A%5Bcomplete_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>complete_sent</dt>\n+<dd>set to true when we send a event=completed.</dd>\n+</dl>\n+<a name=\"announce_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_endpoint&labels=documentation&body=Documentation+under+heading+%22class+announce_endpoint%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"announce-endpoint\">\n+<h1>announce_endpoint</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n+<p>announces are sent to each tracker using every listen socket\n+this class holds information about one listen socket for one tracker</p>\n+<pre class=\"literal-block\">\n+struct announce_endpoint\n+{\n+ <strong>announce_endpoint</strong> ();\n+\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> local_endpoint;\n+ aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n+ bool <strong>enabled</strong> = true;\n+};\n+</pre>\n+<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_endpoint</dt>\n+<dd>the local endpoint of the listen interface associated with this endpoint</dd>\n+</dl>\n+<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hashes</dt>\n+<dd>info_hashes[0] is the v1 info hash (SHA1)\n+info_hashes[1] is the v2 info hash (truncated SHA-256)</dd>\n+</dl>\n+<a name=\"enabled\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_endpoint%3A%3A%5Benabled%5D&labels=documentation&body=Documentation+under+heading+%22announce_endpoint%3A%3A%5Benabled%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>enabled</dt>\n+<dd>set to false to not announce from this endpoint</dd>\n+</dl>\n+<a name=\"announce_entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+announce_entry&labels=documentation&body=Documentation+under+heading+%22class+announce_entry%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"announce-entry\">\n+<h1>announce_entry</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n+<p>this class holds information about one bittorrent tracker, as it\n+relates to a specific torrent.</p>\n+<pre class=\"literal-block\">\n+struct announce_entry\n+{\n+ <strong>announce_entry</strong> (announce_entry const&);\n+ <strong>~announce_entry</strong> ();\n+ announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n+ <strong>announce_entry</strong> ();\n+ explicit <strong>announce_entry</strong> (string_view u);\n+\n+ enum tracker_source\n+ {\n+ source_torrent,\n+ source_client,\n+ source_magnet_link,\n+ source_tex,\n+ };\n+\n+ std::string url;\n+ std::string trackerid;\n+ std::vector<announce_endpoint> endpoints;\n+ std::uint8_t <strong>tier</strong> = 0;\n+ std::uint8_t <strong>fail_limit</strong> = 0;\n+ std::uint8_t source:4;\n+ bool verified:1;\n+};\n+</pre>\n+<a name=\"operator=()\"></a>\n+<a name=\"~announce_entry()\"></a>\n+<a name=\"announce_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Boperator%3D%28%29+~announce_entry%28%29+announce_entry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Boperator%3D%28%29+~announce_entry%28%29+announce_entry%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-announce-entry-announce-entry\">\n+<h2>operator=() ~announce_entry() announce_entry()</h2>\n+<pre class=\"literal-block\">\n+<strong>announce_entry</strong> (announce_entry const&);\n+<strong>~announce_entry</strong> ();\n+announce_entry& <strong>operator=</strong> (announce_entry const&) &;\n+<strong>announce_entry</strong> ();\n+explicit <strong>announce_entry</strong> (string_view u);\n+</pre>\n+<p>constructs a tracker announce <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> with <tt class=\"docutils literal\">u</tt> as the URL.</p>\n+<a name=\"tracker_source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+tracker_source&labels=documentation&body=Documentation+under+heading+%22enum+tracker_source%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-tracker-source\">\n+<h2>enum tracker_source</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/announce_entry.hpp\">libtorrent/announce_entry.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"66%\" />\n-<col width=\"14%\" />\n <col width=\"20%\" />\n+<col width=\"7%\" />\n+<col width=\"74%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>optimistic_unchoke_interval</td>\n-<td>int</td>\n-<td>30</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">optimistic_unchoke_interval</tt> is the number of seconds between\n-each <em>optimistic</em> unchoke. On this timer, the currently\n-optimistically unchoked peer will change.</p>\n-<a name=\"num_want\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"40%\" />\n-<col width=\"24%\" />\n-<col width=\"36%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>num_want</td>\n-<td>int</td>\n-<td>200</td>\n+<tr><td>source_torrent</td>\n+<td>1</td>\n+<td>the tracker was part of the .torrent file</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">num_want</tt> is the number of peers we want from each tracker\n-request. It defines what is sent as the <tt class=\"docutils literal\">&num_want=</tt> parameter to\n-the tracker.</p>\n-<a name=\"initial_picker_threshold\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>source_client</td>\n+<td>2</td>\n+<td>the tracker was added programmatically via the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#add_tracker()\">add_tracker()</a> function</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>initial_picker_threshold</td>\n-<td>int</td>\n+<tr><td>source_magnet_link</td>\n <td>4</td>\n+<td>the tracker was part of a magnet link</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">initial_picker_threshold</tt> specifies the number of pieces we need\n-before we switch to rarest first picking. The first\n-<tt class=\"docutils literal\">initial_picker_threshold</tt> pieces in any torrent are picked at random\n-, the following pieces are picked in rarest first order.</p>\n-<a name=\"allowed_fast_set_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>allowed_fast_set_size</td>\n-<td>int</td>\n-<td>5</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>the number of allowed pieces to send to peers that supports the\n-fast extensions</p>\n-<a name=\"suggest_mode\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"25%\" />\n-<col width=\"11%\" />\n-<col width=\"65%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>suggest_mode</td>\n-<td>int</td>\n-<td>settings_pack::no_piece_suggestions</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">suggest_mode</tt> 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:</p>\n-<ul class=\"simple\">\n-<li><tt class=\"docutils literal\">no_piece_suggestions</tt> which will not send out suggest messages.</li>\n-<li><tt class=\"docutils literal\">suggest_read_cache</tt> which will send out suggest messages for\n-the most recent pieces that are in the read cache.</li>\n-</ul>\n-<a name=\"max_queued_disk_bytes\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"55%\" />\n-<col width=\"14%\" />\n-<col width=\"31%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_queued_disk_bytes</td>\n-<td>int</td>\n-<td>1024 * 1024</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_queued_disk_bytes</tt> 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.</p>\n-<a name=\"handshake_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>handshake_timeout</td>\n-<td>int</td>\n-<td>10</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"send_buffer_low_watermark\"></a>\n-<a name=\"send_buffer_watermark\"></a>\n-<a name=\"send_buffer_watermark_factor\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"13%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>send_buffer_low_watermark</td>\n-<td>int</td>\n-<td>10 * 1024</td>\n-</tr>\n-<tr><td>send_buffer_watermark</td>\n-<td>int</td>\n-<td>500 * 1024</td>\n-</tr>\n-<tr><td>send_buffer_watermark_factor</td>\n-<td>int</td>\n-<td>50</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">send_buffer_low_watermark</tt> 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</p>\n-<p>if the send buffer has fewer bytes than <tt class=\"docutils literal\">send_buffer_watermark</tt>,\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.</p>\n-<p>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-<tt class=\"docutils literal\">send_buffer_watermark</tt> 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.</p>\n-<a name=\"choking_algorithm\"></a>\n-<a name=\"seed_choking_algorithm\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"37%\" />\n-<col width=\"9%\" />\n-<col width=\"54%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>choking_algorithm</td>\n-<td>int</td>\n-<td>settings_pack::fixed_slots_choker</td>\n-</tr>\n-<tr><td>seed_choking_algorithm</td>\n-<td>int</td>\n-<td>settings_pack::round_robin</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">choking_algorithm</tt> 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.</p>\n-<p>The options for choking algorithms are defined in the\n-<a class=\"reference external\" href=\"reference-Settings.html#choking_algorithm_t\">choking_algorithm_t</a> enum.</p>\n-<p><tt class=\"docutils literal\">seed_choking_algorithm</tt> 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 <a class=\"reference external\" href=\"reference-Settings.html#seed_choking_algorithm_t\">seed_choking_algorithm_t</a> enum.</p>\n-<a name=\"disk_io_write_mode\"></a>\n-<a name=\"disk_io_read_mode\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"34%\" />\n-<col width=\"10%\" />\n-<col width=\"55%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>disk_io_write_mode</td>\n-<td>int</td>\n-<td>DISK_WRITE_MODE</td>\n-</tr>\n-<tr><td>disk_io_read_mode</td>\n-<td>int</td>\n-<td>settings_pack::enable_os_cache</td>\n+<tr><td>source_tex</td>\n+<td>8</td>\n+<td>the tracker was received from the swarm via tracker exchange</td>\n </tr>\n </tbody>\n </table>\n-<p>determines how files are opened when they're in read only mode\n-versus read and write mode. The options are:</p>\n-<dl class=\"docutils\">\n-<dt>enable_os_cache</dt>\n-<dd>Files are opened normally, with the OS caching reads and writes.</dd>\n-<dt>disable_os_cache</dt>\n-<dd>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.</dd>\n-<dt>write_through</dt>\n-<dd>flush pieces to disk as they complete validation.</dd>\n+<a name=\"url\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Burl%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Burl%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>url</dt>\n+<dd>tracker URL as it appeared in the torrent file</dd>\n </dl>\n-<p>One reason to disable caching is that it may help the operating\n-system from growing its file cache indefinitely.</p>\n-<a name=\"outgoing_port\"></a>\n-<a name=\"num_outgoing_ports\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>outgoing_port</td>\n-<td>int</td>\n-<td>0</td>\n-</tr>\n-<tr><td>num_outgoing_ports</td>\n-<td>int</td>\n-<td>0</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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, <tt class=\"docutils literal\">num_outgoing_ports</tt> is the size of the range. It should\n-be more than a few</p>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">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.</p>\n+<a name=\"trackerid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Btrackerid%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Btrackerid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>trackerid</dt>\n+<dd>the current <tt class=\"docutils literal\">&trackerid=</tt> argument passed to the tracker.\n+this is optional and is normally empty (in which case no\n+trackerid is sent).</dd>\n+</dl>\n+<a name=\"endpoints\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bendpoints%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bendpoints%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoints</dt>\n+<dd>each local listen socket (endpoint) will announce to the tracker. This\n+list contains state per endpoint.</dd>\n+</dl>\n+<a name=\"tier\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Btier%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Btier%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>tier</dt>\n+<dd>the tier this tracker belongs to</dd>\n+</dl>\n+<a name=\"fail_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bfail_limit%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bfail_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>fail_limit</dt>\n+<dd>the max number of failures to announce to this tracker in\n+a row, before this tracker is not used anymore. 0 means unlimited</dd>\n+</dl>\n+<a name=\"source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bsource%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bsource%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>source</dt>\n+<dd>a bitmask specifying which sources we got this tracker from.</dd>\n+</dl>\n+<a name=\"verified\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:announce_entry%3A%3A%5Bverified%5D&labels=documentation&body=Documentation+under+heading+%22announce_entry%3A%3A%5Bverified%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>verified</dt>\n+<dd>set to true the first time we receive a valid response\n+from this tracker.</dd>\n+</dl>\n+<a name=\"peer_class_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_class_info&labels=documentation&body=Documentation+under+heading+%22class+peer_class_info%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<p>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 <tt class=\"docutils literal\">TIME_WAIT</tt> state.</p>\n-<a name=\"peer_dscp\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"42%\" />\n-<col width=\"23%\" />\n-<col width=\"35%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>peer_dscp</td>\n-<td>int</td>\n-<td>0x04</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">peer_dscp</tt> determines the DSCP field in the IP header of every\n-packet sent to peers (including web seeds). <tt class=\"docutils literal\">0x0</tt> means no marking,\n-<tt class=\"docutils literal\">0x04</tt> represents Lower Effort. For more details see <a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc8622.html\">RFC 8622</a>.</p>\n-<p><tt class=\"docutils literal\">peer_tos</tt> is the backwards compatible name for this setting.</p>\n-<a name=\"active_downloads\"></a>\n-<a name=\"active_seeds\"></a>\n-<a name=\"active_checking\"></a>\n-<a name=\"active_dht_limit\"></a>\n-<a name=\"active_tracker_limit\"></a>\n-<a name=\"active_lsd_limit\"></a>\n-<a name=\"active_limit\"></a><table border=\"1\" class=\"docutils\">\n+<div class=\"section\" id=\"peer-class-info\">\n+<h1>peer_class_info</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class.hpp\">libtorrent/peer_class.hpp</a>"</p>\n+<p>holds settings for a peer class. Used in <a class=\"reference external\" href=\"reference-Session.html#set_peer_class()\">set_peer_class()</a> and\n+<a class=\"reference external\" href=\"reference-Session.html#get_peer_class()\">get_peer_class()</a> calls.</p>\n+<pre class=\"literal-block\">\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+</pre>\n+<a name=\"ignore_unchoke_slots\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bignore_unchoke_slots%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bignore_unchoke_slots%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ignore_unchoke_slots</dt>\n+<dd><tt class=\"docutils literal\">ignore_unchoke_slots</tt> 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 <em>any</em> of the peer classes a peer belongs to has this set to true,\n+that peer will be unchoked at all times.</dd>\n+</dl>\n+<a name=\"connection_limit_factor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bconnection_limit_factor%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bconnection_limit_factor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>connection_limit_factor</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"label\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Blabel%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Blabel%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>label</dt>\n+<dd>not used by libtorrent. It's intended as a potentially user-facing\n+identifier of this peer class.</dd>\n+</dl>\n+<a name=\"upload_limit\"></a>\n+<a name=\"download_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bupload_limit+download_limit%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bupload_limit+download_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>upload_limit download_limit</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"upload_priority\"></a>\n+<a name=\"download_priority\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_info%3A%3A%5Bupload_priority+download_priority%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_info%3A%3A%5Bupload_priority+download_priority%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>upload_priority download_priority</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"peer_class_type_filter\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_class_type_filter&labels=documentation&body=Documentation+under+heading+%22class+peer_class_type_filter%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-class-type-filter\">\n+<h1>peer_class_type_filter</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class_type_filter.hpp\">libtorrent/peer_class_type_filter.hpp</a>"</p>\n+<p><tt class=\"docutils literal\">peer_class_type_filter</tt> is a simple container for rules for adding and subtracting\n+peer-classes from peers. It is applied <em>after</em> the peer class filter is applied (which\n+is based on the peer's IP address).</p>\n+<pre class=\"literal-block\">\n+struct peer_class_type_filter\n+{\n+ void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n+ void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n+ void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+ void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+ std::uint32_t <strong>apply</strong> (socket_type_t const st, std::uint32_t peer_class_mask);\n+ friend bool <strong>operator==</strong> (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+</pre>\n+<a name=\"remove()\"></a>\n+<a name=\"add()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bremove%28%29+add%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"remove-add\">\n+<h2>remove() add()</h2>\n+<pre class=\"literal-block\">\n+void <strong>remove</strong> (socket_type_t const st, peer_class_t const peer_class);\n+void <strong>add</strong> (socket_type_t const st, peer_class_t const peer_class);\n+</pre>\n+<p><tt class=\"docutils literal\">add()</tt> and <tt class=\"docutils literal\">remove()</tt> adds and removes a peer class to be added\n+to new peers based on socket type.</p>\n+<a name=\"allow()\"></a>\n+<a name=\"disallow()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Ballow%28%29+disallow%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Ballow%28%29+disallow%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"allow-disallow\">\n+<h2>allow() disallow()</h2>\n+<pre class=\"literal-block\">\n+void <strong>disallow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+void <strong>allow</strong> (socket_type_t const st, peer_class_t const peer_class);\n+</pre>\n+<p><tt class=\"docutils literal\">disallow()</tt> and <tt class=\"docutils literal\">allow()</tt> adds and removes a peer class to be\n+removed from new peers based on socket type.</p>\n+<p>The <tt class=\"docutils literal\">peer_class</tt> argument cannot be greater than 31. The bitmasks representing\n+peer classes in the <tt class=\"docutils literal\">peer_class_type_filter</tt> are 32 bits.</p>\n+<a name=\"apply()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_class_type_filter%3A%3A%5Bapply%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_class_type_filter%3A%3A%5Bapply%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"apply\">\n+<h2>apply()</h2>\n+<pre class=\"literal-block\">\n+std::uint32_t <strong>apply</strong> (socket_type_t const st, std::uint32_t peer_class_mask);\n+</pre>\n+<p>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+(<tt class=\"docutils literal\">st</tt>).</p>\n+<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-socket-type-t\">\n+<h2>enum socket_type_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_class_type_filter.hpp\">libtorrent/peer_class_type_filter.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n <col width=\"24%\" />\n+<col width=\"9%\" />\n+<col width=\"67%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>active_downloads</td>\n-<td>int</td>\n-<td>3</td>\n-</tr>\n-<tr><td>active_seeds</td>\n-<td>int</td>\n-<td>5</td>\n+<tr><td>tcp_socket</td>\n+<td>0</td>\n+<td>these match the socket types from socket_type.hpp\n+shifted one down</td>\n </tr>\n-<tr><td>active_checking</td>\n-<td>int</td>\n+<tr><td>utp_socket</td>\n <td>1</td>\n+<td> </td>\n </tr>\n-<tr><td>active_dht_limit</td>\n-<td>int</td>\n-<td>88</td>\n-</tr>\n-<tr><td>active_tracker_limit</td>\n-<td>int</td>\n-<td>1600</td>\n-</tr>\n-<tr><td>active_lsd_limit</td>\n-<td>int</td>\n-<td>60</td>\n-</tr>\n-<tr><td>active_limit</td>\n-<td>int</td>\n-<td>500</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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. <tt class=\"docutils literal\">active_downloads</tt> and\n-<tt class=\"docutils literal\">active_seeds</tt> controls how many active seeding and downloading\n-torrents the queuing mechanism allows. The target number of active\n-torrents is <tt class=\"docutils literal\">min(active_downloads + active_seeds, active_limit)</tt>.\n-<tt class=\"docutils literal\">active_downloads</tt> and <tt class=\"docutils literal\">active_seeds</tt> are upper limits on the\n-number of downloading torrents and seeding torrents respectively.\n-Setting the value to -1 means unlimited.</p>\n-<p>For example if there are 10 seeding torrents and 10 downloading\n-torrents, and <tt class=\"docutils literal\">active_downloads</tt> is 4 and <tt class=\"docutils literal\">active_seeds</tt> is 4,\n-there will be 4 seeds active and 4 downloading torrents. If the\n-settings are <tt class=\"docutils literal\">active_downloads</tt> = 2 and <tt class=\"docutils literal\">active_seeds</tt> = 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.</p>\n-<p><tt class=\"docutils literal\">active_checking</tt> is the limit of number of simultaneous checking\n-torrents.</p>\n-<p><tt class=\"docutils literal\">active_limit</tt> is a hard limit on the number of active (auto\n-managed) torrents. This limit also applies to slow torrents.</p>\n-<p><tt class=\"docutils literal\">active_dht_limit</tt> is the max number of torrents to announce to\n-the DHT.</p>\n-<p><tt class=\"docutils literal\">active_tracker_limit</tt> is the max number of torrents to announce\n-to their trackers.</p>\n-<p><tt class=\"docutils literal\">active_lsd_limit</tt> is the max number of torrents to announce to\n-the local network over the local service discovery protocol.</p>\n-<p>You can have more torrents <em>active</em>, 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.</p>\n-<a name=\"auto_manage_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>auto_manage_interval</td>\n-<td>int</td>\n-<td>30</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">auto_manage_interval</tt> is the number of seconds between the\n-torrent queue is updated, and rotated.</p>\n-<a name=\"seed_time_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"46%\" />\n-<col width=\"16%\" />\n-<col width=\"38%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>seed_time_limit</td>\n-<td>int</td>\n-<td>24 * 60 * 60</td>\n+<tr><td>ssl_tcp_socket</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n-<a name=\"auto_scrape_interval\"></a>\n-<a name=\"auto_scrape_min_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>ssl_utp_socket</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>auto_scrape_interval</td>\n-<td>int</td>\n-<td>1800</td>\n+<tr><td>i2p_socket</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n-<tr><td>auto_scrape_min_interval</td>\n-<td>int</td>\n-<td>300</td>\n+<tr><td>num_socket_types</td>\n+<td>5</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">auto_scrape_interval</tt> 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.</p>\n-<p><tt class=\"docutils literal\">auto_scrape_min_interval</tt> 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.</p>\n-<a name=\"max_peerlist_size\"></a>\n-<a name=\"max_paused_peerlist_size\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"storage_params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_params&labels=documentation&body=Documentation+under+heading+%22class+storage_params%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"storage-params\">\n+<h1>storage_params</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n+<p>a parameter pack used to construct the storage for a torrent, used in\n+<a class=\"reference external\" href=\"reference-Custom_Storage.html#disk_interface\">disk_interface</a></p>\n+<pre class=\"literal-block\">\n+struct storage_params\n+{\n+ <strong>storage_params</strong> (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* <strong>mapped_files</strong> = nullptr;\n+ std::string const& path;\n+ storage_mode_t <strong>mode</strong> {storage_mode_sparse};\n+ aux::vector<download_priority_t, file_index_t> const& priorities;\n+ sha1_hash info_hash;\n+};\n+</pre>\n+<a name=\"file_slice\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_slice&labels=documentation&body=Documentation+under+heading+%22class+file_slice%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-slice\">\n+<h1>file_slice</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/file_storage.hpp\">libtorrent/file_storage.hpp</a>"</p>\n+<p>represents a window of a file in a torrent.</p>\n+<p>The <tt class=\"docutils literal\">file_index</tt> refers to the index of the file (in the <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>).\n+To get the path and filename, use <tt class=\"docutils literal\">file_path()</tt> and give the <tt class=\"docutils literal\">file_index</tt>\n+as argument. The <tt class=\"docutils literal\">offset</tt> is the byte offset in the file where the range\n+starts, and <tt class=\"docutils literal\">size</tt> is the number of bytes this range is. The size + offset\n+will never be greater than the file size.</p>\n+<pre class=\"literal-block\">\n+struct file_slice\n+{\n+ file_index_t file_index;\n+ std::int64_t offset;\n+ std::int64_t size;\n+};\n+</pre>\n+<a name=\"file_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Bfile_index%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Bfile_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>file_index</dt>\n+<dd>the index of the file</dd>\n+</dl>\n+<a name=\"offset\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Boffset%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Boffset%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>offset</dt>\n+<dd>the offset from the start of the file, in bytes</dd>\n+</dl>\n+<a name=\"size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_slice%3A%3A%5Bsize%5D&labels=documentation&body=Documentation+under+heading+%22file_slice%3A%3A%5Bsize%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>size</dt>\n+<dd>the size of the window, in bytes</dd>\n+</dl>\n+<a name=\"file_storage\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_storage&labels=documentation&body=Documentation+under+heading+%22class+file_storage%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-storage\">\n+<h1>file_storage</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/file_storage.hpp\">libtorrent/file_storage.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">file_storage</tt> class represents a file list and the piece\n+size. Everything necessary to interpret a regular bittorrent storage\n+file structure.</p>\n+<pre class=\"literal-block\">\n+class file_storage\n+{\n+ bool <strong>is_valid</strong> () const;\n+ void <strong>reserve</strong> (int num_files);\n+ void <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (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 <strong>add_file</strong> (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 <strong>add_file_borrow</strong> (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 <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n+ std::vector<file_slice> <strong>map_block</strong> (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+ peer_request <strong>map_file</strong> (file_index_t file, std::int64_t offset, int size) const;\n+ int <strong>num_files</strong> () const noexcept;\n+ file_index_t <strong>end_file</strong> () const noexcept;\n+ index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n+ std::int64_t <strong>total_size</strong> () const;\n+ int <strong>num_pieces</strong> () const;\n+ void <strong>set_num_pieces</strong> (int n);\n+ piece_index_t <strong>end_piece</strong> () const;\n+ piece_index_t <strong>last_piece</strong> () const;\n+ index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n+ void <strong>set_piece_length</strong> (int l);\n+ int <strong>piece_length</strong> () const;\n+ int <strong>piece_size</strong> (piece_index_t index) const;\n+ int <strong>piece_size2</strong> (piece_index_t index) const;\n+ int <strong>blocks_in_piece2</strong> (piece_index_t index) const;\n+ int <strong>blocks_per_piece</strong> () const;\n+ std::string const& <strong>name</strong> () const;\n+ void <strong>set_name</strong> (std::string const& n);\n+ void <strong>swap</strong> (file_storage& ti) noexcept;\n+ void <strong>canonicalize</strong> ();\n+ sha256_hash <strong>root</strong> (file_index_t index) const;\n+ bool <strong>pad_file_at</strong> (file_index_t index) const;\n+ char const* <strong>root_ptr</strong> (file_index_t const index) const;\n+ std::string <strong>symlink</strong> (file_index_t index) const;\n+ std::int64_t <strong>file_size</strong> (file_index_t index) const;\n+ std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n+ string_view <strong>file_name</strong> (file_index_t index) const;\n+ std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n+ sha1_hash <strong>hash</strong> (file_index_t index) const;\n+ std::time_t <strong>mtime</strong> (file_index_t index) const;\n+ index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n+ int <strong>file_num_blocks</strong> (file_index_t index) const;\n+ int <strong>file_num_pieces</strong> (file_index_t index) const;\n+ int <strong>file_first_block_node</strong> (file_index_t index) const;\n+ int <strong>file_first_piece_node</strong> (file_index_t index) const;\n+ std::uint32_t <strong>file_path_hash</strong> (file_index_t index, std::string const& save_path) const;\n+ void <strong>all_path_hashes</strong> (std::unordered_set<std::uint32_t>& table) const;\n+ file_flags_t <strong>file_flags</strong> (file_index_t index) const;\n+ bool <strong>file_absolute_path</strong> (file_index_t index) const;\n+ file_index_t <strong>file_index_at_offset</strong> (std::int64_t offset) const;\n+ file_index_t <strong>file_index_at_piece</strong> (piece_index_t piece) const;\n+ file_index_t <strong>file_index_for_root</strong> (sha256_hash const& root_hash) const;\n+ piece_index_t <strong>piece_index_at_file</strong> (file_index_t f) const;\n+ void <strong>sanitize_symlinks</strong> ();\n+ bool <strong>v2</strong> () const;\n+\n+ static constexpr file_flags_t <strong>flag_pad_file</strong> = 0_bit;\n+ static constexpr file_flags_t <strong>flag_hidden</strong> = 1_bit;\n+ static constexpr file_flags_t <strong>flag_executable</strong> = 2_bit;\n+ static constexpr file_flags_t <strong>flag_symlink</strong> = 3_bit;\n+};\n+</pre>\n+<a name=\"is_valid()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bis_valid%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bis_valid%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"is-valid-3\">\n+<h2>is_valid()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>is_valid</strong> () const;\n+</pre>\n+<p>returns true if the piece length has been initialized\n+on the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>. This is typically taken as a proxy\n+of whether the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> as a whole is initialized or\n+not.</p>\n+<a name=\"reserve()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Breserve%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Breserve%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reserve\">\n+<h2>reserve()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reserve</strong> (int num_files);\n+</pre>\n+<p>allocates space for <tt class=\"docutils literal\">num_files</tt> 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.</p>\n+<a name=\"add_file_borrow()\"></a>\n+<a name=\"add_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Badd_file_borrow%28%29+add_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Badd_file_borrow%28%29+add_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-file-borrow-add-file\">\n+<h2>add_file_borrow() add_file()</h2>\n+<pre class=\"literal-block\">\n+void <strong>add_file_borrow</strong> (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 <strong>add_file</strong> (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 <strong>add_file</strong> (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 <strong>add_file_borrow</strong> (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+</pre>\n+<p>Adds a file to the file storage. The <tt class=\"docutils literal\">add_file_borrow</tt> version\n+expects that <tt class=\"docutils literal\">filename</tt> is the file name (without a path) of\n+the file that's being added.\n+This memory is <em>borrowed</em>, i.e. it is the caller's\n+responsibility to make sure it stays valid throughout the lifetime\n+of this <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object or any copy of it. The same thing applies\n+to <tt class=\"docutils literal\">filehash</tt>, which is an optional pointer to a 20 byte binary\n+SHA-1 hash of the file.</p>\n+<p>if <tt class=\"docutils literal\">filename</tt> is empty, the filename from <tt class=\"docutils literal\">path</tt> is used and not\n+borrowed.</p>\n+<p>The <tt class=\"docutils literal\">path</tt> 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.</p>\n+<p><tt class=\"docutils literal\">file_size</tt> is the size of the file in bytes.</p>\n+<p>The <tt class=\"docutils literal\">file_flags</tt> argument sets attributes on the file. The file\n+attributes is an extension and may not work in all bittorrent clients.</p>\n+<p>For possible file attributes, see file_storage::flags_t.</p>\n+<p>The <tt class=\"docutils literal\">mtime</tt> 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.</p>\n+<p><tt class=\"docutils literal\">symlink_path</tt> is the path the file is a symlink to. To make this a\n+symlink you also need to set the <a class=\"reference external\" href=\"reference-Storage.html#flag_symlink\">file_storage::flag_symlink</a> file flag.</p>\n+<p><tt class=\"docutils literal\">root_hash</tt> 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 <tt class=\"docutils literal\">root hash</tt> is specified for one file, it has to\n+be specified for all, otherwise this function will fail.\n+Note that the buffer <tt class=\"docutils literal\">root_hash</tt> points to must out-live the\n+<a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object, it will not be copied. This parameter is only\n+used when <em>loading</em> torrents, that already have their file hashes\n+computed. When creating torrents, the file hashes will be computed by\n+the piece hashes.</p>\n+<p>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.</p>\n+<p>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 <tt class=\"docutils literal\">set_name</tt>.</p>\n+<p>The overloads that take an <cite>error_code</cite> reference will report failures\n+via that variable, otherwise <cite>system_error</cite> is thrown.</p>\n+<a name=\"rename_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Brename_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Brename_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"rename-file-2\">\n+<h2>rename_file()</h2>\n+<pre class=\"literal-block\">\n+void <strong>rename_file</strong> (file_index_t index, std::string const& new_filename);\n+</pre>\n+<p>renames the file at <tt class=\"docutils literal\">index</tt> to <tt class=\"docutils literal\">new_filename</tt>. Keep in mind\n+that filenames are expected to be UTF-8 encoded.</p>\n+<a name=\"map_block()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bmap_block%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bmap_block%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"map-block-1\">\n+<h2>map_block()</h2>\n+<pre class=\"literal-block\">\n+std::vector<file_slice> <strong>map_block</strong> (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+</pre>\n+<p>returns a list of <a class=\"reference external\" href=\"reference-Storage.html#file_slice\">file_slice</a> objects representing the portions of\n+files the specified piece index, byte offset and size range overlaps.\n+this is the inverse mapping of <a class=\"reference external\" href=\"reference-Storage.html#map_file()\">map_file()</a>.</p>\n+<p>Preconditions of this function is that the input range is within the\n+torrents address space. <tt class=\"docutils literal\">piece</tt> may not be negative and</p>\n+<blockquote>\n+<tt class=\"docutils literal\">piece</tt> * piece_size + <tt class=\"docutils literal\">offset</tt> + <tt class=\"docutils literal\">size</tt></blockquote>\n+<p>may not exceed the total size of the torrent.</p>\n+<a name=\"map_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bmap_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bmap_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"map-file-1\">\n+<h2>map_file()</h2>\n+<pre class=\"literal-block\">\n+peer_request <strong>map_file</strong> (file_index_t file, std::int64_t offset, int size) const;\n+</pre>\n+<p>returns a <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> representing the piece index, byte offset\n+and size the specified file range overlaps. This is the inverse\n+mapping over <a class=\"reference external\" href=\"reference-Storage.html#map_block()\">map_block()</a>. Note that the <tt class=\"docutils literal\">peer_request</tt> 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.</p>\n+<a name=\"num_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bnum_files%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bnum_files%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-files-1\">\n+<h2>num_files()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_files</strong> () const noexcept;\n+</pre>\n+<p>returns the number of files in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a></p>\n+<a name=\"end_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bend_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bend_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"end-file\">\n+<h2>end_file()</h2>\n+<pre class=\"literal-block\">\n+file_index_t <strong>end_file</strong> () const noexcept;\n+</pre>\n+<p>returns the index of the one-past-end file in the file storage</p>\n+<a name=\"file_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-range-1\">\n+<h2>file_range()</h2>\n+<pre class=\"literal-block\">\n+index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n+<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"total-size-2\">\n+<h2>total_size()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>total_size</strong> () const;\n+</pre>\n+<p>returns the total number of bytes all the files in this torrent spans</p>\n+<a name=\"set_num_pieces()\"></a>\n+<a name=\"num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bset_num_pieces%28%29+num_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bset_num_pieces%28%29+num_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-num-pieces-num-pieces\">\n+<h2>set_num_pieces() num_pieces()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_pieces</strong> () const;\n+void <strong>set_num_pieces</strong> (int n);\n+</pre>\n+<p>set and get the number of pieces in the torrent</p>\n+<a name=\"end_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bend_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bend_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"end-piece\">\n+<h2>end_piece()</h2>\n+<pre class=\"literal-block\">\n+piece_index_t <strong>end_piece</strong> () const;\n+</pre>\n+<p>returns the index of the one-past-end piece in the file storage</p>\n+<a name=\"last_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Blast_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Blast_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"last-piece\">\n+<h2>last_piece()</h2>\n+<pre class=\"literal-block\">\n+piece_index_t <strong>last_piece</strong> () const;\n+</pre>\n+<p>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).</p>\n+<a name=\"piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-range-1\">\n+<h2>piece_range()</h2>\n+<pre class=\"literal-block\">\n+index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n+<a name=\"piece_length()\"></a>\n+<a name=\"set_piece_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_length%28%29+set_piece_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_length%28%29+set_piece_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-length-set-piece-length\">\n+<h2>piece_length() set_piece_length()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_piece_length</strong> (int l);\n+int <strong>piece_length</strong> () const;\n+</pre>\n+<p>set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.</p>\n+<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-size-1\">\n+<h2>piece_size()</h2>\n+<pre class=\"literal-block\">\n+int <strong>piece_size</strong> (piece_index_t index) const;\n+</pre>\n+<p>returns the piece size of <tt class=\"docutils literal\">index</tt>. This will be the same as <a class=\"reference external\" href=\"reference-Storage.html#piece_length()\">piece_length()</a>, except\n+for the last piece, which may be shorter.</p>\n+<a name=\"piece_size2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_size2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_size2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-size2\">\n+<h2>piece_size2()</h2>\n+<pre class=\"literal-block\">\n+int <strong>piece_size2</strong> (piece_index_t index) const;\n+</pre>\n+<p>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.</p>\n+<a name=\"blocks_in_piece2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bblocks_in_piece2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bblocks_in_piece2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"blocks-in-piece2\">\n+<h2>blocks_in_piece2()</h2>\n+<pre class=\"literal-block\">\n+int <strong>blocks_in_piece2</strong> (piece_index_t index) const;\n+</pre>\n+<p>returns the number of blocks in the specified piece, for v2 torrents.</p>\n+<a name=\"blocks_per_piece()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bblocks_per_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bblocks_per_piece%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"blocks-per-piece-1\">\n+<h2>blocks_per_piece()</h2>\n+<pre class=\"literal-block\">\n+int <strong>blocks_per_piece</strong> () const;\n+</pre>\n+<p>returns the number of blocks there are in the typical piece. There\n+may be fewer in the last piece)</p>\n+<a name=\"name()\"></a>\n+<a name=\"set_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bname%28%29+set_name%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"name-set-name\">\n+<h2>name() set_name()</h2>\n+<pre class=\"literal-block\">\n+std::string const& <strong>name</strong> () const;\n+void <strong>set_name</strong> (std::string const& n);\n+</pre>\n+<p>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.</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap-1\">\n+<h2>swap()</h2>\n+<pre class=\"literal-block\">\n+void <strong>swap</strong> (file_storage& ti) noexcept;\n+</pre>\n+<p>swap all content of <em>this</em> with <em>ti</em>.</p>\n+<a name=\"canonicalize()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bcanonicalize%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bcanonicalize%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"canonicalize\">\n+<h2>canonicalize()</h2>\n+<pre class=\"literal-block\">\n+void <strong>canonicalize</strong> ();\n+</pre>\n+<p>arrange files and padding to match the canonical form required\n+by BEP 52</p>\n+<a name=\"file_offset()\"></a>\n+<a name=\"symlink()\"></a>\n+<a name=\"hash()\"></a>\n+<a name=\"file_name()\"></a>\n+<a name=\"file_size()\"></a>\n+<a name=\"root_ptr()\"></a>\n+<a name=\"root()\"></a>\n+<a name=\"file_path()\"></a>\n+<a name=\"pad_file_at()\"></a>\n+<a name=\"mtime()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_offset%28%29+symlink%28%29+hash%28%29+file_name%28%29+file_size%28%29+root_ptr%28%29+root%28%29+file_path%28%29+pad_file_at%28%29+mtime%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_offset%28%29+symlink%28%29+hash%28%29+file_name%28%29+file_size%28%29+root_ptr%28%29+root%28%29+file_path%28%29+pad_file_at%28%29+mtime%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-offset-symlink-hash-file-name-file-size-root-ptr-root-file-path-pad-file-at-mtime\">\n+<h2>file_offset() symlink() hash() file_name() file_size() root_ptr() root() file_path() pad_file_at() mtime()</h2>\n+<pre class=\"literal-block\">\n+sha256_hash <strong>root</strong> (file_index_t index) const;\n+bool <strong>pad_file_at</strong> (file_index_t index) const;\n+char const* <strong>root_ptr</strong> (file_index_t const index) const;\n+std::string <strong>symlink</strong> (file_index_t index) const;\n+std::int64_t <strong>file_size</strong> (file_index_t index) const;\n+std::int64_t <strong>file_offset</strong> (file_index_t index) const;\n+string_view <strong>file_name</strong> (file_index_t index) const;\n+std::string <strong>file_path</strong> (file_index_t index, std::string const& save_path = "") const;\n+sha1_hash <strong>hash</strong> (file_index_t index) const;\n+std::time_t <strong>mtime</strong> (file_index_t index) const;\n+</pre>\n+<p>These functions are used to query attributes of files at\n+a given index.</p>\n+<p>The <tt class=\"docutils literal\">hash()</tt> 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.</p>\n+<p><tt class=\"docutils literal\">root()</tt> returns the SHA-256 merkle tree root of the specified file,\n+in case this is a v2 torrent. Otherwise returns zeros.\n+<tt class=\"docutils literal\">root_ptr()</tt> 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.</p>\n+<p>The <tt class=\"docutils literal\">mtime()</tt> 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.</p>\n+<p><tt class=\"docutils literal\">file_path()</tt> returns the full path to a file.</p>\n+<p><tt class=\"docutils literal\">file_size()</tt> returns the size of a file.</p>\n+<p><tt class=\"docutils literal\">pad_file_at()</tt> returns true if the file at the given\n+index is a pad-file.</p>\n+<p><tt class=\"docutils literal\">file_name()</tt> returns <em>just</em> the name of the file, whereas\n+<tt class=\"docutils literal\">file_path()</tt> returns the path (inside the torrent file) with\n+the filename appended.</p>\n+<p><tt class=\"docutils literal\">file_offset()</tt> 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).</p>\n+<a name=\"file_num_pieces()\"></a>\n+<a name=\"file_piece_range()\"></a>\n+<a name=\"file_num_blocks()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_num_pieces%28%29+file_piece_range%28%29+file_num_blocks%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_num_pieces%28%29+file_piece_range%28%29+file_num_blocks%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-num-pieces-file-piece-range-file-num-blocks\">\n+<h2>file_num_pieces() file_piece_range() file_num_blocks()</h2>\n+<pre class=\"literal-block\">\n+index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t) const;\n+int <strong>file_num_blocks</strong> (file_index_t index) const;\n+int <strong>file_num_pieces</strong> (file_index_t index) const;\n+</pre>\n+<p>Returns the number of pieces or blocks the file at <cite>index</cite> 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.</p>\n+<a name=\"file_first_block_node()\"></a>\n+<a name=\"file_first_piece_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_first_block_node%28%29+file_first_piece_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_first_block_node%28%29+file_first_piece_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-first-block-node-file-first-piece-node\">\n+<h2>file_first_block_node() file_first_piece_node()</h2>\n+<pre class=\"literal-block\">\n+int <strong>file_first_block_node</strong> (file_index_t index) const;\n+int <strong>file_first_piece_node</strong> (file_index_t index) const;\n+</pre>\n+<p>index of first piece node in the merkle tree</p>\n+<a name=\"file_path_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_path_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_path_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-path-hash\">\n+<h2>file_path_hash()</h2>\n+<pre class=\"literal-block\">\n+std::uint32_t <strong>file_path_hash</strong> (file_index_t index, std::string const& save_path) const;\n+</pre>\n+<p>returns the crc32 hash of file_path(index)</p>\n+<a name=\"all_path_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Ball_path_hashes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Ball_path_hashes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"all-path-hashes\">\n+<h2>all_path_hashes()</h2>\n+<pre class=\"literal-block\">\n+void <strong>all_path_hashes</strong> (std::unordered_set<std::uint32_t>& table) const;\n+</pre>\n+<p>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 <tt class=\"docutils literal\">foo/bar/baz</tt>, the CRC32\n+hashes for <tt class=\"docutils literal\">foo</tt>, <tt class=\"docutils literal\">foo/bar</tt> and <tt class=\"docutils literal\">foo/bar/baz</tt> will be added to\n+the set.</p>\n+<a name=\"file_flags()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_flags%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_flags%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-flags\">\n+<h2>file_flags()</h2>\n+<pre class=\"literal-block\">\n+file_flags_t <strong>file_flags</strong> (file_index_t index) const;\n+</pre>\n+<p>returns a bitmask of flags from file_flags_t that apply\n+to file at <tt class=\"docutils literal\">index</tt>.</p>\n+<a name=\"file_absolute_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_absolute_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_absolute_path%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-absolute-path\">\n+<h2>file_absolute_path()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>file_absolute_path</strong> (file_index_t index) const;\n+</pre>\n+<p>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.</p>\n+<a name=\"file_index_at_piece()\"></a>\n+<a name=\"file_index_at_offset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_index_at_piece%28%29+file_index_at_offset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_index_at_piece%28%29+file_index_at_offset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-index-at-piece-file-index-at-offset\">\n+<h2>file_index_at_piece() file_index_at_offset()</h2>\n+<pre class=\"literal-block\">\n+file_index_t <strong>file_index_at_offset</strong> (std::int64_t offset) const;\n+file_index_t <strong>file_index_at_piece</strong> (piece_index_t piece) const;\n+</pre>\n+<p>returns the index of the file at the given offset in the torrent</p>\n+<a name=\"file_index_for_root()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bfile_index_for_root%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bfile_index_for_root%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-index-for-root\">\n+<h2>file_index_for_root()</h2>\n+<pre class=\"literal-block\">\n+file_index_t <strong>file_index_for_root</strong> (sha256_hash const& root_hash) const;\n+</pre>\n+<p>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</p>\n+<a name=\"piece_index_at_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bpiece_index_at_file%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bpiece_index_at_file%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-index-at-file\">\n+<h2>piece_index_at_file()</h2>\n+<pre class=\"literal-block\">\n+piece_index_t <strong>piece_index_at_file</strong> (file_index_t f) const;\n+</pre>\n+<p>returns the piece index the given file starts at</p>\n+<a name=\"sanitize_symlinks()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bsanitize_symlinks%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bsanitize_symlinks%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"sanitize-symlinks\">\n+<h2>sanitize_symlinks()</h2>\n+<pre class=\"literal-block\">\n+void <strong>sanitize_symlinks</strong> ();\n+</pre>\n+<p>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.</p>\n+<a name=\"v2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bv2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bv2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"v2\">\n+<h2>v2()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>v2</strong> () const;\n+</pre>\n+<p>returns true if this torrent contains v2 metadata.</p>\n+<a name=\"flag_pad_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_pad_file%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_pad_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flag_pad_file</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"flag_hidden\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_hidden%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_hidden%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flag_hidden</dt>\n+<dd>this file has the hidden attribute set. This is primarily\n+a windows attribute</dd>\n+</dl>\n+<a name=\"flag_executable\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_executable%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_executable%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flag_executable</dt>\n+<dd>this file has the executable attribute set.</dd>\n+</dl>\n+<a name=\"flag_symlink\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_storage%3A%3A%5Bflag_symlink%5D&labels=documentation&body=Documentation+under+heading+%22file_storage%3A%3A%5Bflag_symlink%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flag_symlink</dt>\n+<dd>this file is a symbolic link. It should have a link\n+target string associated with it.</dd>\n+</dl>\n+<a name=\"mmap_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:mmap_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22mmap_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"mmap-disk-io-constructor\">\n+<h1>mmap_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/mmap_disk_io.hpp\">libtorrent/mmap_disk_io.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::unique_ptr<disk_interface> <strong>mmap_disk_io_constructor</strong> (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+</pre>\n+<p>constructs a memory mapped file disk I/O object.</p>\n+<a name=\"default_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22default_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"default-disk-io-constructor\">\n+<h1>default_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::unique_ptr<disk_interface> <strong>default_disk_io_constructor</strong> (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+</pre>\n+<p>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.</p>\n+<a name=\"disabled_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:disabled_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22disabled_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"disabled-disk-io-constructor\">\n+<h1>disabled_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/disabled_disk_io.hpp\">libtorrent/disabled_disk_io.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::unique_ptr<disk_interface> <strong>disabled_disk_io_constructor</strong> (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+</pre>\n+<p>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.</p>\n+<a name=\"posix_disk_io_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:posix_disk_io_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22posix_disk_io_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"posix-disk-io-constructor\">\n+<h1>posix_disk_io_constructor()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/posix_disk_io.hpp\">libtorrent/posix_disk_io.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::unique_ptr<disk_interface> <strong>posix_disk_io_constructor</strong> (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+</pre>\n+<p>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.</p>\n+<a name=\"storage_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+storage_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+storage_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-storage-mode-t\">\n+<h1>enum storage_mode_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n <col width=\"22%\" />\n+<col width=\"7%\" />\n+<col width=\"72%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_peerlist_size</td>\n-<td>int</td>\n-<td>3000</td>\n-</tr>\n-<tr><td>max_paused_peerlist_size</td>\n-<td>int</td>\n-<td>1000</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_peerlist_size</tt> 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.</p>\n-<p><tt class=\"docutils literal\">max_paused_peerlist_size</tt> 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.</p>\n-<a name=\"min_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>min_announce_interval</td>\n-<td>int</td>\n-<td>5 * 60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"auto_manage_startup\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>auto_manage_startup</td>\n-<td>int</td>\n-<td>60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"seeding_piece_quota\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>seeding_piece_quota</td>\n-<td>int</td>\n-<td>20</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">seeding_piece_quota</tt> is the number of pieces to send to a peer,\n-when seeding, before rotating in another peer to the unchoke set.</p>\n-<a name=\"max_rejects\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"46%\" />\n-<col width=\"21%\" />\n-<col width=\"32%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_rejects</td>\n-<td>int</td>\n-<td>50</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_rejects</tt> 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.</p>\n-<a name=\"recv_socket_buffer_size\"></a>\n-<a name=\"send_socket_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>recv_socket_buffer_size</td>\n-<td>int</td>\n-<td>0</td>\n-</tr>\n-<tr><td>send_socket_buffer_size</td>\n-<td>int</td>\n+<tr><td>storage_mode_allocate</td>\n <td>0</td>\n+<td>All 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.</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<p>Note that uTP peers share a single UDP socket buffer for each of the\n-<tt class=\"docutils literal\">listen_interfaces</tt>, 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.</p>\n-<a name=\"max_peer_recv_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"54%\" />\n-<col width=\"12%\" />\n-<col width=\"34%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_peer_recv_buffer_size</td>\n-<td>int</td>\n-<td>2 * 1024 * 1024</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>the max number of bytes a single peer connection's receive buffer is\n-allowed to grow to.</p>\n-<a name=\"optimistic_disk_retry\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>optimistic_disk_retry</td>\n-<td>int</td>\n-<td>10 * 60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">optimistic_disk_retry</tt> 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.</p>\n-<p>libtorrent will only do this automatically for auto managed\n-torrents.</p>\n-<p>You can explicitly take a torrent out of upload only mode using\n-set_upload_mode().</p>\n-<a name=\"max_suggest_pieces\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_suggest_pieces</td>\n-<td>int</td>\n-<td>16</td>\n+<tr><td>storage_mode_sparse</td>\n+<td>1</td>\n+<td>All pieces will be written to the place where they belong and sparse files\n+will be used. This is the recommended, and default mode.</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">max_suggest_pieces</tt> 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.</p>\n-<a name=\"local_service_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"status_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+status_t&labels=documentation&body=Documentation+under+heading+%22enum+status_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-status-t\">\n+<h1>enum status_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"69%\" />\n-<col width=\"13%\" />\n <col width=\"19%\" />\n+<col width=\"7%\" />\n+<col width=\"74%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>local_service_announce_interval</td>\n-<td>int</td>\n-<td>5 * 60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">local_service_announce_interval</tt> is the time between local\n-network announces for a torrent.\n-This interval is specified in seconds.</p>\n-<a name=\"dht_announce_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_announce_interval</td>\n-<td>int</td>\n-<td>15 * 60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">dht_announce_interval</tt> is the number of seconds between\n-announcing torrents to the distributed hash table (DHT).</p>\n-<a name=\"udp_tracker_token_expiry\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>udp_tracker_token_expiry</td>\n-<td>int</td>\n-<td>60</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">udp_tracker_token_expiry</tt> 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.</p>\n-<a name=\"num_optimistic_unchoke_slots\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>num_optimistic_unchoke_slots</td>\n-<td>int</td>\n+<tr><td>no_error</td>\n <td>0</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">num_optimistic_unchoke_slots</tt> 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.</p>\n-<a name=\"max_pex_peers\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_pex_peers</td>\n-<td>int</td>\n-<td>50</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"tick_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>tick_interval</td>\n-<td>int</td>\n-<td>500</td>\n+<tr><td>fatal_disk_error</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">tick_interval</tt> 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.</p>\n-<a name=\"share_mode_target\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>need_full_check</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>share_mode_target</td>\n-<td>int</td>\n+<tr><td>file_exist</td>\n <td>3</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">share_mode_target</tt> 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.</p>\n-<a name=\"upload_rate_limit\"></a>\n-<a name=\"download_rate_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>upload_rate_limit</td>\n-<td>int</td>\n-<td>0</td>\n-</tr>\n-<tr><td>download_rate_limit</td>\n-<td>int</td>\n-<td>0</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">upload_rate_limit</tt> and <tt class=\"docutils literal\">download_rate_limit</tt> 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.</p>\n-<p>A value of 0 means unlimited.</p>\n-<p>For fine grained control over rate limits, including making them apply\n-to local peers, see <a class=\"reference external\" href=\"manual-ref.html#peer-classes\">peer classes</a>.</p>\n-<a name=\"dht_upload_rate_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_upload_rate_limit</td>\n-<td>int</td>\n-<td>8000</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"unchoke_slots_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>unchoke_slots_limit</td>\n-<td>int</td>\n-<td>8</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">unchoke_slots_limit</tt> is the max number of unchoked peers in the\n-<a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. The number of unchoke slots may be ignored depending on\n-what <tt class=\"docutils literal\">choking_algorithm</tt> is set to. Setting this limit to -1\n-means unlimited, i.e. all peers will always be unchoked.</p>\n-<a name=\"connections_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>connections_limit</td>\n-<td>int</td>\n-<td>200</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">connections_limit</tt> 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.</p>\n-<a name=\"connections_slack\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>connections_slack</td>\n-<td>int</td>\n-<td>10</td>\n+<tr><td>oversized_file</td>\n+<td>16</td>\n+<td>this 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 <a class=\"reference external\" href=\"reference-Storage.html#status_t\">status_t</a> field is used for this to preserve ABI.</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">connections_slack</tt> is the number of incoming connections\n-exceeding the connection limit to accept in order to potentially\n-replace existing ones.</p>\n-<a name=\"utp_target_delay\"></a>\n-<a name=\"utp_gain_factor\"></a>\n-<a name=\"utp_min_timeout\"></a>\n-<a name=\"utp_syn_resends\"></a>\n-<a name=\"utp_fin_resends\"></a>\n-<a name=\"utp_num_resends\"></a>\n-<a name=\"utp_connect_timeout\"></a>\n-<a name=\"utp_loss_multiplier\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"move_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+move_flags_t&labels=documentation&body=Documentation+under+heading+%22enum+move_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-move-flags-t\">\n+<h1>enum move_flags_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/storage_defs.hpp\">libtorrent/storage_defs.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n+<col width=\"29%\" />\n+<col width=\"7%\" />\n+<col width=\"64%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>utp_target_delay</td>\n-<td>int</td>\n-<td>100</td>\n-</tr>\n-<tr><td>utp_gain_factor</td>\n-<td>int</td>\n-<td>3000</td>\n-</tr>\n-<tr><td>utp_min_timeout</td>\n-<td>int</td>\n-<td>500</td>\n+<tr><td>always_replace_files</td>\n+<td>0</td>\n+<td>replace any files in the destination when copying\n+or moving the storage</td>\n </tr>\n-<tr><td>utp_syn_resends</td>\n-<td>int</td>\n-<td>2</td>\n+<tr><td>fail_if_exist</td>\n+<td>1</td>\n+<td>if 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.</td>\n </tr>\n-<tr><td>utp_fin_resends</td>\n-<td>int</td>\n+<tr><td>dont_replace</td>\n <td>2</td>\n+<td>if any file exist in the target, take those files instead\n+of the ones we may have in the source.</td>\n </tr>\n-<tr><td>utp_num_resends</td>\n-<td>int</td>\n+<tr><td>reset_save_path</td>\n <td>3</td>\n+<td>don't move any source files, just forget about them\n+and begin checking files at new save path</td>\n </tr>\n-<tr><td>utp_connect_timeout</td>\n-<td>int</td>\n-<td>3000</td>\n-</tr>\n-<tr><td>utp_loss_multiplier</td>\n-<td>int</td>\n-<td>50</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">utp_target_delay</tt> 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-<tt class=\"docutils literal\">utp_gain_factor</tt> 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.</p>\n-<p><tt class=\"docutils literal\">utp_min_timeout</tt> 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).</p>\n-<p>The shorter the timeout is, the faster the connection will recover\n-from this situation, assuming the RTT is low enough.\n-<tt class=\"docutils literal\">utp_syn_resends</tt> is the number of SYN packets that are sent (and\n-timed out) before giving up and closing the socket.\n-<tt class=\"docutils literal\">utp_num_resends</tt> is the number of times a packet is sent (and\n-lost or timed out) before giving up and closing the connection.\n-<tt class=\"docutils literal\">utp_connect_timeout</tt> 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. <tt class=\"docutils literal\">utp_loss_multiplier</tt>\n-controls how the congestion window is changed when a packet loss is\n-experienced. It's specified as a percentage multiplier for\n-<tt class=\"docutils literal\">cwnd</tt>. Do not change this value unless you know what you're doing.\n-Never set it higher than 100.</p>\n-<a name=\"mixed_mode_algorithm\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"35%\" />\n-<col width=\"10%\" />\n-<col width=\"55%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>mixed_mode_algorithm</td>\n-<td>int</td>\n-<td>settings_pack::peer_proportional</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>The <tt class=\"docutils literal\">mixed_mode_algorithm</tt> 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 <tt class=\"docutils literal\">prefer_tcp</tt>. The <tt class=\"docutils literal\">peer_proportional</tt>\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).</p>\n-<a name=\"listen_queue_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>listen_queue_size</td>\n-<td>int</td>\n-<td>5</td>\n-</tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">listen_queue_size</tt> 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 <tt class=\"docutils literal\">listen_interfaces</tt> settings is updated.</p>\n-<a name=\"torrent_connect_boost\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>torrent_connect_boost</td>\n-<td>int</td>\n-<td>30</td>\n+<tr><td>reset_save_path_unchecked</td>\n+<td>4</td>\n+<td>don't move any source files, just change save path\n+and continue working without any checks</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">torrent_connect_boost</tt> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> tick to trigger connections.\n-This may not be set higher than 255.</p>\n-<a name=\"alert_queue_size\"></a><table border=\"1\" class=\"docutils\">\n+<p>The <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> function on <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is the main interface for retrieving\n+alerts (warnings, messages and errors from libtorrent). If no alerts have\n+been posted by libtorrent <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> will return an empty list.</p>\n+<p>By default, only errors are reported. <a class=\"reference external\" href=\"reference-Settings.html#alert_mask\">settings_pack::alert_mask</a> can be\n+used to specify which kinds of events should be reported. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask is\n+a combination of the <a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a> flags in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> class.</p>\n+<p>Every <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> bitmask to 0 will disable all alerts (except those\n+that are non-discardable). Alerts that are responses to API calls such as\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> and <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> are non-discardable and will be\n+posted even if their category is disabled.</p>\n+<p>There are other <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> base classes that some alerts derive from, all the\n+alerts that are generated for a specific torrent are derived from\n+<a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>, and tracker events derive from <a class=\"reference external\" href=\"reference-Alerts.html#tracker_alert\">tracker_alert</a>.</p>\n+<p>Alerts returned by <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> are only valid until the next call to\n+<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. You may not copy an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> object to access it after the next\n+call to <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a>. Internal members of alerts also become invalid once\n+<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> is called again.</p>\n+<a name=\"dht_routing_bucket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_routing_bucket&labels=documentation&body=Documentation+under+heading+%22class+dht_routing_bucket%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-routing-bucket\">\n+<h1>dht_routing_bucket</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>struct to hold information about a single DHT routing table bucket</p>\n+<pre class=\"literal-block\">\n+struct dht_routing_bucket\n+{\n+ int num_nodes;\n+ int num_replacements;\n+ int last_active;\n+};\n+</pre>\n+<a name=\"num_nodes\"></a>\n+<a name=\"num_replacements\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Bnum_nodes+num_replacements%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_nodes num_replacements</dt>\n+<dd>the total number of nodes and replacement nodes\n+in the routing table</dd>\n+</dl>\n+<a name=\"last_active\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_routing_bucket%3A%3A%5Blast_active%5D&labels=documentation&body=Documentation+under+heading+%22dht_routing_bucket%3A%3A%5Blast_active%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_active</dt>\n+<dd>number of seconds since last activity</dd>\n+</dl>\n+<a name=\"torrent_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-alert\">\n+<h1>torrent_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is a base class for alerts that are associated with a\n+specific torrent. It contains a handle to the torrent.</p>\n+<p>Note that by the time the client receives a <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>, its\n+<tt class=\"docutils literal\">handle</tt> member may be invalid.</p>\n+<pre class=\"literal-block\">\n+struct torrent_alert : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>torrent_name</strong> () const;\n+\n+ torrent_handle handle;\n+};\n+</pre>\n+<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"message\">\n+<h2>message()</h2>\n+<pre class=\"literal-block\">\n+std::string <strong>message</strong> () const override;\n+</pre>\n+<p>returns the message associated with this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a></p>\n+<a name=\"handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_alert%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_alert%3A%3A%5Bhandle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>handle</dt>\n+<dd>The <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> pointing to the torrent this\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is associated with.</dd>\n+</dl>\n+<a name=\"peer_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-alert\">\n+<h1>peer_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The peer <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is a base class for alerts that refer to a specific peer. It includes all\n+the information to identify the peer. i.e. <tt class=\"docutils literal\">ip</tt> and <tt class=\"docutils literal\"><span class=\"pre\">peer-id</span></tt>.</p>\n+<pre class=\"literal-block\">\n+struct peer_alert : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> endpoint;\n+ peer_id pid;\n+};\n+</pre>\n+<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoint</dt>\n+<dd>The peer's IP address and port.</dd>\n+</dl>\n+<a name=\"pid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_alert%3A%3A%5Bpid%5D&labels=documentation&body=Documentation+under+heading+%22peer_alert%3A%3A%5Bpid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pid</dt>\n+<dd>the peer ID, if known.</dd>\n+</dl>\n+<a name=\"tracker_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tracker-alert\">\n+<h1>tracker_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is a base class used for alerts that are associated with a\n+specific tracker. It derives from <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a> since a tracker\n+is also associated with a specific torrent.</p>\n+<pre class=\"literal-block\">\n+struct tracker_alert : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>tracker_url</strong> () const;\n+\n+ aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> local_endpoint;\n+};\n+</pre>\n+<a name=\"tracker_url()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Btracker_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Btracker_url%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"tracker-url\">\n+<h2>tracker_url()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>tracker_url</strong> () const;\n+</pre>\n+<p>returns a 0-terminated string of the tracker's URL</p>\n+<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22tracker_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_endpoint</dt>\n+<dd>endpoint of the listen interface being announced</dd>\n+</dl>\n+<a name=\"torrent_removed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_removed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_removed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"torrent-removed-alert\">\n+<h1>torrent_removed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">torrent_removed_alert</tt> 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 <tt class=\"docutils literal\"><span class=\"pre\">alert_category::status</span></tt> bit is set in the alert_mask.</p>\n+<p>Note that the <tt class=\"docutils literal\">handle</tt> remains valid for some time after\n+<a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a> is posted, as long as some internal libtorrent\n+task (such as an I/O task) refers to it. Additionally, other alerts like\n+<a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a> may be posted after <a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a>.\n+To synchronize on whether the torrent has been removed or not, call\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#in_session()\">torrent_handle::in_session()</a>. This will return true before\n+<a class=\"reference external\" href=\"reference-Alerts.html#torrent_removed_alert\">torrent_removed_alert</a> is posted, and false afterward.</p>\n+<p>Even though the <tt class=\"docutils literal\">handle</tt> 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.</p>\n+<p>The <tt class=\"docutils literal\">torrent_handle</tt> acts as a <tt class=\"docutils literal\">weak_ptr</tt>, 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.</p>\n+<pre class=\"literal-block\">\n+struct torrent_removed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ info_hash_t info_hashes;\n+ client_data_t userdata;\n+};\n+</pre>\n+<a name=\"userdata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_removed_alert%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_removed_alert%3A%3A%5Buserdata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>userdata</dt>\n+<dd>'<cite>userdata`</cite> as set in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> 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.</dd>\n+</dl>\n+<a name=\"read_piece_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+read_piece_alert&labels=documentation&body=Documentation+under+heading+%22class+read_piece_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"read-piece-alert\">\n+<h1>read_piece_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the asynchronous read operation initiated by\n+a call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#read_piece()\">torrent_handle::read_piece()</a> is completed. If the read failed, the torrent\n+is paused and an error state is set and the buffer member of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+is 0. If successful, <tt class=\"docutils literal\">buffer</tt> points to a buffer containing all the data\n+of the piece. <tt class=\"docutils literal\">piece</tt> is the piece index that was read. <tt class=\"docutils literal\">size</tt> is the\n+number of bytes that was read.</p>\n+<p>If the operation fails, <tt class=\"docutils literal\">error</tt> will indicate what went wrong.</p>\n+<pre class=\"literal-block\">\n+struct read_piece_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"file_completed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_completed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_completed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-completed-alert\">\n+<h1>file_completed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is posted whenever an individual file completes its download. i.e.\n+All pieces overlapping this file have passed their hash check.</p>\n+<pre class=\"literal-block\">\n+struct file_completed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ file_index_t const index;\n+};\n+</pre>\n+<a name=\"index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_completed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_completed_alert%3A%3A%5Bindex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>index</dt>\n+<dd>refers to the index of the file that completed.</dd>\n+</dl>\n+<a name=\"file_renamed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_renamed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_renamed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-renamed-alert\">\n+<h1>file_renamed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is posted as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#rename_file()\">torrent_handle::rename_file()</a> call, if the rename\n+operation succeeds.</p>\n+<pre class=\"literal-block\">\n+struct file_renamed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>old_name</strong> () const;\n+ char const* <strong>new_name</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ file_index_t const index;\n+};\n+</pre>\n+<a name=\"new_name()\"></a>\n+<a name=\"old_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bnew_name%28%29+old_name%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"new-name-old-name\">\n+<h2>new_name() old_name()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>old_name</strong> () const;\n+char const* <strong>new_name</strong> () const;\n+</pre>\n+<p>returns the new and previous file name, respectively.</p>\n+<a name=\"index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_renamed_alert%3A%3A%5Bindex%5D&labels=documentation&body=Documentation+under+heading+%22file_renamed_alert%3A%3A%5Bindex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>index</dt>\n+<dd>refers to the index of the file that was renamed,</dd>\n+</dl>\n+<a name=\"file_rename_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_rename_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+file_rename_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"file-rename-failed-alert\">\n+<h1>file_rename_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is posted as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#rename_file()\">torrent_handle::rename_file()</a> call, if the rename\n+operation failed.</p>\n+<pre class=\"literal-block\">\n+struct file_rename_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ file_index_t const index;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"index\"></a>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_rename_failed_alert%3A%3A%5Bindex+error%5D&labels=documentation&body=Documentation+under+heading+%22file_rename_failed_alert%3A%3A%5Bindex+error%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>index error</dt>\n+<dd>refers to the index of the file that was supposed to be renamed,\n+<tt class=\"docutils literal\">error</tt> is the error code returned from the filesystem.</dd>\n+</dl>\n+<a name=\"performance_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+performance_alert&labels=documentation&body=Documentation+under+heading+%22class+performance_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"performance-alert\">\n+<h1>performance_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a limit is reached that might have a negative impact on\n+upload or download rate performance.</p>\n+<pre class=\"literal-block\">\n+struct performance_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () 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 <strong>static_category</strong> = alert_category::performance_warning;\n+ performance_warning_t const warning_code;\n+};\n+</pre>\n+<a name=\"performance_warning_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+performance_warning_t&labels=documentation&body=Documentation+under+heading+%22enum+performance_warning_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-performance-warning-t\">\n+<h2>enum performance_warning_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"55%\" />\n-<col width=\"18%\" />\n <col width=\"27%\" />\n+<col width=\"5%\" />\n+<col width=\"68%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>alert_queue_size</td>\n-<td>int</td>\n-<td>2000</td>\n+<tr><td>outstanding_disk_buffer_limit_reached</td>\n+<td>0</td>\n+<td>This warning means that the number of bytes queued to be written to disk\n+exceeds the max disk byte queue setting (<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_queued_disk_bytes</span></tt>).\n+This might restrict the download rate, by not queuing up enough write jobs\n+to the disk I/O thread. When this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted, peer connections are\n+temporarily stopped from downloading, until the queued disk bytes have fallen\n+below the limit again. Unless your <tt class=\"docutils literal\">max_queued_disk_bytes</tt> setting is already\n+high, you might want to increase it to get better performance.</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">alert_queue_size</tt> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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().</p>\n-<a name=\"max_metadata_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"44%\" />\n-<col width=\"14%\" />\n-<col width=\"42%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>outstanding_request_limit_reached</td>\n+<td>1</td>\n+<td>This is posted when libtorrent would like to send more requests to a peer,\n+but it's limited by <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_out_request_queue</span></tt>. The queue length\n+libtorrent is trying to achieve is determined by the download rate and the\n+assumed round-trip-time (<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::request_queue_time</span></tt>). 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\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 <tt class=\"docutils literal\">max_out_request_queue</tt>\n+setting.</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_metadata_size</td>\n-<td>int</td>\n-<td>3 * 1024 * 10240</td>\n+<tr><td>upload_limit_too_low</td>\n+<td>2</td>\n+<td>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.</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_metadata_size</tt> is the maximum allowed size (in bytes) to be\n-received by the metadata extension, i.e. magnet links.</p>\n-<a name=\"hashing_threads\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>download_limit_too_low</td>\n+<td>3</td>\n+<td>This is the same warning as <tt class=\"docutils literal\">upload_limit_too_low</tt> 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.</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>hashing_threads</td>\n-<td>int</td>\n-<td>1</td>\n+<tr><td>send_buffer_watermark_too_low</td>\n+<td>4</td>\n+<td><p class=\"first\">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:</p>\n+<pre class=\"code C++ literal-block\">\n+<span class=\"name\">min</span><span class=\"punctuation\">(</span><span class=\"literal number integer\">512</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">max</span><span class=\"punctuation\">(</span><span class=\"name\">upload_rate</span><span class=\"whitespace\"> </span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">send_buffer_watermark_factor</span><span class=\"whitespace\"> </span><span class=\"operator\">/</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">100</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">send_buffer_watermark</span><span class=\"punctuation\">))</span>\n+</pre>\n+<p class=\"last\">If you receive this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you might want to either increase your <tt class=\"docutils literal\">send_buffer_watermark</tt>\n+or <tt class=\"docutils literal\">send_buffer_watermark_factor</tt>.</p>\n+</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">hashing_threads</tt> is the number of disk I/O threads to use for\n-piece hash verification. These threads are <em>in addition</em> to the\n-regular disk I/O threads specified by <a class=\"reference external\" href=\"reference-Settings.html#aio_threads\">settings_pack::aio_threads</a>.\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 <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> 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.</p>\n-<a name=\"checking_mem_usage\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>too_many_optimistic_unchoke_slots</td>\n+<td>5</td>\n+<td>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.</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>checking_mem_usage</td>\n-<td>int</td>\n-<td>256</td>\n+<tr><td>too_high_disk_queue_limit</td>\n+<td>6</td>\n+<td>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 <tt class=\"docutils literal\">max_queued_disk_bytes</tt> or increase <tt class=\"docutils literal\">cache_size</tt>.</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"predictive_piece_announce\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"64%\" />\n-<col width=\"14%\" />\n-<col width=\"21%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>aio_limit_reached</td>\n+<td>7</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>predictive_piece_announce</td>\n-<td>int</td>\n-<td>0</td>\n+<tr><td>deprecated_bittyrant_with_no_uplimit</td>\n+<td>8</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"aio_threads\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"46%\" />\n-<col width=\"21%\" />\n-<col width=\"32%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>too_few_outgoing_ports</td>\n+<td>9</td>\n+<td>This is generated if outgoing peer connections are failing because of <em>address in use</em>\n+errors, indicating that <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::outgoing_ports</span></tt> is set and is too small of\n+a range. Consider not using the <tt class=\"docutils literal\">outgoing_ports</tt> setting at all, or widen the range to\n+include more ports.</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>aio_threads</td>\n-<td>int</td>\n+<tr><td>too_few_file_descriptors</td>\n <td>10</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>for some aio back-ends, <tt class=\"docutils literal\">aio_threads</tt> specifies the number of\n-io-threads to use.</p>\n-<a name=\"tracker_backoff\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"53%\" />\n-<col width=\"19%\" />\n-<col width=\"28%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>tracker_backoff</td>\n-<td>int</td>\n-<td>250</td>\n+<tr><td>num_warnings</td>\n+<td>11</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">tracker_backoff</tt> determines how aggressively to back off from\n-retrying failing trackers. This value determines <em>x</em> in the\n-following formula, determining the number of seconds to wait until\n-the next retry:</p>\n-<blockquote>\n-delay = 5 + 5 * x / 100 * fails^2</blockquote>\n-<p>This setting may be useful to make libtorrent more or less\n-aggressive in hitting trackers.</p>\n-<a name=\"share_ratio_limit\"></a>\n-<a name=\"seed_time_ratio_limit\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"state_changed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_changed_alert&labels=documentation&body=Documentation+under+heading+%22class+state_changed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"state-changed-alert\">\n+<h1>state_changed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>Generated whenever a torrent changes its state.</p>\n+<pre class=\"literal-block\">\n+struct state_changed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ torrent_status::state_t const state;\n+ torrent_status::state_t const prev_state;\n+};\n+</pre>\n+<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>state</dt>\n+<dd>the new state of the torrent.</dd>\n+</dl>\n+<a name=\"prev_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_changed_alert%3A%3A%5Bprev_state%5D&labels=documentation&body=Documentation+under+heading+%22state_changed_alert%3A%3A%5Bprev_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>prev_state</dt>\n+<dd>the previous state.</dd>\n+</dl>\n+<a name=\"tracker_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_error_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tracker-error-alert\">\n+<h1>tracker_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated on tracker time outs, premature disconnects,\n+invalid response or a HTTP response other than "200 OK". From the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+you can get the handle to the torrent the tracker belongs to.</p>\n+<pre class=\"literal-block\">\n+struct tracker_error_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>failure_reason</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"failure_reason()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bfailure_reason%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"failure-reason\">\n+<h2>failure_reason()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>failure_reason</strong> () const;\n+</pre>\n+<p>if the tracker sent a "failure reason" string, it will be returned\n+here.</p>\n+<a name=\"times_in_row\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Btimes_in_row%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Btimes_in_row%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>times_in_row</dt>\n+<dd>This member says how many times in a row this tracker has failed.</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error code indicating why the tracker announce failed. If it is\n+is <tt class=\"docutils literal\"><span class=\"pre\">lt::errors::tracker_failure</span></tt> the <a class=\"reference external\" href=\"reference-Alerts.html#failure_reason()\">failure_reason()</a> 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.</dd>\n+</dl>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_error_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_error_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that was announced</dd>\n+</dl>\n+<a name=\"tracker_warning_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_warning_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_warning_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"tracker-warning-alert\">\n+<h1>tracker_warning_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct tracker_warning_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>warning_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker | alert_category::error;\n+ protocol_version version;\n+};\n+</pre>\n+<a name=\"warning_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bwarning_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"warning-message\">\n+<h2>warning_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>warning_message</strong> () const;\n+</pre>\n+<p>the message associated with this warning</p>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_warning_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_warning_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that was announced</dd>\n+</dl>\n+<a name=\"scrape_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"scrape-reply-alert\">\n+<h1>scrape_reply_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a scrape request succeeds.</p>\n+<pre class=\"literal-block\">\n+struct scrape_reply_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n+ int const incomplete;\n+ int const complete;\n+ protocol_version version;\n+};\n+</pre>\n+<a name=\"incomplete\"></a>\n+<a name=\"complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bincomplete+complete%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bincomplete+complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>incomplete complete</dt>\n+<dd>the data returned in the scrape response. These numbers\n+may be -1 if the response was malformed.</dd>\n+</dl>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that was scraped</dd>\n+</dl>\n+<a name=\"scrape_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+scrape_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+scrape_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"scrape-failed-alert\">\n+<h1>scrape_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>If a scrape request fails, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated. This might be due\n+to the tracker timing out, refusing connection or returning an http response\n+code indicating an error.</p>\n+<pre class=\"literal-block\">\n+struct scrape_failed_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>error_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker | alert_category::error;\n+ error_code const error;\n+ protocol_version version;\n+};\n+</pre>\n+<a name=\"error_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"error-message\">\n+<h2>error_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>error_message</strong> () const;\n+</pre>\n+<p>if the error indicates there is an associated message, this returns\n+that message. Otherwise and empty string.</p>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error itself. This may indicate that the tracker sent an error\n+message (<tt class=\"docutils literal\"><span class=\"pre\">error::tracker_failure</span></tt>), in which case it can be\n+retrieved by calling <tt class=\"docutils literal\">error_message()</tt>.</dd>\n+</dl>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:scrape_failed_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22scrape_failed_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that was scraped</dd>\n+</dl>\n+<a name=\"tracker_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"tracker-reply-alert\">\n+<h1>tracker_reply_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct tracker_reply_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n+ int const num_peers;\n+ protocol_version version;\n+};\n+</pre>\n+<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_peers</dt>\n+<dd>tells how many peers the tracker returned in this response. This is\n+not expected to be greater than the <tt class=\"docutils literal\">num_want</tt> settings. These are not necessarily\n+all new peers, some of them may already be connected.</dd>\n+</dl>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_reply_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_reply_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that was announced</dd>\n+</dl>\n+<a name=\"dht_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-reply-alert\">\n+<h1>dht_reply_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated each time the DHT receives peers from a node. <tt class=\"docutils literal\">num_peers</tt>\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.</p>\n+<pre class=\"literal-block\">\n+struct dht_reply_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht | alert_category::tracker;\n+ int const num_peers;\n+};\n+</pre>\n+<a name=\"tracker_announce_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_announce_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tracker-announce-alert\">\n+<h1>tracker_announce_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated each time a tracker announce is sent (or attempted to be sent).\n+There are no extra data members in this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. The url can be found in the base class\n+however.</p>\n+<pre class=\"literal-block\">\n+struct tracker_announce_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::tracker;\n+ event_t const event;\n+ protocol_version version;\n+};\n+</pre>\n+<a name=\"event\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bevent%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bevent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>event</dt>\n+<dd>specifies what event was sent to the tracker. See <a class=\"reference external\" href=\"reference-Core.html#event_t\">event_t</a>.</dd>\n+</dl>\n+<a name=\"version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_announce_alert%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22tracker_announce_alert%3A%3A%5Bversion%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>version</dt>\n+<dd>the bittorrent protocol version that is announced</dd>\n+</dl>\n+<a name=\"hash_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hash_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+hash_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"hash-failed-alert\">\n+<h1>hash_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<pre class=\"literal-block\">\n+struct hash_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"peer_ban_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_ban_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_ban_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-ban-alert\">\n+<h1>peer_ban_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is banned because it has sent too many corrupt pieces\n+to us. <tt class=\"docutils literal\">ip</tt> is the endpoint to the peer that was banned.</p>\n+<pre class=\"literal-block\">\n+struct peer_ban_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+};\n+</pre>\n+<a name=\"peer_unsnubbed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_unsnubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_unsnubbed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-unsnubbed-alert\">\n+<h1>peer_unsnubbed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct peer_unsnubbed_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+};\n+</pre>\n+<a name=\"peer_snubbed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_snubbed_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_snubbed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-snubbed-alert\">\n+<h1>peer_snubbed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is snubbed, when it stops sending data when we request\n+it.</p>\n+<pre class=\"literal-block\">\n+struct peer_snubbed_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+};\n+</pre>\n+<a name=\"peer_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_error_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-error-alert\">\n+<h1>peer_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, to identify it.</p>\n+<pre class=\"literal-block\">\n+struct peer_error_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+ operation_t op;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>a 0-terminated string of the low-level operation that failed, or nullptr if\n+there was no low level disk operation.</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>tells you what error caused this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</dd>\n+</dl>\n+<a name=\"peer_connect_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_connect_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_connect_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-connect-alert\">\n+<h1>peer_connect_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#incoming_connection_alert\">incoming_connection_alert</a>.</p>\n+<pre class=\"literal-block\">\n+struct peer_connect_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ enum direction_t\n+ {\n+ in,\n+ out,\n+ };\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::connect;\n+ direction_t direction;\n+ socket_type_t socket_type;\n+};\n+</pre>\n+<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-direction-t\">\n+<h2>enum direction_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n+<col width=\"23%\" />\n+<col width=\"27%\" />\n+<col width=\"50%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>share_ratio_limit</td>\n-<td>int</td>\n-<td>200</td>\n+<tr><td>in</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-<tr><td>seed_time_ratio_limit</td>\n-<td>int</td>\n-<td>700</td>\n+<tr><td>out</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n-<a name=\"peer_turnover\"></a>\n-<a name=\"peer_turnover_cutoff\"></a>\n-<a name=\"peer_turnover_interval\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"direction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_connect_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22peer_connect_alert%3A%3A%5Bdirection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>direction</dt>\n+<dd>Tells you if the peer was incoming or outgoing</dd>\n+</dl>\n+<a name=\"peer_disconnected_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_disconnected_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_disconnected_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-disconnected-alert\">\n+<h1>peer_disconnected_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer is disconnected for any reason (other than the ones\n+covered by <a class=\"reference external\" href=\"reference-Alerts.html#peer_error_alert\">peer_error_alert</a> ).</p>\n+<pre class=\"literal-block\">\n+struct peer_disconnected_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>socket_type</dt>\n+<dd>the kind of socket this peer was connected over</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the operation or level where the error occurred. Specified as an\n+value from the <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> enum. Defined in operations.hpp.</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>tells you what error caused peer to disconnect.</dd>\n+</dl>\n+<a name=\"reason\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_disconnected_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_disconnected_alert%3A%3A%5Breason%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>reason</dt>\n+<dd>the reason the peer disconnected (if specified)</dd>\n+</dl>\n+<a name=\"invalid_request_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+invalid_request_alert&labels=documentation&body=Documentation+under+heading+%22class+invalid_request_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"invalid-request-alert\">\n+<h1>invalid_request_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is a debug <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> that is generated by an incoming invalid piece request.\n+<tt class=\"docutils literal\">ip</tt> is the address of the peer and the <tt class=\"docutils literal\">request</tt> is the actual incoming\n+request from the peer. See <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> for more info.</p>\n+<pre class=\"literal-block\">\n+struct invalid_request_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+ peer_request const request;\n+ bool const we_have;\n+ bool const peer_interested;\n+ bool const withheld;\n+};\n+</pre>\n+<a name=\"request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Brequest%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Brequest%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>request</dt>\n+<dd>the request we received from the peer</dd>\n+</dl>\n+<a name=\"we_have\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwe_have%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwe_have%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>we_have</dt>\n+<dd>true if we have this piece</dd>\n+</dl>\n+<a name=\"peer_interested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bpeer_interested%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bpeer_interested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>peer_interested</dt>\n+<dd>true if the peer indicated that it was interested to download before\n+sending the request</dd>\n+</dl>\n+<a name=\"withheld\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:invalid_request_alert%3A%3A%5Bwithheld%5D&labels=documentation&body=Documentation+under+heading+%22invalid_request_alert%3A%3A%5Bwithheld%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>withheld</dt>\n+<dd>if this is true, the peer is not allowed to download this piece because\n+of super-seeding rules.</dd>\n+</dl>\n+<a name=\"torrent_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-finished-alert\">\n+<h1>torrent_finished_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> to the\n+torrent in question.</p>\n+<pre class=\"literal-block\">\n+struct torrent_finished_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"piece_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-finished-alert\">\n+<h1>piece_finished_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted every time a piece completes downloading\n+and passes the hash check. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> derives from <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a>\n+which contains the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> 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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#have_piece()\">torrent_handle::have_piece()</a>\n+may still return false</p>\n+<pre class=\"literal-block\">\n+struct piece_finished_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"piece_index\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_finished_alert%3A%3A%5Bpiece_index%5D&labels=documentation&body=Documentation+under+heading+%22piece_finished_alert%3A%3A%5Bpiece_index%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_index</dt>\n+<dd>the index of the piece that finished</dd>\n+</dl>\n+<a name=\"request_dropped_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+request_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+request_dropped_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"request-dropped-alert\">\n+<h1>request_dropped_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a peer rejects or ignores a piece request.</p>\n+<pre class=\"literal-block\">\n+struct request_dropped_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"block_timeout_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_timeout_alert&labels=documentation&body=Documentation+under+heading+%22class+block_timeout_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"block-timeout-alert\">\n+<h1>block_timeout_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request times out.</p>\n+<pre class=\"literal-block\">\n+struct block_timeout_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"block_finished_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_finished_alert&labels=documentation&body=Documentation+under+heading+%22class+block_finished_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"block-finished-alert\">\n+<h1>block_finished_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request receives a response.</p>\n+<pre class=\"literal-block\">\n+struct block_finished_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"block_downloading_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_downloading_alert&labels=documentation&body=Documentation+under+heading+%22class+block_downloading_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"block-downloading-alert\">\n+<h1>block_downloading_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block request is sent to a peer.</p>\n+<pre class=\"literal-block\">\n+struct block_downloading_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"unwanted_block_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+unwanted_block_alert&labels=documentation&body=Documentation+under+heading+%22class+unwanted_block_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"unwanted-block-alert\">\n+<h1>unwanted_block_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a block is received that was not requested or\n+whose request timed out.</p>\n+<pre class=\"literal-block\">\n+struct unwanted_block_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"storage_moved_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"storage-moved-alert\">\n+<h1>storage_moved_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">storage_moved_alert</tt> is generated when all the disk IO has\n+completed and the files have been moved, as an effect of a call to\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::move_storage</span></tt>. This is useful to synchronize with the\n+actual disk. The <tt class=\"docutils literal\">storage_path()</tt> member return the new path of the\n+storage.</p>\n+<pre class=\"literal-block\">\n+struct storage_moved_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>storage_path</strong> () const;\n+ char const* <strong>old_path</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+};\n+</pre>\n+<a name=\"storage_path()\"></a>\n+<a name=\"old_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_alert%3A%3A%5Bstorage_path%28%29+old_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"storage-path-old-path\">\n+<h2>storage_path() old_path()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>storage_path</strong> () const;\n+char const* <strong>old_path</strong> () const;\n+</pre>\n+<p>the path the torrent was moved to and from, respectively.</p>\n+<a name=\"storage_moved_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_moved_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+storage_moved_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"storage-moved-failed-alert\">\n+<h1>storage_moved_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">storage_moved_failed_alert</tt> is generated when an attempt to move the storage,\n+via <a class=\"reference external\" href=\"reference-Torrent_Handle.html#move_storage()\">torrent_handle::move_storage()</a>, fails.</p>\n+<pre class=\"literal-block\">\n+struct storage_moved_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>file_path</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ error_code const error;\n+ operation_t op;\n+};\n+</pre>\n+<a name=\"file_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"file-path\">\n+<h2>file_path()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>file_path</strong> () const;\n+</pre>\n+<p>If the error happened for a specific file, this returns its path.</p>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_moved_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22storage_moved_failed_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>this indicates what underlying operation caused the error</dd>\n+</dl>\n+<a name=\"torrent_deleted_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_deleted_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_deleted_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"torrent-deleted-alert\">\n+<h1>torrent_deleted_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a request to delete the files of a torrent complete.</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted in the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::storage</span></tt> category, and that bit\n+needs to be set in the alert_mask.</p>\n+<pre class=\"literal-block\">\n+struct torrent_deleted_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ info_hash_t info_hashes;\n+};\n+</pre>\n+<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_deleted_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_deleted_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hashes</dt>\n+<dd>The info-hash of the torrent that was just deleted. Most of\n+the time the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> in the <tt class=\"docutils literal\">torrent_alert</tt> will be invalid by the time\n+this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> arrives, since the torrent is being deleted. The <tt class=\"docutils literal\">info_hashes</tt> member\n+is hence the main way of identifying which torrent just completed the delete.</dd>\n+</dl>\n+<a name=\"torrent_delete_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_delete_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_delete_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-delete-failed-alert\">\n+<h1>torrent_delete_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a request to delete the files of a torrent fails.\n+Just removing a torrent from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> cannot fail</p>\n+<pre class=\"literal-block\">\n+struct torrent_delete_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage\n+ | alert_category::error;\n+ error_code const error;\n+ info_hash_t info_hashes;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>tells you why it failed.</dd>\n+</dl>\n+<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_delete_failed_alert%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hashes</dt>\n+<dd>the info hash of the torrent whose files failed to be deleted</dd>\n+</dl>\n+<a name=\"save_resume_data_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"save-resume-data-alert\">\n+<h1>save_resume_data_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::save_resume_data</span></tt> request.\n+It is generated once the disk IO thread is done writing the state for this torrent.</p>\n+<pre class=\"literal-block\">\n+struct save_resume_data_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ add_torrent_params params;\n+};\n+</pre>\n+<a name=\"params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_alert%3A%3A%5Bparams%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>params</dt>\n+<dd><p class=\"first\">the <tt class=\"docutils literal\">params</tt> object is populated with the torrent file whose resume\n+data was saved. It is suitable to be:</p>\n+<ul class=\"last simple\">\n+<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> with <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n+<li>saved to disk with <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></li>\n+<li>turned into a magnet link with <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n+<li>saved as a .torrent file with <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n+</ul>\n+</dd>\n+</dl>\n+<a name=\"save_resume_data_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+save_resume_data_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+save_resume_data_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"save-resume-data-failed-alert\">\n+<h1>save_resume_data_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated instead of <tt class=\"docutils literal\">save_resume_data_alert</tt> if there was an error\n+generating the resume data. <tt class=\"docutils literal\">error</tt> describes what went wrong.</p>\n+<pre class=\"literal-block\">\n+struct save_resume_data_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage\n+ | alert_category::error;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:save_resume_data_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22save_resume_data_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error code from the resume_data failure</dd>\n+</dl>\n+<a name=\"torrent_paused_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_paused_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_paused_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-paused-alert\">\n+<h1>torrent_paused_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::pause</span></tt> 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.</p>\n+<pre class=\"literal-block\">\n+struct torrent_paused_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"torrent_resumed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_resumed_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_resumed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-resumed-alert\">\n+<h1>torrent_resumed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated as a response to a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#resume()\">torrent_handle::resume()</a> request. It is\n+generated when a torrent goes from a paused state to an active state.</p>\n+<pre class=\"literal-block\">\n+struct torrent_resumed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"torrent_checked_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_checked_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_checked_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-checked-alert\">\n+<h1>torrent_checked_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when a torrent completes checking. i.e. when it transitions\n+out of the <tt class=\"docutils literal\">checking files</tt> state into a state where it is ready to start downloading</p>\n+<pre class=\"literal-block\">\n+struct torrent_checked_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"url_seed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+url_seed_alert&labels=documentation&body=Documentation+under+heading+%22class+url_seed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"url-seed-alert\">\n+<h1>url_seed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a HTTP seed name lookup fails.</p>\n+<pre class=\"literal-block\">\n+struct url_seed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>server_url</strong> () const;\n+ char const* <strong>error_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer | alert_category::error;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"server_url()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Bserver_url%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Bserver_url%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"server-url\">\n+<h2>server_url()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>server_url</strong> () const;\n+</pre>\n+<p>the URL the error is associated with</p>\n+<a name=\"error_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror_message%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"error-message-1\">\n+<h2>error_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>error_message</strong> () const;\n+</pre>\n+<p>in case the web server sent an error message, this function returns\n+it.</p>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:url_seed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22url_seed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error the web seed encountered. If this is not set, the server\n+sent an error message, call <tt class=\"docutils literal\">error_message()</tt>.</dd>\n+</dl>\n+<a name=\"file_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_error_alert&labels=documentation&body=Documentation+under+heading+%22class+file_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"file-error-alert\">\n+<h1>file_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>If the storage fails to read or write files that it needs access to, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is\n+generated and the torrent is paused.</p>\n+<pre class=\"literal-block\">\n+struct file_error_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>filename</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status\n+ | alert_category::storage;\n+ error_code const error;\n+ operation_t op;\n+};\n+</pre>\n+<a name=\"filename()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"filename\">\n+<h2>filename()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>filename</strong> () const;\n+</pre>\n+<p>the file that experienced the error</p>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error code describing the error.</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>indicates which underlying operation caused the error</dd>\n+</dl>\n+<a name=\"metadata_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"metadata-failed-alert\">\n+<h1>metadata_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct metadata_failed_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:metadata_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22metadata_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>indicates what failed when parsing the metadata. This error is\n+what's returned from lazy_bdecode().</dd>\n+</dl>\n+<a name=\"metadata_received_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+metadata_received_alert&labels=documentation&body=Documentation+under+heading+%22class+metadata_received_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"metadata-received-alert\">\n+<h1>metadata_received_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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).</p>\n+<p>There are no additional data members in this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<p>Typically, when receiving this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you would want to save the torrent file in order\n+to load it back up again when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is restarted. Here's an example snippet of\n+code to do that:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">torrent_handle</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">alert</span><span class=\"operator\">-></span><span class=\"name\">handle</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">shared_ptr</span><span class=\"operator\"><</span><span class=\"name\">torrent_info</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">ti</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">h</span><span class=\"punctuation\">.</span><span class=\"name\">torrent_file</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"name\">create_torrent</span><span class=\"whitespace\"> </span><span class=\"name function\">ct</span><span class=\"punctuation\">(</span><span class=\"operator\">*</span><span class=\"name\">ti</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">te</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">ct</span><span class=\"punctuation\">.</span><span class=\"name\">generate</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buffer</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"name\">bencode</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">back_inserter</span><span class=\"punctuation\">(</span><span class=\"name\">buffer</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">te</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"keyword type\">FILE</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">fopen</span><span class=\"punctuation\">((</span><span class=\"name\">to_hex</span><span class=\"punctuation\">(</span><span class=\"name\">ti</span><span class=\"operator\">-></span><span class=\"name\">info_hashes</span><span class=\"punctuation\">().</span><span class=\"name\">get_best</span><span class=\"punctuation\">().</span><span class=\"name\">to_string</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"operator\">+</span><span class=\"whitespace\"> </span><span class=\"literal string\">".torrent"</span><span class=\"punctuation\">).</span><span class=\"name\">c_str</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"literal string\">"wb+"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">fwrite</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">buffer</span><span class=\"punctuation\">[</span><span class=\"literal number integer\">0</span><span class=\"punctuation\">],</span><span class=\"whitespace\"> </span><span class=\"literal number integer\">1</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">buffer</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">f</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"name\">fclose</span><span class=\"punctuation\">(</span><span class=\"name\">f</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<pre class=\"literal-block\">\n+struct metadata_received_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"udp_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+udp_error_alert&labels=documentation&body=Documentation+under+heading+%22class+udp_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"udp-error-alert\">\n+<h1>udp_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n+<pre class=\"literal-block\">\n+struct udp_error_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ aux::noexcept_movable<udp::endpoint> endpoint;\n+ operation_t operation;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoint</dt>\n+<dd>the source address associated with the error (if any)</dd>\n+</dl>\n+<a name=\"operation\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Boperation%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Boperation%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>operation</dt>\n+<dd>the operation that failed</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:udp_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22udp_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error code describing the error</dd>\n+</dl>\n+<a name=\"external_ip_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+external_ip_alert&labels=documentation&body=Documentation+under+heading+%22class+external_ip_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"external-ip-alert\">\n+<h1>external_ip_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>Whenever libtorrent learns about the machines external IP, this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">external_address</tt> member.</p>\n+<pre class=\"literal-block\">\n+struct external_ip_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ aux::noexcept_movable<address> external_address;\n+};\n+</pre>\n+<a name=\"external_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:external_ip_alert%3A%3A%5Bexternal_address%5D&labels=documentation&body=Documentation+under+heading+%22external_ip_alert%3A%3A%5Bexternal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>external_address</dt>\n+<dd>the IP address that is believed to be our external IP</dd>\n+</dl>\n+<a name=\"listen_failed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_failed_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_failed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"listen-failed-alert\">\n+<h1>listen_failed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when none of the ports, given in the port range, to\n+<a class=\"reference external\" href=\"reference-Session.html#session\">session</a> can be opened for listening. The <tt class=\"docutils literal\">listen_interface</tt> member is the\n+interface that failed, <tt class=\"docutils literal\">error</tt> is the error code describing the failure.</p>\n+<p>In the case an endpoint was created before generating the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, it is\n+represented by <tt class=\"docutils literal\">address</tt> and <tt class=\"docutils literal\">port</tt>. 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</p>\n+<p>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 <a class=\"reference external\" href=\"reference-Alerts.html#listen_failed_alert\">listen_failed_alert</a> with port 0 even if you didn't ask to\n+listen on it.</p>\n+<pre class=\"literal-block\">\n+struct listen_failed_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>listen_interface</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"listen_interface()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Blisten_interface%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"listen-interface\">\n+<h2>listen_interface()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>listen_interface</strong> () const;\n+</pre>\n+<p>the network device libtorrent attempted to listen on, or the IP address</p>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error the system returned</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the underlying operation that failed</dd>\n+</dl>\n+<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>socket_type</dt>\n+<dd>the type of listen socket this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> refers to.</dd>\n+</dl>\n+<a name=\"address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Baddress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>address</dt>\n+<dd>the address libtorrent attempted to listen on\n+see <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> documentation for validity of this value</dd>\n+</dl>\n+<a name=\"port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_failed_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_failed_alert%3A%3A%5Bport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>port</dt>\n+<dd>the port libtorrent attempted to listen on\n+see <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> documentation for validity of this value</dd>\n+</dl>\n+<a name=\"listen_succeeded_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+listen_succeeded_alert&labels=documentation&body=Documentation+under+heading+%22class+listen_succeeded_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"listen-succeeded-alert\">\n+<h1>listen_succeeded_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the listen port succeeds to be opened on a\n+particular interface. <tt class=\"docutils literal\">address</tt> and <tt class=\"docutils literal\">port</tt> is the endpoint that\n+successfully was opened for listening.</p>\n+<pre class=\"literal-block\">\n+struct listen_succeeded_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ aux::noexcept_movable<lt::address> address;\n+ int const port;\n+ lt::socket_type_t const socket_type;\n+};\n+</pre>\n+<a name=\"address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Baddress%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Baddress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>address</dt>\n+<dd>the address libtorrent ended up listening on. This address\n+refers to the local interface.</dd>\n+</dl>\n+<a name=\"port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bport%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>port</dt>\n+<dd>the port libtorrent ended up listening on.</dd>\n+</dl>\n+<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:listen_succeeded_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22listen_succeeded_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>socket_type</dt>\n+<dd>the type of listen socket this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> refers to.</dd>\n+</dl>\n+<a name=\"portmap_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_error_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"portmap-error-alert\">\n+<h1>portmap_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct portmap_error_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"mapping\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmapping%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>mapping</dt>\n+<dd>refers to the mapping index of the port map that failed, i.e.\n+the index returned from add_mapping().</dd>\n+</dl>\n+<a name=\"map_transport\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Bmap_transport%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Bmap_transport%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>map_transport</dt>\n+<dd>UPnP or NAT-PMP</dd>\n+</dl>\n+<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_address</dt>\n+<dd>the local network the port mapper is running on</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22portmap_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>tells you what failed.</dd>\n+</dl>\n+<a name=\"portmap_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"portmap-alert\">\n+<h1>portmap_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct portmap_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"mapping\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bmapping%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bmapping%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>mapping</dt>\n+<dd>refers to the mapping index of the port map that failed, i.e.\n+the index returned from add_mapping().</dd>\n+</dl>\n+<a name=\"external_port\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Bexternal_port%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Bexternal_port%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>external_port</dt>\n+<dd>the external port allocated for the mapping.</dd>\n+</dl>\n+<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_address</dt>\n+<dd>the local network the port mapper is running on</dd>\n+</dl>\n+<a name=\"portmap_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+portmap_log_alert&labels=documentation&body=Documentation+under+heading+%22class+portmap_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"portmap-log-alert\">\n+<h1>portmap_log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only\n+posted if the alert_category::port_mapping_log flag is enabled in\n+the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> mask.</p>\n+<pre class=\"literal-block\">\n+struct portmap_log_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>log_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::port_mapping_log;\n+ portmap_transport const map_transport;\n+ aux::noexcept_movable<address> local_address;\n+};\n+</pre>\n+<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message\">\n+<h2>log_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>log_message</strong> () const;\n+</pre>\n+<p>the message associated with this log line</p>\n+<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:portmap_log_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22portmap_log_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_address</dt>\n+<dd>the local network the port mapper is running on</dd>\n+</dl>\n+<a name=\"fastresume_rejected_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+fastresume_rejected_alert&labels=documentation&body=Documentation+under+heading+%22class+fastresume_rejected_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"fastresume-rejected-alert\">\n+<h1>fastresume_rejected_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a fast resume file has been passed to\n+<a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct fastresume_rejected_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>file_path</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status\n+ | alert_category::error;\n+ error_code error;\n+ operation_t op;\n+};\n+</pre>\n+<a name=\"file_path()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bfile_path%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"file-path-1\">\n+<h2>file_path()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>file_path</strong> () const;\n+</pre>\n+<p>If the error happened to a specific file, this returns the path to it.</p>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:fastresume_rejected_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22fastresume_rejected_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the underlying operation that failed</dd>\n+</dl>\n+<a name=\"peer_blocked_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_blocked_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_blocked_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-blocked-alert\">\n+<h1>peer_blocked_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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:</p>\n+<ul class=\"simple\">\n+<li>the IP filter</li>\n+<li>i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)</li>\n+<li>the port filter</li>\n+<li>the peer has a low port and <tt class=\"docutils literal\">no_connect_privileged_ports</tt> is enabled</li>\n+<li>the protocol of the peer is blocked (uTP/TCP blocking)</li>\n+</ul>\n+<pre class=\"literal-block\">\n+struct peer_blocked_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () 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 <strong>static_category</strong> = alert_category::ip_block;\n+ int const reason;\n+};\n+</pre>\n+<a name=\"reason_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+reason_t&labels=documentation&body=Documentation+under+heading+%22enum+reason_t%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"enum-reason-t\">\n+<h2>enum reason_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n+<col width=\"56%\" />\n+<col width=\"16%\" />\n+<col width=\"29%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>peer_turnover</td>\n-<td>int</td>\n-<td>4</td>\n-</tr>\n-<tr><td>peer_turnover_cutoff</td>\n-<td>int</td>\n-<td>90</td>\n+<tr><td>ip_filter</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-<tr><td>peer_turnover_interval</td>\n-<td>int</td>\n-<td>300</td>\n+<tr><td>port_filter</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"connect_seed_every_n_download\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>i2p_mixed</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>connect_seed_every_n_download</td>\n-<td>int</td>\n-<td>10</td>\n+<tr><td>privileged_ports</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"max_http_recv_buffer_size\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"60%\" />\n-<col width=\"13%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>utp_disabled</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_http_recv_buffer_size</td>\n-<td>int</td>\n-<td>4*1024*204</td>\n+<tr><td>tcp_disabled</td>\n+<td>5</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>the max number of bytes to allow an HTTP response to be when\n-announcing to trackers or downloading .torrent files via the\n-<tt class=\"docutils literal\">url</tt> provided in <tt class=\"docutils literal\">add_torrent_params</tt>.</p>\n-<a name=\"max_retry_port_bind\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>invalid_local_interface</td>\n+<td>6</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_retry_port_bind</td>\n-<td>int</td>\n-<td>10</td>\n+<tr><td>ssrf_mitigation</td>\n+<td>7</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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</p>\n-<a name=\"alert_mask\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"reason\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_blocked_alert%3A%3A%5Breason%5D&labels=documentation&body=Documentation+under+heading+%22peer_blocked_alert%3A%3A%5Breason%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>reason</dt>\n+<dd>the reason for the peer being blocked. Is one of the values from the\n+<a class=\"reference external\" href=\"reference-Alerts.html#reason_t\">reason_t</a> enum.</dd>\n+</dl>\n+<a name=\"dht_announce_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_announce_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_announce_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"dht-announce-alert\">\n+<h1>dht_announce_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a DHT node announces to an info-hash on our\n+DHT node. It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n+<pre class=\"literal-block\">\n+struct dht_announce_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ aux::noexcept_movable<address> ip;\n+ int port;\n+ sha1_hash info_hash;\n+};\n+</pre>\n+<a name=\"dht_get_peers_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-get-peers-alert\">\n+<h1>dht_get_peers_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when a DHT node sends a <tt class=\"docutils literal\">get_peers</tt> message to\n+our DHT node. It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n+<pre class=\"literal-block\">\n+struct dht_get_peers_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ sha1_hash info_hash;\n+};\n+</pre>\n+<a name=\"cache_flushed_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+cache_flushed_alert&labels=documentation&body=Documentation+under+heading+%22class+cache_flushed_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"cache-flushed-alert\">\n+<h1>cache_flushed_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the disk cache has been flushed for a specific\n+torrent as a result of a call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#flush_cache()\">torrent_handle::flush_cache()</a>. This\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::storage</span></tt> category, which must be\n+enabled to let this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> through. The <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is also posted when removing\n+a torrent from the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, once the outstanding cache flush is complete\n+and the torrent does no longer have any files open.</p>\n+<pre class=\"literal-block\">\n+struct cache_flushed_alert final : torrent_alert\n+{\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+};\n+</pre>\n+<a name=\"lsd_peer_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_peer_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_peer_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"lsd-peer-alert\">\n+<h1>lsd_peer_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when we receive a local service discovery message\n+from a peer for a torrent we're currently participating in.</p>\n+<pre class=\"literal-block\">\n+struct lsd_peer_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+};\n+</pre>\n+<a name=\"trackerid_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+trackerid_alert&labels=documentation&body=Documentation+under+heading+%22class+trackerid_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"trackerid-alert\">\n+<h1>trackerid_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted whenever a tracker responds with a <tt class=\"docutils literal\">trackerid</tt>.\n+The tracker ID is like a cookie. libtorrent will store the tracker ID\n+for this tracker and repeat it in subsequent announces.</p>\n+<pre class=\"literal-block\">\n+struct trackerid_alert final : tracker_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>tracker_id</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"tracker_id()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:trackerid_alert%3A%3A%5Btracker_id%28%29%5D&labels=documentation&body=Documentation+under+heading+%22trackerid_alert%3A%3A%5Btracker_id%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"tracker-id\">\n+<h2>tracker_id()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>tracker_id</strong> () const;\n+</pre>\n+<p>The tracker ID returned by the tracker</p>\n+<a name=\"dht_bootstrap_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_bootstrap_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_bootstrap_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"dht-bootstrap-alert\">\n+<h1>dht_bootstrap_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the initial DHT bootstrap is done.</p>\n+<pre class=\"literal-block\">\n+struct dht_bootstrap_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+};\n+</pre>\n+<a name=\"torrent_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_error_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-error-alert\">\n+<h1>torrent_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is posted whenever a torrent is transitioned into the error state.\n+If the error code is duplicate_torrent (<a class=\"reference external\" href=\"reference-Error_Codes.html#error_code_enum\">error_code_enum</a>) error, it suggests two magnet\n+links ended up resolving to the same hybrid torrent. For more details,\n+see <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.</p>\n+<pre class=\"literal-block\">\n+struct torrent_error_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>filename</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error | alert_category::status;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"filename()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Bfilename%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Bfilename%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"filename-1\">\n+<h2>filename()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>filename</strong> () const;\n+</pre>\n+<p>the filename (or object) the error occurred on.</p>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22torrent_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>specifies which error the torrent encountered.</dd>\n+</dl>\n+<a name=\"torrent_need_cert_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_need_cert_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_need_cert_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"torrent-need-cert-alert\">\n+<h1>torrent_need_cert_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is always posted for SSL torrents. This is a reminder to the client that\n+the torrent won't work unless <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_ssl_certificate()\">torrent_handle::set_ssl_certificate()</a> is called with\n+a valid certificate. Valid certificates MUST be signed by the SSL certificate\n+in the .torrent file.</p>\n+<pre class=\"literal-block\">\n+struct torrent_need_cert_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+};\n+</pre>\n+<a name=\"incoming_connection_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_connection_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_connection_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"incoming-connection-alert\">\n+<h1>incoming_connection_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The incoming connection <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct incoming_connection_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::peer;\n+ socket_type_t socket_type;\n+ aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> endpoint;\n+};\n+</pre>\n+<a name=\"socket_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bsocket_type%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bsocket_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>socket_type</dt>\n+<dd>tells you what kind of socket the connection was accepted</dd>\n+</dl>\n+<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_connection_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22incoming_connection_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoint</dt>\n+<dd>is the IP address and port the connection came from.</dd>\n+</dl>\n+<a name=\"add_torrent_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_alert&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"add-torrent-alert\">\n+<h1>add_torrent_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">handle</tt> member in the base class. If adding\n+the torrent failed, <tt class=\"docutils literal\">error</tt> contains the error code.</p>\n+<pre class=\"literal-block\">\n+struct add_torrent_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ add_torrent_params params;\n+ error_code error;\n+};\n+</pre>\n+<a name=\"params\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Bparams%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Bparams%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>params</dt>\n+<dd><p class=\"first\">This contains copies of the most important fields from the original\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object, passed to <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or\n+<a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a>. Specifically, these fields are copied:</p>\n+<ul class=\"simple\">\n+<li>version</li>\n+<li>ti</li>\n+<li>name</li>\n+<li>save_path</li>\n+<li>userdata</li>\n+<li>tracker_id</li>\n+<li>flags</li>\n+<li>info_hash</li>\n+</ul>\n+<p class=\"last\">the info_hash field will be updated with the info-hash of the torrent\n+specified by <tt class=\"docutils literal\">ti</tt>.</p>\n+</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>set to the error, if one occurred while adding the torrent.</dd>\n+</dl>\n+<a name=\"state_update_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+state_update_alert&labels=documentation&body=Documentation+under+heading+%22class+state_update_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"state-update-alert\">\n+<h1>state_update_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only posted when requested by the user, by calling\n+session::post_torrent_updates() on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It contains the torrent\n+status of all torrents that changed since last time this message was\n+posted. Its category is <tt class=\"docutils literal\"><span class=\"pre\">alert_category::status</span></tt>, but it's not subject to\n+filtering, since it's only manually posted anyway.</p>\n+<pre class=\"literal-block\">\n+struct state_update_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ std::vector<torrent_status> status;\n+};\n+</pre>\n+<a name=\"status\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:state_update_alert%3A%3A%5Bstatus%5D&labels=documentation&body=Documentation+under+heading+%22state_update_alert%3A%3A%5Bstatus%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>status</dt>\n+<dd>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 <tt class=\"docutils literal\">handle</tt> member. The receiving end is\n+suggested to have all torrents sorted by the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> or hashed\n+by it, for efficient updates.</dd>\n+</dl>\n+<a name=\"session_stats_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-stats-alert\">\n+<h1>session_stats_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Alerts.html#session_stats_alert\">session_stats_alert</a> is posted when the user requests <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> statistics by\n+calling <a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> object. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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.</p>\n+<p>the <tt class=\"docutils literal\">message()</tt> member function returns a string representation of the values that\n+properly match the line returned in <tt class=\"docutils literal\"><span class=\"pre\">session_stats_header_alert::message()</span></tt>.</p>\n+<p>this specific output is parsed by tools/parse_session_stats.py\n+if this is changed, that parser should also be changed</p>\n+<pre class=\"literal-block\">\n+struct session_stats_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ span<std::int64_t const> <strong>counters</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = {};\n+};\n+</pre>\n+<a name=\"counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_stats_alert%3A%3A%5Bcounters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22session_stats_alert%3A%3A%5Bcounters%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"counters-1\">\n+<h2>counters()</h2>\n+<pre class=\"literal-block\">\n+span<std::int64_t const> <strong>counters</strong> () const;\n+</pre>\n+<p>An array are a mix of <em>counters</em> and <em>gauges</em>, which meanings can be\n+queries via the <a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a> function on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. 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+<a class=\"reference external\" href=\"reference-Stats.html#session_stats_metrics()\">session_stats_metrics()</a>, once on startup, and then use that mapping to\n+interpret these values throughout the process' runtime.</p>\n+<p>For more information, see the <a class=\"reference external\" href=\"manual-ref.html#session-statistics\">session statistics</a> section.</p>\n+<a name=\"dht_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_error_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"dht-error-alert\">\n+<h1>dht_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when something fails in the DHT. This is not necessarily a fatal\n+error, but it could prevent proper operation</p>\n+<pre class=\"literal-block\">\n+struct dht_error_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error | alert_category::dht;\n+ error_code error;\n+ operation_t op;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error code</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_error_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22dht_error_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the operation that failed</dd>\n+</dl>\n+<a name=\"dht_immutable_item_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_immutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_immutable_item_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-immutable-item-alert\">\n+<h1>dht_immutable_item_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted as a response to a call to session::get_item(),\n+specifically the overload for looking up immutable items in the DHT.</p>\n+<pre class=\"literal-block\">\n+struct dht_immutable_item_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ sha1_hash target;\n+ entry item;\n+};\n+</pre>\n+<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>target</dt>\n+<dd>the target hash of the immutable item. This must\n+match the SHA-1 hash of the bencoded form of <tt class=\"docutils literal\">item</tt>.</dd>\n+</dl>\n+<a name=\"item\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_immutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_immutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>item</dt>\n+<dd>the data for this item</dd>\n+</dl>\n+<a name=\"dht_mutable_item_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_mutable_item_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_mutable_item_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-mutable-item-alert\">\n+<h1>dht_mutable_item_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted as a response to a call to session::get_item(),\n+specifically the overload for looking up mutable items in the DHT.</p>\n+<pre class=\"literal-block\">\n+struct dht_mutable_item_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"key\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bkey%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bkey%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>key</dt>\n+<dd>the public key that was looked up</dd>\n+</dl>\n+<a name=\"signature\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsignature%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsignature%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>signature</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"seq\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bseq%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bseq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>seq</dt>\n+<dd>the sequence number of this item</dd>\n+</dl>\n+<a name=\"salt\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bsalt%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bsalt%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>salt</dt>\n+<dd>the salt, if any, used to lookup and store this item. If no\n+salt was used, this is an empty string</dd>\n+</dl>\n+<a name=\"item\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bitem%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bitem%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>item</dt>\n+<dd>the data for this item</dd>\n+</dl>\n+<a name=\"authoritative\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_mutable_item_alert%3A%3A%5Bauthoritative%5D&labels=documentation&body=Documentation+under+heading+%22dht_mutable_item_alert%3A%3A%5Bauthoritative%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>authoritative</dt>\n+<dd>the last response for mutable data is authoritative.</dd>\n+</dl>\n+<a name=\"dht_put_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_put_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_put_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-put-alert\">\n+<h1>dht_put_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>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.</p>\n+<pre class=\"literal-block\">\n+struct dht_put_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>target</dt>\n+<dd>the target hash the item was stored under if this was an <em>immutable</em>\n+item.</dd>\n+</dl>\n+<a name=\"public_key\"></a>\n+<a name=\"signature\"></a>\n+<a name=\"salt\"></a>\n+<a name=\"seq\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bpublic_key+signature+salt+seq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>public_key signature salt seq</dt>\n+<dd>if a mutable item was stored, these are the public key, signature,\n+salt and sequence number the item was stored under.</dd>\n+</dl>\n+<a name=\"num_success\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_put_alert%3A%3A%5Bnum_success%5D&labels=documentation&body=Documentation+under+heading+%22dht_put_alert%3A%3A%5Bnum_success%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_success</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"i2p_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+i2p_alert&labels=documentation&body=Documentation+under+heading+%22class+i2p_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"i2p-alert\">\n+<h1>i2p_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is used to report errors in the i2p SAM connection</p>\n+<pre class=\"literal-block\">\n+struct i2p_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ error_code error;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22i2p_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error that occurred in the i2p SAM connection</dd>\n+</dl>\n+<a name=\"dht_outgoing_get_peers_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_outgoing_get_peers_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_outgoing_get_peers_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-outgoing-get-peers-alert\">\n+<h1>dht_outgoing_get_peers_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is generated when we send a get_peers request\n+It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht</span></tt> category.</p>\n+<pre class=\"literal-block\">\n+struct dht_outgoing_get_peers_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ sha1_hash info_hash;\n+ sha1_hash obfuscated_info_hash;\n+ aux::noexcept_movable<udp::endpoint> endpoint;\n+};\n+</pre>\n+<a name=\"info_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Binfo_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hash</dt>\n+<dd>the info_hash of the torrent we're looking for peers for.</dd>\n+</dl>\n+<a name=\"obfuscated_info_hash\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bobfuscated_info_hash%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>obfuscated_info_hash</dt>\n+<dd>if this was an obfuscated lookup, this is the info-hash target\n+actually sent to the node.</dd>\n+</dl>\n+<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_outgoing_get_peers_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoint</dt>\n+<dd>the endpoint we're sending this query to</dd>\n+</dl>\n+<a name=\"log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+log_alert&labels=documentation&body=Documentation+under+heading+%22class+log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"log-alert\">\n+<h1>log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted by some <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide event. Its main purpose is\n+trouble shooting and debugging. It's not enabled by the default <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::session_log</span></tt> bit.\n+Furthermore, it's by default disabled as a build configuration.</p>\n+<pre class=\"literal-block\">\n+struct log_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>log_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::session_log;\n+};\n+</pre>\n+<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-1\">\n+<h2>log_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>log_message</strong> () const;\n+</pre>\n+<p>returns the log message</p>\n+<a name=\"torrent_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_log_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"torrent-log-alert\">\n+<h1>torrent_log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::torrent_log</span></tt> bit. By\n+default it is disabled as a build configuration.</p>\n+<pre class=\"literal-block\">\n+struct torrent_log_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>log_message</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::torrent_log;\n+};\n+</pre>\n+<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-2\">\n+<h2>log_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>log_message</strong> () const;\n+</pre>\n+<p>returns the log message</p>\n+<a name=\"peer_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_log_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-log-alert\">\n+<h1>peer_log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+mask and is enabled by the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::peer_log</span></tt> bit. By\n+default it is disabled as a build configuration.</p>\n+<pre class=\"literal-block\">\n+struct peer_log_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>log_message</strong> () 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 <strong>static_category</strong> = alert_category::peer_log;\n+ char const* event_type;\n+ direction_t direction;\n+};\n+</pre>\n+<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-3\">\n+<h2>log_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>log_message</strong> () const;\n+</pre>\n+<p>returns the log message</p>\n+<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-direction-t-1\">\n+<h2>enum direction_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n+<col width=\"47%\" />\n+<col width=\"18%\" />\n+<col width=\"34%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>alert_mask</td>\n-<td>int</td>\n-<td>int</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>a bitmask combining flags from <a class=\"reference external\" href=\"reference-Alerts.html#alert_category_t\">alert_category_t</a> defining which\n-kinds of alerts to receive</p>\n-<a name=\"out_enc_policy\"></a>\n-<a name=\"in_enc_policy\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"33%\" />\n-<col width=\"12%\" />\n-<col width=\"55%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>incoming_message</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>out_enc_policy</td>\n-<td>int</td>\n-<td>settings_pack::pe_enabled</td>\n+<tr><td>outgoing_message</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n-<tr><td>in_enc_policy</td>\n-<td>int</td>\n-<td>settings_pack::pe_enabled</td>\n+<tr><td>incoming</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>control the settings for incoming and outgoing connections\n-respectively. see <a class=\"reference external\" href=\"reference-Settings.html#enc_policy\">enc_policy</a> enum for the available options.\n-Keep in mind that protocol encryption degrades performance in\n-several respects:</p>\n-<ol class=\"arabic simple\">\n-<li>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.</li>\n-<li>The encryption itself requires more CPU than plain bittorrent\n-protocol. The highest cost is the Diffie Hellman exchange on\n-connection setup.</li>\n-<li>The encryption handshake adds several round-trips to the\n-connection setup, and delays transferring data.</li>\n-</ol>\n-<a name=\"allowed_enc_level\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"39%\" />\n-<col width=\"12%\" />\n-<col width=\"49%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>outgoing</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>allowed_enc_level</td>\n-<td>int</td>\n-<td>settings_pack::pe_both</td>\n+<tr><td>info</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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-<a class=\"reference external\" href=\"reference-Settings.html#enc_level\">enc_level</a> enum for options.</p>\n-<a name=\"inactive_down_rate\"></a>\n-<a name=\"inactive_up_rate\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"event_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_log_alert%3A%3A%5Bevent_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_log_alert%3A%3A%5Bevent_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>event_type</dt>\n+<dd>string literal indicating the kind of event. For messages, this is the\n+message name.</dd>\n+</dl>\n+<a name=\"lsd_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+lsd_error_alert&labels=documentation&body=Documentation+under+heading+%22class+lsd_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"lsd-error-alert\">\n+<h1>lsd_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted if the local service discovery socket fails to start properly.\n+it's categorized as <tt class=\"docutils literal\"><span class=\"pre\">alert_category::error</span></tt>.</p>\n+<pre class=\"literal-block\">\n+struct lsd_error_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ aux::noexcept_movable<address> local_address;\n+ error_code error;\n+};\n+</pre>\n+<a name=\"local_address\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Blocal_address%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Blocal_address%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_address</dt>\n+<dd>the local network the corresponding local service discovery is running\n+on</dd>\n+</dl>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:lsd_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22lsd_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>The error code</dd>\n+</dl>\n+<a name=\"dht_lookup\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_lookup&labels=documentation&body=Documentation+under+heading+%22class+dht_lookup%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-lookup\">\n+<h1>dht_lookup</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>holds statistics about a current <a class=\"reference external\" href=\"reference-Alerts.html#dht_lookup\">dht_lookup</a> 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</p>\n+<pre class=\"literal-block\">\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+</pre>\n+<a name=\"type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btype%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btype%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>type</dt>\n+<dd>string literal indicating which kind of lookup this is</dd>\n+</dl>\n+<a name=\"outstanding_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Boutstanding_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Boutstanding_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>outstanding_requests</dt>\n+<dd>the number of outstanding request to individual nodes\n+this lookup has right now</dd>\n+</dl>\n+<a name=\"timeouts\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btimeouts%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btimeouts%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>timeouts</dt>\n+<dd>the total number of requests that have timed out so far\n+for this lookup</dd>\n+</dl>\n+<a name=\"responses\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bresponses%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bresponses%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>responses</dt>\n+<dd>the total number of responses we have received for this\n+lookup so far for this lookup</dd>\n+</dl>\n+<a name=\"branch_factor\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bbranch_factor%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bbranch_factor%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>branch_factor</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"nodes_left\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bnodes_left%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bnodes_left%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nodes_left</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"last_sent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Blast_sent%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Blast_sent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_sent</dt>\n+<dd>the number of seconds ago the\n+last message was sent that's still\n+outstanding</dd>\n+</dl>\n+<a name=\"first_timeout\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Bfirst_timeout%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Bfirst_timeout%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>first_timeout</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"target\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_lookup%3A%3A%5Btarget%5D&labels=documentation&body=Documentation+under+heading+%22dht_lookup%3A%3A%5Btarget%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>target</dt>\n+<dd>the node-id or info-hash target for this lookup</dd>\n+</dl>\n+<a name=\"dht_stats_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_stats_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_stats_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-stats-alert\">\n+<h1>dht_stats_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>contains current DHT state. Posted in response to session::post_dht_stats().</p>\n+<pre class=\"literal-block\">\n+struct dht_stats_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = {};\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+</pre>\n+<a name=\"active_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bactive_requests%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bactive_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>active_requests</dt>\n+<dd>a vector of the currently running DHT lookups.</dd>\n+</dl>\n+<a name=\"routing_table\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Brouting_table%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Brouting_table%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>routing_table</dt>\n+<dd>contains information about every bucket in the DHT routing\n+table.</dd>\n+</dl>\n+<a name=\"nid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Bnid%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Bnid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nid</dt>\n+<dd>the node ID of the DHT node instance</dd>\n+</dl>\n+<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_stats_alert%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_stats_alert%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_endpoint</dt>\n+<dd>the local socket this DHT node is running on</dd>\n+</dl>\n+<a name=\"incoming_request_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+incoming_request_alert&labels=documentation&body=Documentation+under+heading+%22class+incoming_request_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"incoming-request-alert\">\n+<h1>incoming_request_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted every time an incoming request from a peer is accepted and queued\n+up for being serviced. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is only posted if\n+the alert_category::incoming_request flag is enabled in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+mask.</p>\n+<pre class=\"literal-block\">\n+struct incoming_request_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::incoming_request;\n+ peer_request req;\n+};\n+</pre>\n+<a name=\"req\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:incoming_request_alert%3A%3A%5Breq%5D&labels=documentation&body=Documentation+under+heading+%22incoming_request_alert%3A%3A%5Breq%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>req</dt>\n+<dd>the request this peer sent to us</dd>\n+</dl>\n+<a name=\"dht_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_log_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-log-alert\">\n+<h1>dht_log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>debug logging of the DHT when alert_category::dht_log is set in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+mask.</p>\n+<pre class=\"literal-block\">\n+struct dht_log_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ char const* <strong>log_message</strong> () 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 <strong>static_category</strong> = alert_category::dht_log;\n+ dht_module_t module;\n+};\n+</pre>\n+<a name=\"log_message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Blog_message%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Blog_message%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"log-message-4\">\n+<h2>log_message()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>log_message</strong> () const;\n+</pre>\n+<p>the log message</p>\n+<a name=\"dht_module_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+dht_module_t&labels=documentation&body=Documentation+under+heading+%22enum+dht_module_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-dht-module-t\">\n+<h2>enum dht_module_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n+<col width=\"43%\" />\n+<col width=\"20%\" />\n+<col width=\"37%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>inactive_down_rate</td>\n-<td>int</td>\n-<td>2048</td>\n-</tr>\n-<tr><td>inactive_up_rate</td>\n-<td>int</td>\n-<td>2048</td>\n+<tr><td>tracker</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>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 <tt class=\"docutils literal\">inactive_down_rate</tt> and whose upload rate is less than\n-<tt class=\"docutils literal\">inactive_up_rate</tt> for <tt class=\"docutils literal\">auto_manage_startup</tt> seconds, is\n-considered inactive, and another queued torrent may be started.\n-This logic is disabled if <tt class=\"docutils literal\">dont_count_slow_torrents</tt> is false.</p>\n-<a name=\"proxy_type\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"31%\" />\n-<col width=\"15%\" />\n-<col width=\"54%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>node</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>proxy_type</td>\n-<td>int</td>\n-<td>settings_pack::none</td>\n+<tr><td>routing_table</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>proxy to use. see <a class=\"reference external\" href=\"reference-Settings.html#proxy_type_t\">proxy_type_t</a>.</p>\n-<a name=\"proxy_port\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"44%\" />\n-<col width=\"22%\" />\n-<col width=\"33%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>rpc_manager</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>proxy_port</td>\n-<td>int</td>\n-<td>0</td>\n+<tr><td>traversal</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>the port of the proxy server</p>\n-<a name=\"i2p_port\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"module\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_log_alert%3A%3A%5Bmodule%5D&labels=documentation&body=Documentation+under+heading+%22dht_log_alert%3A%3A%5Bmodule%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>module</dt>\n+<dd>the module, or part, of the DHT that produced this log message.</dd>\n+</dl>\n+<a name=\"dht_pkt_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_pkt_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_pkt_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"dht-pkt-alert\">\n+<h1>dht_pkt_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted every time a DHT message is sent or received. It is\n+only posted if the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::dht_log</span></tt> <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> category is\n+enabled. It contains a verbatim copy of the message.</p>\n+<pre class=\"literal-block\">\n+struct dht_pkt_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ span<char const> <strong>pkt_buf</strong> () const;\n+\n+ enum direction_t\n+ {\n+ incoming,\n+ outgoing,\n+ };\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht_log;\n+ direction_t direction;\n+ aux::noexcept_movable<udp::endpoint> node;\n+};\n+</pre>\n+<a name=\"pkt_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bpkt_buf%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"pkt-buf\">\n+<h2>pkt_buf()</h2>\n+<pre class=\"literal-block\">\n+span<char const> <strong>pkt_buf</strong> () const;\n+</pre>\n+<p>returns a pointer to the packet buffer and size of the packet,\n+respectively. This buffer is only valid for as long as the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> itself\n+is valid, which is owned by libtorrent and reclaimed whenever\n+<a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">pop_alerts()</a> is called on the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.</p>\n+<a name=\"direction_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+direction_t&labels=documentation&body=Documentation+under+heading+%22enum+direction_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-direction-t-2\">\n+<h2>enum direction_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"40%\" />\n-<col width=\"24%\" />\n-<col width=\"36%\" />\n+<col width=\"33%\" />\n+<col width=\"23%\" />\n+<col width=\"43%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>i2p_port</td>\n-<td>int</td>\n+<tr><td>incoming</td>\n <td>0</td>\n+<td> </td>\n </tr>\n-</tbody>\n-</table>\n-<p>sets the <a class=\"reference external\" href=\"http://www.i2p2.de\">i2p</a> SAM bridge port to connect to. set the hostname with\n-the <tt class=\"docutils literal\">i2p_hostname</tt> setting.</p>\n-<a name=\"urlseed_max_request_bytes\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"53%\" />\n-<col width=\"12%\" />\n-<col width=\"35%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>urlseed_max_request_bytes</td>\n-<td>int</td>\n-<td>16 * 1024 * 1024</td>\n+<tr><td>outgoing</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>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.</p>\n-<a name=\"web_seed_name_lookup_retry\"></a><table border=\"1\" class=\"docutils\">\n+<a name=\"direction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bdirection%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bdirection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>direction</dt>\n+<dd>whether this is an incoming or outgoing packet.</dd>\n+</dl>\n+<a name=\"node\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_pkt_alert%3A%3A%5Bnode%5D&labels=documentation&body=Documentation+under+heading+%22dht_pkt_alert%3A%3A%5Bnode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>node</dt>\n+<dd>the DHT node we received this packet from, or sent this packet to\n+(depending on <tt class=\"docutils literal\">direction</tt>).</dd>\n+</dl>\n+<a name=\"dht_get_peers_reply_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_get_peers_reply_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_get_peers_reply_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"dht-get-peers-reply-alert\">\n+<h1>dht_get_peers_reply_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>Posted when we receive a response to a DHT get_peers request.</p>\n+<pre class=\"literal-block\">\n+struct dht_get_peers_reply_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ int <strong>num_peers</strong> () const;\n+ std::vector<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> <strong>peers</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht_operation;\n+ sha1_hash info_hash;\n+};\n+</pre>\n+<a name=\"dht_direct_response_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_direct_response_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_direct_response_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-direct-response-alert\">\n+<h1>dht_direct_response_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This is posted exactly once for every call to session_handle::dht_direct_request.\n+If the request failed, <a class=\"reference external\" href=\"reference-Alerts.html#response()\">response()</a> will return a default constructed <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.</p>\n+<pre class=\"literal-block\">\n+struct dht_direct_response_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ bdecode_node <strong>response</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ client_data_t userdata;\n+ aux::noexcept_movable<udp::endpoint> endpoint;\n+};\n+</pre>\n+<a name=\"picker_log_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+picker_log_alert&labels=documentation&body=Documentation+under+heading+%22class+picker_log_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"picker-log-alert\">\n+<h1>picker_log_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>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).</p>\n+<pre class=\"literal-block\">\n+struct picker_log_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ std::vector<piece_block> <strong>blocks</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::picker_log;\n+ static constexpr picker_flags_t <strong>partial_ratio</strong> = 0_bit;\n+ static constexpr picker_flags_t <strong>prioritize_partials</strong> = 1_bit;\n+ static constexpr picker_flags_t <strong>rarest_first_partials</strong> = 2_bit;\n+ static constexpr picker_flags_t <strong>rarest_first</strong> = 3_bit;\n+ static constexpr picker_flags_t <strong>reverse_rarest_first</strong> = 4_bit;\n+ static constexpr picker_flags_t <strong>suggested_pieces</strong> = 5_bit;\n+ static constexpr picker_flags_t <strong>prio_sequential_pieces</strong> = 6_bit;\n+ static constexpr picker_flags_t <strong>sequential_pieces</strong> = 7_bit;\n+ static constexpr picker_flags_t <strong>reverse_pieces</strong> = 8_bit;\n+ static constexpr picker_flags_t <strong>time_critical</strong> = 9_bit;\n+ static constexpr picker_flags_t <strong>random_pieces</strong> = 10_bit;\n+ static constexpr picker_flags_t <strong>prefer_contiguous</strong> = 11_bit;\n+ static constexpr picker_flags_t <strong>reverse_sequential</strong> = 12_bit;\n+ static constexpr picker_flags_t <strong>backup1</strong> = 13_bit;\n+ static constexpr picker_flags_t <strong>backup2</strong> = 14_bit;\n+ static constexpr picker_flags_t <strong>end_game</strong> = 15_bit;\n+ static constexpr picker_flags_t <strong>extent_affinity</strong> = 16_bit;\n+ picker_flags_t const picker_flags;\n+};\n+</pre>\n+<a name=\"picker_flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:picker_log_alert%3A%3A%5Bpicker_flags%5D&labels=documentation&body=Documentation+under+heading+%22picker_log_alert%3A%3A%5Bpicker_flags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>picker_flags</dt>\n+<dd>this is a bitmask of which features were enabled for this particular\n+pick. The bits are defined in the picker_flags_t enum.</dd>\n+</dl>\n+<a name=\"session_error_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_error_alert&labels=documentation&body=Documentation+under+heading+%22class+session_error_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"session-error-alert\">\n+<h1>session_error_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted when the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> encounters a serious error,\n+potentially fatal</p>\n+<pre class=\"literal-block\">\n+struct session_error_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ error_code const error;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:session_error_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22session_error_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>The error code, if one is associated with this error</dd>\n+</dl>\n+<a name=\"dht_live_nodes_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_live_nodes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_live_nodes_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-live-nodes-alert\">\n+<h1>dht_live_nodes_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>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.</p>\n+<pre class=\"literal-block\">\n+struct dht_live_nodes_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n+ int <strong>num_nodes</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::dht;\n+ sha1_hash node_id;\n+};\n+</pre>\n+<a name=\"num_nodes()\"></a>\n+<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnum_nodes%28%29+nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"num-nodes-nodes\">\n+<h2>num_nodes() nodes()</h2>\n+<pre class=\"literal-block\">\n+std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n+int <strong>num_nodes</strong> () const;\n+</pre>\n+<p>the number of nodes in the routing table and the actual nodes.</p>\n+<a name=\"node_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_live_nodes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_live_nodes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>node_id</dt>\n+<dd>the local DHT node's node-ID this routing table belongs to</dd>\n+</dl>\n+<a name=\"session_stats_header_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+session_stats_header_alert&labels=documentation&body=Documentation+under+heading+%22class+session_stats_header_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"session-stats-header-alert\">\n+<h1>session_stats_header_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>The session_stats_header <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted the first time\n+<a class=\"reference external\" href=\"reference-Session.html#post_session_stats()\">post_session_stats()</a> is called</p>\n+<p>the <tt class=\"docutils literal\">message()</tt> member function returns a string representation of the\n+header that properly match the stats values string returned in\n+<tt class=\"docutils literal\"><span class=\"pre\">session_stats_alert::message()</span></tt>.</p>\n+<p>this specific output is parsed by tools/parse_session_stats.py\n+if this is changed, that parser should also be changed</p>\n+<pre class=\"literal-block\">\n+struct session_stats_header_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = {};\n+};\n+</pre>\n+<a name=\"dht_sample_infohashes_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_sample_infohashes_alert&labels=documentation&body=Documentation+under+heading+%22class+dht_sample_infohashes_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-sample-infohashes-alert\">\n+<h1>dht_sample_infohashes_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted as a response to a call to session::dht_sample_infohashes() with\n+the information from the DHT response message.</p>\n+<pre class=\"literal-block\">\n+struct dht_sample_infohashes_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ int <strong>num_samples</strong> () const;\n+ std::vector<sha1_hash> <strong>samples</strong> () const;\n+ int <strong>num_nodes</strong> () const;\n+ std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = 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+</pre>\n+<a name=\"samples()\"></a>\n+<a name=\"num_samples()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bsamples%28%29+num_samples%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"samples-num-samples\">\n+<h2>samples() num_samples()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_samples</strong> () const;\n+std::vector<sha1_hash> <strong>samples</strong> () const;\n+</pre>\n+<p>returns the number of info-hashes returned by the node, as well as the\n+actual info-hashes. <tt class=\"docutils literal\">num_samples()</tt> is more efficient than\n+<tt class=\"docutils literal\"><span class=\"pre\">samples().size()</span></tt>.</p>\n+<a name=\"num_nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_nodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-nodes\">\n+<h2>num_nodes()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_nodes</strong> () const;\n+</pre>\n+<p>The total number of nodes returned by <tt class=\"docutils literal\">nodes()</tt>.</p>\n+<a name=\"nodes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnodes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"nodes-1\">\n+<h2>nodes()</h2>\n+<pre class=\"literal-block\">\n+std::vector<std::pair<sha1_hash, udp::endpoint>> <strong>nodes</strong> () const;\n+</pre>\n+<p>This is the set of more DHT nodes returned by the request.</p>\n+<p>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.</p>\n+<a name=\"node_id\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnode_id%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>node_id</dt>\n+<dd>id of the node the request was sent to (and this response was received from)</dd>\n+</dl>\n+<a name=\"endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bendpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endpoint</dt>\n+<dd>the node the request was sent to (and this response was received from)</dd>\n+</dl>\n+<a name=\"interval\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Binterval%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Binterval%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>interval</dt>\n+<dd>the interval to wait before making another request to this node</dd>\n+</dl>\n+<a name=\"num_infohashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D&labels=documentation&body=Documentation+under+heading+%22dht_sample_infohashes_alert%3A%3A%5Bnum_infohashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_infohashes</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"block_uploaded_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+block_uploaded_alert&labels=documentation&body=Documentation+under+heading+%22class+block_uploaded_alert%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"block-uploaded-alert\">\n+<h1>block_uploaded_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> may be posted without the bytes having been sent to the peer.\n+It belongs to the <tt class=\"docutils literal\"><span class=\"pre\">alert_category::upload</span></tt> category.</p>\n+<pre class=\"literal-block\">\n+struct block_uploaded_alert final : peer_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ int const block_index;\n+ piece_index_t const piece_index;\n+};\n+</pre>\n+<a name=\"alerts_dropped_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alerts_dropped_alert&labels=documentation&body=Documentation+under+heading+%22class+alerts_dropped_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"alerts-dropped-alert\">\n+<h1>alerts_dropped_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted to indicate to the client that some alerts were\n+dropped. Dropped meaning that the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> failed to be delivered to the\n+client. The most common cause of such failure is that the internal <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+queue grew too big (controlled by alert_queue_size).</p>\n+<pre class=\"literal-block\">\n+struct alerts_dropped_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+ <strong>static_assert</strong> (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ std::bitset<abi_alert_count> dropped_alerts;\n+};\n+</pre>\n+<a name=\"dropped_alerts\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D&labels=documentation&body=Documentation+under+heading+%22alerts_dropped_alert%3A%3A%5Bdropped_alerts%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dropped_alerts</dt>\n+<dd>a bitmask indicating which alerts were dropped. Each bit represents the\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type ID, where bit 0 represents whether any <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> of type 0 has\n+been dropped, and so on.</dd>\n+</dl>\n+<a name=\"socks5_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+socks5_alert&labels=documentation&body=Documentation+under+heading+%22class+socks5_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"socks5-alert\">\n+<h1>socks5_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n+configured. It's enabled with the alert_category::error <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> category.</p>\n+<pre class=\"literal-block\">\n+struct socks5_alert final : alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ error_code error;\n+ operation_t op;\n+ aux::noexcept_movable<<a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a>> ip;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the operation that failed</dd>\n+</dl>\n+<a name=\"ip\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks5_alert%3A%3A%5Bip%5D&labels=documentation&body=Documentation+under+heading+%22socks5_alert%3A%3A%5Bip%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ip</dt>\n+<dd>the endpoint configured as the proxy</dd>\n+</dl>\n+<a name=\"file_prio_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_prio_alert&labels=documentation&body=Documentation+under+heading+%22class+file_prio_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-prio-alert\">\n+<h1>file_prio_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#prioritize_files()\">prioritize_files()</a> or <a class=\"reference external\" href=\"reference-Torrent_Handle.html#file_priority()\">file_priority()</a> update of the file\n+priorities complete, which requires a round-trip to the disk thread.</p>\n+<p>If the disk operation fails this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> won't be posted, but a\n+<a class=\"reference external\" href=\"reference-Alerts.html#file_error_alert\">file_error_alert</a> is posted instead, and the torrent is stopped.</p>\n+<pre class=\"literal-block\">\n+struct file_prio_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+ error_code error;\n+ operation_t op;\n+};\n+</pre>\n+<a name=\"error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Berror%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Berror%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd>the error</dd>\n+</dl>\n+<a name=\"op\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_prio_alert%3A%3A%5Bop%5D&labels=documentation&body=Documentation+under+heading+%22file_prio_alert%3A%3A%5Bop%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>op</dt>\n+<dd>the operation that failed</dd>\n+</dl>\n+<a name=\"oversized_file_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+oversized_file_alert&labels=documentation&body=Documentation+under+heading+%22class+oversized_file_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"oversized-file-alert\">\n+<h1>oversized_file_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted.\n+the client may want to call <a class=\"reference external\" href=\"reference-Core.html#truncate_files()\">truncate_files()</a> 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.</p>\n+<pre class=\"literal-block\">\n+struct oversized_file_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::storage;\n+};\n+</pre>\n+<a name=\"torrent_conflict_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_conflict_alert&labels=documentation&body=Documentation+under+heading+%22class+torrent_conflict_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-conflict-alert\">\n+<h1>torrent_conflict_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <tt class=\"docutils literal\">duplicate_torrent</tt>\n+as the error code. This <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> is posted containing the metadata. For more\n+information, see <a class=\"reference external\" href=\"manual-ref.html#bittorrent-v2-torrents\">BitTorrent v2 torrents</a>.\n+The torrent this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> originated from was the one that downloaded the</p>\n+<p>metadata (i.e. the <cite>handle</cite> member from the <a class=\"reference external\" href=\"reference-Alerts.html#torrent_alert\">torrent_alert</a> base class).</p>\n+<pre class=\"literal-block\">\n+struct torrent_conflict_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::error;\n+ torrent_handle conflicting_torrent;\n+ std::shared_ptr<torrent_info> metadata;\n+};\n+</pre>\n+<a name=\"conflicting_torrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bconflicting_torrent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>conflicting_torrent</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_conflict_alert%3A%3A%5Bmetadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_conflict_alert%3A%3A%5Bmetadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>metadata</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"peer_info_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_info_alert&labels=documentation&body=Documentation+under+heading+%22class+peer_info_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-info-alert\">\n+<h1>peer_info_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_peer_info()\">torrent_handle::post_peer_info()</a> is called</p>\n+<pre class=\"literal-block\">\n+struct peer_info_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ std::vector<lt::peer_info> peer_info;\n+};\n+</pre>\n+<a name=\"peer_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info_alert%3A%3A%5Bpeer_info%5D&labels=documentation&body=Documentation+under+heading+%22peer_info_alert%3A%3A%5Bpeer_info%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>peer_info</dt>\n+<dd>the list of the currently connected peers</dd>\n+</dl>\n+<a name=\"file_progress_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+file_progress_alert&labels=documentation&body=Documentation+under+heading+%22class+file_progress_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"file-progress-alert\">\n+<h1>file_progress_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_file_progress()\">torrent_handle::post_file_progress()</a> is called</p>\n+<pre class=\"literal-block\">\n+struct file_progress_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::file_progress;\n+ aux::vector<std::int64_t, file_index_t> files;\n+};\n+</pre>\n+<a name=\"files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:file_progress_alert%3A%3A%5Bfiles%5D&labels=documentation&body=Documentation+under+heading+%22file_progress_alert%3A%3A%5Bfiles%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>files</dt>\n+<dd>the list of the files in the torrent</dd>\n+</dl>\n+<a name=\"piece_info_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_info_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_info_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-info-alert\">\n+<h1>piece_info_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_download_queue()\">torrent_handle::post_download_queue()</a> is called</p>\n+<pre class=\"literal-block\">\n+struct piece_info_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::piece_progress;\n+ std::vector<partial_piece_info> piece_info;\n+ std::vector<block_info> block_data;\n+};\n+</pre>\n+<a name=\"piece_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_info_alert%3A%3A%5Bpiece_info%5D&labels=documentation&body=Documentation+under+heading+%22piece_info_alert%3A%3A%5Bpiece_info%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_info</dt>\n+<dd>info about pieces being downloaded for the torrent</dd>\n+</dl>\n+<a name=\"block_data\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_info_alert%3A%3A%5Bblock_data%5D&labels=documentation&body=Documentation+under+heading+%22piece_info_alert%3A%3A%5Bblock_data%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>block_data</dt>\n+<dd>storage for <a class=\"reference external\" href=\"reference-Torrent_Handle.html#block_info\">block_info</a> pointers in <a class=\"reference external\" href=\"reference-Torrent_Handle.html#partial_piece_info\">partial_piece_info</a> objects</dd>\n+</dl>\n+<a name=\"piece_availability_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_availability_alert&labels=documentation&body=Documentation+under+heading+%22class+piece_availability_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"piece-availability-alert\">\n+<h1>piece_availability_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_piece_availability()\">torrent_handle::post_piece_availability()</a> is called</p>\n+<pre class=\"literal-block\">\n+struct piece_availability_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ std::vector<int> piece_availability;\n+};\n+</pre>\n+<a name=\"piece_availability\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:piece_availability_alert%3A%3A%5Bpiece_availability%5D&labels=documentation&body=Documentation+under+heading+%22piece_availability_alert%3A%3A%5Bpiece_availability%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece_availability</dt>\n+<dd>info about pieces being downloaded for the torrent</dd>\n+</dl>\n+<a name=\"tracker_list_alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+tracker_list_alert&labels=documentation&body=Documentation+under+heading+%22class+tracker_list_alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"tracker-list-alert\">\n+<h1>tracker_list_alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<p>posted when <a class=\"reference external\" href=\"reference-Torrent_Handle.html#post_trackers()\">torrent_handle::post_trackers()</a> is called</p>\n+<pre class=\"literal-block\">\n+struct tracker_list_alert final : torrent_alert\n+{\n+ std::string <strong>message</strong> () const override;\n+\n+ static constexpr alert_category_t <strong>static_category</strong> = alert_category::status;\n+ std::vector<announce_entry> trackers;\n+};\n+</pre>\n+<a name=\"trackers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:tracker_list_alert%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22tracker_list_alert%3A%3A%5Btrackers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>trackers</dt>\n+<dd>list of trackers and their status for the torrent</dd>\n+</dl>\n+<a name=\"alert\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+alert&labels=documentation&body=Documentation+under+heading+%22class+alert%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"alert\">\n+<h1>alert</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">alert</tt> class is the base class that specific messages are derived from.\n+<a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Session.html#pop_alerts()\">session_handle::pop_alerts()</a>)</p>\n+<pre class=\"literal-block\">\n+struct alert\n+{\n+ time_point <strong>timestamp</strong> () const;\n+ virtual int <strong>type</strong> () const noexcept = 0;\n+ virtual char const* <strong>what</strong> () const noexcept = 0;\n+ virtual std::string <strong>message</strong> () const = 0;\n+ virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n+\n+ static constexpr alert_category_t <strong>error_notification</strong> = 0_bit;\n+ static constexpr alert_category_t <strong>peer_notification</strong> = 1_bit;\n+ static constexpr alert_category_t <strong>port_mapping_notification</strong> = 2_bit;\n+ static constexpr alert_category_t <strong>storage_notification</strong> = 3_bit;\n+ static constexpr alert_category_t <strong>tracker_notification</strong> = 4_bit;\n+ static constexpr alert_category_t <strong>connect_notification</strong> = 5_bit;\n+ static constexpr alert_category_t <strong>status_notification</strong> = 6_bit;\n+ static constexpr alert_category_t <strong>ip_block_notification</strong> = 8_bit;\n+ static constexpr alert_category_t <strong>performance_warning</strong> = 9_bit;\n+ static constexpr alert_category_t <strong>dht_notification</strong> = 10_bit;\n+ static constexpr alert_category_t <strong>session_log_notification</strong> = 13_bit;\n+ static constexpr alert_category_t <strong>torrent_log_notification</strong> = 14_bit;\n+ static constexpr alert_category_t <strong>peer_log_notification</strong> = 15_bit;\n+ static constexpr alert_category_t <strong>incoming_request_notification</strong> = 16_bit;\n+ static constexpr alert_category_t <strong>dht_log_notification</strong> = 17_bit;\n+ static constexpr alert_category_t <strong>dht_operation_notification</strong> = 18_bit;\n+ static constexpr alert_category_t <strong>port_mapping_log_notification</strong> = 19_bit;\n+ static constexpr alert_category_t <strong>picker_log_notification</strong> = 20_bit;\n+ static constexpr alert_category_t <strong>file_progress_notification</strong> = 21_bit;\n+ static constexpr alert_category_t <strong>piece_progress_notification</strong> = 22_bit;\n+ static constexpr alert_category_t <strong>upload_notification</strong> = 23_bit;\n+ static constexpr alert_category_t <strong>block_progress_notification</strong> = 24_bit;\n+ static constexpr alert_category_t <strong>all_categories</strong> = alert_category_t::all();\n+};\n+</pre>\n+<a name=\"timestamp()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btimestamp%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btimestamp%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"timestamp\">\n+<h2>timestamp()</h2>\n+<pre class=\"literal-block\">\n+time_point <strong>timestamp</strong> () const;\n+</pre>\n+<p>a timestamp is automatically created in the constructor</p>\n+<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"type-1\">\n+<h2>type()</h2>\n+<pre class=\"literal-block\">\n+virtual int <strong>type</strong> () const noexcept = 0;\n+</pre>\n+<p>returns an integer that is unique to this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type. It can be\n+compared against a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> by querying a static constant called <tt class=\"docutils literal\">alert_type</tt>\n+in the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It can be used to determine the run-time type of an alert* in\n+order to cast to that <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type and access specific members.</p>\n+<p>e.g:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"name\">alert</span><span class=\"operator\">*></span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"name\">ses</span><span class=\"punctuation\">.</span><span class=\"name\">pop_alerts</span><span class=\"punctuation\">(</span><span class=\"operator\">&</span><span class=\"name\">alerts</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">for</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">alert</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">a</span><span class=\"whitespace\"> </span><span class=\"operator\">:</span><span class=\"whitespace\"> </span><span class=\"name\">alerts</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">switch</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"operator\">-></span><span class=\"name\">type</span><span class=\"punctuation\">())</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+\n+ </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">read_piece_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">auto</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"keyword\">static_cast</span><span class=\"operator\"><</span><span class=\"name\">read_piece_alert</span><span class=\"operator\">*></span><span class=\"punctuation\">(</span><span class=\"name\">a</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">p</span><span class=\"operator\">-></span><span class=\"name\">ec</span><span class=\"punctuation\">)</span><span class=\"whitespace\"> </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// read_piece failed\n+</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// use p\n+</span><span class=\"whitespace\"> </span><span class=\"keyword\">break</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"keyword\">case</span><span class=\"whitespace\"> </span><span class=\"name constant\">file_renamed_alert</span><span class=\"operator\">::</span><span class=\"name constant\">alert_type</span><span class=\"punctuation\">:</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"comment single\">// etc...\n+</span><span class=\"whitespace\"> </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+ </span><span class=\"punctuation\">}</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<a name=\"what()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bwhat%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bwhat%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"what\">\n+<h2>what()</h2>\n+<pre class=\"literal-block\">\n+virtual char const* <strong>what</strong> () const noexcept = 0;\n+</pre>\n+<p>returns a string literal describing the type of the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>. It does\n+not include any information that might be bundled with the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</p>\n+<a name=\"message()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bmessage%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bmessage%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"message-1\">\n+<h2>message()</h2>\n+<pre class=\"literal-block\">\n+virtual std::string <strong>message</strong> () const = 0;\n+</pre>\n+<p>generate a string describing the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> 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 <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>\n+type individually and extract and render the information from the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> depending\n+on the locale.</p>\n+<a name=\"category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert%3A%3A%5Bcategory%28%29%5D&labels=documentation&body=Documentation+under+heading+%22alert%3A%3A%5Bcategory%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"category\">\n+<h2>category()</h2>\n+<pre class=\"literal-block\">\n+virtual alert_category_t <strong>category</strong> () const noexcept = 0;\n+</pre>\n+<p>returns a bitmask specifying which categories this <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> belong to.</p>\n+<a name=\"alert_cast()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_cast%28%29&labels=documentation&body=Documentation+under+heading+%22alert_cast%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"alert-cast\">\n+<h1>alert_cast()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+template <typename T> T* <strong>alert_cast</strong> (alert* a);\n+template <typename T> T const* <strong>alert_cast</strong> (alert const* a);\n+</pre>\n+<p>When you get an <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>, you can use <tt class=\"docutils literal\">alert_cast<></tt> to attempt to cast the\n+pointer to a specific <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, in order to query it for more\n+information.</p>\n+<div class=\"admonition note\">\n+<p class=\"first admonition-title\">Note</p>\n+<p class=\"last\"><tt class=\"docutils literal\">alert_cast<></tt> can only cast to an exact <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> type, not a base class</p>\n+</div>\n+<a name=\"operation_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:operation_name%28%29&labels=documentation&body=Documentation+under+heading+%22operation_name%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operation-name\">\n+<h1>operation_name()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/operations.hpp\">libtorrent/operations.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+char const* <strong>operation_name</strong> (operation_t op);\n+</pre>\n+<p>maps an operation id (from <a class=\"reference external\" href=\"reference-Alerts.html#peer_error_alert\">peer_error_alert</a> and <a class=\"reference external\" href=\"reference-Alerts.html#peer_disconnected_alert\">peer_disconnected_alert</a>)\n+to its name. See <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> for the constants</p>\n+<a name=\"operation_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+operation_t&labels=documentation&body=Documentation+under+heading+%22enum+operation_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-operation-t\">\n+<h1>enum operation_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/operations.hpp\">libtorrent/operations.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"65%\" />\n-<col width=\"14%\" />\n <col width=\"21%\" />\n+<col width=\"7%\" />\n+<col width=\"72%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>web_seed_name_lookup_retry</td>\n-<td>int</td>\n-<td>1800</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>time to wait until a new retry of a web seed name lookup</p>\n-<a name=\"close_file_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"44%\" />\n-<col width=\"13%\" />\n-<col width=\"44%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>close_file_interval</td>\n-<td>int</td>\n-<td>CLOSE_FILE_INTERVAL</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"utp_cwnd_reduce_timer\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>unknown</td>\n+<td>0</td>\n+<td>the error was unexpected and it is unknown which operation caused it</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>utp_cwnd_reduce_timer</td>\n-<td>int</td>\n-<td>100</td>\n+<tr><td>bittorrent</td>\n+<td>1</td>\n+<td>this is used when the bittorrent logic\n+determines to disconnect</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"max_web_seed_connections\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"63%\" />\n-<col width=\"15%\" />\n-<col width=\"22%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>iocontrol</td>\n+<td>2</td>\n+<td>a call to iocontrol failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_web_seed_connections</td>\n-<td>int</td>\n+<tr><td>getpeername</td>\n <td>3</td>\n+<td>a call to <tt class=\"docutils literal\">getpeername()</tt> failed (querying the remote IP of a\n+connection)</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the max number of web seeds to have connected per torrent at any\n-given time.</p>\n-<a name=\"resolver_cache_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"62%\" />\n-<col width=\"15%\" />\n-<col width=\"23%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>resolver_cache_timeout</td>\n-<td>int</td>\n-<td>1200</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>the number of seconds before the internal host name resolver\n-considers a cache value timed out, negative values are interpreted\n-as zero.</p>\n-<a name=\"send_not_sent_low_watermark\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"66%\" />\n-<col width=\"14%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>send_not_sent_low_watermark</td>\n-<td>int</td>\n-<td>16384</td>\n-</tr>\n-</tbody>\n-</table>\n-<p>specify the not-sent low watermark for socket send buffers. This\n-corresponds to the, Linux-specific, <tt class=\"docutils literal\">TCP_NOTSENT_LOWAT</tt> TCP socket\n-option.</p>\n-<a name=\"rate_choker_initial_threshold\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>rate_choker_initial_threshold</td>\n-<td>int</td>\n-<td>1024</td>\n+<tr><td>getname</td>\n+<td>4</td>\n+<td>a call to getname failed (querying the local IP of a\n+connection)</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"upnp_lease_duration\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>alloc_recvbuf</td>\n+<td>5</td>\n+<td>an attempt to allocate a receive buffer failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>upnp_lease_duration</td>\n-<td>int</td>\n-<td>3600</td>\n+<tr><td>alloc_sndbuf</td>\n+<td>6</td>\n+<td>an attempt to allocate a send buffer failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"max_concurrent_http_announces\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file_write</td>\n+<td>7</td>\n+<td>writing to a file failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_concurrent_http_announces</td>\n-<td>int</td>\n-<td>50</td>\n+<tr><td>file_read</td>\n+<td>8</td>\n+<td>reading from a file failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"dht_max_peers_reply\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file</td>\n+<td>9</td>\n+<td>a non-read and non-write file operation failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_peers_reply</td>\n-<td>int</td>\n-<td>100</td>\n+<tr><td>sock_write</td>\n+<td>10</td>\n+<td>a socket write operation failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the maximum number of peers to send in a reply to <tt class=\"docutils literal\">get_peers</tt></p>\n-<a name=\"dht_search_branching\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>sock_read</td>\n+<td>11</td>\n+<td>a socket read operation failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_search_branching</td>\n-<td>int</td>\n-<td>5</td>\n+<tr><td>sock_open</td>\n+<td>12</td>\n+<td>a call to open(), to create a socket socket failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"dht_max_fail_count\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"57%\" />\n-<col width=\"17%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>sock_bind</td>\n+<td>13</td>\n+<td>a call to bind() on a socket failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_fail_count</td>\n-<td>int</td>\n-<td>20</td>\n+<tr><td>available</td>\n+<td>14</td>\n+<td>an attempt to query the number of bytes available to read from a socket\n+failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"dht_max_torrents\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"55%\" />\n-<col width=\"18%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>encryption</td>\n+<td>15</td>\n+<td>a call related to bittorrent protocol encryption failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_torrents</td>\n-<td>int</td>\n-<td>2000</td>\n+<tr><td>connect</td>\n+<td>16</td>\n+<td>an attempt to connect a socket failed</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"dht_max_dht_items\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>ssl_handshake</td>\n+<td>17</td>\n+<td>establishing an SSL connection failed</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_dht_items</td>\n-<td>int</td>\n-<td>700</td>\n+<tr><td>get_interface</td>\n+<td>18</td>\n+<td>a connection failed to satisfy the bind interface setting</td>\n </tr>\n-</tbody>\n-</table>\n-<p>max number of items the DHT will store</p>\n-<a name=\"dht_max_peers\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>sock_listen</td>\n+<td>19</td>\n+<td>a call to listen() on a socket</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_peers</td>\n-<td>int</td>\n-<td>500</td>\n+<tr><td>sock_bind_to_device</td>\n+<td>20</td>\n+<td>a call to the ioctl to bind a socket to a specific network device or\n+adapter</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the max number of peers to store per torrent (for the DHT)</p>\n-<a name=\"dht_max_torrent_search_reply\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"67%\" />\n-<col width=\"13%\" />\n-<col width=\"20%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>sock_accept</td>\n+<td>21</td>\n+<td>a call to accept() on a socket</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_torrent_search_reply</td>\n-<td>int</td>\n-<td>20</td>\n+<tr><td>parse_address</td>\n+<td>22</td>\n+<td>convert a string into a valid network address</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the max number of torrents to return in a torrent search query to the\n-DHT</p>\n-<a name=\"dht_block_timeout\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>enum_if</td>\n+<td>23</td>\n+<td>enumeration network devices or adapters</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_block_timeout</td>\n-<td>int</td>\n-<td>5 * 60</td>\n+<tr><td>file_stat</td>\n+<td>24</td>\n+<td>invoking stat() on a file</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"dht_block_ratelimit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"58%\" />\n-<col width=\"17%\" />\n-<col width=\"25%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file_copy</td>\n+<td>25</td>\n+<td>copying a file</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_block_ratelimit</td>\n-<td>int</td>\n-<td>5</td>\n+<tr><td>file_fallocate</td>\n+<td>26</td>\n+<td>allocating storage for a file</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the max number of packets per second a DHT node is allowed to send\n-without getting banned.</p>\n-<a name=\"dht_item_lifetime\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"56%\" />\n-<col width=\"18%\" />\n-<col width=\"26%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file_hard_link</td>\n+<td>27</td>\n+<td>creating a hard link</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_item_lifetime</td>\n-<td>int</td>\n-<td>0</td>\n+<tr><td>file_remove</td>\n+<td>28</td>\n+<td>removing a file</td>\n </tr>\n-</tbody>\n-</table>\n-<p>the number of seconds a immutable/mutable item will be expired.\n-default is 0, means never expires.</p>\n-<a name=\"dht_sample_infohashes_interval\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"68%\" />\n-<col width=\"13%\" />\n-<col width=\"19%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file_rename</td>\n+<td>29</td>\n+<td>renaming a file</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_sample_infohashes_interval</td>\n-<td>int</td>\n-<td>21600</td>\n+<tr><td>file_open</td>\n+<td>30</td>\n+<td>opening a file</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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).</p>\n-<a name=\"dht_max_infohashes_sample_count\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"69%\" />\n-<col width=\"13%\" />\n-<col width=\"19%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>mkdir</td>\n+<td>31</td>\n+<td>creating a directory</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>dht_max_infohashes_sample_count</td>\n-<td>int</td>\n-<td>20</td>\n+<tr><td>check_resume</td>\n+<td>32</td>\n+<td>check fast resume data against files on disk</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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</p>\n-<a name=\"max_piece_count\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"52%\" />\n-<col width=\"18%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>exception</td>\n+<td>33</td>\n+<td>an unknown exception</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>max_piece_count</td>\n-<td>int</td>\n-<td>0x200000</td>\n+<tr><td>alloc_cache_piece</td>\n+<td>34</td>\n+<td>allocate space for a piece in the cache</td>\n </tr>\n-</tbody>\n-</table>\n-<p><tt class=\"docutils literal\">max_piece_count</tt> 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 <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> and\n-<a class=\"reference external\" href=\"reference-Torrent_Info.html#parse_info_section()\">torrent_info::parse_info_section()</a>, if those are used.</p>\n-<a name=\"metadata_token_limit\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>partfile_move</td>\n+<td>35</td>\n+<td>move a part-file</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>metadata_token_limit</td>\n-<td>int</td>\n-<td>2500000</td>\n+<tr><td>partfile_read</td>\n+<td>36</td>\n+<td>read from a part file</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"disk_write_mode\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"23%\" />\n-<col width=\"8%\" />\n-<col width=\"69%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>partfile_write</td>\n+<td>37</td>\n+<td>write to a part-file</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>disk_write_mode</td>\n-<td>int</td>\n-<td>settings_pack::mmap_write_mode_t::auto_mmap_write</td>\n+<tr><td>hostname_lookup</td>\n+<td>38</td>\n+<td>a hostname lookup</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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 <a class=\"reference external\" href=\"reference-Settings.html#mmap_write_mode_t\">mmap_write_mode_t</a>.</p>\n-<a name=\"mmap_file_size_cutoff\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>symlink</td>\n+<td>39</td>\n+<td>create or read a symlink</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>mmap_file_size_cutoff</td>\n-<td>int</td>\n+<tr><td>handshake</td>\n <td>40</td>\n+<td>handshake with a peer or server</td>\n </tr>\n-</tbody>\n-</table>\n-<p>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.</p>\n-<a name=\"i2p_inbound_quantity\"></a>\n-<a name=\"i2p_outbound_quantity\"></a>\n-<a name=\"i2p_inbound_length\"></a>\n-<a name=\"i2p_outbound_length\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"61%\" />\n-<col width=\"16%\" />\n-<col width=\"24%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>i2p_inbound_quantity</td>\n-<td>int</td>\n-<td>3</td>\n+<tr><td>sock_option</td>\n+<td>41</td>\n+<td>set socket option</td>\n </tr>\n-<tr><td>i2p_outbound_quantity</td>\n-<td>int</td>\n-<td>3</td>\n+<tr><td>enum_route</td>\n+<td>42</td>\n+<td>enumeration of network routes</td>\n </tr>\n-<tr><td>i2p_inbound_length</td>\n-<td>int</td>\n-<td>3</td>\n+<tr><td>file_seek</td>\n+<td>43</td>\n+<td>moving read/write position in a file, <a class=\"reference external\" href=\"reference-Alerts.html#hostname_lookup\">operation_t::hostname_lookup</a></td>\n </tr>\n-<tr><td>i2p_outbound_length</td>\n-<td>int</td>\n-<td>3</td>\n+<tr><td>timer</td>\n+<td>44</td>\n+<td>an async wait operation on a timer</td>\n </tr>\n-</tbody>\n-</table>\n-<p>Configures the SAM <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>\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).</p>\n-<a name=\"announce_port\"></a><table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"50%\" />\n-<col width=\"20%\" />\n-<col width=\"30%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">type</th>\n-<th class=\"head\">default</th>\n+<tr><td>file_mmap</td>\n+<td>45</td>\n+<td>call to mmap() (or windows counterpart)</td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>announce_port</td>\n-<td>int</td>\n-<td>0</td>\n+<tr><td>file_truncate</td>\n+<td>46</td>\n+<td>call to ftruncate() (or SetEndOfFile() on windows)</td>\n </tr>\n </tbody>\n </table>\n-<p><tt class=\"docutils literal\">announce_port</tt> is the port passed along as the <tt class=\"docutils literal\">port</tt> parameter\n-to remote trackers such as HTTP or DHT. This setting does not affect\n-the effective listening port nor local service discovery announcements.\n-If left as zero (default), the listening port value is used.</p>\n+<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"int\">\n+<h1>int</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert_types.hpp\">libtorrent/alert_types.hpp</a>"</p>\n+<a name=\"int::user_alert_id\"></a><dl class=\"docutils\">\n+<dt>user_alert_id</dt>\n+<dd>user defined alerts should use IDs greater than this</dd>\n+</dl>\n+<a name=\"int::num_alert_types\"></a><dl class=\"docutils\">\n+<dt>num_alert_types</dt>\n+<dd>this constant represents "max_alert_index" + 1</dd>\n+</dl>\n+<a name=\"alert_category_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:alert_category_t&labels=documentation&body=Documentation+under+heading+%22alert_category_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"alert-category-t\">\n+<h1>alert_category_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/alert.hpp\">libtorrent/alert.hpp</a>"</p>\n+<a name=\"alert_category_t::error\"></a><dl class=\"docutils\">\n+<dt>error</dt>\n+<dd><p class=\"first\">Enables alerts that report an error. This includes:</p>\n+<ul class=\"last simple\">\n+<li>tracker errors</li>\n+<li>tracker warnings</li>\n+<li>file errors</li>\n+<li>resume data failures</li>\n+<li>web seed errors</li>\n+<li>.torrent files errors</li>\n+<li>listen socket errors</li>\n+<li>port mapping errors</li>\n+</ul>\n+</dd>\n+</dl>\n+<a name=\"alert_category_t::peer\"></a><dl class=\"docutils\">\n+<dt>peer</dt>\n+<dd>Enables alerts when peers send invalid requests, get banned or\n+snubbed.</dd>\n+</dl>\n+<a name=\"alert_category_t::port_mapping\"></a><dl class=\"docutils\">\n+<dt>port_mapping</dt>\n+<dd>Enables alerts for port mapping events. For NAT-PMP and UPnP.</dd>\n+</dl>\n+<a name=\"alert_category_t::storage\"></a><dl class=\"docutils\">\n+<dt>storage</dt>\n+<dd>Enables alerts for events related to the storage. File errors and\n+synchronization events for moving the storage, renaming files etc.</dd>\n+</dl>\n+<a name=\"alert_category_t::tracker\"></a><dl class=\"docutils\">\n+<dt>tracker</dt>\n+<dd>Enables all tracker events. Includes announcing to trackers,\n+receiving responses, warnings and errors.</dd>\n+</dl>\n+<a name=\"alert_category_t::connect\"></a><dl class=\"docutils\">\n+<dt>connect</dt>\n+<dd>Low level alerts for when peers are connected and disconnected.</dd>\n+</dl>\n+<a name=\"alert_category_t::status\"></a><dl class=\"docutils\">\n+<dt>status</dt>\n+<dd>Enables alerts for when a torrent or the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> changes state.</dd>\n+</dl>\n+<a name=\"alert_category_t::ip_block\"></a><dl class=\"docutils\">\n+<dt>ip_block</dt>\n+<dd>Alerts when a peer is blocked by the ip blocker or port blocker.</dd>\n+</dl>\n+<a name=\"alert_category_t::performance_warning\"></a><dl class=\"docutils\">\n+<dt>performance_warning</dt>\n+<dd>Alerts when some limit is reached that might limit the download\n+or upload rate.</dd>\n+</dl>\n+<a name=\"alert_category_t::dht\"></a><dl class=\"docutils\">\n+<dt>dht</dt>\n+<dd>Alerts on events in the DHT node. For incoming searches or\n+bootstrapping being done etc.</dd>\n+</dl>\n+<a name=\"alert_category_t::stats\"></a><dl class=\"docutils\">\n+<dt>stats</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the interval since\n+the lasts stats <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a>.</dd>\n+</dl>\n+<a name=\"alert_category_t::session_log\"></a><dl class=\"docutils\">\n+<dt>session_log</dt>\n+<dd>Enables debug logging alerts. These are available unless libtorrent\n+was built with logging disabled (<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The\n+alerts being posted are <a class=\"reference external\" href=\"reference-Alerts.html#log_alert\">log_alert</a> and are <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> wide.</dd>\n+</dl>\n+<a name=\"alert_category_t::torrent_log\"></a><dl class=\"docutils\">\n+<dt>torrent_log</dt>\n+<dd>Enables debug logging alerts for torrents. These are available\n+unless libtorrent was built with logging disabled\n+(<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The alerts being posted are\n+<a class=\"reference external\" href=\"reference-Alerts.html#torrent_log_alert\">torrent_log_alert</a> and are torrent wide debug events.</dd>\n+</dl>\n+<a name=\"alert_category_t::peer_log\"></a><dl class=\"docutils\">\n+<dt>peer_log</dt>\n+<dd>Enables debug logging alerts for peers. These are available unless\n+libtorrent was built with logging disabled\n+(<tt class=\"docutils literal\">TORRENT_DISABLE_LOGGING</tt>). The alerts being posted are\n+<a class=\"reference external\" href=\"reference-Alerts.html#peer_log_alert\">peer_log_alert</a> and low-level peer events and messages.</dd>\n+</dl>\n+<a name=\"alert_category_t::incoming_request\"></a><dl class=\"docutils\">\n+<dt>incoming_request</dt>\n+<dd>enables the <a class=\"reference external\" href=\"reference-Alerts.html#incoming_request_alert\">incoming_request_alert</a>.</dd>\n+</dl>\n+<a name=\"alert_category_t::dht_log\"></a><dl class=\"docutils\">\n+<dt>dht_log</dt>\n+<dd>enables <a class=\"reference external\" href=\"reference-Alerts.html#dht_log_alert\">dht_log_alert</a>, debug logging for the DHT</dd>\n+</dl>\n+<a name=\"alert_category_t::dht_operation\"></a><dl class=\"docutils\">\n+<dt>dht_operation</dt>\n+<dd>enable events from pure dht operations not related to torrents</dd>\n+</dl>\n+<a name=\"alert_category_t::port_mapping_log\"></a><dl class=\"docutils\">\n+<dt>port_mapping_log</dt>\n+<dd>enables port mapping log events. This log is useful\n+for debugging the UPnP or NAT-PMP implementation</dd>\n+</dl>\n+<a name=\"alert_category_t::picker_log\"></a><dl class=\"docutils\">\n+<dt>picker_log</dt>\n+<dd>enables verbose logging from the piece picker.</dd>\n+</dl>\n+<a name=\"alert_category_t::file_progress\"></a><dl class=\"docutils\">\n+<dt>file_progress</dt>\n+<dd>alerts when files complete downloading</dd>\n+</dl>\n+<a name=\"alert_category_t::piece_progress\"></a><dl class=\"docutils\">\n+<dt>piece_progress</dt>\n+<dd>alerts when pieces complete downloading or fail hash check</dd>\n+</dl>\n+<a name=\"alert_category_t::upload\"></a><dl class=\"docutils\">\n+<dt>upload</dt>\n+<dd>alerts when we upload blocks to other peers</dd>\n+</dl>\n+<a name=\"alert_category_t::block_progress\"></a><dl class=\"docutils\">\n+<dt>block_progress</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"alert_category_t::all\"></a><dl class=\"docutils\">\n+<dt>all</dt>\n+<dd><p class=\"first\">The full bitmask, representing all available categories.</p>\n+<p class=\"last\">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.</p>\n+</dd>\n+</dl>\n+<a name=\"hasher\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hasher&labels=documentation&body=Documentation+under+heading+%22class+hasher%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"hasher\">\n+<h1>hasher</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/hasher.hpp\">libtorrent/hasher.hpp</a>"</p>\n+<p>this is a SHA-1 hash class.</p>\n+<p>You use it by first instantiating it, then call <tt class=\"docutils literal\">update()</tt> 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 <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> parts of it at a time. When\n+You have fed the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> with all the data, you call <tt class=\"docutils literal\">final()</tt> and it\n+will return the sha1-hash of the data.</p>\n+<p>The constructor that takes a <tt class=\"docutils literal\">char const*</tt> and an integer will construct the\n+sha1 context and feed it the data passed in.</p>\n+<p>If you want to reuse the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> object once you have created a hash, you have to\n+call <tt class=\"docutils literal\">reset()</tt> to reinitialize it.</p>\n+<p>The built-in software version of sha1-algorithm was implemented\n+by Steve Reid and released as public domain.\n+For more info, see <tt class=\"docutils literal\">src/sha1.cpp</tt>.</p>\n+<pre class=\"literal-block\">\n+class hasher\n+{\n+ <strong>hasher</strong> ();\n+ <strong>hasher</strong> (char const* data, int len);\n+ explicit <strong>hasher</strong> (span<char const> data);\n+ <strong>hasher</strong> (hasher const&);\n+ hasher& <strong>operator=</strong> (hasher const&) &;\n+ hasher& <strong>update</strong> (span<char const> data);\n+ hasher& <strong>update</strong> (char const* data, int len);\n+ sha1_hash <strong>final</strong> ();\n+ void <strong>reset</strong> ();\n+};\n+</pre>\n+<a name=\"operator=()\"></a>\n+<a name=\"hasher()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Boperator%3D%28%29+hasher%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher\">\n+<h2>operator=() hasher()</h2>\n+<pre class=\"literal-block\">\n+<strong>hasher</strong> (char const* data, int len);\n+explicit <strong>hasher</strong> (span<char const> data);\n+<strong>hasher</strong> (hasher const&);\n+hasher& <strong>operator=</strong> (hasher const&) &;\n+</pre>\n+<p>this is the same as default constructing followed by a call to\n+<tt class=\"docutils literal\">update(data, len)</tt>.</p>\n+<a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"update\">\n+<h2>update()</h2>\n+<pre class=\"literal-block\">\n+hasher& <strong>update</strong> (span<char const> data);\n+hasher& <strong>update</strong> (char const* data, int len);\n+</pre>\n+<p>append the following bytes to what is being hashed</p>\n+<a name=\"final()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Bfinal%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Bfinal%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"final\">\n+<h2>final()</h2>\n+<pre class=\"literal-block\">\n+sha1_hash <strong>final</strong> ();\n+</pre>\n+<p>returns the SHA-1 digest of the buffers previously passed to\n+<a class=\"reference external\" href=\"reference-Utility.html#update()\">update()</a> and the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> constructor.</p>\n+<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reset-1\">\n+<h2>reset()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reset</strong> ();\n+</pre>\n+<p>restore the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> state to be as if the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> has just been\n+default constructed.</p>\n+<a name=\"hasher256\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+hasher256&labels=documentation&body=Documentation+under+heading+%22class+hasher256%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"hasher256\">\n+<h1>hasher256</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/hasher.hpp\">libtorrent/hasher.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+class hasher256\n+{\n+ <strong>hasher256</strong> ();\n+ hasher256& <strong>operator=</strong> (hasher256 const&) &;\n+ <strong>hasher256</strong> (char const* data, int len);\n+ explicit <strong>hasher256</strong> (span<char const> data);\n+ <strong>hasher256</strong> (hasher256 const&);\n+ hasher256& <strong>update</strong> (span<char const> data);\n+ hasher256& <strong>update</strong> (char const* data, int len);\n+ sha256_hash <strong>final</strong> ();\n+ void <strong>reset</strong> ();\n+ <strong>~hasher256</strong> ();\n+};\n+</pre>\n+<a name=\"operator=()\"></a>\n+<a name=\"hasher256()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Boperator%3D%28%29+hasher256%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-hasher256\">\n+<h2>operator=() hasher256()</h2>\n+<pre class=\"literal-block\">\n+hasher256& <strong>operator=</strong> (hasher256 const&) &;\n+<strong>hasher256</strong> (char const* data, int len);\n+explicit <strong>hasher256</strong> (span<char const> data);\n+<strong>hasher256</strong> (hasher256 const&);\n+</pre>\n+<p>this is the same as default constructing followed by a call to\n+<tt class=\"docutils literal\">update(data, len)</tt>.</p>\n+<a name=\"update()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bupdate%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bupdate%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"update-1\">\n+<h2>update()</h2>\n+<pre class=\"literal-block\">\n+hasher256& <strong>update</strong> (span<char const> data);\n+hasher256& <strong>update</strong> (char const* data, int len);\n+</pre>\n+<p>append the following bytes to what is being hashed</p>\n+<a name=\"final()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Bfinal%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Bfinal%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"final-1\">\n+<h2>final()</h2>\n+<pre class=\"literal-block\">\n+sha256_hash <strong>final</strong> ();\n+</pre>\n+<p>returns the SHA-1 digest of the buffers previously passed to\n+<a class=\"reference external\" href=\"reference-Utility.html#update()\">update()</a> and the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> constructor.</p>\n+<a name=\"reset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:hasher256%3A%3A%5Breset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22hasher256%3A%3A%5Breset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reset-2\">\n+<h2>reset()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reset</strong> ();\n+</pre>\n+<p>restore the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> state to be as if the <a class=\"reference external\" href=\"reference-Utility.html#hasher\">hasher</a> has just been\n+default constructed.</p>\n+<a name=\"bitfield\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bitfield&labels=documentation&body=Documentation+under+heading+%22class+bitfield%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"bitfield\">\n+<h1>bitfield</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bitfield.hpp\">libtorrent/bitfield.hpp</a>"</p>\n+<p>The <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> type stores any number of bits as a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n+in a heap allocated array.</p>\n+<pre class=\"literal-block\">\n+struct bitfield\n+{\n+ explicit <strong>bitfield</strong> (int bits);\n+ <strong>bitfield</strong> (char const* b, int bits);\n+ <strong>bitfield</strong> () noexcept = default;\n+ <strong>bitfield</strong> (int bits, bool val);\n+ <strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n+ <strong>bitfield</strong> (bitfield const& rhs);\n+ void <strong>assign</strong> (char const* b, int const bits);\n+ bool <strong>operator[]</strong> (int index) const noexcept;\n+ bool <strong>get_bit</strong> (int index) const noexcept;\n+ void <strong>set_bit</strong> (int index) noexcept;\n+ void <strong>clear_bit</strong> (int index) noexcept;\n+ bool <strong>all_set</strong> () const noexcept;\n+ bool <strong>none_set</strong> () const noexcept;\n+ int <strong>size</strong> () const noexcept;\n+ int <strong>num_words</strong> () const noexcept;\n+ int <strong>num_bytes</strong> () const noexcept;\n+ bool <strong>empty</strong> () const noexcept;\n+ char* <strong>data</strong> () noexcept;\n+ char const* <strong>data</strong> () const noexcept;\n+ void <strong>swap</strong> (bitfield& rhs) noexcept;\n+ int <strong>count</strong> () const noexcept;\n+ int <strong>find_first_set</strong> () const noexcept;\n+ int <strong>find_last_clear</strong> () const noexcept;\n+ bool <strong>operator==</strong> (lt::bitfield const& rhs) const;\n+};\n+</pre>\n+<a name=\"bitfield()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bbitfield%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bbitfield%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bitfield-1\">\n+<h2>bitfield()</h2>\n+<pre class=\"literal-block\">\n+explicit <strong>bitfield</strong> (int bits);\n+<strong>bitfield</strong> (char const* b, int bits);\n+<strong>bitfield</strong> () noexcept = default;\n+<strong>bitfield</strong> (int bits, bool val);\n+<strong>bitfield</strong> (bitfield&& rhs) noexcept = default;\n+<strong>bitfield</strong> (bitfield const& rhs);\n+</pre>\n+<p>constructs a new <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. The default constructor creates an empty\n+<a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>. <tt class=\"docutils literal\">bits</tt> is the size of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> (specified in bits).\n+<tt class=\"docutils literal\">val</tt> is the value to initialize the bits to. If not specified\n+all bits are initialized to 0.</p>\n+<p>The constructor taking a pointer <tt class=\"docutils literal\">b</tt> and <tt class=\"docutils literal\">bits</tt> copies a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>\n+from the specified buffer, and <tt class=\"docutils literal\">bits</tt> number of bits (rounded up to\n+the nearest byte boundary).</p>\n+<a name=\"assign()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bassign%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bassign%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"assign\">\n+<h2>assign()</h2>\n+<pre class=\"literal-block\">\n+void <strong>assign</strong> (char const* b, int const bits);\n+</pre>\n+<p>copy <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> from buffer <tt class=\"docutils literal\">b</tt> of <tt class=\"docutils literal\">bits</tt> number of bits, rounded up to\n+the nearest byte boundary.</p>\n+<a name=\"operator[]()\"></a>\n+<a name=\"get_bit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Boperator%5B%5D%28%29+get_bit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Boperator%5B%5D%28%29+get_bit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-get-bit\">\n+<h2>operator[]() get_bit()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator[]</strong> (int index) const noexcept;\n+bool <strong>get_bit</strong> (int index) const noexcept;\n+</pre>\n+<p>query bit at <tt class=\"docutils literal\">index</tt>. Returns true if bit is 1, otherwise false.</p>\n+<a name=\"set_bit()\"></a>\n+<a name=\"clear_bit()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bset_bit%28%29+clear_bit%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bset_bit%28%29+clear_bit%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"set-bit-clear-bit\">\n+<h2>set_bit() clear_bit()</h2>\n+<pre class=\"literal-block\">\n+void <strong>set_bit</strong> (int index) noexcept;\n+void <strong>clear_bit</strong> (int index) noexcept;\n+</pre>\n+<p>set bit at <tt class=\"docutils literal\">index</tt> to 0 (clear_bit) or 1 (set_bit).</p>\n+<a name=\"all_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Ball_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Ball_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"all-set\">\n+<h2>all_set()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>all_set</strong> () const noexcept;\n+</pre>\n+<p>returns true if all bits in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> are set</p>\n+<a name=\"none_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnone_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnone_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"none-set\">\n+<h2>none_set()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>none_set</strong> () const noexcept;\n+</pre>\n+<p>returns true if no bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> is set</p>\n+<a name=\"size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bsize%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bsize%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"size\">\n+<h2>size()</h2>\n+<pre class=\"literal-block\">\n+int <strong>size</strong> () const noexcept;\n+</pre>\n+<p>returns the size of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> in bits.</p>\n+<a name=\"num_words()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnum_words%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnum_words%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-words\">\n+<h2>num_words()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_words</strong> () const noexcept;\n+</pre>\n+<p>returns the number of 32 bit words are needed to represent all bits in\n+this <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>.</p>\n+<a name=\"num_bytes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bnum_bytes%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bnum_bytes%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"num-bytes\">\n+<h2>num_bytes()</h2>\n+<pre class=\"literal-block\">\n+int <strong>num_bytes</strong> () const noexcept;\n+</pre>\n+<p>returns the number of bytes needed to represent all bits in this\n+<a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a></p>\n+<a name=\"empty()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bempty%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bempty%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"empty-1\">\n+<h2>empty()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>empty</strong> () const noexcept;\n+</pre>\n+<p>returns true if the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> has zero size.</p>\n+<a name=\"data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bdata%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bdata%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"data-1\">\n+<h2>data()</h2>\n+<pre class=\"literal-block\">\n+char* <strong>data</strong> () noexcept;\n+char const* <strong>data</strong> () const noexcept;\n+</pre>\n+<p>returns a pointer to the internal buffer of the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, or\n+<tt class=\"docutils literal\">nullptr</tt> if it's empty.</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap-2\">\n+<h2>swap()</h2>\n+<pre class=\"literal-block\">\n+void <strong>swap</strong> (bitfield& rhs) noexcept;\n+</pre>\n+<p>swaps the bit-fields two variables refer to</p>\n+<a name=\"count()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bcount%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bcount%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"count\">\n+<h2>count()</h2>\n+<pre class=\"literal-block\">\n+int <strong>count</strong> () const noexcept;\n+</pre>\n+<p>count the number of bits in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a> that are set to 1.</p>\n+<a name=\"find_first_set()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bfind_first_set%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bfind_first_set%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"find-first-set\">\n+<h2>find_first_set()</h2>\n+<pre class=\"literal-block\">\n+int <strong>find_first_set</strong> () const noexcept;\n+</pre>\n+<p>returns the index of the first set bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, i.e. 1 bit.</p>\n+<a name=\"find_last_clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bitfield%3A%3A%5Bfind_last_clear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bitfield%3A%3A%5Bfind_last_clear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"find-last-clear\">\n+<h2>find_last_clear()</h2>\n+<pre class=\"literal-block\">\n+int <strong>find_last_clear</strong> () const noexcept;\n+</pre>\n+<p>returns the index to the last cleared bit in the <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, i.e. 0 bit.</p>\n+<a name=\"peer_request\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_request&labels=documentation&body=Documentation+under+heading+%22class+peer_request%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"peer-request\">\n+<h1>peer_request</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_request.hpp\">libtorrent/peer_request.hpp</a>"</p>\n+<p>represents a byte range within a piece. Internally this is is used for\n+incoming piece requests.</p>\n+<pre class=\"literal-block\">\n+struct peer_request\n+{\n+ bool <strong>operator==</strong> (peer_request const& r) const;\n+\n+ piece_index_t piece;\n+ int start;\n+ int length;\n+};\n+</pre>\n+<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-2\">\n+<h2>operator==()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator==</strong> (peer_request const& r) const;\n+</pre>\n+<p>returns true if the right hand side <a class=\"reference external\" href=\"reference-Core.html#peer_request\">peer_request</a> refers to the same\n+range as this does.</p>\n+<a name=\"piece\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bpiece%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bpiece%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>piece</dt>\n+<dd>The index of the piece in which the range starts.</dd>\n+</dl>\n+<a name=\"start\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Bstart%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Bstart%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>start</dt>\n+<dd>The byte offset within that piece where the range starts.</dd>\n+</dl>\n+<a name=\"length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_request%3A%3A%5Blength%5D&labels=documentation&body=Documentation+under+heading+%22peer_request%3A%3A%5Blength%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>length</dt>\n+<dd>The size of the range, in bytes.</dd>\n+</dl>\n+<a name=\"piece_block\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+piece_block&labels=documentation&body=Documentation+under+heading+%22class+piece_block%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"piece-block\">\n+<h1>piece_block</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/piece_block.hpp\">libtorrent/piece_block.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+struct piece_block\n+{\n+ <strong>piece_block</strong> (piece_index_t p_index, int b_index);\n+ <strong>piece_block</strong> () = default;\n+ bool <strong>operator<</strong> (piece_block const& b) const;\n+ bool <strong>operator==</strong> (piece_block const& b) const;\n+ bool <strong>operator!=</strong> (piece_block const& b) const;\n+\n+ static const piece_block invalid;\n+ piece_index_t piece_index {0};\n+ int <strong>block_index</strong> = 0;\n+};\n+</pre>\n+<a name=\"peer_info\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+peer_info&labels=documentation&body=Documentation+under+heading+%22class+peer_info%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"peer-info\">\n+<h1>peer_info</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_info.hpp\">libtorrent/peer_info.hpp</a>"</p>\n+<p>holds information and statistics about one peer\n+that libtorrent is connected to</p>\n+<pre class=\"literal-block\">\n+struct peer_info\n+{\n+ sha256_hash <strong>i2p_destination</strong> () 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 <strong>interesting</strong> = 0_bit;\n+ static constexpr peer_flags_t <strong>choked</strong> = 1_bit;\n+ static constexpr peer_flags_t <strong>remote_interested</strong> = 2_bit;\n+ static constexpr peer_flags_t <strong>remote_choked</strong> = 3_bit;\n+ static constexpr peer_flags_t <strong>supports_extensions</strong> = 4_bit;\n+ static constexpr peer_flags_t <strong>outgoing_connection</strong> = 5_bit;\n+ static constexpr peer_flags_t <strong>local_connection</strong> = 5_bit;\n+ static constexpr peer_flags_t <strong>handshake</strong> = 6_bit;\n+ static constexpr peer_flags_t <strong>connecting</strong> = 7_bit;\n+ static constexpr peer_flags_t <strong>on_parole</strong> = 9_bit;\n+ static constexpr peer_flags_t <strong>seed</strong> = 10_bit;\n+ static constexpr peer_flags_t <strong>optimistic_unchoke</strong> = 11_bit;\n+ static constexpr peer_flags_t <strong>snubbed</strong> = 12_bit;\n+ static constexpr peer_flags_t <strong>upload_only</strong> = 13_bit;\n+ static constexpr peer_flags_t <strong>endgame_mode</strong> = 14_bit;\n+ static constexpr peer_flags_t <strong>holepunched</strong> = 15_bit;\n+ static constexpr peer_flags_t <strong>i2p_socket</strong> = 16_bit;\n+ static constexpr peer_flags_t <strong>utp_socket</strong> = 17_bit;\n+ static constexpr peer_flags_t <strong>ssl_socket</strong> = 18_bit;\n+ static constexpr peer_flags_t <strong>rc4_encrypted</strong> = 19_bit;\n+ static constexpr peer_flags_t <strong>plaintext_encrypted</strong> = 20_bit;\n+ peer_flags_t flags;\n+ static constexpr peer_source_flags_t <strong>tracker</strong> = 0_bit;\n+ static constexpr peer_source_flags_t <strong>dht</strong> = 1_bit;\n+ static constexpr peer_source_flags_t <strong>pex</strong> = 2_bit;\n+ static constexpr peer_source_flags_t <strong>lsd</strong> = 3_bit;\n+ static constexpr peer_source_flags_t <strong>resume_data</strong> = 4_bit;\n+ static constexpr peer_source_flags_t <strong>incoming</strong> = 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 <strong>standard_bittorrent</strong> = 0_bit;\n+ static constexpr connection_type_t <strong>web_seed</strong> = 1_bit;\n+ static constexpr connection_type_t <strong>http_seed</strong> = 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+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> ip;\n+ <a class=\"reference external\" href=\"tcp::endpoint\">tcp::endpoint</a> local_endpoint;\n+ static constexpr bandwidth_state_flags_t <strong>bw_idle</strong> = 0_bit;\n+ static constexpr bandwidth_state_flags_t <strong>bw_limit</strong> = 1_bit;\n+ static constexpr bandwidth_state_flags_t <strong>bw_network</strong> = 2_bit;\n+ static constexpr bandwidth_state_flags_t <strong>bw_disk</strong> = 4_bit;\n+ bandwidth_state_flags_t read_state;\n+ bandwidth_state_flags_t write_state;\n+};\n+</pre>\n+<a name=\"i2p_destination()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bi2p_destination%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bi2p_destination%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"i2p-destination\">\n+<h2>i2p_destination()</h2>\n+<pre class=\"literal-block\">\n+sha256_hash <strong>i2p_destination</strong> () const;\n+</pre>\n+<p>If this peer is an i2p peer, this function returns the destination\n+address of the peer</p>\n+<a name=\"client\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bclient%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bclient%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>client</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpieces%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pieces</dt>\n+<dd>a <a class=\"reference external\" href=\"reference-Utility.html#bitfield\">bitfield</a>, 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).</dd>\n+</dl>\n+<a name=\"total_download\"></a>\n+<a name=\"total_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btotal_download+total_upload%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btotal_download+total_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_download total_upload</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"last_request\"></a>\n+<a name=\"last_active\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blast_request+last_active%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blast_request+last_active%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_request last_active</dt>\n+<dd>the time since we last sent a request to this peer and since any\n+transfer occurred with this peer</dd>\n+</dl>\n+<a name=\"download_queue_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_queue_time%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_queue_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>download_queue_time</dt>\n+<dd>the time until all blocks in the request queue will be downloaded</dd>\n+</dl>\n+<a name=\"interesting\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Binteresting%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Binteresting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>interesting</dt>\n+<dd><strong>we</strong> are interested in pieces from this peer.</dd>\n+</dl>\n+<a name=\"choked\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bchoked%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bchoked%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>choked</dt>\n+<dd><strong>we</strong> have choked this peer.</dd>\n+</dl>\n+<a name=\"remote_interested\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bremote_interested%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bremote_interested%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>remote_interested</dt>\n+<dd>the peer is interested in <strong>us</strong></dd>\n+</dl>\n+<a name=\"remote_choked\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bremote_choked%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bremote_choked%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>remote_choked</dt>\n+<dd>the peer has choked <strong>us</strong>.</dd>\n+</dl>\n+<a name=\"supports_extensions\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsupports_extensions%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsupports_extensions%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>supports_extensions</dt>\n+<dd>means that this peer supports the\n+<a class=\"reference external\" href=\"extension_protocol.html\">extension protocol</a>.</dd>\n+</dl>\n+<a name=\"outgoing_connection\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Boutgoing_connection%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Boutgoing_connection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>outgoing_connection</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"local_connection\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blocal_connection%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blocal_connection%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_connection</dt>\n+<dd>deprecated synonym for outgoing_connection</dd>\n+</dl>\n+<a name=\"handshake\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bhandshake%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bhandshake%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>handshake</dt>\n+<dd>The connection is opened, and waiting for the\n+handshake. Until the handshake is done, the peer\n+cannot be identified.</dd>\n+</dl>\n+<a name=\"connecting\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bconnecting%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bconnecting%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>connecting</dt>\n+<dd>The connection is in a half-open state (i.e. it is\n+being connected).</dd>\n+</dl>\n+<a name=\"on_parole\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bon_parole%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bon_parole%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>on_parole</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bseed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bseed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>seed</dt>\n+<dd>This peer is a seed (it has all the pieces).</dd>\n+</dl>\n+<a name=\"optimistic_unchoke\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Boptimistic_unchoke%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Boptimistic_unchoke%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>optimistic_unchoke</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"snubbed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsnubbed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsnubbed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>snubbed</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"upload_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bupload_only%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bupload_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>upload_only</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"endgame_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bendgame_mode%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bendgame_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>endgame_mode</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"holepunched\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bholepunched%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bholepunched%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>holepunched</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"i2p_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bi2p_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bi2p_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>i2p_socket</dt>\n+<dd>indicates that this socket is running on top of the\n+I2P transport.</dd>\n+</dl>\n+<a name=\"utp_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Butp_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Butp_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>utp_socket</dt>\n+<dd>indicates that this socket is a uTP socket</dd>\n+</dl>\n+<a name=\"ssl_socket\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bssl_socket%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bssl_socket%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ssl_socket</dt>\n+<dd>indicates that this socket is running on top of an SSL\n+(TLS) channel</dd>\n+</dl>\n+<a name=\"rc4_encrypted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brc4_encrypted%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brc4_encrypted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>rc4_encrypted</dt>\n+<dd>this connection is obfuscated with RC4</dd>\n+</dl>\n+<a name=\"plaintext_encrypted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bplaintext_encrypted%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bplaintext_encrypted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>plaintext_encrypted</dt>\n+<dd>the handshake of this connection was obfuscated\n+with a Diffie-Hellman exchange</dd>\n+</dl>\n+<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flags</dt>\n+<dd>tells you in which state the peer is in. It is set to\n+any combination of the peer_flags_t flags above.</dd>\n+</dl>\n+<a name=\"tracker\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btracker%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btracker%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>tracker</dt>\n+<dd>The peer was received from the tracker.</dd>\n+</dl>\n+<a name=\"dht\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdht%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdht%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>dht</dt>\n+<dd>The peer was received from the kademlia DHT.</dd>\n+</dl>\n+<a name=\"pex\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpex%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpex%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pex</dt>\n+<dd>The peer was received from the peer exchange\n+extension.</dd>\n+</dl>\n+<a name=\"lsd\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blsd%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blsd%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>lsd</dt>\n+<dd>The peer was received from the local service\n+discovery (The peer is on the local network).</dd>\n+</dl>\n+<a name=\"resume_data\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bresume_data%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bresume_data%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>resume_data</dt>\n+<dd>The peer was added from the fast resume data.</dd>\n+</dl>\n+<a name=\"incoming\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bincoming%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bincoming%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>incoming</dt>\n+<dd>we received an incoming connection from this peer</dd>\n+</dl>\n+<a name=\"source\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsource%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsource%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>source</dt>\n+<dd>a combination of flags describing from which sources this peer\n+was received. A combination of the peer_source_flags_t above.</dd>\n+</dl>\n+<a name=\"up_speed\"></a>\n+<a name=\"down_speed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bup_speed+down_speed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bup_speed+down_speed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>up_speed down_speed</dt>\n+<dd>the current upload and download speed we have to and from this peer\n+(including any protocol messages). updated about once per second</dd>\n+</dl>\n+<a name=\"payload_up_speed\"></a>\n+<a name=\"payload_down_speed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpayload_up_speed+payload_down_speed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpayload_up_speed+payload_down_speed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>payload_up_speed payload_down_speed</dt>\n+<dd>The transfer rates of payload data only updated about once per second</dd>\n+</dl>\n+<a name=\"pid\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpid%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpid%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pid</dt>\n+<dd>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()_</dd>\n+</dl>\n+<a name=\"queue_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bqueue_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bqueue_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>queue_bytes</dt>\n+<dd>the number of bytes we have requested from this peer, but not yet\n+received.</dd>\n+</dl>\n+<a name=\"request_timeout\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brequest_timeout%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brequest_timeout%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>request_timeout</dt>\n+<dd>the number of seconds until the current front piece request will time\n+out. This timeout can be adjusted through\n+<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::request_timeout</span></tt>.\n+-1 means that there is not outstanding request.</dd>\n+</dl>\n+<a name=\"send_buffer_size\"></a>\n+<a name=\"used_send_buffer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsend_buffer_size+used_send_buffer%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsend_buffer_size+used_send_buffer%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>send_buffer_size used_send_buffer</dt>\n+<dd>the number of bytes allocated\n+and used for the peer's send buffer, respectively.</dd>\n+</dl>\n+<a name=\"receive_buffer_size\"></a>\n+<a name=\"used_receive_buffer\"></a>\n+<a name=\"receive_buffer_watermark\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Breceive_buffer_size+used_receive_buffer+receive_buffer_watermark%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Breceive_buffer_size+used_receive_buffer+receive_buffer_watermark%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>receive_buffer_size used_receive_buffer receive_buffer_watermark</dt>\n+<dd>the number of bytes\n+allocated and used as receive buffer, respectively.</dd>\n+</dl>\n+<a name=\"num_hashfails\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bnum_hashfails%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bnum_hashfails%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_hashfails</dt>\n+<dd>the number of pieces this peer has participated in sending us that\n+turned out to fail the hash check.</dd>\n+</dl>\n+<a name=\"download_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>download_queue_length</dt>\n+<dd>this is the number of requests we have sent to this peer that we\n+haven't got a response for yet</dd>\n+</dl>\n+<a name=\"timed_out_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btimed_out_requests%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btimed_out_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>timed_out_requests</dt>\n+<dd>the number of block requests that have timed out, and are still in the\n+download queue</dd>\n+</dl>\n+<a name=\"busy_requests\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbusy_requests%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbusy_requests%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>busy_requests</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"requests_in_buffer\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brequests_in_buffer%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brequests_in_buffer%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>requests_in_buffer</dt>\n+<dd>the number of requests messages that are currently in the send buffer\n+waiting to be sent.</dd>\n+</dl>\n+<a name=\"target_dl_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Btarget_dl_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Btarget_dl_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>target_dl_queue_length</dt>\n+<dd>the number of requests that is tried to be maintained (this is\n+typically a function of download speed)</dd>\n+</dl>\n+<a name=\"upload_queue_length\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bupload_queue_length%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bupload_queue_length%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>upload_queue_length</dt>\n+<dd>the number of piece-requests we have received from this peer\n+that we haven't answered with a piece yet.</dd>\n+</dl>\n+<a name=\"failcount\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bfailcount%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bfailcount%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>failcount</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"downloading_piece_index\"></a>\n+<a name=\"downloading_block_index\"></a>\n+<a name=\"downloading_progress\"></a>\n+<a name=\"downloading_total\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownloading_piece_index+downloading_block_index+downloading_progress+downloading_total%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownloading_piece_index+downloading_block_index+downloading_progress+downloading_total%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>downloading_piece_index downloading_block_index downloading_progress downloading_total</dt>\n+<dd>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. <tt class=\"docutils literal\">downloading_piece_index</tt> 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. <tt class=\"docutils literal\">downloading_block_index</tt> is the\n+index of the block (or sub-piece) that is being downloaded.\n+<tt class=\"docutils literal\">downloading_progress</tt> is the number of bytes of this block we have\n+received from the peer, and <tt class=\"docutils literal\">downloading_total</tt> is the total number\n+of bytes in this block.</dd>\n+</dl>\n+<a name=\"standard_bittorrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bstandard_bittorrent%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bstandard_bittorrent%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>standard_bittorrent</dt>\n+<dd>Regular bittorrent connection</dd>\n+</dl>\n+<a name=\"web_seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bweb_seed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bweb_seed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>web_seed</dt>\n+<dd>HTTP connection using the <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0019.html\">BEP 19</a> protocol</dd>\n+</dl>\n+<a name=\"http_seed\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bhttp_seed%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bhttp_seed%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>http_seed</dt>\n+<dd>HTTP connection using the <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0017.html\">BEP 17</a> protocol</dd>\n+</dl>\n+<a name=\"connection_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bconnection_type%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bconnection_type%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>connection_type</dt>\n+<dd>the kind of connection this peer uses. See connection_type_t.</dd>\n+</dl>\n+<a name=\"pending_disk_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpending_disk_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpending_disk_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pending_disk_bytes</dt>\n+<dd>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 <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::max_queued_disk_bytes</span></tt>.</dd>\n+</dl>\n+<a name=\"pending_disk_read_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bpending_disk_read_bytes%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bpending_disk_read_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pending_disk_read_bytes</dt>\n+<dd>number of outstanding bytes to read\n+from disk</dd>\n+</dl>\n+<a name=\"send_quota\"></a>\n+<a name=\"receive_quota\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bsend_quota+receive_quota%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bsend_quota+receive_quota%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>send_quota receive_quota</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"rtt\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Brtt%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Brtt%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>rtt</dt>\n+<dd>an estimated round trip time to this peer, in milliseconds. It is\n+estimated by timing the TCP <tt class=\"docutils literal\">connect()</tt>. It may be 0 for\n+incoming connections.</dd>\n+</dl>\n+<a name=\"num_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bnum_pieces%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bnum_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_pieces</dt>\n+<dd>the number of pieces this peer has.</dd>\n+</dl>\n+<a name=\"download_rate_peak\"></a>\n+<a name=\"upload_rate_peak\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bdownload_rate_peak+upload_rate_peak%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bdownload_rate_peak+upload_rate_peak%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>download_rate_peak upload_rate_peak</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bprogress%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bprogress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>progress</dt>\n+<dd>the progress of the peer in the range [0, 1]. This is always 0 when\n+floating point operations are disabled, instead use <tt class=\"docutils literal\">progress_ppm</tt>.</dd>\n+</dl>\n+<a name=\"progress_ppm\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bprogress_ppm%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bprogress_ppm%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>progress_ppm</dt>\n+<dd>indicates the download progress of the peer in the range [0, 1000000]\n+(parts per million).</dd>\n+</dl>\n+<a name=\"ip\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bip%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bip%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>ip</dt>\n+<dd>the IP-address to this peer. The type is an asio endpoint. For\n+more info, see the <a class=\"reference external\" href=\"http://asio.sourceforge.net/asio-0.3.8/doc/asio/reference.html\">asio</a> documentation. This field is not valid for\n+i2p peers. Instead use the <a class=\"reference external\" href=\"reference-Core.html#i2p_destination()\">i2p_destination()</a> function.</dd>\n+</dl>\n+<a name=\"local_endpoint\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Blocal_endpoint%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Blocal_endpoint%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>local_endpoint</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"bw_idle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_idle%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_idle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>bw_idle</dt>\n+<dd>The peer is not waiting for any external events to\n+send or receive data.</dd>\n+</dl>\n+<a name=\"bw_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_limit%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>bw_limit</dt>\n+<dd>The peer is waiting for the rate limiter.</dd>\n+</dl>\n+<a name=\"bw_network\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_network%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_network%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>bw_network</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"bw_disk\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bbw_disk%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bbw_disk%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>bw_disk</dt>\n+<dd>The peer is waiting for the disk I/O thread to catch\n+up writing buffers to disk before downloading more.</dd>\n+</dl>\n+<a name=\"read_state\"></a>\n+<a name=\"write_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:peer_info%3A%3A%5Bread_state+write_state%5D&labels=documentation&body=Documentation+under+heading+%22peer_info%3A%3A%5Bread_state+write_state%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>read_state write_state</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"info_hash_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+info_hash_t&labels=documentation&body=Documentation+under+heading+%22class+info_hash_t%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"info-hash-t\">\n+<h1>info_hash_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n+<p>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.</p>\n <div class=\"admonition note\">\n <p class=\"first admonition-title\">Note</p>\n-<p class=\"last\">This setting is only meant for very special cases where a\n-seed's listening port differs from the external port. As an\n-example, if a local proxy is used and that the proxy supports\n-reverse tunnels through NAT-PMP, the tracker must connect to\n-the external NAT-PMP port (configured using <tt class=\"docutils literal\">announce_port</tt>)\n-instead of the actual local listening port.</p>\n+<p class=\"last\">If <tt class=\"docutils literal\">has_v2()</tt> is false then the v1 hash might actually be a truncated\n+v2 hash</p>\n </div>\n <pre class=\"literal-block\">\n-struct settings_pack final : settings_interface\n+struct info_hash_t\n {\n- friend void <strong>apply_pack_impl</strong> (settings_pack const*\n- , aux::session_settings_single_thread&\n- , std::vector<void(aux::session_impl::*)()>*);\n- void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n- void <strong>set_int</strong> (int name, int val) override;\n- void <strong>set_bool</strong> (int name, bool val) override;\n- void <strong>set_str</strong> (int name, std::string val) override;\n- bool <strong>has_val</strong> (int name) const override;\n- void <strong>clear</strong> ();\n- void <strong>clear</strong> (int name);\n- int <strong>get_int</strong> (int name) const override;\n- bool <strong>get_bool</strong> (int name) const override;\n- std::string const& <strong>get_str</strong> (int name) const override;\n- void <strong>for_each</strong> (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+ <strong>info_hash_t</strong> () noexcept = default;\n+ explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n+ explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n+ <strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n+ bool <strong>has_v1</strong> () const;\n+ bool <strong>has_v2</strong> () const;\n+ bool <strong>has</strong> (protocol_version v) const;\n+ sha1_hash <strong>get</strong> (protocol_version v) const;\n+ sha1_hash <strong>get_best</strong> () const;\n+ friend bool <strong>operator!=</strong> (info_hash_t const& lhs, info_hash_t const& rhs);\n+ friend bool <strong>operator==</strong> (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n+ template <typename F> void <strong>for_each</strong> (F f) const;\n+ bool <strong>operator<</strong> (info_hash_t const& o) const;\n+ friend std::ostream& <strong>operator<<</strong> (std::ostream& os, info_hash_t const& ih);\n \n- enum proxy_type_t\n- {\n- none,\n- socks4,\n- socks5,\n- socks5_pw,\n- http,\n- http_pw,\n- };\n+ sha1_hash v1;\n+ sha256_hash v2;\n };\n </pre>\n-<a name=\"set_bool()\"></a>\n-<a name=\"set_int()\"></a>\n-<a name=\"set_str()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bset_bool%28%29+set_int%28%29+set_str%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bset_bool%28%29+set_int%28%29+set_str%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"set-bool-set-int-set-str\">\n-<h2>set_bool() set_int() set_str()</h2>\n+<a name=\"info_hash_t()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Binfo_hash_t%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"info-hash-t-1\">\n+<h2>info_hash_t()</h2>\n <pre class=\"literal-block\">\n-void <strong>set_int</strong> (int name, flags::bitfield_flag<Type, Tag> const val);\n-void <strong>set_int</strong> (int name, int val) override;\n-void <strong>set_bool</strong> (int name, bool val) override;\n-void <strong>set_str</strong> (int name, std::string val) override;\n+<strong>info_hash_t</strong> () noexcept = default;\n+explicit <strong>info_hash_t</strong> (sha256_hash h2) noexcept;\n+explicit <strong>info_hash_t</strong> (sha1_hash h1) noexcept;\n+<strong>info_hash_t</strong> (sha1_hash h1, sha256_hash h2) noexcept;\n </pre>\n-<p>set a configuration option in the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>. <tt class=\"docutils literal\">name</tt> 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.</p>\n-<a name=\"has_val()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bhas_val%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bhas_val%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"has-val\">\n-<h2>has_val()</h2>\n+<p>The default constructor creates an object that has neither a v1 or v2\n+hash.</p>\n+<p>For backwards compatibility, make it possible to construct directly\n+from a v1 hash. This constructor allows <em>implicit</em> conversion from a\n+v1 hash, but the implicitness is deprecated.</p>\n+<a name=\"has_v2()\"></a>\n+<a name=\"has_v1()\"></a>\n+<a name=\"has()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bhas_v2%28%29+has_v1%28%29+has%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bhas_v2%28%29+has_v1%28%29+has%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"has-v2-has-v1-has\">\n+<h2>has_v2() has_v1() has()</h2>\n <pre class=\"literal-block\">\n-bool <strong>has_val</strong> (int name) const override;\n+bool <strong>has_v1</strong> () const;\n+bool <strong>has_v2</strong> () const;\n+bool <strong>has</strong> (protocol_version v) const;\n </pre>\n-<p>queries whether the specified configuration option has a value set in\n-this pack. <tt class=\"docutils literal\">name</tt> can be any enumeration value from string_types,\n-int_types or bool_types.</p>\n-<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear\">\n-<h2>clear()</h2>\n+<p>returns true if the corresponding info hash is present in this\n+object.</p>\n+<a name=\"get()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get\">\n+<h2>get()</h2>\n <pre class=\"literal-block\">\n-void <strong>clear</strong> ();\n+sha1_hash <strong>get</strong> (protocol_version v) const;\n </pre>\n-<p>clear the settings pack from all settings</p>\n-<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-1\">\n-<h2>clear()</h2>\n+<p>returns the has for the specified protocol version</p>\n+<a name=\"get_best()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bget_best%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bget_best%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"get-best\">\n+<h2>get_best()</h2>\n <pre class=\"literal-block\">\n-void <strong>clear</strong> (int name);\n+sha1_hash <strong>get_best</strong> () const;\n </pre>\n-<p>clear a specific setting from the pack</p>\n-<a name=\"get_str()\"></a>\n-<a name=\"get_bool()\"></a>\n-<a name=\"get_int()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:settings_pack%3A%3A%5Bget_str%28%29+get_bool%28%29+get_int%28%29%5D&labels=documentation&body=Documentation+under+heading+%22settings_pack%3A%3A%5Bget_str%28%29+get_bool%28%29+get_int%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"get-str-get-bool-get-int\">\n-<h2>get_str() get_bool() get_int()</h2>\n+<p>returns the v2 (truncated) info-hash, if there is one, otherwise\n+returns the v1 info-hash</p>\n+<a name=\"for_each()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:info_hash_t%3A%3A%5Bfor_each%28%29%5D&labels=documentation&body=Documentation+under+heading+%22info_hash_t%3A%3A%5Bfor_each%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"for-each\">\n+<h2>for_each()</h2>\n <pre class=\"literal-block\">\n-int <strong>get_int</strong> (int name) const override;\n-bool <strong>get_bool</strong> (int name) const override;\n-std::string const& <strong>get_str</strong> (int name) const override;\n+template <typename F> void <strong>for_each</strong> (F f) const;\n </pre>\n-<p>queries the current configuration option from the <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.\n-<tt class=\"docutils literal\">name</tt> 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.</p>\n-<a name=\"type_bases\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_bases&labels=documentation&body=Documentation+under+heading+%22enum+type_bases%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-type-bases\">\n-<h2>enum type_bases</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<p>calls the function object <tt class=\"docutils literal\">f</tt> for each hash that is available.\n+starting with v1. The signature of <tt class=\"docutils literal\">F</tt> is:</p>\n+<pre class=\"literal-block\">\n+void(sha1_hash const&, protocol_version);\n+</pre>\n+<a name=\"load_torrent_parsed()\"></a>\n+<a name=\"load_torrent_file()\"></a>\n+<a name=\"load_torrent_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:load_torrent_parsed%28%29+load_torrent_file%28%29+load_torrent_buffer%28%29&labels=documentation&body=Documentation+under+heading+%22load_torrent_parsed%28%29+load_torrent_file%28%29+load_torrent_buffer%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"load-torrent-parsed-load-torrent-file-load-torrent-buffer\">\n+<h1>load_torrent_parsed() load_torrent_file() load_torrent_buffer()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/load_torrent.hpp\">libtorrent/load_torrent.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+add_torrent_params <strong>load_torrent_file</strong> (\n+ std::string const& filename);\n+add_torrent_params <strong>load_torrent_buffer</strong> (\n+ span<char const> buffer, load_torrent_limits const& cfg);\n+add_torrent_params <strong>load_torrent_file</strong> (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params <strong>load_torrent_parsed</strong> (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params <strong>load_torrent_parsed</strong> (\n+ bdecode_node const& torrent_file);\n+add_torrent_params <strong>load_torrent_buffer</strong> (\n+ span<char const> buffer);\n+</pre>\n+<p>These functions load the content of a .torrent file into an\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object.\n+The immutable part of a torrent file (the info-dictionary) is stored in\n+the <tt class=\"docutils literal\">ti</tt> field in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object (as a <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a>\n+object).\n+The returned object is suitable to be:</p>\n+<blockquote>\n+<ul class=\"simple\">\n+<li>added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> via <a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> or <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a></li>\n+<li>saved as a .torrent_file via <a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a></li>\n+<li>turned into a magnet link via <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a></li>\n+</ul>\n+</blockquote>\n+<a name=\"truncate_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:truncate_files%28%29&labels=documentation&body=Documentation+under+heading+%22truncate_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"truncate-files\">\n+<h1>truncate_files()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/truncate.hpp\">libtorrent/truncate.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+void <strong>truncate_files</strong> (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+</pre>\n+<p>Truncates files larger than specified in the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>, saved under\n+the specified save_path.</p>\n+<a name=\"make_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:make_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22make_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"make-magnet-uri\">\n+<h1>make_magnet_uri()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::string <strong>make_magnet_uri</strong> (add_torrent_params const& atp);\n+std::string <strong>make_magnet_uri</strong> (torrent_info const& info);\n+std::string <strong>make_magnet_uri</strong> (torrent_handle const& handle);\n+</pre>\n+<p>Generates a magnet URI from the specified torrent.</p>\n+<p>Several fields from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> objects are recorded in the\n+magnet link. In order to not include them, they have to be cleared before\n+calling <a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a>. These fields are used:</p>\n+<blockquote>\n+<tt class=\"docutils literal\">ti</tt>, <tt class=\"docutils literal\">info_hashes</tt>, <tt class=\"docutils literal\">url_seeds</tt>, <tt class=\"docutils literal\">dht_nodes</tt>,\n+<tt class=\"docutils literal\">file_priorities</tt>, <tt class=\"docutils literal\">trackers</tt>, <tt class=\"docutils literal\">name</tt>, <tt class=\"docutils literal\">peers</tt>.</blockquote>\n+<p>Depending on what the use case for the resulting magnet link is, clearing\n+<tt class=\"docutils literal\">peers</tt> and <tt class=\"docutils literal\">dht_nodes</tt> is probably a good idea if the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n+came from a running torrent. Those lists may be long and be ephemeral.</p>\n+<p>If none of the <tt class=\"docutils literal\">info_hashes</tt> or <tt class=\"docutils literal\">ti</tt> fields are set, there is not\n+info-hash available, and a magnet link cannot be created. In this case\n+<a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a> returns an empty string.</p>\n+<p>The recommended way to generate a magnet link from a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> is to\n+call <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a>, which will post a <a class=\"reference external\" href=\"reference-Alerts.html#save_resume_data_alert\">save_resume_data_alert</a>\n+containing an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. This can then be passed to\n+<a class=\"reference external\" href=\"reference-Core.html#make_magnet_uri()\">make_magnet_uri()</a>.</p>\n+<p>The overload that takes a <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> will make blocking calls to\n+query information about the torrent. If the torrent handle is invalid,\n+an empty string is returned.</p>\n+<p>For more information about magnet links, see <a class=\"reference external\" href=\"manual-ref.html#magnet-links\">magnet links</a>.</p>\n+<a name=\"parse_magnet_uri()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:parse_magnet_uri%28%29&labels=documentation&body=Documentation+under+heading+%22parse_magnet_uri%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"parse-magnet-uri\">\n+<h1>parse_magnet_uri()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/magnet_uri.hpp\">libtorrent/magnet_uri.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+void <strong>parse_magnet_uri</strong> (string_view uri, add_torrent_params& p, error_code& ec);\n+add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri);\n+add_torrent_params <strong>parse_magnet_uri</strong> (string_view uri, error_code& ec);\n+</pre>\n+<p>This function parses out information from the magnet link and populates the\n+<a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. The overload that does not take an\n+<tt class=\"docutils literal\">error_code</tt> reference will throw a system_error on error\n+The overload taking an <tt class=\"docutils literal\">add_torrent_params</tt> reference will fill in the\n+fields specified in the magnet URI.</p>\n+<a name=\"torrent_peer_equal()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_peer_equal%28%29&labels=documentation&body=Documentation+under+heading+%22torrent_peer_equal%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-peer-equal\">\n+<h1>torrent_peer_equal()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_peer.hpp\">libtorrent/torrent_peer.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+inline bool <strong>torrent_peer_equal</strong> (torrent_peer const* lhs, torrent_peer const* rhs);\n+</pre>\n+<a name=\"version()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:version%28%29&labels=documentation&body=Documentation+under+heading+%22version%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"version\">\n+<h1>version()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+char const* <strong>version</strong> ();\n+</pre>\n+<p>returns the libtorrent version as string form in this format:\n+"<major>.<minor>.<tiny>.<tag>"</p>\n+<a name=\"event_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+event_t&labels=documentation&body=Documentation+under+heading+%22enum+event_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-event-t\">\n+<h1>enum event_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/tracker_manager.hpp\">libtorrent/tracker_manager.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"47%\" />\n-<col width=\"18%\" />\n-<col width=\"34%\" />\n+<col width=\"35%\" />\n+<col width=\"23%\" />\n+<col width=\"42%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>string_type_base</td>\n+<tr><td>none</td>\n <td>0</td>\n <td> </td>\n </tr>\n-<tr><td>int_type_base</td>\n-<td>16384</td>\n+<tr><td>completed</td>\n+<td>1</td>\n <td> </td>\n </tr>\n-<tr><td>bool_type_base</td>\n-<td>32768</td>\n+<tr><td>started</td>\n+<td>2</td>\n <td> </td>\n </tr>\n-<tr><td>type_mask</td>\n-<td>49152</td>\n+<tr><td>stopped</td>\n+<td>3</td>\n <td> </td>\n </tr>\n-<tr><td>index_mask</td>\n-<td>16383</td>\n+<tr><td>paused</td>\n+<td>4</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"mmap_write_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+mmap_write_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+mmap_write_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-mmap-write-mode-t\">\n-<h2>enum mmap_write_mode_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"portmap_transport\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+portmap_transport&labels=documentation&body=Documentation+under+heading+%22enum+portmap_transport%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-portmap-transport\">\n+<h1>enum portmap_transport</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/portmap.hpp\">libtorrent/portmap.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"21%\" />\n-<col width=\"8%\" />\n-<col width=\"71%\" />\n+<col width=\"18%\" />\n+<col width=\"16%\" />\n+<col width=\"67%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>always_pwrite</td>\n+<tr><td>natpmp</td>\n <td>0</td>\n-<td>disable writing to disk via mmap, always use normal write calls</td>\n+<td>natpmp can be NAT-PMP or PCP</td>\n </tr>\n-<tr><td>always_mmap_write</td>\n+<tr><td>upnp</td>\n <td>1</td>\n-<td>prefer using memory mapped files for disk writes (at least for\n-large files where it might make sense)</td>\n-</tr>\n-<tr><td>auto_mmap_write</td>\n-<td>2</td>\n-<td>determine whether to use pwrite or memory mapped files for disk\n-writes depending on the kind of storage behind the save path</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"suggest_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+suggest_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+suggest_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-suggest-mode-t\">\n-<h2>enum suggest_mode_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"portmap_protocol\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+portmap_protocol&labels=documentation&body=Documentation+under+heading+%22enum+portmap_protocol%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-portmap-protocol\">\n+<h1>enum portmap_protocol</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/portmap.hpp\">libtorrent/portmap.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"52%\" />\n-<col width=\"17%\" />\n-<col width=\"31%\" />\n+<col width=\"23%\" />\n+<col width=\"27%\" />\n+<col width=\"50%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>no_piece_suggestions</td>\n+<tr><td>none</td>\n <td>0</td>\n <td> </td>\n </tr>\n-<tr><td>suggest_read_cache</td>\n+<tr><td>tcp</td>\n <td>1</td>\n <td> </td>\n </tr>\n-</tbody>\n-</table>\n-<a name=\"choking_algorithm_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+choking_algorithm_t&labels=documentation&body=Documentation+under+heading+%22enum+choking_algorithm_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-choking-algorithm-t\">\n-<h2>enum choking_algorithm_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"28%\" />\n-<col width=\"7%\" />\n-<col width=\"65%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>fixed_slots_choker</td>\n-<td>0</td>\n-<td>This is the traditional choker with a fixed number of unchoke\n-slots (as specified by <a class=\"reference external\" href=\"reference-Settings.html#unchoke_slots_limit\">settings_pack::unchoke_slots_limit</a>).</td>\n-</tr>\n-<tr><td>rate_based_choker</td>\n+<tr><td>udp</td>\n <td>2</td>\n-<td><p class=\"first\">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 <a class=\"reference external\" href=\"reference-Settings.html#rate_choker_initial_threshold\">settings_pack::rate_choker_initial_threshold</a>.</p>\n-<p class=\"last\">For more information, see <a class=\"reference external\" href=\"manual-ref.html#rate-based-choking\">rate based choking</a>.</p>\n-</td>\n-</tr>\n-<tr><td>deprecated_bittyrant_choker</td>\n-<td>3</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"seed_choking_algorithm_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+seed_choking_algorithm_t&labels=documentation&body=Documentation+under+heading+%22enum+seed_choking_algorithm_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-seed-choking-algorithm-t\">\n-<h2>enum seed_choking_algorithm_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"protocol_version\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+protocol_version&labels=documentation&body=Documentation+under+heading+%22enum+protocol_version%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-protocol-version\">\n+<h1>enum protocol_version</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/info_hash.hpp\">libtorrent/info_hash.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"18%\" />\n <col width=\"8%\" />\n-<col width=\"75%\" />\n+<col width=\"10%\" />\n+<col width=\"82%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>round_robin</td>\n+<tr><td>V1</td>\n <td>0</td>\n-<td>which 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.</td>\n+<td>The original BitTorrent version, using SHA-1 hashes</td>\n </tr>\n-<tr><td>fastest_upload</td>\n+<tr><td>V2</td>\n <td>1</td>\n-<td>unchokes the peers we can send to the fastest. This might be a\n-bit more reliable in utilizing all available capacity.</td>\n+<td>Version 2 of the BitTorrent protocol, using SHA-256 hashes</td>\n </tr>\n-<tr><td>anti_leech</td>\n+<tr><td>NUM</td>\n <td>2</td>\n-<td>prioritizes 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.</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"io_buffer_mode_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+io_buffer_mode_t&labels=documentation&body=Documentation+under+heading+%22enum+io_buffer_mode_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-io-buffer-mode-t\">\n-<h2>enum io_buffer_mode_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"socket_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socket_type_t&labels=documentation&body=Documentation+under+heading+%22enum+socket_type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-socket-type-t-1\">\n+<h1>enum socket_type_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socket_type.hpp\">libtorrent/socket_type.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"70%\" />\n-<col width=\"10%\" />\n-<col width=\"19%\" />\n+<col width=\"38%\" />\n+<col width=\"22%\" />\n+<col width=\"41%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>enable_os_cache</td>\n+<tr><td>tcp</td>\n <td>0</td>\n <td> </td>\n </tr>\n-<tr><td>deprecated_disable_os_cache_for_aligned_files</td>\n+<tr><td>socks5</td>\n <td>1</td>\n <td> </td>\n </tr>\n-<tr><td>disable_os_cache</td>\n+<tr><td>http</td>\n <td>2</td>\n <td> </td>\n </tr>\n-<tr><td>write_through</td>\n+<tr><td>utp</td>\n <td>3</td>\n <td> </td>\n </tr>\n-</tbody>\n-</table>\n-<a name=\"bandwidth_mixed_algo_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+bandwidth_mixed_algo_t&labels=documentation&body=Documentation+under+heading+%22enum+bandwidth_mixed_algo_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-bandwidth-mixed-algo-t\">\n-<h2>enum bandwidth_mixed_algo_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"22%\" />\n-<col width=\"8%\" />\n-<col width=\"70%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n+<tr><td>i2p</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>prefer_tcp</td>\n-<td>0</td>\n-<td>disables the mixed mode bandwidth balancing</td>\n+<tr><td>tcp_ssl</td>\n+<td>5</td>\n+<td> </td>\n </tr>\n-<tr><td>peer_proportional</td>\n-<td>1</td>\n-<td>does not throttle uTP, throttles TCP to the same proportion\n-of throughput as there are TCP connections</td>\n+<tr><td>socks5_ssl</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>http_ssl</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>utp_ssl</td>\n+<td>8</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"enc_policy\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+enc_policy&labels=documentation&body=Documentation+under+heading+%22enum+enc_policy%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-enc-policy\">\n-<h2>enum enc_policy</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"connection_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+connection_type&labels=documentation&body=Documentation+under+heading+%22enum+connection_type%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-connection-type\">\n+<h1>enum connection_type</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/peer_connection.hpp\">libtorrent/peer_connection.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"15%\" />\n-<col width=\"8%\" />\n-<col width=\"78%\" />\n+<col width=\"38%\" />\n+<col width=\"22%\" />\n+<col width=\"41%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>pe_forced</td>\n+<tr><td>bittorrent</td>\n <td>0</td>\n-<td>Only 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.</td>\n+<td> </td>\n </tr>\n-<tr><td>pe_enabled</td>\n+<tr><td>url_seed</td>\n <td>1</td>\n-<td>encrypted 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.</td>\n+<td> </td>\n </tr>\n-<tr><td>pe_disabled</td>\n+<tr><td>http_seed</td>\n <td>2</td>\n-<td>only non-encrypted connections are allowed.</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"enc_level\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+enc_level&labels=documentation&body=Documentation+under+heading+%22enum+enc_level%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-enc-level\">\n-<h2>enum enc_level</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"torrent_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_flags_t&labels=documentation&body=Documentation+under+heading+%22torrent_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-flags-t\">\n+<h1>torrent_flags_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_flags.hpp\">libtorrent/torrent_flags.hpp</a>"</p>\n+<a name=\"torrent_flags_t::seed_mode\"></a><dl class=\"docutils\">\n+<dt>seed_mode</dt>\n+<dd><p class=\"first\">If <tt class=\"docutils literal\">seed_mode</tt> 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.</p>\n+<p>Setting <tt class=\"docutils literal\">seed_mode</tt> on a torrent without metadata (a\n+.torrent file) is a no-op and will be ignored.</p>\n+<p class=\"last\">It is not possible to <em>set</em> the <tt class=\"docutils literal\">seed_mode</tt> flag on a torrent after it has\n+been added to a <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. It is possible to <em>clear</em> it though.</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::upload_mode\"></a><dl class=\"docutils\">\n+<dt>upload_mode</dt>\n+<dd><p class=\"first\">If <tt class=\"docutils literal\">upload_mode</tt> 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 <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::optimistic_disk_retry</span></tt>).</p>\n+<p>This mode can be used to avoid race conditions when\n+adjusting priorities of pieces before allowing the torrent to start\n+downloading.</p>\n+<p class=\"last\">If the torrent is auto-managed (<tt class=\"docutils literal\">auto_managed</tt>), 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.</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::share_mode\"></a><dl class=\"docutils\">\n+<dt>share_mode</dt>\n+<dd><p class=\"first\">determines if the torrent should be added in <em>share mode</em> 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.</p>\n+<p>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.</p>\n+<p class=\"last\">The share mode has one setting, the share ratio target, see\n+<tt class=\"docutils literal\"><span class=\"pre\">settings_pack::share_mode_target</span></tt> for more info.</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::apply_ip_filter\"></a><dl class=\"docutils\">\n+<dt>apply_ip_filter</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::paused\"></a><dl class=\"docutils\">\n+<dt>paused</dt>\n+<dd>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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::auto_managed\"></a><dl class=\"docutils\">\n+<dt>auto_managed</dt>\n+<dd><p class=\"first\">If the torrent is auto-managed (<tt class=\"docutils literal\">auto_managed</tt>), 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.</p>\n+<p class=\"last\">If <tt class=\"docutils literal\">auto_managed</tt> 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 <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>.</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::duplicate_is_error\"></a><dl class=\"docutils\">\n+<dt>duplicate_is_error</dt>\n+<dd>used in <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> to indicate that it's an error to attempt\n+to add a torrent that's already in the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. If it's not considered an\n+error, a handle to the existing torrent is returned.\n+This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>, since it is only meant for\n+adding torrents.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::update_subscribe\"></a><dl class=\"docutils\">\n+<dt>update_subscribe</dt>\n+<dd>on by default and means that this torrent will be part of state\n+updates when calling <a class=\"reference external\" href=\"reference-Session.html#post_torrent_updates()\">post_torrent_updates()</a>.\n+This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::super_seeding\"></a><dl class=\"docutils\">\n+<dt>super_seeding</dt>\n+<dd>sets the torrent into super seeding/initial seeding mode. If the torrent\n+is not a seed, this flag has no effect.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::sequential_download\"></a><dl class=\"docutils\">\n+<dt>sequential_download</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#set_piece_deadline()\">set_piece_deadline()</a> instead.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::stop_when_ready\"></a><dl class=\"docutils\">\n+<dt>stop_when_ready</dt>\n+<dd><p class=\"first\">When this flag is set, the torrent will <em>force stop</em> 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.</p>\n+<p><em>Force stopped</em> 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.</p>\n+<p>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.</p>\n+<p>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.</p>\n+<p>The behavior is more robust when setting this flag as part of adding\n+the torrent. See <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>.</p>\n+<p>The stop-when-ready flag fixes the inherent race condition of waiting\n+for the <a class=\"reference external\" href=\"reference-Alerts.html#state_changed_alert\">state_changed_alert</a> and then call <a class=\"reference external\" href=\"reference-Session.html#pause()\">pause()</a>. The download/seeding\n+will most likely start in between posting the <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> and receiving the\n+call to pause.</p>\n+<p class=\"last\">A downloading state is one where peers are being connected. Which means\n+just downloading the metadata via the <tt class=\"docutils literal\">ut_metadata</tt> 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</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::override_trackers\"></a><dl class=\"docutils\">\n+<dt>override_trackers</dt>\n+<dd>when this flag is set, the tracker list in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n+object override any trackers from the torrent file. If the flag is\n+not set, the trackers from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object will be\n+added to the list of trackers used by the torrent.\n+This flag is set by <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n+This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></dd>\n+</dl>\n+<a name=\"torrent_flags_t::override_web_seeds\"></a><dl class=\"docutils\">\n+<dt>override_web_seeds</dt>\n+<dd>If this flag is set, the web seeds from the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a>\n+object will override any web seeds in the torrent file. If it's not\n+set, web seeds in the <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object will be added to the\n+list of web seeds used by the torrent.\n+This flag is set by <a class=\"reference external\" href=\"reference-Resume_Data.html#read_resume_data()\">read_resume_data()</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>.\n+This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a></dd>\n+</dl>\n+<a name=\"torrent_flags_t::need_save_resume\"></a><dl class=\"docutils\">\n+<dt>need_save_resume</dt>\n+<dd><p class=\"first\">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+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a> for details.</p>\n+<p class=\"last\">This flag is cleared by a successful call to <a class=\"reference external\" href=\"reference-Torrent_Handle.html#save_resume_data()\">save_resume_data()</a>\n+This flag is not saved by <a class=\"reference external\" href=\"reference-Resume_Data.html#write_resume_data()\">write_resume_data()</a>, since it represents an\n+ephemeral state of a running torrent.</p>\n+</dd>\n+</dl>\n+<a name=\"torrent_flags_t::disable_dht\"></a><dl class=\"docutils\">\n+<dt>disable_dht</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::disable_lsd\"></a><dl class=\"docutils\">\n+<dt>disable_lsd</dt>\n+<dd>set this flag to disable local service discovery for this torrent.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::disable_pex\"></a><dl class=\"docutils\">\n+<dt>disable_pex</dt>\n+<dd>set this flag to disable peer exchange for this torrent.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::no_verify_files\"></a><dl class=\"docutils\">\n+<dt>no_verify_files</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::default_dont_download\"></a><dl class=\"docutils\">\n+<dt>default_dont_download</dt>\n+<dd>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).</dd>\n+</dl>\n+<a name=\"torrent_flags_t::i2p_torrent\"></a><dl class=\"docutils\">\n+<dt>i2p_torrent</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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 <a class=\"reference external\" href=\"reference-Core.html#parse_magnet_uri()\">parse_magnet_uri()</a> if the tracker list contains such\n+URL.</dd>\n+</dl>\n+<a name=\"torrent_flags_t::all\"></a><dl class=\"docutils\">\n+<dt>all</dt>\n+<dd>all torrent flags combined. Can conveniently be used when creating masks\n+for flags</dd>\n+</dl>\n+<a name=\"int\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:int&labels=documentation&body=Documentation+under+heading+%22int%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"int-1\">\n+<h1>int</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"int::version_major\"></a><dl class=\"docutils\">\n+<dt>version_major</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n+<a name=\"int::version_minor\"></a><dl class=\"docutils\">\n+<dt>version_minor</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n+<a name=\"int::version_tiny\"></a><dl class=\"docutils\">\n+<dt>version_tiny</dt>\n+<dd>the major, minor and tiny versions of libtorrent</dd>\n+</dl>\n+<a name=\"pex_flags_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:pex_flags_t&labels=documentation&body=Documentation+under+heading+%22pex_flags_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"pex-flags-t\">\n+<h1>pex_flags_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/pex_flags.hpp\">libtorrent/pex_flags.hpp</a>"</p>\n+<a name=\"pex_flags_t::pex_encryption\"></a><dl class=\"docutils\">\n+<dt>pex_encryption</dt>\n+<dd>the peer supports protocol encryption</dd>\n+</dl>\n+<a name=\"pex_flags_t::pex_seed\"></a><dl class=\"docutils\">\n+<dt>pex_seed</dt>\n+<dd>the peer is a seed</dd>\n+</dl>\n+<a name=\"pex_flags_t::pex_utp\"></a><dl class=\"docutils\">\n+<dt>pex_utp</dt>\n+<dd>the peer supports the uTP, transport protocol over UDP.</dd>\n+</dl>\n+<a name=\"pex_flags_t::pex_holepunch\"></a><dl class=\"docutils\">\n+<dt>pex_holepunch</dt>\n+<dd>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</dd>\n+</dl>\n+<a name=\"pex_flags_t::pex_lt_v2\"></a><dl class=\"docutils\">\n+<dt>pex_lt_v2</dt>\n+<dd>protocol v2\n+this is not a standard flag, it is only used internally</dd>\n+</dl>\n+<a name=\"char const*\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:char+const%2A&labels=documentation&body=Documentation+under+heading+%22char+const%2A%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"char-const\">\n+<h1>char const*</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"char const*::version_str\"></a><dl class=\"docutils\">\n+<dt>version_str</dt>\n+<dd>the libtorrent version in string form</dd>\n+</dl>\n+<a name=\"std::uint64_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:std%3A%3Auint64_t&labels=documentation&body=Documentation+under+heading+%22std%3A%3Auint64_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"std-uint64-t\">\n+<h1>std::uint64_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/version.hpp\">libtorrent/version.hpp</a>"</p>\n+<a name=\"std::uint64_t::version_revision\"></a><dl class=\"docutils\">\n+<dt>version_revision</dt>\n+<dd>the git commit of this libtorrent version</dd>\n+</dl>\n+<a name=\"download_priority_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:download_priority_t&labels=documentation&body=Documentation+under+heading+%22download_priority_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"download-priority-t\">\n+<h1>download_priority_t</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/download_priority.hpp\">libtorrent/download_priority.hpp</a>"</p>\n+<a name=\"download_priority_t::dont_download\"></a><dl class=\"docutils\">\n+<dt>dont_download</dt>\n+<dd>Don't download the file or piece. Partial pieces may still be downloaded when\n+setting file priorities.</dd>\n+</dl>\n+<a name=\"download_priority_t::default_priority\"></a><dl class=\"docutils\">\n+<dt>default_priority</dt>\n+<dd>The default priority for files and pieces.</dd>\n+</dl>\n+<a name=\"download_priority_t::low_priority\"></a><dl class=\"docutils\">\n+<dt>low_priority</dt>\n+<dd>The lowest priority for files and pieces.</dd>\n+</dl>\n+<a name=\"download_priority_t::top_priority\"></a><dl class=\"docutils\">\n+<dt>top_priority</dt>\n+<dd>The highest priority for files and pieces.</dd>\n+</dl>\n+<a name=\"bdecode_node\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bdecode_node&labels=documentation&body=Documentation+under+heading+%22class+bdecode_node%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bdecode-node\">\n+<h1>bdecode_node</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n+<p>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+<a class=\"reference external\" href=\"reference-Bdecoding.html#non_owning()\">non_owning()</a> member function.</p>\n+<p>There are 5 different types of nodes, see <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>.</p>\n+<pre class=\"literal-block\">\n+struct bdecode_node\n+{\n+ <strong>bdecode_node</strong> () = default;\n+ <strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n+ bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n+ bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n+ <strong>bdecode_node</strong> (bdecode_node const&);\n+ type_t <strong>type</strong> () const noexcept;\n+ explicit operator <strong>bool</strong> () const noexcept;\n+ bdecode_node <strong>non_owning</strong> () const;\n+ std::ptrdiff_t <strong>data_offset</strong> () const noexcept;\n+ span<char const> <strong>data_section</strong> () const noexcept;\n+ bdecode_node <strong>list_at</strong> (int i) const;\n+ string_view <strong>list_string_value_at</strong> (int i\n+ , string_view default_val = string_view()) const;\n+ int <strong>list_size</strong> () const;\n+ std::int64_t <strong>list_int_value_at</strong> (int i\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n+ string_view <strong>dict_find_string_value</strong> (string_view key\n+ , string_view default_value = string_view()) const;\n+ int <strong>dict_size</strong> () const;\n+ bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n+ std::int64_t <strong>dict_find_int_value</strong> (string_view key\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n+ bdecode_node <strong>dict_find</strong> (string_view key) const;\n+ std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n+ std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n+ bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n+ std::int64_t <strong>int_value</strong> () const;\n+ char const* <strong>string_ptr</strong> () const;\n+ std::ptrdiff_t <strong>string_offset</strong> () const;\n+ string_view <strong>string_value</strong> () const;\n+ int <strong>string_length</strong> () const;\n+ void <strong>clear</strong> ();\n+ void <strong>swap</strong> (bdecode_node& n);\n+ void <strong>reserve</strong> (int tokens);\n+ void <strong>switch_underlying_buffer</strong> (char const* buf) noexcept;\n+ bool <strong>has_soft_error</strong> (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+</pre>\n+<a name=\"bdecode_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbdecode_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbdecode_node%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bdecode-node-1\">\n+<h2>bdecode_node()</h2>\n+<pre class=\"literal-block\">\n+<strong>bdecode_node</strong> () = default;\n+</pre>\n+<p>creates a default constructed node, it will have the type <tt class=\"docutils literal\">none_t</tt>.</p>\n+<a name=\"bdecode_node()\"></a>\n+<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbdecode_node%28%29+operator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbdecode_node%28%29+operator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bdecode-node-operator\">\n+<h2>bdecode_node() operator=()</h2>\n+<pre class=\"literal-block\">\n+<strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n+bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n+bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n+<strong>bdecode_node</strong> (bdecode_node const&);\n+</pre>\n+<p>For owning nodes, the copy will create a copy of the tree, but the\n+underlying buffer remains the same.</p>\n+<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"type-2\">\n+<h2>type()</h2>\n+<pre class=\"literal-block\">\n+type_t <strong>type</strong> () const noexcept;\n+</pre>\n+<p>the type of this node. See <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>.</p>\n+<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bool-1\">\n+<h2>bool()</h2>\n+<pre class=\"literal-block\">\n+explicit operator <strong>bool</strong> () const noexcept;\n+</pre>\n+<p>returns true if <a class=\"reference external\" href=\"reference-Bencoding.html#type()\">type()</a> != none_t.</p>\n+<a name=\"non_owning()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bnon_owning%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bnon_owning%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"non-owning\">\n+<h2>non_owning()</h2>\n+<pre class=\"literal-block\">\n+bdecode_node <strong>non_owning</strong> () const;\n+</pre>\n+<p>return a non-owning reference to this node. This is useful to refer to\n+the root node without copying it in assignments.</p>\n+<a name=\"data_section()\"></a>\n+<a name=\"data_offset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdata_section%28%29+data_offset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdata_section%28%29+data_offset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"data-section-data-offset\">\n+<h2>data_section() data_offset()</h2>\n+<pre class=\"literal-block\">\n+std::ptrdiff_t <strong>data_offset</strong> () const noexcept;\n+span<char const> <strong>data_section</strong> () const noexcept;\n+</pre>\n+<p>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 <tt class=\"docutils literal\">d</tt> and ends with <tt class=\"docutils literal\">e</tt>, and has all the content of the\n+dictionary in between.\n+the <tt class=\"docutils literal\">data_offset()</tt> function returns the byte-offset to this node in,\n+starting from the beginning of the buffer that was parsed.</p>\n+<a name=\"list_size()\"></a>\n+<a name=\"list_at()\"></a>\n+<a name=\"list_string_value_at()\"></a>\n+<a name=\"list_int_value_at()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Blist_size%28%29+list_at%28%29+list_string_value_at%28%29+list_int_value_at%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Blist_size%28%29+list_at%28%29+list_string_value_at%28%29+list_int_value_at%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"list-size-list-at-list-string-value-at-list-int-value-at\">\n+<h2>list_size() list_at() list_string_value_at() list_int_value_at()</h2>\n+<pre class=\"literal-block\">\n+bdecode_node <strong>list_at</strong> (int i) const;\n+string_view <strong>list_string_value_at</strong> (int i\n+ , string_view default_val = string_view()) const;\n+int <strong>list_size</strong> () const;\n+std::int64_t <strong>list_int_value_at</strong> (int i\n+ , std::int64_t default_val = 0) const;\n+</pre>\n+<p>functions with the <tt class=\"docutils literal\">list_</tt> prefix operate on lists. These functions are\n+only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">list_t</tt>. <tt class=\"docutils literal\">list_at()</tt> returns the item\n+in the list at index <tt class=\"docutils literal\">i</tt>. <tt class=\"docutils literal\">i</tt> may not be greater than or equal to the\n+size of the list. <tt class=\"docutils literal\">size()</tt> returns the size of the list.</p>\n+<a name=\"dict_at_node()\"></a>\n+<a name=\"dict_find_int()\"></a>\n+<a name=\"dict_find_int_value()\"></a>\n+<a name=\"dict_find_list()\"></a>\n+<a name=\"dict_find()\"></a>\n+<a name=\"dict_at()\"></a>\n+<a name=\"dict_size()\"></a>\n+<a name=\"dict_find_string()\"></a>\n+<a name=\"dict_find_string_value()\"></a>\n+<a name=\"dict_find_dict()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdict_at_node%28%29+dict_find_int%28%29+dict_find_int_value%28%29+dict_find_list%28%29+dict_find%28%29+dict_at%28%29+dict_size%28%29+dict_find_string%28%29+dict_find_string_value%28%29+dict_find_dict%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdict_at_node%28%29+dict_find_int%28%29+dict_find_int_value%28%29+dict_find_list%28%29+dict_find%28%29+dict_at%28%29+dict_size%28%29+dict_find_string%28%29+dict_find_string_value%28%29+dict_find_dict%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dict-at-node-dict-find-int-dict-find-int-value-dict-find-list-dict-find-dict-at-dict-size-dict-find-string-dict-find-string-value-dict-find-dict\">\n+<h2>dict_at_node() dict_find_int() dict_find_int_value() dict_find_list() dict_find() dict_at() dict_size() dict_find_string() dict_find_string_value() dict_find_dict()</h2>\n+<pre class=\"literal-block\">\n+bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n+string_view <strong>dict_find_string_value</strong> (string_view key\n+ , string_view default_value = string_view()) const;\n+int <strong>dict_size</strong> () const;\n+bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n+std::int64_t <strong>dict_find_int_value</strong> (string_view key\n+ , std::int64_t default_val = 0) const;\n+bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n+bdecode_node <strong>dict_find</strong> (string_view key) const;\n+std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n+std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n+bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n+</pre>\n+<p>Functions with the <tt class=\"docutils literal\">dict_</tt> prefix operates on dictionaries. They are\n+only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">dict_t</tt>. 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 <tt class=\"docutils literal\">string_view</tt> instead. <tt class=\"docutils literal\">dict_find_list</tt> will return a\n+valid <tt class=\"docutils literal\">bdecode_node</tt> if the key is found _and_ it is a list. Otherwise\n+it will return a default-constructed <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.</p>\n+<p>Functions with the <tt class=\"docutils literal\">_value</tt> 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).</p>\n+<p><tt class=\"docutils literal\">dict_at()</tt> returns the (key, value)-pair at the specified index in a\n+dictionary. Keys are only allowed to be strings. <tt class=\"docutils literal\">dict_at_node()</tt> also\n+returns the (key, value)-pair, but the key is returned as a\n+<tt class=\"docutils literal\">bdecode_node</tt> (and it will always be a string).</p>\n+<a name=\"int_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bint_value%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bint_value%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"int-value\">\n+<h2>int_value()</h2>\n+<pre class=\"literal-block\">\n+std::int64_t <strong>int_value</strong> () const;\n+</pre>\n+<p>this function is only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">int_t</tt>. It returns the\n+value of the integer.</p>\n+<a name=\"string_offset()\"></a>\n+<a name=\"string_ptr()\"></a>\n+<a name=\"string_value()\"></a>\n+<a name=\"string_length()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bstring_offset%28%29+string_ptr%28%29+string_value%28%29+string_length%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bstring_offset%28%29+string_ptr%28%29+string_value%28%29+string_length%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"string-offset-string-ptr-string-value-string-length\">\n+<h2>string_offset() string_ptr() string_value() string_length()</h2>\n+<pre class=\"literal-block\">\n+char const* <strong>string_ptr</strong> () const;\n+std::ptrdiff_t <strong>string_offset</strong> () const;\n+string_view <strong>string_value</strong> () const;\n+int <strong>string_length</strong> () const;\n+</pre>\n+<p>these functions are only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">string_t</tt>. They return\n+the string values. Note that <tt class=\"docutils literal\">string_ptr()</tt> is <em>not</em> 0-terminated.\n+<tt class=\"docutils literal\">string_length()</tt> returns the number of bytes in the string.\n+<tt class=\"docutils literal\">string_offset()</tt> returns the byte offset from the start of the parsed\n+bencoded buffer this string can be found.</p>\n+<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"clear-2\">\n+<h2>clear()</h2>\n+<pre class=\"literal-block\">\n+void <strong>clear</strong> ();\n+</pre>\n+<p>resets the <tt class=\"docutils literal\">bdecoded_node</tt> to a default constructed state. If this is\n+an owning node, the tree is freed and all child nodes are invalidated.</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap-3\">\n+<h2>swap()</h2>\n+<pre class=\"literal-block\">\n+void <strong>swap</strong> (bdecode_node& n);\n+</pre>\n+<p>Swap contents.</p>\n+<a name=\"reserve()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Breserve%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Breserve%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"reserve-1\">\n+<h2>reserve()</h2>\n+<pre class=\"literal-block\">\n+void <strong>reserve</strong> (int tokens);\n+</pre>\n+<p>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 <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>.</p>\n+<a name=\"switch_underlying_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bswitch_underlying_buffer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bswitch_underlying_buffer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"switch-underlying-buffer\">\n+<h2>switch_underlying_buffer()</h2>\n+<pre class=\"literal-block\">\n+void <strong>switch_underlying_buffer</strong> (char const* buf) noexcept;\n+</pre>\n+<p>this buffer <em>MUST</em> 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().</p>\n+<a name=\"has_soft_error()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bhas_soft_error%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bhas_soft_error%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"has-soft-error\">\n+<h2>has_soft_error()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>has_soft_error</strong> (span<char> error) const;\n+</pre>\n+<p>returns true if there is a non-fatal error in the bencoding of this node\n+or its children</p>\n+<a name=\"type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_t&labels=documentation&body=Documentation+under+heading+%22enum+type_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-type-t-1\">\n+<h2>enum type_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"26%\" />\n <col width=\"13%\" />\n-<col width=\"60%\" />\n+<col width=\"9%\" />\n+<col width=\"78%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>pe_plaintext</td>\n+<tr><td>none_t</td>\n+<td>0</td>\n+<td>uninitialized or default constructed. This is also used\n+to indicate that a node was not found in some cases.</td>\n+</tr>\n+<tr><td>dict_t</td>\n <td>1</td>\n-<td>use only plain text encryption</td>\n+<td>a dictionary node. The <tt class=\"docutils literal\">dict_find_</tt> functions are valid.</td>\n </tr>\n-<tr><td>pe_rc4</td>\n+<tr><td>list_t</td>\n <td>2</td>\n-<td>use only RC4 encryption</td>\n+<td>a list node. The <tt class=\"docutils literal\">list_</tt> functions are valid.</td>\n </tr>\n-<tr><td>pe_both</td>\n+<tr><td>string_t</td>\n <td>3</td>\n-<td>allow both</td>\n+<td>a string node, the <tt class=\"docutils literal\">string_</tt> functions are valid.</td>\n+</tr>\n+<tr><td>int_t</td>\n+<td>4</td>\n+<td>an integer node. The <tt class=\"docutils literal\">int_</tt> functions are valid.</td>\n </tr>\n </tbody>\n </table>\n-<a name=\"proxy_type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+proxy_type_t&labels=documentation&body=Documentation+under+heading+%22enum+proxy_type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-proxy-type-t\">\n-<h2>enum proxy_type_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"print_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:print_entry%28%29&labels=documentation&body=Documentation+under+heading+%22print_entry%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"print-entry\">\n+<h1>print_entry()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+std::string <strong>print_entry</strong> (bdecode_node const& e\n+ , bool single_line = false, int indent = 0);\n+</pre>\n+<p>print the bencoded structure in a human-readable format to a string\n+that's returned.</p>\n+<a name=\"bdecode()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode%28%29&labels=documentation&body=Documentation+under+heading+%22bdecode%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"bdecode\">\n+<h1>bdecode()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+int <strong>bdecode</strong> (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 <strong>bdecode</strong> (span<char const> buffer\n+ , int depth_limit = 100, int token_limit = 2000000);\n+bdecode_node <strong>bdecode</strong> (span<char const> buffer\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+</pre>\n+<p>This function decodes/parses bdecoded data (for example a .torrent file).\n+The data structure is returned in the <tt class=\"docutils literal\">ret</tt> argument. the buffer to parse\n+is specified by the <tt class=\"docutils literal\">start</tt> of the buffer as well as the <tt class=\"docutils literal\">end</tt>, 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 <tt class=\"docutils literal\">ec</tt> with the error code. The optional\n+argument <tt class=\"docutils literal\">error_pos</tt>, if set to non-nullptr, will be set to the byte offset\n+into the buffer where the parse failure occurred.</p>\n+<p><tt class=\"docutils literal\">depth_limit</tt> 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).</p>\n+<p><tt class=\"docutils literal\">token_limit</tt> 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.</p>\n+<p>The resulting <tt class=\"docutils literal\">bdecode_node</tt> is an <em>owning</em> node. That means it will\n+be holding the whole parsed tree. When iterating lists and dictionaries,\n+those <tt class=\"docutils literal\">bdecode_node</tt> objects will simply have references to the root or\n+owning <tt class=\"docutils literal\">bdecode_node</tt>. If the root node is destructed, all other nodes\n+that refer to anything in that tree become invalid.</p>\n+<p>However, the underlying buffer passed in to this function (<tt class=\"docutils literal\">start</tt>, <tt class=\"docutils literal\">end</tt>)\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.</p>\n+<a name=\"torrent_status\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+torrent_status&labels=documentation&body=Documentation+under+heading+%22class+torrent_status%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"torrent-status\">\n+<h1>torrent_status</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_status.hpp\">libtorrent/torrent_status.hpp</a>"</p>\n+<p>holds a snapshot of the status of a torrent, as queried by\n+<a class=\"reference external\" href=\"reference-Torrent_Handle.html#status()\">torrent_handle::status()</a>.</p>\n+<pre class=\"literal-block\">\n+struct torrent_status\n+{\n+ bool <strong>operator==</strong> (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 <strong>error_file</strong> = torrent_status::error_file_none;\n+ static constexpr file_index_t <strong>error_file_none</strong> {-1};\n+ static constexpr file_index_t <strong>error_file_ssl_ctx</strong> {-3};\n+ static constexpr file_index_t <strong>error_file_metadata</strong> {-4};\n+ static constexpr file_index_t <strong>error_file_exception</strong> {-5};\n+ static constexpr file_index_t <strong>error_file_partfile</strong> {-6};\n+ std::string save_path;\n+ std::string name;\n+ std::weak_ptr<const torrent_info> torrent_file;\n+ time_duration <strong>next_announce</strong> = seconds{0};\n+ std::string current_tracker;\n+ std::int64_t <strong>total_download</strong> = 0;\n+ std::int64_t <strong>total_upload</strong> = 0;\n+ std::int64_t <strong>total_payload_download</strong> = 0;\n+ std::int64_t <strong>total_payload_upload</strong> = 0;\n+ std::int64_t <strong>total_failed_bytes</strong> = 0;\n+ std::int64_t <strong>total_redundant_bytes</strong> = 0;\n+ typed_bitfield<piece_index_t> pieces;\n+ typed_bitfield<piece_index_t> verified_pieces;\n+ std::int64_t <strong>total_done</strong> = 0;\n+ std::int64_t <strong>total</strong> = 0;\n+ std::int64_t <strong>total_wanted_done</strong> = 0;\n+ std::int64_t <strong>total_wanted</strong> = 0;\n+ std::int64_t <strong>all_time_upload</strong> = 0;\n+ std::int64_t <strong>all_time_download</strong> = 0;\n+ std::time_t <strong>added_time</strong> = 0;\n+ std::time_t <strong>completed_time</strong> = 0;\n+ std::time_t <strong>last_seen_complete</strong> = 0;\n+ storage_mode_t <strong>storage_mode</strong> = storage_mode_sparse;\n+ float <strong>progress</strong> = 0.f;\n+ int <strong>progress_ppm</strong> = 0;\n+ queue_position_t <strong>queue_position</strong> {};\n+ int <strong>download_rate</strong> = 0;\n+ int <strong>upload_rate</strong> = 0;\n+ int <strong>download_payload_rate</strong> = 0;\n+ int <strong>upload_payload_rate</strong> = 0;\n+ int <strong>num_seeds</strong> = 0;\n+ int <strong>num_peers</strong> = 0;\n+ int <strong>num_complete</strong> = -1;\n+ int <strong>num_incomplete</strong> = -1;\n+ int <strong>list_seeds</strong> = 0;\n+ int <strong>list_peers</strong> = 0;\n+ int <strong>connect_candidates</strong> = 0;\n+ int <strong>num_pieces</strong> = 0;\n+ int <strong>distributed_full_copies</strong> = 0;\n+ int <strong>distributed_fraction</strong> = 0;\n+ float <strong>distributed_copies</strong> = 0.f;\n+ int <strong>block_size</strong> = 0;\n+ int <strong>num_uploads</strong> = 0;\n+ int <strong>num_connections</strong> = 0;\n+ int <strong>uploads_limit</strong> = 0;\n+ int <strong>connections_limit</strong> = 0;\n+ int <strong>up_bandwidth_queue</strong> = 0;\n+ int <strong>down_bandwidth_queue</strong> = 0;\n+ int <strong>seed_rank</strong> = 0;\n+ state_t <strong>state</strong> = checking_resume_data;\n+ bool <strong>need_save_resume</strong> = false;\n+ bool <strong>is_seeding</strong> = false;\n+ bool <strong>is_finished</strong> = false;\n+ bool <strong>has_metadata</strong> = false;\n+ bool <strong>has_incoming</strong> = false;\n+ bool <strong>moving_storage</strong> = false;\n+ bool <strong>announcing_to_trackers</strong> = false;\n+ bool <strong>announcing_to_lsd</strong> = false;\n+ bool <strong>announcing_to_dht</strong> = 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 <strong>flags</strong> {};\n+};\n+</pre>\n+<a name=\"operator==()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Boperator%3D%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Boperator%3D%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"operator-3\">\n+<h2>operator==()</h2>\n+<pre class=\"literal-block\">\n+bool <strong>operator==</strong> (torrent_status const& st) const;\n+</pre>\n+<p>compares if the torrent status objects come from the same torrent. i.e.\n+only the <a class=\"reference external\" href=\"reference-Torrent_Handle.html#torrent_handle\">torrent_handle</a> field is compared.</p>\n+<a name=\"state_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+state_t&labels=documentation&body=Documentation+under+heading+%22enum+state_t%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-state-t\">\n+<h2>enum state_t</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/torrent_status.hpp\">libtorrent/torrent_status.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"11%\" />\n-<col width=\"7%\" />\n-<col width=\"81%\" />\n+<col width=\"44%\" />\n+<col width=\"6%\" />\n+<col width=\"50%\" />\n </colgroup>\n <thead valign=\"bottom\">\n <tr><th class=\"head\">name</th>\n <th class=\"head\">value</th>\n <th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>none</td>\n-<td>0</td>\n-<td>No proxy server is used and all other fields are ignored.</td>\n-</tr>\n-<tr><td>socks4</td>\n+<tr><td>checking_files</td>\n <td>1</td>\n-<td>The server is assumed to be a <a class=\"reference external\" href=\"http://www.ufasoft.com/doc/socks4_protocol.htm\">SOCKS4 server</a> that requires a\n-username.</td>\n+<td>The torrent has not started its download yet, and is\n+currently checking existing files.</td>\n </tr>\n-<tr><td>socks5</td>\n+<tr><td>downloading_metadata</td>\n <td>2</td>\n-<td>The server is assumed to be a SOCKS5 server (<a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc1928.html\">RFC 1928</a>) that does\n-not require any authentication. The username and password are\n-ignored.</td>\n+<td>The torrent is trying to download metadata from peers.\n+This implies the ut_metadata extension is in use.</td>\n </tr>\n-<tr><td>socks5_pw</td>\n+<tr><td>downloading</td>\n <td>3</td>\n-<td>The server is assumed to be a SOCKS5 server that supports plain\n-text username and password authentication (<a class=\"reference external\" href=\"http://www.faqs.org/rfcs/rfc1929.html\">RFC 1929</a>). The\n-username and password specified may be sent to the proxy if it\n-requires.</td>\n+<td>The torrent is being downloaded. This is the state\n+most torrents will be in most of the time. The progress\n+meter will tell how much of the files that has been\n+downloaded.</td>\n </tr>\n-<tr><td>http</td>\n+<tr><td>finished</td>\n <td>4</td>\n-<td>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 <a class=\"reference external\" href=\"http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01\">CONNECT</a> 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.</td>\n+<td>In this state the torrent has finished downloading but\n+still doesn't have the entire torrent. i.e. some pieces\n+are filtered and won't get downloaded.</td>\n </tr>\n-<tr><td>http_pw</td>\n+<tr><td>seeding</td>\n <td>5</td>\n-<td>The server is assumed to be an HTTP proxy that requires user\n-authorization. The username and password will be sent to the proxy.</td>\n+<td>In this state the torrent has finished downloading and\n+is a pure seeder.</td>\n+</tr>\n+<tr><td>unused_enum_for_backwards_compatibility_allocating</td>\n+<td>6</td>\n+<td>If the torrent was started in full allocation mode, this\n+indicates that the (disk) storage for the torrent is\n+allocated.</td>\n+</tr>\n+<tr><td>checking_resume_data</td>\n+<td>7</td>\n+<td>The torrent is currently checking the fast resume data and\n+comparing it to the files on disk. This is typically\n+completed in a fraction of a second, but if you add a\n+large number of torrents at once, they will queue up.</td>\n </tr>\n </tbody>\n </table>\n-<a name=\"min_memory_usage()\"></a>\n-<a name=\"high_performance_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:min_memory_usage%28%29+high_performance_seed%28%29&labels=documentation&body=Documentation+under+heading+%22min_memory_usage%28%29+high_performance_seed%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"handle\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhandle%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhandle%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>handle</dt>\n+<dd>a handle to the torrent whose status the object represents.</dd>\n+</dl>\n+<a name=\"errc\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berrc%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berrc%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>errc</dt>\n+<dd>may be set to an error code describing why the torrent was paused, in\n+case it was paused by an error. If the torrent is not paused or if it's\n+paused but not because of an error, this error_code is not set.\n+if the error is attributed specifically to a file, error_file is set to\n+the index of that file in the .torrent file.</dd>\n+</dl>\n+<a name=\"error_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file</dt>\n+<dd>if the torrent is stopped because of an disk I/O error, this field\n+contains the index of the file in the torrent that encountered the\n+error. If the error did not originate in a file in the torrent, there\n+are a few special values this can be set to: error_file_none,\n+error_file_ssl_ctx, error_file_exception, error_file_partfile or\n+error_file_metadata;</dd>\n+</dl>\n+<a name=\"error_file_none\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_none%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_none%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file_none</dt>\n+<dd>special values for error_file to describe which file or component\n+encountered the error (<tt class=\"docutils literal\">errc</tt>).\n+the error did not occur on a file</dd>\n+</dl>\n+<a name=\"error_file_ssl_ctx\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_ssl_ctx%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_ssl_ctx%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file_ssl_ctx</dt>\n+<dd>the error occurred setting up the SSL context</dd>\n+</dl>\n+<a name=\"error_file_metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_metadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_metadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file_metadata</dt>\n+<dd>the error occurred while loading the metadata for the torrent</dd>\n+</dl>\n+<a name=\"error_file_exception\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_exception%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_exception%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file_exception</dt>\n+<dd>there was a serious error reported in this torrent. The error code\n+or a torrent log <a class=\"reference external\" href=\"reference-Alerts.html#alert\">alert</a> may provide more information.</dd>\n+</dl>\n+<a name=\"error_file_partfile\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Berror_file_partfile%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Berror_file_partfile%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>error_file_partfile</dt>\n+<dd>the error occurred with the partfile</dd>\n+</dl>\n+<a name=\"save_path\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bsave_path%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bsave_path%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>save_path</dt>\n+<dd>the path to the directory where this torrent's files are stored.\n+It's typically the path as was given to <a class=\"reference external\" href=\"reference-Session.html#async_add_torrent()\">async_add_torrent()</a> or\n+<a class=\"reference external\" href=\"reference-Session.html#add_torrent()\">add_torrent()</a> when this torrent was started. This field is only\n+included if the torrent status is queried with\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_save_path</span></tt>.</dd>\n+</dl>\n+<a name=\"name\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bname%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>name</dt>\n+<dd>the name of the torrent. Typically this is derived from the\n+.torrent file. In case the torrent was started without metadata,\n+and hasn't completely received it yet, it returns the name given\n+to it when added to the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. See <tt class=\"docutils literal\"><span class=\"pre\">session::add_torrent</span></tt>.\n+This field is only included if the torrent status is queried\n+with <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_name</span></tt>.</dd>\n+</dl>\n+<a name=\"torrent_file\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btorrent_file%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btorrent_file%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>torrent_file</dt>\n+<dd>set to point to the <tt class=\"docutils literal\">torrent_info</tt> object for this torrent. It's\n+only included if the torrent status is queried with\n+<tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::query_torrent_file</span></tt>.</dd>\n+</dl>\n+<a name=\"next_announce\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnext_announce%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnext_announce%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>next_announce</dt>\n+<dd>the time until the torrent will announce itself to the tracker.</dd>\n+</dl>\n+<a name=\"current_tracker\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bcurrent_tracker%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bcurrent_tracker%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>current_tracker</dt>\n+<dd>the URL of the last working tracker. If no tracker request has\n+been successful yet, it's set to an empty string.</dd>\n+</dl>\n+<a name=\"total_download\"></a>\n+<a name=\"total_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_download+total_upload%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_download+total_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_download total_upload</dt>\n+<dd>the number of bytes downloaded and uploaded to all peers, accumulated,\n+<em>this session</em> only. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is considered to restart when a\n+torrent is paused and restarted again. When a torrent is paused, these\n+<a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are reset to 0. If you want complete, persistent, stats, see\n+<tt class=\"docutils literal\">all_time_upload</tt> and <tt class=\"docutils literal\">all_time_download</tt>.</dd>\n+</dl>\n+<a name=\"total_payload_download\"></a>\n+<a name=\"total_payload_upload\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_payload_download+total_payload_upload%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_payload_download+total_payload_upload%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_payload_download total_payload_upload</dt>\n+<dd>counts the amount of bytes send and received this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>, but only\n+the actual payload data (i.e the interesting data), these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>\n+ignore any protocol overhead. The <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> is considered to restart\n+when a torrent is paused and restarted again. When a torrent is\n+paused, these <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> are reset to 0.</dd>\n+</dl>\n+<a name=\"total_failed_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_failed_bytes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_failed_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_failed_bytes</dt>\n+<dd>the number of bytes that has been downloaded and that has failed the\n+piece hash test. In other words, this is just how much crap that has\n+been downloaded since the torrent was last started. If a torrent is\n+paused and then restarted again, this counter will be reset.</dd>\n+</dl>\n+<a name=\"total_redundant_bytes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_redundant_bytes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_redundant_bytes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_redundant_bytes</dt>\n+<dd>the number of bytes that has been downloaded even though that data\n+already was downloaded. The reason for this is that in some situations\n+the same data can be downloaded by mistake. When libtorrent sends\n+requests to a peer, and the peer doesn't send a response within a\n+certain timeout, libtorrent will re-request that block. Another\n+situation when libtorrent may re-request blocks is when the requests\n+it sends out are not replied in FIFO-order (it will re-request blocks\n+that are skipped by an out of order block). This is supposed to be as\n+low as possible. This only counts bytes since the torrent was last\n+started. If a torrent is paused and then restarted again, this counter\n+will be reset.</dd>\n+</dl>\n+<a name=\"pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bpieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bpieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>pieces</dt>\n+<dd>a bitmask that represents which pieces we have (set to true) and the\n+pieces we don't have. It's a pointer and may be set to 0 if the\n+torrent isn't downloading or seeding.</dd>\n+</dl>\n+<a name=\"verified_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bverified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bverified_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>verified_pieces</dt>\n+<dd>a bitmask representing which pieces has had their hash checked. This\n+only applies to torrents in <em>seed mode</em>. If the torrent is not in seed\n+mode, this bitmask may be empty.</dd>\n+</dl>\n+<a name=\"total_done\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_done%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_done%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_done</dt>\n+<dd>the total number of bytes of the file(s) that we have. All this does\n+not necessarily has to be downloaded during this <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> (that's\n+<tt class=\"docutils literal\">total_payload_download</tt>).</dd>\n+</dl>\n+<a name=\"total\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total</dt>\n+<dd>the total number of bytes to download for this torrent. This\n+may be less than the size of the torrent in case there are\n+pad files. This number only counts bytes that will actually\n+be requested from peers.</dd>\n+</dl>\n+<a name=\"total_wanted_done\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_wanted_done%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_wanted_done%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_wanted_done</dt>\n+<dd>the number of bytes we have downloaded, only counting the pieces that\n+we actually want to download. i.e. excluding any pieces that we have\n+but have priority 0 (i.e. not wanted).\n+Once a torrent becomes seed, any piece- and file priorities are\n+forgotten and all bytes are considered "wanted".</dd>\n+</dl>\n+<a name=\"total_wanted\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Btotal_wanted%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Btotal_wanted%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>total_wanted</dt>\n+<dd>The total number of bytes we want to download. This may be smaller\n+than the total torrent size in case any pieces are prioritized to 0,\n+i.e. not wanted.\n+Once a torrent becomes seed, any piece- and file priorities are\n+forgotten and all bytes are considered "wanted".</dd>\n+</dl>\n+<a name=\"all_time_upload\"></a>\n+<a name=\"all_time_download\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Ball_time_upload+all_time_download%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Ball_time_upload+all_time_download%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>all_time_upload all_time_download</dt>\n+<dd>are accumulated upload and download payload byte <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a>. They are\n+saved in and restored from resume data to keep totals across sessions.</dd>\n+</dl>\n+<a name=\"added_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Badded_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Badded_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>added_time</dt>\n+<dd>the posix-time when this torrent was added. i.e. what <tt class=\"docutils literal\">time(nullptr)</tt>\n+returned at the time.</dd>\n+</dl>\n+<a name=\"completed_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bcompleted_time%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bcompleted_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>completed_time</dt>\n+<dd>the posix-time when this torrent was finished. If the torrent is not\n+yet finished, this is 0.</dd>\n+</dl>\n+<a name=\"last_seen_complete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blast_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blast_seen_complete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_seen_complete</dt>\n+<dd>the time when we, or one of our peers, last saw a complete copy of\n+this torrent.</dd>\n+</dl>\n+<a name=\"storage_mode\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bstorage_mode%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bstorage_mode%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>storage_mode</dt>\n+<dd>The allocation mode for the torrent. See <a class=\"reference external\" href=\"reference-Storage.html#storage_mode_t\">storage_mode_t</a> for the\n+options. For more information, see <a class=\"reference external\" href=\"manual-ref.html#storage-allocation\">storage allocation</a>.</dd>\n+</dl>\n+<a name=\"progress\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bprogress%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bprogress%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>progress</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"progress_ppm\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bprogress_ppm%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bprogress_ppm%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>progress_ppm</dt>\n+<dd><p class=\"first\">progress parts per million (progress * 1000000) when disabling\n+floating point operations, this is the only option to query progress</p>\n+<p class=\"last\">reflects the same value as <tt class=\"docutils literal\">progress</tt>, but instead in a range [0,\n+1000000] (ppm = parts per million). When floating point operations are\n+disabled, this is the only alternative to the floating point value in\n+progress.</p>\n+</dd>\n+</dl>\n+<a name=\"queue_position\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bqueue_position%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bqueue_position%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>queue_position</dt>\n+<dd>the position this torrent has in the download\n+queue. If the torrent is a seed or finished, this is -1.</dd>\n+</dl>\n+<a name=\"download_rate\"></a>\n+<a name=\"upload_rate\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdownload_rate+upload_rate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdownload_rate+upload_rate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>download_rate upload_rate</dt>\n+<dd>the total rates for all peers for this torrent. These will usually\n+have better precision than summing the rates from all peers. The rates\n+are given as the number of bytes per second.</dd>\n+</dl>\n+<a name=\"download_payload_rate\"></a>\n+<a name=\"upload_payload_rate\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdownload_payload_rate+upload_payload_rate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdownload_payload_rate+upload_payload_rate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>download_payload_rate upload_payload_rate</dt>\n+<dd>the total transfer rate of payload only, not counting protocol\n+chatter. This might be slightly smaller than the other rates, but if\n+projected over a long time (e.g. when calculating ETA:s) the\n+difference may be noticeable.</dd>\n+</dl>\n+<a name=\"num_seeds\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_seeds%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_seeds%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_seeds</dt>\n+<dd>the number of peers that are seeding that this client is\n+currently connected to.</dd>\n+</dl>\n+<a name=\"num_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_peers%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_peers</dt>\n+<dd>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 <a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_peer_info()\">get_peer_info()</a>.</dd>\n+</dl>\n+<a name=\"num_complete\"></a>\n+<a name=\"num_incomplete\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_complete+num_incomplete%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_complete num_incomplete</dt>\n+<dd>if the tracker sends scrape info in its announce reply, these fields\n+will be set to the total number of peers that have the whole file and\n+the total number of peers that are still downloading. set to -1 if the\n+tracker did not send any scrape data in its announce reply.</dd>\n+</dl>\n+<a name=\"list_seeds\"></a>\n+<a name=\"list_peers\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blist_seeds+list_peers%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blist_seeds+list_peers%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>list_seeds list_peers</dt>\n+<dd>the number of seeds in our peer list and the total number of peers\n+(including seeds). We are not necessarily connected to all the peers\n+in our peer list. This is the number of peers we know of in total,\n+including banned peers and peers that we have failed to connect to.</dd>\n+</dl>\n+<a name=\"connect_candidates\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bconnect_candidates%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bconnect_candidates%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>connect_candidates</dt>\n+<dd>the number of peers in this torrent's peer list that is a candidate to\n+be connected to. i.e. It has fewer connect attempts than the max fail\n+count, it is not a seed if we are a seed, it is not banned etc. If\n+this is 0, it means we don't know of any more peers that we can try.</dd>\n+</dl>\n+<a name=\"num_pieces\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_pieces%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_pieces%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_pieces</dt>\n+<dd>the number of pieces that has been downloaded. It is equivalent to:\n+<tt class=\"docutils literal\"><span class=\"pre\">std::accumulate(pieces->begin(),</span> <span class=\"pre\">pieces->end())</span></tt>. So you don't have\n+to count yourself. This can be used to see if anything has updated\n+since last time if you want to keep a graph of the pieces up to date.\n+Note that these pieces have not necessarily been written to disk yet,\n+and there is a risk the write to disk will fail.</dd>\n+</dl>\n+<a name=\"distributed_full_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_full_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_full_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>distributed_full_copies</dt>\n+<dd>the number of distributed copies of the torrent. Note that one copy\n+may be spread out among many peers. It tells how many copies there are\n+currently of the rarest piece(s) among the peers this client is\n+connected to.</dd>\n+</dl>\n+<a name=\"distributed_fraction\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_fraction%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_fraction%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>distributed_fraction</dt>\n+<dd><p class=\"first\">tells the share of pieces that have more copies than the rarest\n+piece(s). Divide this number by 1000 to get the fraction.</p>\n+<p>For example, if <tt class=\"docutils literal\">distributed_full_copies</tt> is 2 and\n+<tt class=\"docutils literal\">distributed_fraction</tt> is 500, it means that the rarest pieces have\n+only 2 copies among the peers this torrent is connected to, and that\n+50% of all the pieces have more than two copies.</p>\n+<p class=\"last\">If we are a seed, the piece picker is deallocated as an optimization,\n+and piece availability is no longer tracked. In this case the\n+distributed copies members are set to -1.</p>\n+</dd>\n+</dl>\n+<a name=\"distributed_copies\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bdistributed_copies%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bdistributed_copies%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>distributed_copies</dt>\n+<dd><p class=\"first\">the number of distributed copies of the file. note that one copy may\n+be spread out among many peers. This is a floating point\n+representation of the distributed copies.</p>\n+<dl class=\"last docutils\">\n+<dt>the integer part tells how many copies</dt>\n+<dd>there are of the rarest piece(s)</dd>\n+<dt>the fractional part tells the fraction of pieces that</dt>\n+<dd>have more copies than the rarest piece(s).</dd>\n+</dl>\n+</dd>\n+</dl>\n+<a name=\"block_size\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bblock_size%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bblock_size%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>block_size</dt>\n+<dd>the size of a block, in bytes. A block is a sub piece, it is the\n+number of bytes that each piece request asks for and the number of\n+bytes that each bit in the <tt class=\"docutils literal\">partial_piece_info</tt>'s bitset represents,\n+see <a class=\"reference external\" href=\"reference-Torrent_Handle.html#get_download_queue()\">get_download_queue()</a>. This is typically 16 kB, but it may be\n+smaller, if the pieces are smaller.</dd>\n+</dl>\n+<a name=\"num_uploads\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_uploads%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_uploads%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_uploads</dt>\n+<dd>the number of unchoked peers in this torrent.</dd>\n+</dl>\n+<a name=\"num_connections\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bnum_connections%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bnum_connections%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>num_connections</dt>\n+<dd>the number of peer connections this torrent has, including half-open\n+connections that hasn't completed the bittorrent handshake yet. This\n+is always >= <tt class=\"docutils literal\">num_peers</tt>.</dd>\n+</dl>\n+<a name=\"uploads_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Buploads_limit%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Buploads_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>uploads_limit</dt>\n+<dd>the set limit of upload slots (unchoked peers) for this torrent.</dd>\n+</dl>\n+<a name=\"connections_limit\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bconnections_limit%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bconnections_limit%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>connections_limit</dt>\n+<dd>the set limit of number of connections for this torrent.</dd>\n+</dl>\n+<a name=\"up_bandwidth_queue\"></a>\n+<a name=\"down_bandwidth_queue\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bup_bandwidth_queue+down_bandwidth_queue%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bup_bandwidth_queue+down_bandwidth_queue%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>up_bandwidth_queue down_bandwidth_queue</dt>\n+<dd>the number of peers in this torrent that are waiting for more\n+bandwidth quota from the torrent rate limiter. This can determine if\n+the rate you get from this torrent is bound by the torrents limit or\n+not. If there is no limit set on this torrent, the peers might still\n+be waiting for bandwidth quota from the global limiter, but then they\n+are counted in the <tt class=\"docutils literal\">session_status</tt> object.</dd>\n+</dl>\n+<a name=\"seed_rank\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bseed_rank%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bseed_rank%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>seed_rank</dt>\n+<dd>A rank of how important it is to seed the torrent, it is used to\n+determine which torrents to seed and which to queue. It is based on\n+the peer to seed ratio from the tracker scrape. For more information,\n+see <a class=\"reference external\" href=\"manual-ref.html#queuing\">queuing</a>. Higher value means more important to seed</dd>\n+</dl>\n+<a name=\"state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bstate%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bstate%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>state</dt>\n+<dd>the main state the torrent is in. See <a class=\"reference external\" href=\"reference-Torrent_Status.html#state_t\">torrent_status::state_t</a>.</dd>\n+</dl>\n+<a name=\"need_save_resume\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bneed_save_resume%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bneed_save_resume%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>need_save_resume</dt>\n+<dd>true if this torrent has unsaved changes\n+to its download state and statistics since the last resume data\n+was saved.</dd>\n+</dl>\n+<a name=\"is_seeding\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bis_seeding%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bis_seeding%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>is_seeding</dt>\n+<dd>true if all pieces have been downloaded.</dd>\n+</dl>\n+<a name=\"is_finished\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bis_finished%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bis_finished%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>is_finished</dt>\n+<dd>true if all pieces that have a priority > 0 are downloaded. There is\n+only a distinction between finished and seeding if some pieces or\n+files have been set to priority 0, i.e. are not downloaded.</dd>\n+</dl>\n+<a name=\"has_metadata\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhas_metadata%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhas_metadata%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>has_metadata</dt>\n+<dd>true if this torrent has metadata (either it was started from a\n+.torrent file or the metadata has been downloaded). The only scenario\n+where this can be false is when the torrent was started torrent-less\n+(i.e. with just an info-hash and tracker ip, a magnet link for\n+instance).</dd>\n+</dl>\n+<a name=\"has_incoming\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bhas_incoming%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bhas_incoming%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>has_incoming</dt>\n+<dd>true if there has ever been an incoming connection attempt to this\n+torrent.</dd>\n+</dl>\n+<a name=\"moving_storage\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bmoving_storage%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bmoving_storage%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>moving_storage</dt>\n+<dd>this is true if this torrent's storage is currently being moved from\n+one location to another. This may potentially be a long operation\n+if a large file ends up being copied from one drive to another.</dd>\n+</dl>\n+<a name=\"announcing_to_trackers\"></a>\n+<a name=\"announcing_to_lsd\"></a>\n+<a name=\"announcing_to_dht\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bannouncing_to_trackers+announcing_to_lsd+announcing_to_dht%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bannouncing_to_trackers+announcing_to_lsd+announcing_to_dht%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>announcing_to_trackers announcing_to_lsd announcing_to_dht</dt>\n+<dd>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.</dd>\n+</dl>\n+<a name=\"info_hashes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Binfo_hashes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>info_hashes</dt>\n+<dd>the info-hash for this torrent</dd>\n+</dl>\n+<a name=\"last_upload\"></a>\n+<a name=\"last_download\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Blast_upload+last_download%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Blast_upload+last_download%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>last_upload last_download</dt>\n+<dd>the timestamps of the last time this torrent uploaded or downloaded\n+payload to any peer.</dd>\n+</dl>\n+<a name=\"active_duration\"></a>\n+<a name=\"finished_duration\"></a>\n+<a name=\"seeding_duration\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bactive_duration+finished_duration+seeding_duration%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bactive_duration+finished_duration+seeding_duration%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>active_duration finished_duration seeding_duration</dt>\n+<dd>these are cumulative <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> of for how long the torrent has been in\n+different states. active means not paused and added to <a class=\"reference external\" href=\"reference-Session.html#session\">session</a>. Whether\n+it has found any peers or not is not relevant.\n+finished means all selected files/pieces were downloaded and available\n+to other peers (this is always a subset of active time).\n+seeding means all files/pieces were downloaded and available to\n+peers. Being available to peers does not imply there are other peers\n+asking for the payload.</dd>\n+</dl>\n+<a name=\"flags\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:torrent_status%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22torrent_status%3A%3A%5Bflags%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>flags</dt>\n+<dd>reflects several of the torrent's flags. For more\n+information, see <tt class=\"docutils literal\"><span class=\"pre\">torrent_handle::flags()</span></tt>.</dd>\n+</dl>\n+<p>Bencoding is a common representation in bittorrent used for dictionary,\n+list, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state.</p>\n+<p>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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0003.html\">BEP 3</a>.</p>\n+<p>The function for decoding bencoded data <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>, returning a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.\n+This function builds a tree that points back into the original buffer. The\n+returned <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> will not be valid once the buffer it was parsed out of\n+is discarded.</p>\n+<p>It's possible to construct an <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> from a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>, if a structure needs\n+to be altered and re-encoded.</p>\n+<a name=\"entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+entry&labels=documentation&body=Documentation+under+heading+%22class+entry%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"min-memory-usage-high-performance-seed\">\n-<h1>min_memory_usage() high_performance_seed()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/session.hpp\">libtorrent/session.hpp</a>"</p>\n+<div class=\"section\" id=\"entry\">\n+<h1>entry</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n+<p>The <tt class=\"docutils literal\">entry</tt> class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (<tt class=\"docutils literal\"><span class=\"pre\">std::map</span></tt>), an integer\n+or a string.</p>\n <pre class=\"literal-block\">\n-settings_pack <strong>min_memory_usage</strong> ();\n-settings_pack <strong>high_performance_seed</strong> ();\n+class entry\n+{\n+ data_type <strong>type</strong> () const;\n+ <strong>entry</strong> (dictionary_type);\n+ <strong>entry</strong> (span<char const>);\n+ <strong>entry</strong> (list_type);\n+ <strong>entry</strong> (integer_type);\n+ <strong>entry</strong> (preformatted_type);\n+ <strong>entry</strong> (U v);\n+ <strong>entry</strong> (data_type t);\n+ <strong>entry</strong> (bdecode_node const& n);\n+ entry& <strong>operator=</strong> (bdecode_node const&) &;\n+ entry& <strong>operator=</strong> (preformatted_type) &;\n+ entry& <strong>operator=</strong> (entry&&) & noexcept;\n+ entry& <strong>operator=</strong> (dictionary_type) &;\n+ entry& <strong>operator=</strong> (entry const&) &;\n+ entry& <strong>operator=</strong> (span<char const>) &;\n+ entry& <strong>operator=</strong> (list_type) &;\n+ entry& <strong>operator=</strong> (integer_type) &;\n+ entry& <strong>operator=</strong> (U v) &;\n+ dictionary_type const& <strong>dict</strong> () const;\n+ string_type& <strong>string</strong> ();\n+ integer_type& <strong>integer</strong> ();\n+ list_type const& <strong>list</strong> () const;\n+ dictionary_type& <strong>dict</strong> ();\n+ list_type& <strong>list</strong> ();\n+ integer_type const& <strong>integer</strong> () const;\n+ preformatted_type& <strong>preformatted</strong> ();\n+ string_type const& <strong>string</strong> () const;\n+ preformatted_type const& <strong>preformatted</strong> () const;\n+ void <strong>swap</strong> (entry& e);\n+ entry& <strong>operator[]</strong> (string_view key);\n+ entry const& <strong>operator[]</strong> (string_view key) const;\n+ entry* <strong>find_key</strong> (string_view key);\n+ entry const* <strong>find_key</strong> (string_view key) const;\n+ std::string <strong>to_string</strong> (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 </pre>\n-<p>The default values of the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> settings are set for a regular\n-bittorrent client running on a desktop system. There are functions that\n-can set the <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> 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.</p>\n-<p><tt class=\"docutils literal\">min_memory_usage</tt> 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.</p>\n-<p>This configuration is intended to be the starting point for embedded\n-devices. It will significantly reduce memory usage.</p>\n-<p><tt class=\"docutils literal\">high_performance_seed</tt> 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.</p>\n-<a name=\"generate_fingerprint()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:generate_fingerprint%28%29&labels=documentation&body=Documentation+under+heading+%22generate_fingerprint%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"generate-fingerprint\">\n-<h1>generate_fingerprint()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/fingerprint.hpp\">libtorrent/fingerprint.hpp</a>"</p>\n+<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"type-3\">\n+<h2>type()</h2>\n <pre class=\"literal-block\">\n-std::string <strong>generate_fingerprint</strong> (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n+data_type <strong>type</strong> () const;\n </pre>\n-<p>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-<tt class=\"docutils literal\">peer_fingerprint</tt> setting, in <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a>.</p>\n-<p>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:</p>\n+<p>returns the concrete type of the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n+<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"entry-1\">\n+<h2>entry()</h2>\n+<pre class=\"literal-block\">\n+<strong>entry</strong> (dictionary_type);\n+<strong>entry</strong> (span<char const>);\n+<strong>entry</strong> (list_type);\n+<strong>entry</strong> (integer_type);\n+<strong>entry</strong> (preformatted_type);\n+</pre>\n+<p>constructors directly from a specific type.\n+The content of the argument is copied into the\n+newly constructed <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n+<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"entry-2\">\n+<h2>entry()</h2>\n+<pre class=\"literal-block\">\n+<strong>entry</strong> (data_type t);\n+</pre>\n+<p>construct an empty <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> of the specified type.\n+see <a class=\"reference external\" href=\"reference-Bencoding.html#data_type\">data_type</a> enum.</p>\n+<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"entry-3\">\n+<h2>entry()</h2>\n+<pre class=\"literal-block\">\n+<strong>entry</strong> (bdecode_node const& n);\n+</pre>\n+<p>construct from <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> parsed form (see <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>)</p>\n+<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Boperator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Boperator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-4\">\n+<h2>operator=()</h2>\n+<pre class=\"literal-block\">\n+entry& <strong>operator=</strong> (bdecode_node const&) &;\n+entry& <strong>operator=</strong> (preformatted_type) &;\n+entry& <strong>operator=</strong> (entry&&) & noexcept;\n+entry& <strong>operator=</strong> (dictionary_type) &;\n+entry& <strong>operator=</strong> (entry const&) &;\n+entry& <strong>operator=</strong> (span<char const>) &;\n+entry& <strong>operator=</strong> (list_type) &;\n+entry& <strong>operator=</strong> (integer_type) &;\n+</pre>\n+<p>copies the structure of the right hand side into this\n+<a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a>.</p>\n+<a name=\"string()\"></a>\n+<a name=\"preformatted()\"></a>\n+<a name=\"list()\"></a>\n+<a name=\"integer()\"></a>\n+<a name=\"dict()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bstring%28%29+preformatted%28%29+list%28%29+integer%28%29+dict%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bstring%28%29+preformatted%28%29+list%28%29+integer%28%29+dict%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"string-preformatted-list-integer-dict\">\n+<h2>string() preformatted() list() integer() dict()</h2>\n+<pre class=\"literal-block\">\n+dictionary_type const& <strong>dict</strong> () const;\n+string_type& <strong>string</strong> ();\n+integer_type& <strong>integer</strong> ();\n+list_type const& <strong>list</strong> () const;\n+dictionary_type& <strong>dict</strong> ();\n+list_type& <strong>list</strong> ();\n+integer_type const& <strong>integer</strong> () const;\n+preformatted_type& <strong>preformatted</strong> ();\n+string_type const& <strong>string</strong> () const;\n+preformatted_type const& <strong>preformatted</strong> () const;\n+</pre>\n+<p>The <tt class=\"docutils literal\">integer()</tt>, <tt class=\"docutils literal\">string()</tt>, <tt class=\"docutils literal\">list()</tt> and <tt class=\"docutils literal\">dict()</tt> functions\n+are accessors that return the respective type. If the <tt class=\"docutils literal\">entry</tt> object\n+isn't of the type you request, the accessor will throw\n+system_error. You can ask an <tt class=\"docutils literal\">entry</tt> for its type through the\n+<tt class=\"docutils literal\">type()</tt> function.</p>\n+<p>If you want to create an <tt class=\"docutils literal\">entry</tt> 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.</p>\n+<p>The typical code to get info from a torrent file will then look like\n+this:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"comment single\">// ...\n+</span><span class=\"whitespace\">\n+</span><span class=\"comment single\">// throws if this is not a dictionary\n+</span><span class=\"name\">entry</span><span class=\"operator\">::</span><span class=\"name\">dictionary_type</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">.</span><span class=\"name\">dict</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+</span><span class=\"name\">entry</span><span class=\"operator\">::</span><span class=\"name\">dictionary_type</span><span class=\"operator\">::</span><span class=\"name\">const_iterator</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"literal string\">"announce"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n+</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">!=</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">string</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">cout</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"literal string\">"</span><span class=\"literal string escape\">\\n</span><span class=\"literal string\">"</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<p>The following code is equivalent, but a little bit shorter:</p>\n+<pre class=\"code c++ literal-block\">\n+<span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"comment single\">// ...\n+</span><span class=\"whitespace\">\n+</span><span class=\"comment single\">// throws if this is not a dictionary\n+</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">entry</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">.</span><span class=\"name\">find_key</span><span class=\"punctuation\">(</span><span class=\"literal string\">"announce"</span><span class=\"punctuation\">))</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">string</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n+ </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">cout</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"literal string\">"</span><span class=\"literal string escape\">\\n</span><span class=\"literal string\">"</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n+</span><span class=\"punctuation\">}</span>\n+</pre>\n+<p>To make it easier to extract information from a torrent file, the\n+class <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> exists.</p>\n+<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"swap-4\">\n+<h2>swap()</h2>\n+<pre class=\"literal-block\">\n+void <strong>swap</strong> (entry& e);\n+</pre>\n+<p>swaps the content of <em>this</em> with <tt class=\"docutils literal\">e</tt>.</p>\n+<a name=\"operator[]()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Boperator%5B%5D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Boperator%5B%5D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-5\">\n+<h2>operator[]()</h2>\n+<pre class=\"literal-block\">\n+entry& <strong>operator[]</strong> (string_view key);\n+entry const& <strong>operator[]</strong> (string_view key) const;\n+</pre>\n+<p>All of these functions requires the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> to be a dictionary, if it\n+isn't they will throw <tt class=\"docutils literal\">system_error</tt>.</p>\n+<p>The non-const versions of the <tt class=\"docutils literal\">operator[]</tt> 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.</p>\n+<p>The const version of <tt class=\"docutils literal\">operator[]</tt> will only return a reference to an\n+existing element at the given key. If the key is not found, it will\n+throw <tt class=\"docutils literal\">system_error</tt>.</p>\n+<a name=\"find_key()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bfind_key%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bfind_key%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"find-key\">\n+<h2>find_key()</h2>\n+<pre class=\"literal-block\">\n+entry* <strong>find_key</strong> (string_view key);\n+entry const* <strong>find_key</strong> (string_view key) const;\n+</pre>\n+<p>These functions requires the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> to be a dictionary, if it isn't\n+they will throw <tt class=\"docutils literal\">system_error</tt>.</p>\n+<p>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.</p>\n+<a name=\"to_string()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bto_string%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bto_string%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"to-string\">\n+<h2>to_string()</h2>\n+<pre class=\"literal-block\">\n+std::string <strong>to_string</strong> (bool single_line = false) const;\n+</pre>\n+<p>returns a pretty-printed string representation\n+of the bencoded structure, with JSON-style syntax</p>\n+<a name=\"data_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+data_type&labels=documentation&body=Documentation+under+heading+%22enum+data_type%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-data-type\">\n+<h2>enum data_type</h2>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n-<col width=\"30%\" />\n-<col width=\"70%\" />\n+<col width=\"44%\" />\n+<col width=\"19%\" />\n+<col width=\"36%\" />\n </colgroup>\n <thead valign=\"bottom\">\n-<tr><th class=\"head\">id chars</th>\n-<th class=\"head\">client</th>\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n </tr>\n </thead>\n <tbody valign=\"top\">\n-<tr><td>LT</td>\n-<td>libtorrent (default)</td>\n-</tr>\n-<tr><td>UT</td>\n-<td>uTorrent</td>\n-</tr>\n-<tr><td>UM</td>\n-<td>uTorrent Mac</td>\n-</tr>\n-<tr><td>qB</td>\n-<td>qBittorrent</td>\n+<tr><td>int_t</td>\n+<td>0</td>\n+<td> </td>\n </tr>\n-<tr><td>BP</td>\n-<td>BitTorrent Pro</td>\n+<tr><td>string_t</td>\n+<td>1</td>\n+<td> </td>\n </tr>\n-<tr><td>BT</td>\n-<td>BitTorrent</td>\n+<tr><td>list_t</td>\n+<td>2</td>\n+<td> </td>\n </tr>\n-<tr><td>DE</td>\n-<td>Deluge</td>\n+<tr><td>dictionary_t</td>\n+<td>3</td>\n+<td> </td>\n </tr>\n-<tr><td>AZ</td>\n-<td>Azureus</td>\n+<tr><td>undefined_t</td>\n+<td>4</td>\n+<td> </td>\n </tr>\n-<tr><td>TL</td>\n-<td>Tribler</td>\n+<tr><td>preformatted_t</td>\n+<td>5</td>\n+<td> </td>\n </tr>\n </tbody>\n </table>\n-<p>There's an informal directory of client id's <a class=\"reference external\" href=\"http://wiki.theory.org/BitTorrentSpecification#peer_id\">here</a>.</p>\n-<p>The <tt class=\"docutils literal\">major</tt>, <tt class=\"docutils literal\">minor</tt>, <tt class=\"docutils literal\">revision</tt> and <tt class=\"docutils literal\">tag</tt> parameters are used to\n-identify the version of your client.</p>\n-<a name=\"name_for_setting()\"></a>\n-<a name=\"setting_by_name()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:name_for_setting%28%29+setting_by_name%28%29&labels=documentation&body=Documentation+under+heading+%22name_for_setting%28%29+setting_by_name%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"name-for-setting-setting-by-name\">\n-<h1>name_for_setting() setting_by_name()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<a name=\"bencode()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bencode%28%29&labels=documentation&body=Documentation+under+heading+%22bencode%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n+<div class=\"section\" id=\"bencode\">\n+<h1>bencode()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bencode.hpp\">libtorrent/bencode.hpp</a>"</p>\n <pre class=\"literal-block\">\n-char const* <strong>name_for_setting</strong> (int s);\n-int <strong>setting_by_name</strong> (string_view name);\n+template<class OutIt> int <strong>bencode</strong> (OutIt out, const entry& e);\n </pre>\n-<p>converts a setting integer (from the enums string_types, int_types or\n-bool_types) to a string, and vice versa.</p>\n-<a name=\"default_settings()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:default_settings%28%29&labels=documentation&body=Documentation+under+heading+%22default_settings%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"default-settings\">\n-<h1>default_settings()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/settings_pack.hpp\">libtorrent/settings_pack.hpp</a>"</p>\n+<p>This function will encode data to bencoded form.</p>\n+<p>The <a class=\"reference internal\" href=\"#entry\">entry</a> class is the internal representation of the bencoded data\n+and it can be used to retrieve information, an <a class=\"reference internal\" href=\"#entry\">entry</a> can also be build by\n+the program and given to <tt class=\"docutils literal\">bencode()</tt> to encode it into the <tt class=\"docutils literal\">OutIt</tt>\n+iterator.</p>\n+<p><tt class=\"docutils literal\">OutIt</tt> is an <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/named_req/OutputIterator\">OutputIterator</a>. It's a template and usually\n+instantiated as <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/iterator/ostream_iterator\">ostream_iterator</a> or <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/iterator/back_insert_iterator\">back_insert_iterator</a>. This\n+function assumes the value_type of the iterator is a <tt class=\"docutils literal\">char</tt>.\n+In order to encode <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> <tt class=\"docutils literal\">e</tt> into a buffer, do:</p>\n <pre class=\"literal-block\">\n-settings_pack <strong>default_settings</strong> ();\n+std::vector<char> buf;\n+bencode(std::back_inserter(buf), e);\n </pre>\n-<p>returns a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> with every setting set to its default value</p>\n+<a name=\"operator<<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:operator%3C%3C%28%29&labels=documentation&body=Documentation+under+heading+%22operator%3C%3C%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"operator-6\">\n+<h1>operator<<()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+inline std::ostream& <strong>operator<<</strong> (std::ostream& os, const entry& e);\n+</pre>\n+<p>prints the bencoded structure to the ostream as a JSON-style structure.</p>\n <a name=\"storage_error\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+storage_error&labels=documentation&body=Documentation+under+heading+%22class+storage_error%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"storage-error\">\n <h1>storage_error</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n <p>used by storage to return errors\n also includes which underlying file the\n error happened on</p>\n <pre class=\"literal-block\">\n struct storage_error\n {\n explicit operator <strong>bool</strong> () const;\n- file_index_t <strong>file</strong> () const;\n void <strong>file</strong> (file_index_t f);\n+ file_index_t <strong>file</strong> () const;\n \n error_code ec;\n operation_t operation;\n };\n </pre>\n-<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bool-1\">\n+<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bool-2\">\n <h2>bool()</h2>\n <pre class=\"literal-block\">\n explicit operator <strong>bool</strong> () const;\n </pre>\n <p>explicitly converts to true if this object represents an error, and\n false if it does not.</p>\n <a name=\"file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Bfile%28%29%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Bfile%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"file\">\n <h2>file()</h2>\n <pre class=\"literal-block\">\n-file_index_t <strong>file</strong> () const;\n void <strong>file</strong> (file_index_t f);\n+file_index_t <strong>file</strong> () const;\n </pre>\n <p>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 <a class=\"reference external\" href=\"reference-Torrent_Status.html#torrent_status\">torrent_status</a>.</p>\n <a name=\"ec\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Bec%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Bec%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>ec</dt>\n <dd>the error that occurred</dd>\n </dl>\n <a name=\"operation\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:storage_error%3A%3A%5Boperation%5D&labels=documentation&body=Documentation+under+heading+%22storage_error%3A%3A%5Boperation%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n <dt>operation</dt>\n <dd>A code from <a class=\"reference external\" href=\"reference-Alerts.html#operation_t\">operation_t</a> enum, indicating what\n kind of operation failed.</dd>\n </dl>\n-<a name=\"libtorrent_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:libtorrent_category%28%29&labels=documentation&body=Documentation+under+heading+%22libtorrent_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<a name=\"gzip_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:gzip_category%28%29&labels=documentation&body=Documentation+under+heading+%22gzip_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n </div>\n-<div class=\"section\" id=\"libtorrent-category\">\n-<h1>libtorrent_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>libtorrent_category</strong> ();\n-</pre>\n-<p>return the instance of the libtorrent_error_category which\n-maps libtorrent error codes to human readable error messages.</p>\n-<a name=\"http_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:http_category%28%29&labels=documentation&body=Documentation+under+heading+%22http_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"http-category\">\n-<h1>http_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<div class=\"section\" id=\"gzip-category\">\n+<h1>gzip_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n <pre class=\"literal-block\">\n-boost::system::error_category& <strong>http_category</strong> ();\n+boost::system::error_category& <strong>gzip_category</strong> ();\n </pre>\n-<p>returns the error_category for HTTP errors</p>\n-<a name=\"i2p_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_category%28%29&labels=documentation&body=Documentation+under+heading+%22i2p_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"i2p-category\">\n-<h1>i2p_category()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<p>get the <tt class=\"docutils literal\">error_category</tt> for zip errors</p>\n+<a name=\"upnp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:upnp_category%28%29&labels=documentation&body=Documentation+under+heading+%22upnp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"upnp-category\">\n+<h1>upnp_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n <pre class=\"literal-block\">\n-boost::system::error_category& <strong>i2p_category</strong> ();\n+boost::system::error_category& <strong>upnp_category</strong> ();\n </pre>\n-<p>returns the error category for I2P errors</p>\n+<p>the boost.system error category for UPnP errors</p>\n <a name=\"bdecode_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_category%28%29&labels=documentation&body=Documentation+under+heading+%22bdecode_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"bdecode-category\">\n <h1>bdecode_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>bdecode_category</strong> ();\n </pre>\n <a name=\"pcp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:pcp_category%28%29&labels=documentation&body=Documentation+under+heading+%22pcp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"pcp-category\">\n <h1>pcp_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>pcp_category</strong> ();\n </pre>\n+<a name=\"i2p_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:i2p_category%28%29&labels=documentation&body=Documentation+under+heading+%22i2p_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"i2p-category\">\n+<h1>i2p_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>i2p_category</strong> ();\n+</pre>\n+<p>returns the error category for I2P errors</p>\n+<a name=\"libtorrent_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:libtorrent_category%28%29&labels=documentation&body=Documentation+under+heading+%22libtorrent_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"libtorrent-category\">\n+<h1>libtorrent_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>libtorrent_category</strong> ();\n+</pre>\n+<p>return the instance of the libtorrent_error_category which\n+maps libtorrent error codes to human readable error messages.</p>\n+<a name=\"http_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:http_category%28%29&labels=documentation&body=Documentation+under+heading+%22http_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"http-category\">\n+<h1>http_category()</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n+<pre class=\"literal-block\">\n+boost::system::error_category& <strong>http_category</strong> ();\n+</pre>\n+<p>returns the error_category for HTTP errors</p>\n <a name=\"socks_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:socks_category%28%29&labels=documentation&body=Documentation+under+heading+%22socks_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"socks-category\">\n <h1>socks_category()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socks5_stream.hpp\">libtorrent/socks5_stream.hpp</a>"</p>\n <pre class=\"literal-block\">\n boost::system::error_category& <strong>socks_category</strong> ();\n </pre>\n <p>returns the error_category for SOCKS5 errors</p>\n-<a name=\"gzip_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:gzip_category%28%29&labels=documentation&body=Documentation+under+heading+%22gzip_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"gzip-category\">\n-<h1>gzip_category()</h1>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum\">\n+<h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>gzip_category</strong> ();\n-</pre>\n-<p>get the <tt class=\"docutils literal\">error_category</tt> for zip errors</p>\n-<a name=\"upnp_category()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:upnp_category%28%29&labels=documentation&body=Documentation+under+heading+%22upnp_category%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"upnp-category\">\n-<h1>upnp_category()</h1>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"33%\" />\n+<col width=\"6%\" />\n+<col width=\"61%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>Not an error</td>\n+</tr>\n+<tr><td>invalid_gzip_header</td>\n+<td>1</td>\n+<td>the supplied gzip buffer has invalid header</td>\n+</tr>\n+<tr><td>inflated_data_too_large</td>\n+<td>2</td>\n+<td>the gzip buffer would inflate to more bytes than the specified\n+maximum size, and was rejected.</td>\n+</tr>\n+<tr><td>data_did_not_terminate</td>\n+<td>3</td>\n+<td>available inflate data did not terminate</td>\n+</tr>\n+<tr><td>space_exhausted</td>\n+<td>4</td>\n+<td>output space exhausted before completing inflate</td>\n+</tr>\n+<tr><td>invalid_block_type</td>\n+<td>5</td>\n+<td>invalid block type (type == 3)</td>\n+</tr>\n+<tr><td>invalid_stored_block_length</td>\n+<td>6</td>\n+<td>stored block length did not match one's complement</td>\n+</tr>\n+<tr><td>too_many_length_or_distance_codes</td>\n+<td>7</td>\n+<td>dynamic block code description: too many length or distance codes</td>\n+</tr>\n+<tr><td>code_lengths_codes_incomplete</td>\n+<td>8</td>\n+<td>dynamic block code description: code lengths codes incomplete</td>\n+</tr>\n+<tr><td>repeat_lengths_with_no_first_length</td>\n+<td>9</td>\n+<td>dynamic block code description: repeat lengths with no first length</td>\n+</tr>\n+<tr><td>repeat_more_than_specified_lengths</td>\n+<td>10</td>\n+<td>dynamic block code description: repeat more than specified lengths</td>\n+</tr>\n+<tr><td>invalid_literal_length_code_lengths</td>\n+<td>11</td>\n+<td>dynamic block code description: invalid literal/length code lengths</td>\n+</tr>\n+<tr><td>invalid_distance_code_lengths</td>\n+<td>12</td>\n+<td>dynamic block code description: invalid distance code lengths</td>\n+</tr>\n+<tr><td>invalid_literal_code_in_block</td>\n+<td>13</td>\n+<td>invalid literal/length or distance code in fixed or dynamic block</td>\n+</tr>\n+<tr><td>distance_too_far_back_in_block</td>\n+<td>14</td>\n+<td>distance is too far back in fixed or dynamic block</td>\n+</tr>\n+<tr><td>unknown_gzip_error</td>\n+<td>15</td>\n+<td>an unknown error occurred during gzip inflation</td>\n+</tr>\n+<tr><td>error_code_max</td>\n+<td>16</td>\n+<td>the number of error codes</td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum-1\">\n+<h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-boost::system::error_category& <strong>upnp_category</strong> ();\n-</pre>\n-<p>the boost.system error category for UPnP errors</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"37%\" />\n+<col width=\"7%\" />\n+<col width=\"56%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>No error</td>\n+</tr>\n+<tr><td>invalid_argument</td>\n+<td>402</td>\n+<td>One of the arguments in the request is invalid</td>\n+</tr>\n+<tr><td>action_failed</td>\n+<td>501</td>\n+<td>The request failed</td>\n+</tr>\n+<tr><td>value_not_in_array</td>\n+<td>714</td>\n+<td>The specified value does not exist in the array</td>\n+</tr>\n+<tr><td>source_ip_cannot_be_wildcarded</td>\n+<td>715</td>\n+<td>The source IP address cannot be wild-carded, but\n+must be fully specified</td>\n+</tr>\n+<tr><td>external_port_cannot_be_wildcarded</td>\n+<td>716</td>\n+<td>The external port cannot be a wildcard, but must\n+be specified</td>\n+</tr>\n+<tr><td>port_mapping_conflict</td>\n+<td>718</td>\n+<td>The port mapping <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> specified conflicts with a\n+mapping assigned previously to another client</td>\n+</tr>\n+<tr><td>internal_port_must_match_external</td>\n+<td>724</td>\n+<td>Internal and external port value must be the same</td>\n+</tr>\n+<tr><td>only_permanent_leases_supported</td>\n+<td>725</td>\n+<td>The NAT implementation only supports permanent\n+lease times on port mappings</td>\n+</tr>\n+<tr><td>remote_host_must_be_wildcard</td>\n+<td>726</td>\n+<td>RemoteHost must be a wildcard and cannot be a\n+specific IP address or DNS name</td>\n+</tr>\n+<tr><td>external_port_must_be_wildcard</td>\n+<td>727</td>\n+<td>ExternalPort must be a wildcard and cannot be a\n+specific port</td>\n+</tr>\n+</tbody>\n+</table>\n <a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum\">\n+<div class=\"section\" id=\"enum-error-code-enum-2\">\n+<h1>enum error_code_enum</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"18%\" />\n+<col width=\"8%\" />\n+<col width=\"74%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td>Not an error</td>\n+</tr>\n+<tr><td>expected_digit</td>\n+<td>1</td>\n+<td>expected digit in bencoded string</td>\n+</tr>\n+<tr><td>expected_colon</td>\n+<td>2</td>\n+<td>expected colon in bencoded string</td>\n+</tr>\n+<tr><td>unexpected_eof</td>\n+<td>3</td>\n+<td>unexpected end of file in bencoded string</td>\n+</tr>\n+<tr><td>expected_value</td>\n+<td>4</td>\n+<td>expected value (list, dict, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> or string) in bencoded string</td>\n+</tr>\n+<tr><td>depth_exceeded</td>\n+<td>5</td>\n+<td>bencoded recursion depth limit exceeded</td>\n+</tr>\n+<tr><td>limit_exceeded</td>\n+<td>6</td>\n+<td>bencoded item count limit exceeded</td>\n+</tr>\n+<tr><td>overflow</td>\n+<td>7</td>\n+<td>integer overflow</td>\n+</tr>\n+<tr><td>error_code_max</td>\n+<td>8</td>\n+<td>the number of error codes</td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"pcp_errors\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+pcp_errors&labels=documentation&body=Documentation+under+heading+%22enum+pcp_errors%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-pcp-errors\">\n+<h1>enum pcp_errors</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"59%\" />\n+<col width=\"14%\" />\n+<col width=\"27%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>pcp_success</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_version</td>\n+<td>1</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_not_authorized</td>\n+<td>2</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_malformed_request</td>\n+<td>3</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_opcode</td>\n+<td>4</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_option</td>\n+<td>5</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_malformed_option</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_network_failure</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_no_resources</td>\n+<td>8</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_unsupp_protocol</td>\n+<td>9</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_user_ex_quota</td>\n+<td>10</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_cannot_provide_external</td>\n+<td>11</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_address_mismatch</td>\n+<td>12</td>\n+<td> </td>\n+</tr>\n+<tr><td>pcp_excessive_remote_peers</td>\n+<td>13</td>\n+<td> </td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"i2p_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+i2p_error_code&labels=documentation&body=Documentation+under+heading+%22enum+i2p_error_code%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-i2p-error-code\">\n+<h1>enum i2p_error_code</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n+<table border=\"1\" class=\"docutils\">\n+<colgroup>\n+<col width=\"46%\" />\n+<col width=\"19%\" />\n+<col width=\"35%\" />\n+</colgroup>\n+<thead valign=\"bottom\">\n+<tr><th class=\"head\">name</th>\n+<th class=\"head\">value</th>\n+<th class=\"head\">description</th>\n+</tr>\n+</thead>\n+<tbody valign=\"top\">\n+<tr><td>no_error</td>\n+<td>0</td>\n+<td> </td>\n+</tr>\n+<tr><td>parse_failed</td>\n+<td>1</td>\n+<td> </td>\n+</tr>\n+<tr><td>cant_reach_peer</td>\n+<td>2</td>\n+<td> </td>\n+</tr>\n+<tr><td>i2p_error</td>\n+<td>3</td>\n+<td> </td>\n+</tr>\n+<tr><td>invalid_key</td>\n+<td>4</td>\n+<td> </td>\n+</tr>\n+<tr><td>invalid_id</td>\n+<td>5</td>\n+<td> </td>\n+</tr>\n+<tr><td>timeout</td>\n+<td>6</td>\n+<td> </td>\n+</tr>\n+<tr><td>key_not_found</td>\n+<td>7</td>\n+<td> </td>\n+</tr>\n+<tr><td>duplicated_id</td>\n+<td>8</td>\n+<td> </td>\n+</tr>\n+<tr><td>num_errors</td>\n+<td>9</td>\n+<td> </td>\n+</tr>\n+</tbody>\n+</table>\n+<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"enum-error-code-enum-3\">\n <h1>enum error_code_enum</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/error_code.hpp\">libtorrent/error_code.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"32%\" />\n <col width=\"6%\" />\n <col width=\"63%\" />\n@@ -18597,203 +20272,14 @@\n </tr>\n <tr><td>service_unavailable</td>\n <td>503</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"i2p_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+i2p_error_code&labels=documentation&body=Documentation+under+heading+%22enum+i2p_error_code%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-i2p-error-code\">\n-<h1>enum i2p_error_code</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/i2p_stream.hpp\">libtorrent/i2p_stream.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"46%\" />\n-<col width=\"19%\" />\n-<col width=\"35%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>parse_failed</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>cant_reach_peer</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>i2p_error</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>invalid_key</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>invalid_id</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>timeout</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>key_not_found</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>duplicated_id</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-<tr><td>num_errors</td>\n-<td>9</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-1\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"18%\" />\n-<col width=\"8%\" />\n-<col width=\"74%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>Not an error</td>\n-</tr>\n-<tr><td>expected_digit</td>\n-<td>1</td>\n-<td>expected digit in bencoded string</td>\n-</tr>\n-<tr><td>expected_colon</td>\n-<td>2</td>\n-<td>expected colon in bencoded string</td>\n-</tr>\n-<tr><td>unexpected_eof</td>\n-<td>3</td>\n-<td>unexpected end of file in bencoded string</td>\n-</tr>\n-<tr><td>expected_value</td>\n-<td>4</td>\n-<td>expected value (list, dict, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> or string) in bencoded string</td>\n-</tr>\n-<tr><td>depth_exceeded</td>\n-<td>5</td>\n-<td>bencoded recursion depth limit exceeded</td>\n-</tr>\n-<tr><td>limit_exceeded</td>\n-<td>6</td>\n-<td>bencoded item count limit exceeded</td>\n-</tr>\n-<tr><td>overflow</td>\n-<td>7</td>\n-<td>integer overflow</td>\n-</tr>\n-<tr><td>error_code_max</td>\n-<td>8</td>\n-<td>the number of error codes</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"pcp_errors\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+pcp_errors&labels=documentation&body=Documentation+under+heading+%22enum+pcp_errors%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-pcp-errors\">\n-<h1>enum pcp_errors</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/natpmp.hpp\">libtorrent/natpmp.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"59%\" />\n-<col width=\"14%\" />\n-<col width=\"27%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>pcp_success</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_version</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_not_authorized</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_malformed_request</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_opcode</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_option</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_malformed_option</td>\n-<td>6</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_network_failure</td>\n-<td>7</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_no_resources</td>\n-<td>8</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_unsupp_protocol</td>\n-<td>9</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_user_ex_quota</td>\n-<td>10</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_cannot_provide_external</td>\n-<td>11</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_address_mismatch</td>\n-<td>12</td>\n-<td> </td>\n-</tr>\n-<tr><td>pcp_excessive_remote_peers</td>\n-<td>13</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n <a name=\"socks_error_code\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+socks_error_code&labels=documentation&body=Documentation+under+heading+%22enum+socks_error_code%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"enum-socks-error-code\">\n <h1>enum socks_error_code</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/socks5_stream.hpp\">libtorrent/socks5_stream.hpp</a>"</p>\n <table border=\"1\" class=\"docutils\">\n <colgroup>\n <col width=\"64%\" />\n@@ -18849,1242 +20335,40 @@\n </tr>\n <tr><td>num_errors</td>\n <td>10</td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-2\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/gzip.hpp\">libtorrent/gzip.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"33%\" />\n-<col width=\"6%\" />\n-<col width=\"61%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>Not an error</td>\n-</tr>\n-<tr><td>invalid_gzip_header</td>\n-<td>1</td>\n-<td>the supplied gzip buffer has invalid header</td>\n-</tr>\n-<tr><td>inflated_data_too_large</td>\n-<td>2</td>\n-<td>the gzip buffer would inflate to more bytes than the specified\n-maximum size, and was rejected.</td>\n-</tr>\n-<tr><td>data_did_not_terminate</td>\n-<td>3</td>\n-<td>available inflate data did not terminate</td>\n-</tr>\n-<tr><td>space_exhausted</td>\n-<td>4</td>\n-<td>output space exhausted before completing inflate</td>\n-</tr>\n-<tr><td>invalid_block_type</td>\n-<td>5</td>\n-<td>invalid block type (type == 3)</td>\n-</tr>\n-<tr><td>invalid_stored_block_length</td>\n-<td>6</td>\n-<td>stored block length did not match one's complement</td>\n-</tr>\n-<tr><td>too_many_length_or_distance_codes</td>\n-<td>7</td>\n-<td>dynamic block code description: too many length or distance codes</td>\n-</tr>\n-<tr><td>code_lengths_codes_incomplete</td>\n-<td>8</td>\n-<td>dynamic block code description: code lengths codes incomplete</td>\n-</tr>\n-<tr><td>repeat_lengths_with_no_first_length</td>\n-<td>9</td>\n-<td>dynamic block code description: repeat lengths with no first length</td>\n-</tr>\n-<tr><td>repeat_more_than_specified_lengths</td>\n-<td>10</td>\n-<td>dynamic block code description: repeat more than specified lengths</td>\n-</tr>\n-<tr><td>invalid_literal_length_code_lengths</td>\n-<td>11</td>\n-<td>dynamic block code description: invalid literal/length code lengths</td>\n-</tr>\n-<tr><td>invalid_distance_code_lengths</td>\n-<td>12</td>\n-<td>dynamic block code description: invalid distance code lengths</td>\n-</tr>\n-<tr><td>invalid_literal_code_in_block</td>\n-<td>13</td>\n-<td>invalid literal/length or distance code in fixed or dynamic block</td>\n-</tr>\n-<tr><td>distance_too_far_back_in_block</td>\n-<td>14</td>\n-<td>distance is too far back in fixed or dynamic block</td>\n-</tr>\n-<tr><td>unknown_gzip_error</td>\n-<td>15</td>\n-<td>an unknown error occurred during gzip inflation</td>\n-</tr>\n-<tr><td>error_code_max</td>\n-<td>16</td>\n-<td>the number of error codes</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"error_code_enum\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+error_code_enum&labels=documentation&body=Documentation+under+heading+%22enum+error_code_enum%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-error-code-enum-3\">\n-<h1>enum error_code_enum</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/upnp.hpp\">libtorrent/upnp.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"37%\" />\n-<col width=\"7%\" />\n-<col width=\"56%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>no_error</td>\n-<td>0</td>\n-<td>No error</td>\n-</tr>\n-<tr><td>invalid_argument</td>\n-<td>402</td>\n-<td>One of the arguments in the request is invalid</td>\n-</tr>\n-<tr><td>action_failed</td>\n-<td>501</td>\n-<td>The request failed</td>\n-</tr>\n-<tr><td>value_not_in_array</td>\n-<td>714</td>\n-<td>The specified value does not exist in the array</td>\n-</tr>\n-<tr><td>source_ip_cannot_be_wildcarded</td>\n-<td>715</td>\n-<td>The source IP address cannot be wild-carded, but\n-must be fully specified</td>\n-</tr>\n-<tr><td>external_port_cannot_be_wildcarded</td>\n-<td>716</td>\n-<td>The external port cannot be a wildcard, but must\n-be specified</td>\n-</tr>\n-<tr><td>port_mapping_conflict</td>\n-<td>718</td>\n-<td>The port mapping <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> specified conflicts with a\n-mapping assigned previously to another client</td>\n-</tr>\n-<tr><td>internal_port_must_match_external</td>\n-<td>724</td>\n-<td>Internal and external port value must be the same</td>\n-</tr>\n-<tr><td>only_permanent_leases_supported</td>\n-<td>725</td>\n-<td>The NAT implementation only supports permanent\n-lease times on port mappings</td>\n-</tr>\n-<tr><td>remote_host_must_be_wildcard</td>\n-<td>726</td>\n-<td>RemoteHost must be a wildcard and cannot be a\n-specific IP address or DNS name</td>\n-</tr>\n-<tr><td>external_port_must_be_wildcard</td>\n-<td>727</td>\n-<td>ExternalPort must be a wildcard and cannot be a\n-specific port</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"bdecode_node\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+bdecode_node&labels=documentation&body=Documentation+under+heading+%22class+bdecode_node%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bdecode-node\">\n-<h1>bdecode_node</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<p>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-<a class=\"reference external\" href=\"reference-Bdecoding.html#non_owning()\">non_owning()</a> member function.</p>\n-<p>There are 5 different types of nodes, see <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>.</p>\n+<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_state&labels=documentation&body=Documentation+under+heading+%22class+dht_state%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"dht-state\">\n+<h1>dht_state</h1>\n+<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_state.hpp\">libtorrent/kademlia/dht_state.hpp</a>"</p>\n+<p>This structure helps to store and load the state\n+of the <tt class=\"docutils literal\">dht_tracker</tt>.\n+At this moment the library is only a dual stack\n+implementation of the DHT. See <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0032.html\">BEP 32</a></p>\n <pre class=\"literal-block\">\n-struct bdecode_node\n+struct dht_state\n {\n- <strong>bdecode_node</strong> () = default;\n- bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n- bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n- <strong>bdecode_node</strong> (bdecode_node const&);\n- <strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n- type_t <strong>type</strong> () const noexcept;\n- explicit operator <strong>bool</strong> () const noexcept;\n- bdecode_node <strong>non_owning</strong> () const;\n- std::ptrdiff_t <strong>data_offset</strong> () const noexcept;\n- span<char const> <strong>data_section</strong> () const noexcept;\n- std::int64_t <strong>list_int_value_at</strong> (int i\n- , std::int64_t default_val = 0) const;\n- int <strong>list_size</strong> () const;\n- bdecode_node <strong>list_at</strong> (int i) const;\n- string_view <strong>list_string_value_at</strong> (int i\n- , string_view default_val = string_view()) const;\n- std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n- bdecode_node <strong>dict_find</strong> (string_view key) const;\n- std::int64_t <strong>dict_find_int_value</strong> (string_view key\n- , std::int64_t default_val = 0) const;\n- std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n- bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n- bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n- string_view <strong>dict_find_string_value</strong> (string_view key\n- , string_view default_value = string_view()) const;\n- bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n- int <strong>dict_size</strong> () const;\n- bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n- std::int64_t <strong>int_value</strong> () const;\n- int <strong>string_length</strong> () const;\n- string_view <strong>string_value</strong> () const;\n- char const* <strong>string_ptr</strong> () const;\n- std::ptrdiff_t <strong>string_offset</strong> () const;\n void <strong>clear</strong> ();\n- void <strong>swap</strong> (bdecode_node& n);\n- void <strong>reserve</strong> (int tokens);\n- void <strong>switch_underlying_buffer</strong> (char const* buf) noexcept;\n- bool <strong>has_soft_error</strong> (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-</pre>\n-<a name=\"bdecode_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbdecode_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbdecode_node%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"bdecode-node-1\">\n-<h2>bdecode_node()</h2>\n-<pre class=\"literal-block\">\n-<strong>bdecode_node</strong> () = default;\n-</pre>\n-<p>creates a default constructed node, it will have the type <tt class=\"docutils literal\">none_t</tt>.</p>\n-<a name=\"operator=()\"></a>\n-<a name=\"bdecode_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Boperator%3D%28%29+bdecode_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Boperator%3D%28%29+bdecode_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-bdecode-node\">\n-<h2>operator=() bdecode_node()</h2>\n-<pre class=\"literal-block\">\n-bdecode_node& <strong>operator=</strong> (bdecode_node const&) &;\n-bdecode_node& <strong>operator=</strong> (bdecode_node&&) & = default;\n-<strong>bdecode_node</strong> (bdecode_node const&);\n-<strong>bdecode_node</strong> (bdecode_node&&) noexcept;\n-</pre>\n-<p>For owning nodes, the copy will create a copy of the tree, but the\n-underlying buffer remains the same.</p>\n-<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"type-2\">\n-<h2>type()</h2>\n-<pre class=\"literal-block\">\n-type_t <strong>type</strong> () const noexcept;\n-</pre>\n-<p>the type of this node. See <a class=\"reference external\" href=\"reference-Bdecoding.html#type_t\">type_t</a>.</p>\n-<a name=\"bool()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bbool%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bbool%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bool-2\">\n-<h2>bool()</h2>\n-<pre class=\"literal-block\">\n-explicit operator <strong>bool</strong> () const noexcept;\n-</pre>\n-<p>returns true if <a class=\"reference external\" href=\"reference-Bencoding.html#type()\">type()</a> != none_t.</p>\n-<a name=\"non_owning()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bnon_owning%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bnon_owning%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"non-owning\">\n-<h2>non_owning()</h2>\n-<pre class=\"literal-block\">\n-bdecode_node <strong>non_owning</strong> () const;\n-</pre>\n-<p>return a non-owning reference to this node. This is useful to refer to\n-the root node without copying it in assignments.</p>\n-<a name=\"data_section()\"></a>\n-<a name=\"data_offset()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdata_section%28%29+data_offset%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdata_section%28%29+data_offset%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"data-section-data-offset\">\n-<h2>data_section() data_offset()</h2>\n-<pre class=\"literal-block\">\n-std::ptrdiff_t <strong>data_offset</strong> () const noexcept;\n-span<char const> <strong>data_section</strong> () const noexcept;\n-</pre>\n-<p>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 <tt class=\"docutils literal\">d</tt> and ends with <tt class=\"docutils literal\">e</tt>, and has all the content of the\n-dictionary in between.\n-the <tt class=\"docutils literal\">data_offset()</tt> function returns the byte-offset to this node in,\n-starting from the beginning of the buffer that was parsed.</p>\n-<a name=\"list_string_value_at()\"></a>\n-<a name=\"list_int_value_at()\"></a>\n-<a name=\"list_size()\"></a>\n-<a name=\"list_at()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Blist_string_value_at%28%29+list_int_value_at%28%29+list_size%28%29+list_at%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Blist_string_value_at%28%29+list_int_value_at%28%29+list_size%28%29+list_at%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"list-string-value-at-list-int-value-at-list-size-list-at\">\n-<h2>list_string_value_at() list_int_value_at() list_size() list_at()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>list_int_value_at</strong> (int i\n- , std::int64_t default_val = 0) const;\n-int <strong>list_size</strong> () const;\n-bdecode_node <strong>list_at</strong> (int i) const;\n-string_view <strong>list_string_value_at</strong> (int i\n- , string_view default_val = string_view()) const;\n-</pre>\n-<p>functions with the <tt class=\"docutils literal\">list_</tt> prefix operate on lists. These functions are\n-only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">list_t</tt>. <tt class=\"docutils literal\">list_at()</tt> returns the item\n-in the list at index <tt class=\"docutils literal\">i</tt>. <tt class=\"docutils literal\">i</tt> may not be greater than or equal to the\n-size of the list. <tt class=\"docutils literal\">size()</tt> returns the size of the list.</p>\n-<a name=\"dict_find_int()\"></a>\n-<a name=\"dict_size()\"></a>\n-<a name=\"dict_at_node()\"></a>\n-<a name=\"dict_at()\"></a>\n-<a name=\"dict_find_string()\"></a>\n-<a name=\"dict_find_string_value()\"></a>\n-<a name=\"dict_find()\"></a>\n-<a name=\"dict_find_int_value()\"></a>\n-<a name=\"dict_find_list()\"></a>\n-<a name=\"dict_find_dict()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bdict_find_int%28%29+dict_size%28%29+dict_at_node%28%29+dict_at%28%29+dict_find_string%28%29+dict_find_string_value%28%29+dict_find%28%29+dict_find_int_value%28%29+dict_find_list%28%29+dict_find_dict%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bdict_find_int%28%29+dict_size%28%29+dict_at_node%28%29+dict_at%28%29+dict_find_string%28%29+dict_find_string_value%28%29+dict_find%28%29+dict_find_int_value%28%29+dict_find_list%28%29+dict_find_dict%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"dict-find-int-dict-size-dict-at-node-dict-at-dict-find-string-dict-find-string-value-dict-find-dict-find-int-value-dict-find-list-dict-find-dict\">\n-<h2>dict_find_int() dict_size() dict_at_node() dict_at() dict_find_string() dict_find_string_value() dict_find() dict_find_int_value() dict_find_list() dict_find_dict()</h2>\n-<pre class=\"literal-block\">\n-std::pair<bdecode_node, bdecode_node> <strong>dict_at_node</strong> (int i) const;\n-bdecode_node <strong>dict_find</strong> (string_view key) const;\n-std::int64_t <strong>dict_find_int_value</strong> (string_view key\n- , std::int64_t default_val = 0) const;\n-std::pair<string_view, bdecode_node> <strong>dict_at</strong> (int i) const;\n-bdecode_node <strong>dict_find_dict</strong> (string_view key) const;\n-bdecode_node <strong>dict_find_string</strong> (string_view key) const;\n-string_view <strong>dict_find_string_value</strong> (string_view key\n- , string_view default_value = string_view()) const;\n-bdecode_node <strong>dict_find_int</strong> (string_view key) const;\n-int <strong>dict_size</strong> () const;\n-bdecode_node <strong>dict_find_list</strong> (string_view key) const;\n-</pre>\n-<p>Functions with the <tt class=\"docutils literal\">dict_</tt> prefix operates on dictionaries. They are\n-only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">dict_t</tt>. 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 <tt class=\"docutils literal\">string_view</tt> instead. <tt class=\"docutils literal\">dict_find_list</tt> will return a\n-valid <tt class=\"docutils literal\">bdecode_node</tt> if the key is found _and_ it is a list. Otherwise\n-it will return a default-constructed <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.</p>\n-<p>Functions with the <tt class=\"docutils literal\">_value</tt> 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).</p>\n-<p><tt class=\"docutils literal\">dict_at()</tt> returns the (key, value)-pair at the specified index in a\n-dictionary. Keys are only allowed to be strings. <tt class=\"docutils literal\">dict_at_node()</tt> also\n-returns the (key, value)-pair, but the key is returned as a\n-<tt class=\"docutils literal\">bdecode_node</tt> (and it will always be a string).</p>\n-<a name=\"int_value()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bint_value%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bint_value%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"int-value\">\n-<h2>int_value()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>int_value</strong> () const;\n-</pre>\n-<p>this function is only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">int_t</tt>. It returns the\n-value of the integer.</p>\n-<a name=\"string_value()\"></a>\n-<a name=\"string_offset()\"></a>\n-<a name=\"string_length()\"></a>\n-<a name=\"string_ptr()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bstring_value%28%29+string_offset%28%29+string_length%28%29+string_ptr%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bstring_value%28%29+string_offset%28%29+string_length%28%29+string_ptr%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"string-value-string-offset-string-length-string-ptr\">\n-<h2>string_value() string_offset() string_length() string_ptr()</h2>\n-<pre class=\"literal-block\">\n-int <strong>string_length</strong> () const;\n-string_view <strong>string_value</strong> () const;\n-char const* <strong>string_ptr</strong> () const;\n-std::ptrdiff_t <strong>string_offset</strong> () const;\n-</pre>\n-<p>these functions are only valid if <tt class=\"docutils literal\">type()</tt> == <tt class=\"docutils literal\">string_t</tt>. They return\n-the string values. Note that <tt class=\"docutils literal\">string_ptr()</tt> is <em>not</em> 0-terminated.\n-<tt class=\"docutils literal\">string_length()</tt> returns the number of bytes in the string.\n-<tt class=\"docutils literal\">string_offset()</tt> returns the byte offset from the start of the parsed\n-bencoded buffer this string can be found.</p>\n-<a name=\"clear()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bclear%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bclear%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"clear-2\">\n-<h2>clear()</h2>\n-<pre class=\"literal-block\">\n-void <strong>clear</strong> ();\n-</pre>\n-<p>resets the <tt class=\"docutils literal\">bdecoded_node</tt> to a default constructed state. If this is\n-an owning node, the tree is freed and all child nodes are invalidated.</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap-3\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (bdecode_node& n);\n-</pre>\n-<p>Swap contents.</p>\n-<a name=\"reserve()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Breserve%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Breserve%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"reserve-1\">\n-<h2>reserve()</h2>\n-<pre class=\"literal-block\">\n-void <strong>reserve</strong> (int tokens);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>.</p>\n-<a name=\"switch_underlying_buffer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bswitch_underlying_buffer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bswitch_underlying_buffer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"switch-underlying-buffer\">\n-<h2>switch_underlying_buffer()</h2>\n-<pre class=\"literal-block\">\n-void <strong>switch_underlying_buffer</strong> (char const* buf) noexcept;\n-</pre>\n-<p>this buffer <em>MUST</em> 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().</p>\n-<a name=\"has_soft_error()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode_node%3A%3A%5Bhas_soft_error%28%29%5D&labels=documentation&body=Documentation+under+heading+%22bdecode_node%3A%3A%5Bhas_soft_error%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"has-soft-error\">\n-<h2>has_soft_error()</h2>\n-<pre class=\"literal-block\">\n-bool <strong>has_soft_error</strong> (span<char> error) const;\n-</pre>\n-<p>returns true if there is a non-fatal error in the bencoding of this node\n-or its children</p>\n-<a name=\"type_t\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+type_t&labels=documentation&body=Documentation+under+heading+%22enum+type_t%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-type-t-1\">\n-<h2>enum type_t</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"13%\" />\n-<col width=\"9%\" />\n-<col width=\"78%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>none_t</td>\n-<td>0</td>\n-<td>uninitialized or default constructed. This is also used\n-to indicate that a node was not found in some cases.</td>\n-</tr>\n-<tr><td>dict_t</td>\n-<td>1</td>\n-<td>a dictionary node. The <tt class=\"docutils literal\">dict_find_</tt> functions are valid.</td>\n-</tr>\n-<tr><td>list_t</td>\n-<td>2</td>\n-<td>a list node. The <tt class=\"docutils literal\">list_</tt> functions are valid.</td>\n-</tr>\n-<tr><td>string_t</td>\n-<td>3</td>\n-<td>a string node, the <tt class=\"docutils literal\">string_</tt> functions are valid.</td>\n-</tr>\n-<tr><td>int_t</td>\n-<td>4</td>\n-<td>an integer node. The <tt class=\"docutils literal\">int_</tt> functions are valid.</td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"print_entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:print_entry%28%29&labels=documentation&body=Documentation+under+heading+%22print_entry%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"print-entry\">\n-<h1>print_entry()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-std::string <strong>print_entry</strong> (bdecode_node const& e\n- , bool single_line = false, int indent = 0);\n-</pre>\n-<p>print the bencoded structure in a human-readable format to a string\n-that's returned.</p>\n-<a name=\"bdecode()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bdecode%28%29&labels=documentation&body=Documentation+under+heading+%22bdecode%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"bdecode\">\n-<h1>bdecode()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bdecode.hpp\">libtorrent/bdecode.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-bdecode_node <strong>bdecode</strong> (span<char const> buffer\n- , int depth_limit = 100, int token_limit = 2000000);\n-int <strong>bdecode</strong> (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 <strong>bdecode</strong> (span<char const> buffer\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n-</pre>\n-<p>This function decodes/parses bdecoded data (for example a .torrent file).\n-The data structure is returned in the <tt class=\"docutils literal\">ret</tt> argument. the buffer to parse\n-is specified by the <tt class=\"docutils literal\">start</tt> of the buffer as well as the <tt class=\"docutils literal\">end</tt>, 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 <tt class=\"docutils literal\">ec</tt> with the error code. The optional\n-argument <tt class=\"docutils literal\">error_pos</tt>, if set to non-nullptr, will be set to the byte offset\n-into the buffer where the parse failure occurred.</p>\n-<p><tt class=\"docutils literal\">depth_limit</tt> 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).</p>\n-<p><tt class=\"docutils literal\">token_limit</tt> 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.</p>\n-<p>The resulting <tt class=\"docutils literal\">bdecode_node</tt> is an <em>owning</em> node. That means it will\n-be holding the whole parsed tree. When iterating lists and dictionaries,\n-those <tt class=\"docutils literal\">bdecode_node</tt> objects will simply have references to the root or\n-owning <tt class=\"docutils literal\">bdecode_node</tt>. If the root node is destructed, all other nodes\n-that refer to anything in that tree become invalid.</p>\n-<p>However, the underlying buffer passed in to this function (<tt class=\"docutils literal\">start</tt>, <tt class=\"docutils literal\">end</tt>)\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.</p>\n-<p>Bencoding is a common representation in bittorrent used for dictionary,\n-list, <a class=\"reference external\" href=\"reference-Core.html#int\">int</a> 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 <a class=\"reference external\" href=\"reference-Session.html#session\">session</a> state.</p>\n-<p>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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0003.html\">BEP 3</a>.</p>\n-<p>The function for decoding bencoded data <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>, returning a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>.\n-This function builds a tree that points back into the original buffer. The\n-returned <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> will not be valid once the buffer it was parsed out of\n-is discarded.</p>\n-<p>It's possible to construct an <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> from a <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a>, if a structure needs\n-to be altered and re-encoded.</p>\n-<a name=\"entry\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+entry&labels=documentation&body=Documentation+under+heading+%22class+entry%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"entry\">\n-<h1>entry</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n-<p>The <tt class=\"docutils literal\">entry</tt> class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (<tt class=\"docutils literal\"><span class=\"pre\">std::map</span></tt>), an integer\n-or a string.</p>\n-<pre class=\"literal-block\">\n-class entry\n-{\n- data_type <strong>type</strong> () const;\n- <strong>entry</strong> (dictionary_type);\n- <strong>entry</strong> (span<char const>);\n- <strong>entry</strong> (integer_type);\n- <strong>entry</strong> (preformatted_type);\n- <strong>entry</strong> (list_type);\n- <strong>entry</strong> (U v);\n- <strong>entry</strong> (data_type t);\n- <strong>entry</strong> (bdecode_node const& n);\n- entry& <strong>operator=</strong> (dictionary_type) &;\n- entry& <strong>operator=</strong> (list_type) &;\n- entry& <strong>operator=</strong> (entry&&) & noexcept;\n- entry& <strong>operator=</strong> (bdecode_node const&) &;\n- entry& <strong>operator=</strong> (entry const&) &;\n- entry& <strong>operator=</strong> (preformatted_type) &;\n- entry& <strong>operator=</strong> (integer_type) &;\n- entry& <strong>operator=</strong> (span<char const>) &;\n- entry& <strong>operator=</strong> (U v) &;\n- dictionary_type& <strong>dict</strong> ();\n- preformatted_type& <strong>preformatted</strong> ();\n- preformatted_type const& <strong>preformatted</strong> () const;\n- dictionary_type const& <strong>dict</strong> () const;\n- integer_type& <strong>integer</strong> ();\n- string_type const& <strong>string</strong> () const;\n- string_type& <strong>string</strong> ();\n- list_type& <strong>list</strong> ();\n- list_type const& <strong>list</strong> () const;\n- integer_type const& <strong>integer</strong> () const;\n- void <strong>swap</strong> (entry& e);\n- entry const& <strong>operator[]</strong> (string_view key) const;\n- entry& <strong>operator[]</strong> (string_view key);\n- entry* <strong>find_key</strong> (string_view key);\n- entry const* <strong>find_key</strong> (string_view key) const;\n- std::string <strong>to_string</strong> (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-</pre>\n-<a name=\"type()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Btype%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Btype%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"type-3\">\n-<h2>type()</h2>\n-<pre class=\"literal-block\">\n-data_type <strong>type</strong> () const;\n-</pre>\n-<p>returns the concrete type of the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n-<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"entry-1\">\n-<h2>entry()</h2>\n-<pre class=\"literal-block\">\n-<strong>entry</strong> (dictionary_type);\n-<strong>entry</strong> (span<char const>);\n-<strong>entry</strong> (integer_type);\n-<strong>entry</strong> (preformatted_type);\n-<strong>entry</strong> (list_type);\n-</pre>\n-<p>constructors directly from a specific type.\n-The content of the argument is copied into the\n-newly constructed <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a></p>\n-<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"entry-2\">\n-<h2>entry()</h2>\n-<pre class=\"literal-block\">\n-<strong>entry</strong> (data_type t);\n-</pre>\n-<p>construct an empty <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> of the specified type.\n-see <a class=\"reference external\" href=\"reference-Bencoding.html#data_type\">data_type</a> enum.</p>\n-<a name=\"entry()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bentry%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bentry%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"entry-3\">\n-<h2>entry()</h2>\n-<pre class=\"literal-block\">\n-<strong>entry</strong> (bdecode_node const& n);\n-</pre>\n-<p>construct from <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode_node\">bdecode_node</a> parsed form (see <a class=\"reference external\" href=\"reference-Bdecoding.html#bdecode()\">bdecode()</a>)</p>\n-<a name=\"operator=()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Boperator%3D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Boperator%3D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-4\">\n-<h2>operator=()</h2>\n-<pre class=\"literal-block\">\n-entry& <strong>operator=</strong> (dictionary_type) &;\n-entry& <strong>operator=</strong> (list_type) &;\n-entry& <strong>operator=</strong> (entry&&) & noexcept;\n-entry& <strong>operator=</strong> (bdecode_node const&) &;\n-entry& <strong>operator=</strong> (entry const&) &;\n-entry& <strong>operator=</strong> (preformatted_type) &;\n-entry& <strong>operator=</strong> (integer_type) &;\n-entry& <strong>operator=</strong> (span<char const>) &;\n-</pre>\n-<p>copies the structure of the right hand side into this\n-<a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a>.</p>\n-<a name=\"preformatted()\"></a>\n-<a name=\"dict()\"></a>\n-<a name=\"list()\"></a>\n-<a name=\"string()\"></a>\n-<a name=\"integer()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bpreformatted%28%29+dict%28%29+list%28%29+string%28%29+integer%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bpreformatted%28%29+dict%28%29+list%28%29+string%28%29+integer%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"preformatted-dict-list-string-integer\">\n-<h2>preformatted() dict() list() string() integer()</h2>\n-<pre class=\"literal-block\">\n-dictionary_type& <strong>dict</strong> ();\n-preformatted_type& <strong>preformatted</strong> ();\n-preformatted_type const& <strong>preformatted</strong> () const;\n-dictionary_type const& <strong>dict</strong> () const;\n-integer_type& <strong>integer</strong> ();\n-string_type const& <strong>string</strong> () const;\n-string_type& <strong>string</strong> ();\n-list_type& <strong>list</strong> ();\n-list_type const& <strong>list</strong> () const;\n-integer_type const& <strong>integer</strong> () const;\n-</pre>\n-<p>The <tt class=\"docutils literal\">integer()</tt>, <tt class=\"docutils literal\">string()</tt>, <tt class=\"docutils literal\">list()</tt> and <tt class=\"docutils literal\">dict()</tt> functions\n-are accessors that return the respective type. If the <tt class=\"docutils literal\">entry</tt> object\n-isn't of the type you request, the accessor will throw\n-system_error. You can ask an <tt class=\"docutils literal\">entry</tt> for its type through the\n-<tt class=\"docutils literal\">type()</tt> function.</p>\n-<p>If you want to create an <tt class=\"docutils literal\">entry</tt> 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.</p>\n-<p>The typical code to get info from a torrent file will then look like\n-this:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"comment single\">// ...\n-</span><span class=\"whitespace\">\n-</span><span class=\"comment single\">// throws if this is not a dictionary\n-</span><span class=\"name\">entry</span><span class=\"operator\">::</span><span class=\"name\">dictionary_type</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">.</span><span class=\"name\">dict</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"name\">entry</span><span class=\"operator\">::</span><span class=\"name\">dictionary_type</span><span class=\"operator\">::</span><span class=\"name\">const_iterator</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"punctuation\">.</span><span class=\"name\">find</span><span class=\"punctuation\">(</span><span class=\"literal string\">"announce"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">!=</span><span class=\"whitespace\"> </span><span class=\"name\">dict</span><span class=\"punctuation\">.</span><span class=\"name\">end</span><span class=\"punctuation\">())</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">second</span><span class=\"punctuation\">.</span><span class=\"name\">string</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">cout</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"literal string\">"</span><span class=\"literal string escape\">\\n</span><span class=\"literal string\">"</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span>\n-</pre>\n-<p>The following code is equivalent, but a little bit shorter:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">entry</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"comment single\">// ...\n-</span><span class=\"whitespace\">\n-</span><span class=\"comment single\">// throws if this is not a dictionary\n-</span><span class=\"keyword\">if</span><span class=\"whitespace\"> </span><span class=\"punctuation\">(</span><span class=\"name\">entry</span><span class=\"operator\">*</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">torrent_file</span><span class=\"punctuation\">.</span><span class=\"name\">find_key</span><span class=\"punctuation\">(</span><span class=\"literal string\">"announce"</span><span class=\"punctuation\">))</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">{</span><span class=\"whitespace\">\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">i</span><span class=\"operator\">-></span><span class=\"name\">string</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n- </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">cout</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"name\">tracker_url</span><span class=\"whitespace\"> </span><span class=\"operator\"><<</span><span class=\"whitespace\"> </span><span class=\"literal string\">"</span><span class=\"literal string escape\">\\n</span><span class=\"literal string\">"</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-</span><span class=\"punctuation\">}</span>\n-</pre>\n-<p>To make it easier to extract information from a torrent file, the\n-class <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> exists.</p>\n-<a name=\"swap()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bswap%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bswap%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"swap-4\">\n-<h2>swap()</h2>\n-<pre class=\"literal-block\">\n-void <strong>swap</strong> (entry& e);\n-</pre>\n-<p>swaps the content of <em>this</em> with <tt class=\"docutils literal\">e</tt>.</p>\n-<a name=\"operator[]()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Boperator%5B%5D%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Boperator%5B%5D%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-5\">\n-<h2>operator[]()</h2>\n-<pre class=\"literal-block\">\n-entry const& <strong>operator[]</strong> (string_view key) const;\n-entry& <strong>operator[]</strong> (string_view key);\n-</pre>\n-<p>All of these functions requires the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> to be a dictionary, if it\n-isn't they will throw <tt class=\"docutils literal\">system_error</tt>.</p>\n-<p>The non-const versions of the <tt class=\"docutils literal\">operator[]</tt> 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.</p>\n-<p>The const version of <tt class=\"docutils literal\">operator[]</tt> will only return a reference to an\n-existing element at the given key. If the key is not found, it will\n-throw <tt class=\"docutils literal\">system_error</tt>.</p>\n-<a name=\"find_key()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bfind_key%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bfind_key%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"find-key\">\n-<h2>find_key()</h2>\n-<pre class=\"literal-block\">\n-entry* <strong>find_key</strong> (string_view key);\n-entry const* <strong>find_key</strong> (string_view key) const;\n-</pre>\n-<p>These functions requires the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> to be a dictionary, if it isn't\n-they will throw <tt class=\"docutils literal\">system_error</tt>.</p>\n-<p>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.</p>\n-<a name=\"to_string()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:entry%3A%3A%5Bto_string%28%29%5D&labels=documentation&body=Documentation+under+heading+%22entry%3A%3A%5Bto_string%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"to-string\">\n-<h2>to_string()</h2>\n-<pre class=\"literal-block\">\n-std::string <strong>to_string</strong> (bool single_line = false) const;\n-</pre>\n-<p>returns a pretty-printed string representation\n-of the bencoded structure, with JSON-style syntax</p>\n-<a name=\"data_type\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:enum+data_type&labels=documentation&body=Documentation+under+heading+%22enum+data_type%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"enum-data-type\">\n-<h2>enum data_type</h2>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n-<table border=\"1\" class=\"docutils\">\n-<colgroup>\n-<col width=\"44%\" />\n-<col width=\"19%\" />\n-<col width=\"36%\" />\n-</colgroup>\n-<thead valign=\"bottom\">\n-<tr><th class=\"head\">name</th>\n-<th class=\"head\">value</th>\n-<th class=\"head\">description</th>\n-</tr>\n-</thead>\n-<tbody valign=\"top\">\n-<tr><td>int_t</td>\n-<td>0</td>\n-<td> </td>\n-</tr>\n-<tr><td>string_t</td>\n-<td>1</td>\n-<td> </td>\n-</tr>\n-<tr><td>list_t</td>\n-<td>2</td>\n-<td> </td>\n-</tr>\n-<tr><td>dictionary_t</td>\n-<td>3</td>\n-<td> </td>\n-</tr>\n-<tr><td>undefined_t</td>\n-<td>4</td>\n-<td> </td>\n-</tr>\n-<tr><td>preformatted_t</td>\n-<td>5</td>\n-<td> </td>\n-</tr>\n-</tbody>\n-</table>\n-<a name=\"bencode()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:bencode%28%29&labels=documentation&body=Documentation+under+heading+%22bencode%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"bencode\">\n-<h1>bencode()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/bencode.hpp\">libtorrent/bencode.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-template<class OutIt> int <strong>bencode</strong> (OutIt out, const entry& e);\n-</pre>\n-<p>This function will encode data to bencoded form.</p>\n-<p>The <a class=\"reference internal\" href=\"#entry\">entry</a> class is the internal representation of the bencoded data\n-and it can be used to retrieve information, an <a class=\"reference internal\" href=\"#entry\">entry</a> can also be build by\n-the program and given to <tt class=\"docutils literal\">bencode()</tt> to encode it into the <tt class=\"docutils literal\">OutIt</tt>\n-iterator.</p>\n-<p><tt class=\"docutils literal\">OutIt</tt> is an <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/named_req/OutputIterator\">OutputIterator</a>. It's a template and usually\n-instantiated as <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/iterator/ostream_iterator\">ostream_iterator</a> or <a class=\"reference external\" href=\"https://en.cppreference.com/w/cpp/iterator/back_insert_iterator\">back_insert_iterator</a>. This\n-function assumes the value_type of the iterator is a <tt class=\"docutils literal\">char</tt>.\n-In order to encode <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> <tt class=\"docutils literal\">e</tt> into a buffer, do:</p>\n-<pre class=\"literal-block\">\n-std::vector<char> buf;\n-bencode(std::back_inserter(buf), e);\n-</pre>\n-<a name=\"operator<<()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:operator%3C%3C%28%29&labels=documentation&body=Documentation+under+heading+%22operator%3C%3C%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"operator-6\">\n-<h1>operator<<()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/entry.hpp\">libtorrent/entry.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-inline std::ostream& <strong>operator<<</strong> (std::ostream& os, const entry& e);\n-</pre>\n-<p>prints the bencoded structure to the ostream as a JSON-style structure.</p>\n-<p>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:</p>\n-<ol class=\"arabic simple\">\n-<li>first the files that will be part of the torrent are determined.</li>\n-<li>the torrent properties are set, such as tracker url, web seeds,\n-DHT nodes etc.</li>\n-<li>Read through all the files in the torrent, SHA-1 all the data\n-and set the piece hashes.</li>\n-<li>The torrent is bencoded into a file or buffer.</li>\n-</ol>\n-<p>If there are a lot of files and or deep directory hierarchies to\n-traverse, step one can be time consuming.</p>\n-<p>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.</p>\n-<p>All of these classes and functions are declared by including\n-<tt class=\"docutils literal\">libtorrent/create_torrent.hpp</tt>.</p>\n-<p>example:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"name\">file_storage</span><span class=\"whitespace\"> </span><span class=\"name\">fs</span><span class=\"punctuation\">;</span><span class=\"whitespace\">\n-\n-</span><span class=\"comment single\">// recursively adds files in directories\n-</span><span class=\"name\">add_files</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal string\">"./my_torrent"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-\n-</span><span class=\"name\">create_torrent</span><span class=\"whitespace\"> </span><span class=\"name function\">t</span><span class=\"punctuation\">(</span><span class=\"name\">fs</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">add_tracker</span><span class=\"punctuation\">(</span><span class=\"literal string\">"http://my.tracker.com/announce"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">set_creator</span><span class=\"punctuation\">(</span><span class=\"literal string\">"libtorrent example"</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-\n-</span><span class=\"comment single\">// reads the files and calculates the hashes\n-</span><span class=\"name\">set_piece_hashes</span><span class=\"punctuation\">(</span><span class=\"name\">t</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"literal string\">"."</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-\n-</span><span class=\"name\">ofstream</span><span class=\"whitespace\"> </span><span class=\"name\">out</span><span class=\"punctuation\">(</span><span class=\"literal string\">"my_torrent.torrent"</span><span class=\"punctuation\">,</span><span class=\"whitespace\"> </span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ios_base</span><span class=\"operator\">::</span><span class=\"name\">binary</span><span class=\"punctuation\">);</span><span class=\"whitespace\">\n-</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">vector</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"whitespace\"> </span><span class=\"operator\">=</span><span class=\"whitespace\"> </span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">generate_buf</span><span class=\"punctuation\">();</span><span class=\"whitespace\">\n-</span><span class=\"name\">out</span><span class=\"punctuation\">.</span><span class=\"name\">write</span><span class=\"punctuation\">(</span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">data</span><span class=\"punctuation\">(),</span><span class=\"whitespace\"> </span><span class=\"name\">buf</span><span class=\"punctuation\">.</span><span class=\"name\">size</span><span class=\"punctuation\">());</span><span class=\"whitespace\">\n-\n-</span><span class=\"comment single\">// alternatively, generate an entry and encode it directly to an ostream\n-// iterator\n-</span><span class=\"name\">bencode</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">ostream_iterator</span><span class=\"operator\"><</span><span class=\"keyword type\">char</span><span class=\"operator\">></span><span class=\"punctuation\">(</span><span class=\"name\">out</span><span class=\"punctuation\">),</span><span class=\"whitespace\"> </span><span class=\"name\">t</span><span class=\"punctuation\">.</span><span class=\"name\">generate</span><span class=\"punctuation\">());</span>\n-</pre>\n-<a name=\"create_torrent\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+create_torrent&labels=documentation&body=Documentation+under+heading+%22class+create_torrent%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"create-torrent\">\n-<h1>create_torrent</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n-<p>This class holds state for creating a torrent. After having added\n-all information to it, call <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">create_torrent::generate()</a> to generate\n-the torrent. The <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> that's returned can then be bencoded into a\n-.torrent file using <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a>.</p>\n-<pre class=\"literal-block\">\n-struct create_torrent\n-{\n- explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n- , create_flags_t flags = {});\n- explicit <strong>create_torrent</strong> (torrent_info const& ti);\n- entry <strong>generate</strong> () const;\n- std::vector<char> <strong>generate_buf</strong> () const;\n- file_storage const& <strong>files</strong> () const;\n- void <strong>set_comment</strong> (char const* str);\n- void <strong>set_creator</strong> (char const* str);\n- void <strong>set_creation_date</strong> (std::time_t timestamp);\n- void <strong>set_hash</strong> (piece_index_t index, sha1_hash const& h);\n- void <strong>set_hash2</strong> (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n- void <strong>add_url_seed</strong> (string_view url);\n- void <strong>add_http_seed</strong> (string_view url);\n- void <strong>add_node</strong> (std::pair<std::string, int> node);\n- void <strong>add_tracker</strong> (string_view url, int tier = 0);\n- void <strong>set_root_cert</strong> (string_view cert);\n- void <strong>set_priv</strong> (bool p);\n- bool <strong>priv</strong> () const;\n- bool <strong>is_v1_only</strong> () const;\n- bool <strong>is_v2_only</strong> () const;\n- int <strong>num_pieces</strong> () const;\n- piece_index_t <strong>end_piece</strong> () const;\n- index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n- file_index_t <strong>end_file</strong> () const;\n- index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n- index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t f);\n- std::int64_t <strong>total_size</strong> () const;\n- int <strong>piece_length</strong> () const;\n- int <strong>piece_size</strong> (piece_index_t i) const;\n- void <strong>add_similar_torrent</strong> (sha1_hash ih);\n- void <strong>add_collection</strong> (string_view c);\n \n- static constexpr create_flags_t <strong>modification_time</strong> = 2_bit;\n- static constexpr create_flags_t <strong>symlinks</strong> = 3_bit;\n- static constexpr create_flags_t <strong>v2_only</strong> = 5_bit;\n- static constexpr create_flags_t <strong>v1_only</strong> = 6_bit;\n- static constexpr create_flags_t <strong>canonical_files</strong> = 7_bit;\n- static constexpr create_flags_t <strong>no_attributes</strong> = 8_bit;\n- static constexpr create_flags_t <strong>canonical_files_no_tail_padding</strong> = 9_bit;\n+ node_ids_t nids;\n+ std::vector<udp::endpoint> nodes;\n+ std::vector<udp::endpoint> nodes6;\n };\n </pre>\n-<a name=\"create_torrent()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcreate_torrent%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcreate_torrent%28%29%5D%22+could+be+improved\">report issue</a>]</span><div class=\"section\" id=\"create-torrent-1\">\n-<h2>create_torrent()</h2>\n-<pre class=\"literal-block\">\n-explicit <strong>create_torrent</strong> (file_storage& fs, int piece_size = 0\n- , create_flags_t flags = {});\n-explicit <strong>create_torrent</strong> (torrent_info const& ti);\n-</pre>\n-<p>The <tt class=\"docutils literal\">piece_size</tt> is the size of each piece in bytes. It must be a\n-power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n-specified, a piece_size will be set automatically.\n-Piece sizes greater than 128 MiB are considered unreasonable and will\n-be rejected (with an lt::system_error exception).</p>\n-<p>The <tt class=\"docutils literal\">flags</tt> arguments specifies options for the torrent creation. It can\n-be any combination of the flags defined by create_flags_t.</p>\n-<p>The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> (<tt class=\"docutils literal\">fs</tt>) 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> constructor.</p>\n-<p>The overload that takes a <tt class=\"docutils literal\">torrent_info</tt> 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">create_torrent::generate()</a>. This means\n-that none of the member functions of <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> that affects\n-the content of the info dictionary (such as <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>), will\n-have any affect. Instead of using this overload, consider using\n-<a class=\"reference external\" href=\"reference-Resume_Data.html#write_torrent_file()\">write_torrent_file()</a> instead.</p>\n-<div class=\"admonition warning\">\n-<p class=\"first admonition-title\">Warning</p>\n-<p class=\"last\">The <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> and <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> objects must stay alive for the\n-entire duration of the <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> object.</p>\n-</div>\n-<a name=\"generate()\"></a>\n-<a name=\"generate_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bgenerate%28%29+generate_buf%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"generate-generate-buf\">\n-<h2>generate() generate_buf()</h2>\n-<pre class=\"literal-block\">\n-entry <strong>generate</strong> () const;\n-std::vector<char> <strong>generate_buf</strong> () const;\n-</pre>\n-<p>This function will generate the .torrent file as a bencode tree, or a\n-bencoded into a buffer.\n-In order to encode the <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> into a flat file, use the <a class=\"reference external\" href=\"reference-Bencoding.html#bencode()\">bencode()</a> function.</p>\n-<p>The function returning an <a class=\"reference external\" href=\"reference-Bencoding.html#entry\">entry</a> may be useful to add custom entries\n-to the torrent file before bencoding it and saving it to disk.</p>\n-<p>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.</p>\n-<p>Any failure will cause this function to throw system_error, with an\n-appropriate error message. These are the reasons this call may throw:</p>\n-<ul class=\"simple\">\n-<li>the file storage has 0 files</li>\n-<li>the total size of the file storage is 0 bytes (i.e. it only has\n-empty files)</li>\n-<li>not all v1 hashes (<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>) and not all v2 hashes (<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a>)\n-were set</li>\n-<li>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, <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>\n-fails.</li>\n-</ul>\n-<a name=\"files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfiles%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfiles%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"files\">\n-<h2>files()</h2>\n-<pre class=\"literal-block\">\n-file_storage const& <strong>files</strong> () const;\n-</pre>\n-<p>returns an immutable reference to the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> used to create\n-the torrent from.</p>\n-<a name=\"set_comment()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_comment%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_comment%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-comment\">\n-<h2>set_comment()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_comment</strong> (char const* str);\n-</pre>\n-<p>Sets the comment for the torrent. The string <tt class=\"docutils literal\">str</tt> should be utf-8 encoded.\n-The comment in a torrent file is optional.</p>\n-<a name=\"set_creator()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_creator%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_creator%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-creator\">\n-<h2>set_creator()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_creator</strong> (char const* str);\n-</pre>\n-<p>Sets the creator of the torrent. The string <tt class=\"docutils literal\">str</tt> should be utf-8 encoded.\n-This is optional.</p>\n-<a name=\"set_creation_date()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_creation_date%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_creation_date%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-creation-date\">\n-<h2>set_creation_date()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_creation_date</strong> (std::time_t timestamp);\n-</pre>\n-<p>sets the "creation time" field. Defaults to the system clock at the\n-time of construction of the <a class=\"reference external\" href=\"reference-Create_Torrents.html#create_torrent\">create_torrent</a> 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.</p>\n-<a name=\"set_hash()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_hash%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_hash%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-hash\">\n-<h2>set_hash()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_hash</strong> (piece_index_t index, sha1_hash const& h);\n-</pre>\n-<p>This sets the SHA-1 hash for the specified piece (<tt class=\"docutils literal\">index</tt>). 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_piece_hashes()\">set_piece_hashes()</a>.\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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>.\n-This function will throw <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> if it is called on an\n-object constructed with the v2_only flag.</p>\n-<a name=\"set_hash2()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_hash2%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_hash2%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-hash2\">\n-<h2>set_hash2()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_hash2</strong> (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n-</pre>\n-<p>sets the bittorrent v2 hash for file <cite>file</cite> of the piece <cite>piece</cite>.\n-<cite>piece</cite> is relative to the first piece of the file, starting at 0. The\n-first piece in the file can be computed with\n-<a class=\"reference external\" href=\"reference-Storage.html#file_index_at_piece()\">file_storage::file_index_at_piece()</a>.\n-The hash, <cite>h</cite>, 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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>.\n-This function will throw <tt class=\"docutils literal\"><span class=\"pre\">std::system_error</span></tt> if it is called on an\n-object constructed with the v1_only flag.</p>\n-<a name=\"add_http_seed()\"></a>\n-<a name=\"add_url_seed()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_http_seed%28%29+add_url_seed%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_http_seed%28%29+add_url_seed%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-http-seed-add-url-seed\">\n-<h2>add_http_seed() add_url_seed()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_url_seed</strong> (string_view url);\n-void <strong>add_http_seed</strong> (string_view url);\n-</pre>\n-<p>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.</p>\n-<p>The second function, <tt class=\"docutils literal\">add_http_seed()</tt> adds an HTTP seed instead.</p>\n-<a name=\"add_node()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_node%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_node%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-node-1\">\n-<h2>add_node()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_node</strong> (std::pair<std::string, int> node);\n-</pre>\n-<p>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.</p>\n-<a name=\"add_tracker()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_tracker%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_tracker%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-tracker\">\n-<h2>add_tracker()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_tracker</strong> (string_view url, int tier = 0);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"http://\">http://</a> 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.</p>\n-<a name=\"set_root_cert()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_root_cert%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_root_cert%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-root-cert\">\n-<h2>set_root_cert()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_root_cert</strong> (string_view cert);\n-</pre>\n-<p>This function sets an X.509 certificate in PEM format to the torrent. This makes the\n-torrent an <em>SSL torrent</em>. 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 <a class=\"reference external\" href=\"manual-ref.html#ssl-torrents\">ssl torrents</a>.</p>\n-<p>The string is not the path to the cert, it's the actual content of the\n-certificate.</p>\n-<a name=\"set_priv()\"></a>\n-<a name=\"priv()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bset_priv%28%29+priv%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bset_priv%28%29+priv%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-priv-priv\">\n-<h2>set_priv() priv()</h2>\n-<pre class=\"literal-block\">\n-void <strong>set_priv</strong> (bool p);\n-bool <strong>priv</strong> () const;\n-</pre>\n-<p>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.</p>\n-<a name=\"num_pieces()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bnum_pieces%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bnum_pieces%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"num-pieces\">\n-<h2>num_pieces()</h2>\n-<pre class=\"literal-block\">\n-int <strong>num_pieces</strong> () const;\n-</pre>\n-<p>returns the number of pieces in the associated <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object.</p>\n-<a name=\"piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-range-1\">\n-<h2>piece_range()</h2>\n-<pre class=\"literal-block\">\n-index_range<piece_index_t> <strong>piece_range</strong> () const noexcept;\n-</pre>\n-<p>all piece indices in the torrent to be created</p>\n-<a name=\"file_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfile_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfile_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-range-1\">\n-<h2>file_range()</h2>\n-<pre class=\"literal-block\">\n-index_range<file_index_t> <strong>file_range</strong> () const noexcept;\n-</pre>\n-<p>all file indices in the torrent to be created</p>\n-<a name=\"file_piece_range()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bfile_piece_range%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bfile_piece_range%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"file-piece-range\">\n-<h2>file_piece_range()</h2>\n-<pre class=\"literal-block\">\n-index_range<piece_index_t::diff_type> <strong>file_piece_range</strong> (file_index_t f);\n-</pre>\n-<p>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.</p>\n-<a name=\"total_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Btotal_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Btotal_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"total-size-2\">\n-<h2>total_size()</h2>\n-<pre class=\"literal-block\">\n-std::int64_t <strong>total_size</strong> () const;\n-</pre>\n-<p>the total number of bytes of all files and pad files</p>\n-<a name=\"piece_length()\"></a>\n-<a name=\"piece_size()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bpiece_length%28%29+piece_size%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"piece-length-piece-size\">\n-<h2>piece_length() piece_size()</h2>\n-<pre class=\"literal-block\">\n-int <strong>piece_length</strong> () const;\n-int <strong>piece_size</strong> (piece_index_t i) const;\n-</pre>\n-<p><tt class=\"docutils literal\">piece_length()</tt> returns the piece size of all pieces but the\n-last one. <tt class=\"docutils literal\">piece_size()</tt> returns the size of the specified piece.\n-these functions are just forwarding to the associated <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a>.</p>\n-<a name=\"add_similar_torrent()\"></a>\n-<a name=\"add_collection()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Badd_similar_torrent%28%29+add_collection%28%29%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Badd_similar_torrent%28%29+add_collection%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"add-similar-torrent-add-collection\">\n-<h2>add_similar_torrent() add_collection()</h2>\n-<pre class=\"literal-block\">\n-void <strong>add_similar_torrent</strong> (sha1_hash ih);\n-void <strong>add_collection</strong> (string_view c);\n-</pre>\n-<p>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 <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0038.html\">BEP 38</a>.</p>\n-<a name=\"modification_time\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bmodification_time%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bmodification_time%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>modification_time</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"symlinks\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bsymlinks%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bsymlinks%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>symlinks</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"v2_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bv2_only%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bv2_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>v2_only</dt>\n-<dd>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-<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a> before calling <a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>. Setting v1 hashes (with\n-<a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>) is an error with this flag set.</dd>\n-</dl>\n-<a name=\"v1_only\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bv1_only%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bv1_only%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>v1_only</dt>\n-<dd>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 <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash()\">set_hash()</a>, before calling\n-<a class=\"reference external\" href=\"reference-Create_Torrents.html#generate()\">generate()</a>. Setting v2 hashes (with <a class=\"reference external\" href=\"reference-Create_Torrents.html#set_hash2()\">set_hash2()</a>) is an error with\n-this flag set.</dd>\n-</dl>\n-<a name=\"canonical_files\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcanonical_files%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcanonical_files%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>canonical_files</dt>\n-<dd>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.</dd>\n-</dl>\n-<a name=\"no_attributes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bno_attributes%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bno_attributes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>no_attributes</dt>\n-<dd>passing this flag to <a class=\"reference external\" href=\"reference-Create_Torrents.html#add_files()\">add_files()</a> 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.</dd>\n+<a name=\"nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nodes</dt>\n+<dd>the bootstrap nodes saved from the buckets node</dd>\n </dl>\n-<a name=\"canonical_files_no_tail_padding\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:create_torrent%3A%3A%5Bcanonical_files_no_tail_padding%5D&labels=documentation&body=Documentation+under+heading+%22create_torrent%3A%3A%5Bcanonical_files_no_tail_padding%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>canonical_files_no_tail_padding</dt>\n-<dd>this flag enforces the file layout to be canonical according to the\n-bittorrent v2 specification (just like the <tt class=\"docutils literal\">canonical_files</tt> 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.</dd>\n+<a name=\"nodes6\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes6%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes6%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n+<dt>nodes6</dt>\n+<dd>the bootstrap nodes saved from the IPv6 buckets node</dd>\n </dl>\n-<a name=\"add_files()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:add_files%28%29&labels=documentation&body=Documentation+under+heading+%22add_files%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"add-files\">\n-<h1>add_files()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-void <strong>add_files</strong> (file_storage& fs, std::string const& file\n- , std::function<bool(std::string)> p, create_flags_t flags = {});\n-void <strong>add_files</strong> (file_storage& fs, std::string const& file\n- , create_flags_t flags = {});\n-</pre>\n-<p>Adds the file specified by <tt class=\"docutils literal\">path</tt> to the <a class=\"reference external\" href=\"reference-Storage.html#file_storage\">file_storage</a> object. In case <tt class=\"docutils literal\">path</tt>\n-refers to a directory, files will be added recursively from the directory.</p>\n-<p>If specified, the predicate <tt class=\"docutils literal\">p</tt> is called once for every file and directory that\n-is encountered. Files for which <tt class=\"docutils literal\">p</tt> returns true are added, and directories for\n-which <tt class=\"docutils literal\">p</tt> returns true are traversed. <tt class=\"docutils literal\">p</tt> must have the following signature:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"keyword type\">bool</span><span class=\"whitespace\"> </span><span class=\"name function\">Pred</span><span class=\"punctuation\">(</span><span class=\"name\">std</span><span class=\"operator\">::</span><span class=\"name\">string</span><span class=\"whitespace\"> </span><span class=\"keyword\">const</span><span class=\"operator\">&</span><span class=\"whitespace\"> </span><span class=\"name\">p</span><span class=\"punctuation\">);</span>\n-</pre>\n-<p>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.</p>\n-<p>The ".." directory is never traversed.</p>\n-<p>The <tt class=\"docutils literal\">flags</tt> argument should be the same as the flags passed to the <a class=\"reference internal\" href=\"#create-torrent\">create_torrent</a>\n-constructor.</p>\n-<a name=\"set_piece_hashes()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:set_piece_hashes%28%29&labels=documentation&body=Documentation+under+heading+%22set_piece_hashes%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"set-piece-hashes\">\n-<h1>set_piece_hashes()</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/create_torrent.hpp\">libtorrent/create_torrent.hpp</a>"</p>\n-<pre class=\"literal-block\">\n-inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p, error_code& ec);\n-inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function<void(piece_index_t)> const& f);\n-void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n- , settings_interface const& settings, disk_io_constructor_type disk_io\n- , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n- , std::function<void(piece_index_t)> const& f);\n-void <strong>set_piece_hashes</strong> (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 <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p);\n-void <strong>set_piece_hashes</strong> (create_torrent& t, std::string const& p\n- , std::function<void(piece_index_t)> const& f, error_code& ec);\n-</pre>\n-<p>This function will assume that the files added to the torrent file exists at path\n-<tt class=\"docutils literal\">p</tt>, read those files and hash the content and set the hashes in the <tt class=\"docutils literal\">create_torrent</tt>\n-object. The optional function <tt class=\"docutils literal\">f</tt> is called in between every hash that is set. <tt class=\"docutils literal\">f</tt>\n-must have the following signature:</p>\n-<pre class=\"code c++ literal-block\">\n-<span class=\"keyword type\">void</span><span class=\"whitespace\"> </span><span class=\"name function\">Fun</span><span class=\"punctuation\">(</span><span class=\"name\">piece_index_t</span><span class=\"punctuation\">);</span>\n-</pre>\n-<p>The overloads taking a <a class=\"reference external\" href=\"reference-Settings.html#settings_pack\">settings_pack</a> may be used to configure the\n-underlying disk access. Such as <tt class=\"docutils literal\"><span class=\"pre\">settings_pack::aio_threads</span></tt>.</p>\n-<p>The overloads that don't take an <tt class=\"docutils literal\">error_code&</tt> may throw an exception in case of a\n-file error, the other overloads sets the error code to reflect the error, if any.</p>\n <a name=\"dht_storage_counters\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_storage_counters&labels=documentation&body=Documentation+under+heading+%22class+dht_storage_counters%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"dht-storage-counters\">\n <h1>dht_storage_counters</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_storage.hpp\">libtorrent/kademlia/dht_storage.hpp</a>"</p>\n <p>This structure hold the relevant <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the storage</p>\n <pre class=\"literal-block\">\n struct dht_storage_counters\n@@ -20308,42 +20592,16 @@\n <a name=\"counters()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_storage_interface%3A%3A%5Bcounters%28%29%5D&labels=documentation&body=Documentation+under+heading+%22dht_storage_interface%3A%3A%5Bcounters%28%29%5D%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"counters-2\">\n <h2>counters()</h2>\n <pre class=\"literal-block\">\n virtual dht_storage_counters <strong>counters</strong> () const = 0;\n </pre>\n <p>return stats <a class=\"reference external\" href=\"reference-Stats.html#counters\">counters</a> for the store</p>\n-<a name=\"dht_state\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:class+dht_state&labels=documentation&body=Documentation+under+heading+%22class+dht_state%22+could+be+improved\">report issue</a>]</span></div>\n-</div>\n-<div class=\"section\" id=\"dht-state\">\n-<h1>dht_state</h1>\n-<p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_state.hpp\">libtorrent/kademlia/dht_state.hpp</a>"</p>\n-<p>This structure helps to store and load the state\n-of the <tt class=\"docutils literal\">dht_tracker</tt>.\n-At this moment the library is only a dual stack\n-implementation of the DHT. See <a class=\"reference external\" href=\"https://www.bittorrent.org/beps/bep_0032.html\">BEP 32</a></p>\n-<pre class=\"literal-block\">\n-struct dht_state\n-{\n- void <strong>clear</strong> ();\n-\n- node_ids_t nids;\n- std::vector<udp::endpoint> nodes;\n- std::vector<udp::endpoint> nodes6;\n-};\n-</pre>\n-<a name=\"nodes\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nodes</dt>\n-<dd>the bootstrap nodes saved from the buckets node</dd>\n-</dl>\n-<a name=\"nodes6\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_state%3A%3A%5Bnodes6%5D&labels=documentation&body=Documentation+under+heading+%22dht_state%3A%3A%5Bnodes6%5D%22+could+be+improved\">report issue</a>]</span><dl class=\"docutils\">\n-<dt>nodes6</dt>\n-<dd>the bootstrap nodes saved from the IPv6 buckets node</dd>\n-</dl>\n <a name=\"dht_default_storage_constructor()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:dht_default_storage_constructor%28%29&labels=documentation&body=Documentation+under+heading+%22dht_default_storage_constructor%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+</div>\n <div class=\"section\" id=\"dht-default-storage-constructor\">\n <h1>dht_default_storage_constructor()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/dht_storage.hpp\">libtorrent/kademlia/dht_storage.hpp</a>"</p>\n <pre class=\"literal-block\">\n std::unique_ptr<dht_storage_interface> <strong>dht_default_storage_constructor</strong> (\n settings_interface const& settings);\n </pre>\n@@ -20387,22 +20645,22 @@\n <dd>Specify the port number for the SSL listen socket in the DHT announce.</dd>\n </dl>\n <a name=\"read_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:read_resume_data%28%29&labels=documentation&body=Documentation+under+heading+%22read_resume_data%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"read-resume-data\">\n <h1>read_resume_data()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/read_resume_data.hpp\">libtorrent/read_resume_data.hpp</a>"</p>\n <pre class=\"literal-block\">\n-add_torrent_params <strong>read_resume_data</strong> (span<char const> buffer\n- , load_torrent_limits const& cfg = {});\n add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n , int piece_limit = 0x200000);\n-add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n- , error_code& ec, int piece_limit = 0x200000);\n+add_torrent_params <strong>read_resume_data</strong> (span<char const> buffer\n+ , load_torrent_limits const& cfg = {});\n add_torrent_params <strong>read_resume_data</strong> (span<char const> buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\n+add_torrent_params <strong>read_resume_data</strong> (bdecode_node const& rd\n+ , error_code& ec, int piece_limit = 0x200000);\n </pre>\n <p>these functions are used to parse resume data and populate the appropriate\n fields in an <a class=\"reference external\" href=\"reference-Add_Torrent.html#add_torrent_params\">add_torrent_params</a> object. This object can then be used to add\n the actual <a class=\"reference external\" href=\"reference-Torrent_Info.html#torrent_info\">torrent_info</a> object to and pass to session::add_torrent() or\n session::async_add_torrent().</p>\n <p>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@@ -20410,22 +20668,22 @@\n <p>The <tt class=\"docutils literal\">piece_limit</tt> parameter determines the largest number of pieces\n allowed in the torrent that may be loaded as part of the resume data, if\n it contains an <tt class=\"docutils literal\">info</tt> field. The overloads that take a flat buffer are\n instead configured with limits on torrent sizes via load_torrent limits.</p>\n <p>In order to support large torrents, it may also be necessary to raise the\n <a class=\"reference external\" href=\"reference-Settings.html#max_piece_count\">settings_pack::max_piece_count</a> setting and pass a higher limit to calls\n to <a class=\"reference external\" href=\"reference-Torrent_Info.html#parse_info_section()\">torrent_info::parse_info_section()</a>.</p>\n-<a name=\"write_resume_data_buf()\"></a>\n-<a name=\"write_resume_data()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_resume_data_buf%28%29+write_resume_data%28%29&labels=documentation&body=Documentation+under+heading+%22write_resume_data_buf%28%29+write_resume_data%28%29%22+could+be+improved\">report issue</a>]</span></div>\n-<div class=\"section\" id=\"write-resume-data-buf-write-resume-data\">\n-<h1>write_resume_data_buf() write_resume_data()</h1>\n+<a name=\"write_resume_data()\"></a>\n+<a name=\"write_resume_data_buf()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_resume_data%28%29+write_resume_data_buf%28%29&labels=documentation&body=Documentation+under+heading+%22write_resume_data%28%29+write_resume_data_buf%28%29%22+could+be+improved\">report issue</a>]</span></div>\n+<div class=\"section\" id=\"write-resume-data-write-resume-data-buf\">\n+<h1>write_resume_data() write_resume_data_buf()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/write_resume_data.hpp\">libtorrent/write_resume_data.hpp</a>"</p>\n <pre class=\"literal-block\">\n-entry <strong>write_resume_data</strong> (add_torrent_params const& atp);\n std::vector<char> <strong>write_resume_data_buf</strong> (add_torrent_params const& atp);\n+entry <strong>write_resume_data</strong> (add_torrent_params const& atp);\n </pre>\n <p>this function turns the resume data in an <tt class=\"docutils literal\">add_torrent_params</tt> object\n into a bencoded structure</p>\n <a name=\"write_torrent_file_buf()\"></a>\n <a name=\"write_torrent_file()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:write_torrent_file_buf%28%29+write_torrent_file%28%29&labels=documentation&body=Documentation+under+heading+%22write_torrent_file_buf%28%29+write_torrent_file%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"write-torrent-file-buf-write-torrent-file\">\n <h1>write_torrent_file_buf() write_torrent_file()</h1>\n@@ -20510,18 +20768,18 @@\n </pre>\n <p>Verifies the signature on the given message using <tt class=\"docutils literal\">pk</tt></p>\n <a name=\"ed25519_add_scalar()\"></a><span class=\"report-issue\">[<a href=\"http://github.com/arvidn/libtorrent/issues/new?title=docs:ed25519_add_scalar%28%29&labels=documentation&body=Documentation+under+heading+%22ed25519_add_scalar%28%29%22+could+be+improved\">report issue</a>]</span></div>\n <div class=\"section\" id=\"ed25519-add-scalar\">\n <h1>ed25519_add_scalar()</h1>\n <p>Declared in "<a class=\"reference external\" href=\"include/libtorrent/kademlia/ed25519.hpp\">libtorrent/kademlia/ed25519.hpp</a>"</p>\n <pre class=\"literal-block\">\n-public_key <strong>ed25519_add_scalar</strong> (public_key const& pk\n- , std::array<char, 32> const& scalar);\n secret_key <strong>ed25519_add_scalar</strong> (secret_key const& sk\n , std::array<char, 32> const& scalar);\n+public_key <strong>ed25519_add_scalar</strong> (public_key const& pk\n+ , std::array<char, 32> const& scalar);\n </pre>\n <p>Adds a scalar to the given key pair where scalar is a 32 byte buffer\n (possibly generated with <cite>ed25519_create_seed</cite>), generating a new key pair.</p>\n <p>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,113 +1,161 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n- * _\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_\b1_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b(_\b)\n- o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n- o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n- * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n- o _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b)\n- * _\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- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n- * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n- * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\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 _\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- * _\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- * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n- * _\bi_\bn_\bt\n- * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n- * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n- * _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo\n- o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b(_\b)_\b _\bp_\be_\be_\br_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt\n- * _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bh_\ba_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n- o _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\bs_\be_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n- o _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n- o _\bf_\bl_\bu_\bs_\bh_\b__\bc_\ba_\bc_\bh_\be_\b(_\b)\n- o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b(_\b)\n- o _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bn_\be_\be_\bd_\b__\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)\n- _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)\n- o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bs_\be_\bt_\b(_\b)\n- o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n- o _\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 _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n- o _\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 _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n- _\bs_\be_\bt_\b__\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 _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n- o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n- o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)_\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+ * _\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_\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+ * _\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+ o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n+ o _\bl_\bo_\ba_\bd_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n+ o _\bn_\be_\bw_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n+ o _\bt_\bi_\bc_\bk_\b(_\b)\n+ o _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)\n+ o _\bo_\bn_\b__\bf_\bi_\bl_\be_\bs_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ o _\bo_\bn_\b__\ba_\bd_\bd_\b__\bp_\be_\be_\br_\b(_\b)\n+ * _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n+ o _\bo_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n+ o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n+ o _\bo_\bn_\b__\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__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\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+ _\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__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bn_\bo_\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)\n+ _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\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+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ * _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n+ o _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)_\b _\bv_\bo_\bi_\bd_\b*_\b(_\b)\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ * _\bb_\bu_\bf_\bf_\be_\br_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ * _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br\n+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\b~_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\bi_\bs_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b(_\b)\n+ o _\bb_\bo_\bo_\bl_\b(_\b)\n+ * _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n+ * _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\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+ * _\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+ * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n+ o _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\ba_\bl_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n+ o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n+ o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n+ o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n+ * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n+ * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+ * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\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 _\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 _\ba_\bd_\bd_\b__\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\ba_\bd_\bd_\b__\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ * _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ * _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n * _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+ o _\bc_\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__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n+ o _\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)_\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 _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bv_\b1_\b(_\b)_\b _\bv_\b2_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n@@ -122,119 +170,188 @@\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- * _\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- * _\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+ * _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n o _\be_\bm_\bp_\bt_\by_\b(_\b)\n- o _\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\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_\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 _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n+ o _\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 _\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)_\b _\bp_\bo_\bs_\bt_\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 _\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)_\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__\bd_\bo_\bw_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)\n+ _\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(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+ o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n+ o _\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__\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 _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)\n+ o _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n+ o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n+ o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)_\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 * _\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 _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\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 _\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 _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\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 _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)\n+ o _\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 _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- o _\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 _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n o _\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- * _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\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 * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)\n+ * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n * _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\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- * _\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 _\bv_\bo_\bi_\bd_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n- * _\ba_\bl_\be_\br_\bt\n- o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\bw_\bh_\ba_\bt_\b(_\b)\n- o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n+ o _\br_\be_\bm_\bo_\bv_\be_\b(_\b)_\b _\ba_\bd_\bd_\b(_\b)\n+ o _\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)\n+ o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\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+ o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n+ o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n+ o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)\n+ _\br_\bo_\bo_\bt_\b(_\b)_\b _\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 _\bm_\bt_\bi_\bm_\be_\b(_\b)\n+ o _\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)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bf_\bo_\br_\b__\br_\bo_\bo_\bt_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bs_\ba_\bn_\bi_\bt_\bi_\bz_\be_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk_\bs_\b(_\b)\n+ o _\bv_\b2_\b(_\b)\n+ * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\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 * _\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@@ -359,1121 +476,4420 @@\n * _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n+ * _\ba_\bl_\be_\br_\bt\n+ o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\bw_\bh_\ba_\bt_\b(_\b)\n+ o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n+ o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n- * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n * _\bi_\bn_\bt\n- * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n- * _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be\n- * _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b__\bb_\bo_\br_\br_\bo_\bw_\b(_\b)\n- o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n- o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n- o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n- o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n- o _\br_\bo_\bo_\bt_\b(_\b)_\b _\bm_\bt_\bi_\bm_\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 _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\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 _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n- o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\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- * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\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_\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_\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- * _\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- o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n- o _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\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 _\bt_\bi_\bc_\bk_\b(_\b)\n- o _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)\n- o _\bo_\bn_\b__\bf_\bi_\bl_\be_\bs_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\b)\n- o _\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\bo_\bn_\b__\ba_\bd_\bd_\b__\bp_\be_\be_\br_\b(_\b)\n- * _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n- o _\bo_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n- o _\bo_\bn_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b(_\b)\n- o _\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n- o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n- o _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\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__\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- _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)\n- o _\bo_\bn_\b__\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__\bh_\ba_\bv_\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__\bp_\bi_\be_\bc_\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__\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 _\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- * _\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- * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\be_\b__\bt\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\br_\be_\bm_\bo_\bv_\be_\b(_\b)_\b _\ba_\bd_\bd_\b(_\b)\n- o _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\ba_\bl_\bl_\bo_\bw_\b(_\b)\n- o _\ba_\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- * _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n- o _\bo_\bn_\b__\bd_\bi_\bs_\bk_\b(_\b)\n- * _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n- * _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n- o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\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- * _\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+ * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\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+ * _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n+ o _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n+ o _\ba_\bs_\bs_\bi_\bg_\bn_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)\n+ o _\ba_\bl_\bl_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bn_\bo_\bn_\be_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bw_\bo_\br_\bd_\bs_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bb_\by_\bt_\be_\bs_\b(_\b)\n+ o _\be_\bm_\bp_\bt_\by_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bi_\bs_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b(_\b)\n- o _\bb_\bo_\bo_\bl_\b(_\b)\n- * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n- * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n- o _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\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__\bs_\bt_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n- o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n- o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)_\b _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n- * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n- * _\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- * _\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- * _\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- * _\bp_\bc_\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- * _\bg_\bz_\bi_\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- * _\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 _\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 _\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 _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\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+ * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+ * _\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+ * _\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+ * _\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)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+ * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+ * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n+ * _\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 _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\bi_\bn_\bt\n+ * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n+ * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+ * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n * _\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 _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\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__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\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+ o _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\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)\n+ o _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt\n+ _\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)\n o _\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n- o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)\n+ o _\bs_\bt_\br_\bi_\bn_\bg_\b__\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 * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\be_\b__\bt\n * _\be_\bn_\bt_\br_\by\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)\n+ o _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bk_\be_\by_\b(_\b)\n o _\bt_\bo_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be\n * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n- * _\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__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n- o _\bs_\be_\bt_\b__\br_\bo_\bo_\bt_\b__\bc_\be_\br_\bt_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\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+ * _\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+ * _\bg_\bz_\bi_\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+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\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+ * _\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bs_\bo_\bc_\bk_\bs_\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 _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+ * _\be_\bn_\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 _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n+ * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n o _\br_\be_\bs_\be_\bt_\b(_\b)\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\bs_\b(_\b)\n 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 o _\bp_\bu_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n- * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\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 * _\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+libtorrent has a _\bp_\bl_\bu_\bg_\bi_\bn interface for implementing extensions to the protocol.\n+These can be general extensions for transferring metadata or peer exchange\n+extensions, or it could be used to provide a way to customize the protocol to\n+fit a particular (closed) network.\n+In short, the _\bp_\bl_\bu_\bg_\bi_\bn interface makes it possible to:\n+ * register extension messages (sent in the extension handshake), see\n+ _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs.\n+ * add data and parse data from the extension handshake.\n+ * send extension messages and standard bittorrent messages.\n+ * override or block the handling of standard bittorrent messages.\n+ * save and restore state via the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n+ * see all alerts that are posted\n+*\b**\b**\b**\b**\b**\b* a\ba w\bwo\bor\brd\bd o\bof\bf c\bca\bau\but\bti\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Writing your own _\bp_\bl_\bu_\bg_\bi_\bn is a very easy way to introduce serious bugs such as\n+dead locks and race conditions. Since a _\bp_\bl_\bu_\bg_\bi_\bn has access to internal\n+structures it is also quite easy to sabotage libtorrent's operation.\n+All the callbacks are always called from the libtorrent network thread. In case\n+portions of your _\bp_\bl_\bu_\bg_\bi_\bn are called from other threads, typically the main\n+thread, you cannot use any of the member functions on the internal structures\n+in libtorrent, since those require being called from the libtorrent network\n+thread . Furthermore, you also need to synchronize your own shared data within\n+the _\bp_\bl_\bu_\bg_\bi_\bn, to make sure it is not accessed at the same time from the\n+libtorrent thread (through a callback). If you need to send out a message from\n+another thread, it is advised to use an internal queue, and do the actual\n+sending in tick().\n+Since the _\bp_\bl_\bu_\bg_\bi_\bn interface gives you easy access to internal structures, it is\n+not supported as a stable API. Plugins should be considered specific to a\n+specific version of libtorrent. Although, in practice the internals mostly\n+don't change that dramatically.\n+*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn-\b-i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n+The _\bp_\bl_\bu_\bg_\bi_\bn interface consists of three base classes that the _\bp_\bl_\bu_\bg_\bi_\bn may\n+implement. These are called _\bp_\bl_\bu_\bg_\bi_\bn, _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn and _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. They are\n+found in the <libtorrent/extensions.hpp> header.\n+These plugins are instantiated for each _\bs_\be_\bs_\bs_\bi_\bo_\bn, torrent and possibly each\n+peer, respectively.\n+For plugins that only need per torrent state, it is enough to only implement\n+torrent_plugin and pass a constructor function or function object to session::\n+add_extension() or torrent_handle::add_extension() (if the torrent has already\n+been started and you want to hook in the extension at run-time).\n+The signature of the function is:\n+std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);\n+The second argument is the userdata passed to session::add_torrent() or\n+torrent_handle::add_extension().\n+The function should return a std::shared_ptr<torrent_plugin> which may or may\n+not be 0. If it is a nullptr, the extension is simply ignored for this torrent.\n+If it is a valid pointer (to a class inheriting torrent_plugin), it will be\n+associated with this torrent and callbacks will be made on torrent events.\n+For more elaborate plugins which require _\bs_\be_\bs_\bs_\bi_\bo_\bn wide state, you would\n+implement plugin, construct an object (in a std::shared_ptr) and pass it in to\n+session::add_extension().\n+*\b**\b**\b**\b**\b**\b* c\bcu\bus\bst\bto\bom\bm a\bal\ble\ber\brt\bts\bs *\b**\b**\b**\b**\b**\b*\n+Since plugins are running within internal libtorrent threads, one convenient\n+way to communicate with the client is to post custom alerts.\n+The expected interface of any _\ba_\bl_\be_\br_\bt, apart from deriving from the _\ba_\bl_\be_\br_\bt base\n+class, looks like this:\n+static const int alert_type = <\b<u\bun\bni\biq\bqu\bue\be a\bal\ble\ber\brt\bt I\bID\bD>\b>;\n+virtual int type() const { return alert_type; }\n+\n+virtual std::string message() const;\n+\n+static const alert_category_t static_category = <\b<b\bbi\bit\btm\bma\bas\bsk\bk o\bof\bf a\bal\ble\ber\brt\bt:\b::\b:c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt\n+f\bfl\bla\bag\bgs\bs>\b>;\n+virtual alert_category_t category() const { return static_category; }\n+\n+virtual char const* what() const { return <\b<s\bst\btr\bri\bin\bng\bg l\bli\bit\bte\ber\bra\bal\bl o\bof\bf t\bth\bhe\be n\bna\bam\bme\be o\bof\bf t\bth\bhi\bis\bs\n+a\bal\ble\ber\brt\bt>\b>; }\n+The alert_type is used for the type-checking in alert_cast. It must not collide\n+with any other _\ba_\bl_\be_\br_\bt. The built-in alerts in libtorrent will not use _\ba_\bl_\be_\br_\bt type\n+IDs greater than user_alert_id. When defining your own _\ba_\bl_\be_\br_\bt, make sure it's\n+greater than this constant.\n+type() is the run-time equivalence of the alert_type.\n+The message() virtual function is expected to construct a useful string\n+representation of the _\ba_\bl_\be_\br_\bt and the event or data it represents. Something\n+convenient to put in a log file for instance.\n+clone() is used internally to copy alerts. The suggested implementation of\n+simply allocating a new instance as a copy of *this is all that's expected.\n+The static category is required for checking whether or not the category for a\n+specific _\ba_\bl_\be_\br_\bt is enabled or not, without instantiating the _\ba_\bl_\be_\br_\bt. The category\n+virtual function is the run-time equivalence.\n+The what() virtual function may simply be a string literal of the class name of\n+your _\ba_\bl_\be_\br_\bt.\n+For more information, see the _\ba_\bl_\be_\br_\bt_\b _\bs_\be_\bc_\bt_\bi_\bo_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n+the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n+connection object, to be used by plugins. This is a low level interface that\n+may not be stable across libtorrent versions\n+struct peer_connection_handle\n {\n- 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+ explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr<peer_connection> impl);\n+ connection_type t\bty\byp\bpe\be () const;\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr<peer_plugin>);\n+ peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n+ bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n+ bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n+ bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n+ peer_id const& p\bpi\bid\bd () const;\n+ bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n+ bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n+ torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt const& r\bre\bem\bmo\bot\bte\be () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n+ void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n+ , disconnect_severity_t = peer_connection_interface::normal);\n+ bool i\bis\bs_\b_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+ bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n+ bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n+ bool f\bfa\bai\bil\ble\bed\bd () const;\n+ bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n+ void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n+ , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n+(4,5);\n+ bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n+ bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n+ bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n+ void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n+ std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be () const;\n+ time_point t\bti\bim\bme\be_\b_o\bof\bf_\b_l\bla\bas\bst\bt_\b_u\bun\bnc\bch\bho\bok\bke\be () const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (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<peer_connection> 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* 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+*\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- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n- explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n- 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 <typename F> 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+ explicit b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (peer_connection_handle pc);\n+ bool p\bpa\bac\bck\bke\bet\bt_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd () const;\n+ bool s\bsu\bup\bpp\bpo\bor\brt\bt_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs () const;\n+ bool s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\ben\bnc\bcr\bry\byp\bpt\bti\bio\bon\bn () const;\n+ void s\bsw\bwi\bit\btc\bch\bh_\b_r\bre\bec\bcv\bv_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr<crypto_plugin> 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_plugin> crypto);\n+ std::shared_ptr<bt_peer_connection> 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* p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+this is the base class for a _\bs_\be_\bs_\bs_\bi_\bo_\bn _\bp_\bl_\bu_\bg_\bi_\bn. One primary feature is that it is\n+notified of all torrents that are added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, and can add its own\n+torrent_plugins.\n+struct plugin\n+{\n+ virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n+ virtual std::shared_ptr<torrent_plugin> n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n+client_data_t);\n+ virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n+ virtual void a\bab\bbo\bor\brt\bt ();\n+ virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n+ , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n+ , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n+ virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n+ virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n+ , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n+ virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n+ virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br\n+*\b*/\b/);\n+ virtual std::map<std::string, std::string> s\bsa\bav\bve\be_\b_s\bst\bta\bat\bte\be () const;\n+ virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map<std::string, std::string> const&);\n \n- sha1_hash v1;\n- sha256_hash v2;\n+ static constexpr feature_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_f\bfe\bea\bat\btu\bur\bre\be = 1_bit;\n+ static constexpr feature_flags_t t\bti\bic\bck\bk_\b_f\bfe\bea\bat\btu\bur\bre\be = 2_bit;\n+ static constexpr feature_flags_t d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 3_bit;\n+ static constexpr feature_flags_t a\bal\ble\ber\brt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 4_bit;\n+ static constexpr feature_flags_t u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 5_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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 (sha1_hash h1, sha256_hash h2) noexcept;\n-i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n-explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n-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+*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n+This function is expected to return a bitmask indicating which features this\n+_\bp_\bl_\bu_\bg_\bi_\bn implements. Some callbacks on this object may not be called unless the\n+corresponding feature flag is returned here. Note that callbacks may still be\n+called even if the corresponding feature is not specified in the return value\n+here. See feature_flags_t for possible flags to return.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs(\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+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::shared_ptr<torrent_plugin> n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n+client_data_t);\n+this is called by the _\bs_\be_\bs_\bs_\bi_\bo_\bn every time a new torrent is added. The torrent*\n+points to the internal torrent object created for the new torrent. The\n+_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt is the userdata pointer as passed in via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n+If the _\bp_\bl_\bu_\bg_\bi_\bn returns a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance, it will be added to the new\n+torrent. Otherwise, return an empty shared_ptr to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn (the\n+default).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b* a\bad\bdd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n+called when _\bp_\bl_\bu_\bg_\bi_\bn is added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bab\bbo\bor\brt\bt ();\n+called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is aborted the _\bp_\bl_\bu_\bg_\bi_\bn should perform any cleanup\n+necessary to allow the session's destruction (e.g. cancel outstanding async\n+operations)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n-template <typename F> 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+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n+ , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n+ , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n+called when a dht request is received. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be\n+called, make sure to include the flag dht_request_feature in the return value\n+from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\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+*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n+called when an _\ba_\bl_\be_\br_\bt is posted alerts that are filtered are not posted. If your\n+_\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to include the flag alert_feature\n+in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n+ , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n+return true if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs should be added\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n+called once per second. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to\n+include the flag tick_feature in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br *\b*/\b/\n+);\n+called when choosing peers to optimistically unchoke. The return value\n+indicates the peer's priority for unchoking. Lower return values correspond to\n+higher priority. Priorities above 2^63-1 are reserved. If your _\bp_\bl_\bu_\bg_\bi_\bn has no\n+priority to assign a peer it should return 2^64-1. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this\n+to be called, make sure to include the flag optimistic_unchoke_feature in the\n+return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b). If multiple plugins implement this\n+function the lowest return value (i.e. the highest priority) is used.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map<std::string, std::string> const&);\n+called on startup while loading settings state from the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ optimistic_unchoke_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to alter the order of the\n+ optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n+ callback be called.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ tick_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_request_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ alert_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ unknown_torrent_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) called\n+ even if there is no active torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+Torrent plugins are associated with a single torrent and have a number of\n+functions called at certain events. Many of its functions have the ability to\n+change or override the default libtorrent behavior.\n+struct torrent_plugin\n {\n- sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n+ virtual std::shared_ptr<peer_plugin> n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n+const&);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+ virtual void t\bti\bic\bck\bk ();\n+ virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+ virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n+ virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n+ virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n+ virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n \n- 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 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+ static constexpr add_peer_flags_t f\bfi\bir\brs\bst\bt_\b_t\bti\bim\bme\be = 1_bit;\n+ static constexpr add_peer_flags_t f\bfi\bil\blt\bte\ber\bre\bed\bd = 2_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\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+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::shared_ptr<peer_plugin> n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n+const&);\n+This function is called each time a new peer is connected to the torrent. You\n+may choose to ignore this by just returning a default constructed shared_ptr\n+(in which case you don't need to override this member function).\n+If you need an extension to the peer connection (which most plugins do) you are\n+supposed to return an instance of your _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn class. Which in turn will\n+have its hook functions called on event specific to that peer.\n+The peer_connection_handle will be valid as long as the shared_ptr is being\n+held by the torrent object. So, it is generally a good idea to not keep a\n+shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n+weak_ptr.\n+If this function throws an exception, the connection will be closed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+These hooks are called when a piece passes the hash check or fails the hash\n+check, respectively. The index is the piece index that was downloaded. It is\n+possible to access the list of peers that participated in sending the piece\n+through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\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- 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+*\b**\b**\b**\b**\b* o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n+These hooks are called when the torrent is paused and resumed respectively. The\n+return value indicates if the event was handled. A return value of true\n+indicates that it was handled, and no other _\bp_\bl_\bu_\bg_\bi_\bn after this one will have\n+this hook function called, and the standard handler will also not be invoked.\n+So, returning true effectively overrides the standard behavior of pause or\n+resume.\n+Note that if you call pause() or resume() on the torrent from your handler it\n+will recurse back into your handler, so in order to invoke the standard\n+handler, you have to keep your own state on whether you want standard behavior\n+or overridden behavior.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\b**\b**\b**\b**\b* o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n+This function is called when the initial files of the torrent have been\n+checked. If there are no files to check, this function is called immediately.\n+i.e. This function is always called when the torrent is in a state where it can\n+start downloading.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_queue_time\n- the time until all blocks in the request queue will be downloaded\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n+called when the torrent changes state the state is one of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n+_\bs_\bt_\ba_\bt_\be_\b__\bt enum members\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- interesting\n- w\bwe\be are interested in pieces from this peer.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n+called every time a new peer is added to the peer list. This is before the peer\n+is connected to. For flags, see torrent_plugin::flags_t. The source argument\n+refers to the source where we learned about this peer from. It's a bitmask,\n+because many sources may have told us about the same peer. For peer source\n+flags, see peer_info::peer_source_flags.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- choked\n- w\bwe\be have choked this peer.\n+ first_time\n+ this is the first time we see this peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_interested\n- the peer is interested in u\bus\bs\n+ filtered\n+ this peer was not added because it was filtered by the IP filter\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_choked\n- the peer has choked u\bus\bs.\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+peer plugins are associated with a specific peer. A peer could be both a\n+regular bittorrent peer (bt_peer_connection) or one of the web seed connections\n+(web_peer_connection or http_seed_connection). In order to only attach to\n+certain peers, make your torrent_plugin::new_connection only return a _\bp_\bl_\bu_\bg_\bi_\bn\n+for certain peer connection types\n+struct peer_plugin\n+{\n+ virtual string_view t\bty\byp\bpe\be () const;\n+ virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n+ virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n+ virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span<char const>);\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_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+ virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual bool o\bon\bn_\b_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_\b_a\bal\bll\bl ();\n+ virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be (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_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_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n+ , span<char const> /\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_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_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_s\bsu\bug\bgg\bge\bes\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_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n+ virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n+ virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span<char const> /\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<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+ virtual void t\bti\bic\bck\bk ();\n+ virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual string_view t\bty\byp\bpe\be () const;\n+This function is expected to return the name of the _\bp_\bl_\bu_\bg_\bi_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n+can add entries to the extension handshake this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_connection\n- deprecated synonym for outgoing_connection\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n+called when the peer is being disconnected.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- handshake\n- The connection is opened, and waiting for the handshake. Until the\n- handshake is done, the peer cannot be identified.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n+called when the peer is successfully connected. Note that incoming connections\n+will have been connected by the time the peer _\bp_\bl_\bu_\bg_\bi_\bn is attached to it, and\n+won't have this hook called.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connecting\n- The connection is in a half-open state (i.e. it is being connected).\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span<char const>);\n+this is called when the initial bittorrent handshake is received. Returning\n+false means that the other end doesn't support this extension and will remove\n+it from the list of plugins. this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\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- seed\n- This peer is a seed (it has all the pieces).\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b)\n+o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) 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)\n+o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual bool o\bon\bn_\b_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_\b_a\bal\bll\bl ();\n+virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be (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_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+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- 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+*\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<char const> /\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- 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+*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_n\bno\bot\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)\n+s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n+virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+called after a choke message has been sent to the peer\n [_\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+*\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- 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+*\b**\b**\b**\b**\b* c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n+called when libtorrent think this peer should be disconnected. if the _\bp_\bl_\bu_\bg_\bi_\bn\n+returns false, the peer will not be disconnected.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- 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+*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+called when an extended message is received. If returning true, the message is\n+not processed by any other _\bp_\bl_\bu_\bg_\bi_\bn and if false is returned the next _\bp_\bl_\bu_\bg_\bi_\bn in\n+the chain will receive it to be able to handle it. This is not called for web\n+seeds. thus function may be called more than once per incoming message, but\n+only the last of the calls will the body size equal the length. i.e. Every time\n+another fragment of the message is received, this function will be called,\n+until finally the whole message has been received. The purpose of this is to\n+allow early disconnects for invalid messages and for reporting progress of\n+receiving large messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- i2p_socket\n- indicates that this socket is running on top of the I2P transport.\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<char const> /\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- utp_socket\n- indicates that this socket is a uTP socket\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+called when a piece that this peer participated in either fails or passes the\n+hash_check\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ssl_socket\n- indicates that this socket is running on top of an SSL (TLS) channel\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- rc4_encrypted\n- this connection is obfuscated with RC4\n+*\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+called each time a request message is to be sent. If true is returned, the\n+original request message won't be sent and no other _\bp_\bl_\bu_\bg_\bi_\bn will have this\n+function called.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- plaintext_encrypted\n- the handshake of this connection was obfuscated with a Diffie-Hellman\n- exchange\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<char const> 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<char const> key) = 0;\n+ e\ben\bnc\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n+ virtual std::tuple<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\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<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n+0;\n+decrypt the provided buffers. returns is a tuple representing the values\n+(consume, produce, packet_size)\n+consume is set to the number of bytes which should be trimmed from the head of\n+the buffers, default is 0\n+produce is set to the number of bytes of payload which are now ready to be sent\n+to the upper layer. default is the number of bytes passed in receive_vec\n+packet_size is set to the minimum number of bytes which must be read to advance\n+the next step of decryption. default is 0\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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<torrent_plugin> c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n+client_data_t);\n+constructor function for the ut_pex extension. The ut_pex extension allows\n+peers to gossip about their connections, allowing the swarm stay well connected\n+and peers aware of more peers in the swarm. This extension is enabled by\n+default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n+std::shared_ptr<torrent_plugin> 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_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<torrent_plugin> c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n+const&, client_data_t);\n+constructor function for the ut_metadata extension. The ut_metadata extension\n+allows peers to request the .torrent file (or more specifically the info-\n+dictionary of the .torrent file) from each other. This is the main building\n+block in making magnet links work. This extension is enabled by default unless\n+explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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<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 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<std::vector<download_priority_t>> 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<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 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- tells you in which state the peer is in. It is set to any combination of\n- the peer_flags_t flags above.\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- tracker\n- The peer was received from the tracker.\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- dht\n- The peer was received from the kademlia DHT.\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- pex\n- The peer was received from the peer exchange extension.\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- lsd\n- The peer was received from the local service discovery (The peer is on\n- the local network).\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- resume_data\n- The peer was added from the fast resume data.\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- incoming\n- we received an incoming connection from this peer\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- 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+ 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- 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+ 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- payload_up_speed payload_down_speed\n- The transfer rates of payload data only updated about once per second\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- 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+ 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- queue_bytes\n- the number of bytes we have requested from this peer, but not yet\n- received.\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- 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+ 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- send_buffer_size used_send_buffer\n- the number of bytes allocated and used for the peer's send buffer,\n- respectively.\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- receive_buffer_size used_receive_buffer receive_buffer_watermark\n- the number of bytes allocated and used as receive buffer, respectively.\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- num_hashfails\n- the number of pieces this peer has participated in sending us that turned\n- out to fail the hash check.\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- 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+ merkle_trees\n+ v2 hashes, if known\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+ 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- 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+ 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- requests_in_buffer\n- the number of requests messages that are currently in the send buffer\n- waiting to be sent.\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- 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+ 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- 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+*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+ explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n+ explicit operator T\bT () const;\n+ T* g\bge\bet\bt () const;\n+ operator v\bvo\boi\bid\bd*\b* () const = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+\n+ template <typename T, typename U\bU = typename std::enable_if<std::\n+is_pointer<T>::value>::type>\n+};\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+*\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- 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+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) *\b**\b**\b**\b**\b*\n+operator v\bvo\boi\bid\bd*\b* () const = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+we don't allow type-unsafe operations\n+The disk I/O can be customized in libtorrent. In previous versions, the\n+customization was at the level of each torrent. Now, the customization point is\n+at the _\bs_\be_\bs_\bs_\bi_\bo_\bn level. All torrents added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn will use the same disk I/\n+O subsystem, as determined by the disk_io_constructor (in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n+This allows the disk subsystem to also customize threading and disk job\n+management.\n+To customize the disk subsystem, implement _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be and provide a factory\n+function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor (via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n+Example use:\n+struct temp_storage\n+{\n+ explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {}\n+\n+ lt::span<char const> readv(lt::peer_request const r, lt::storage_error& ec)\n+const\n+ {\n+ auto const i = m_file_data.find(r.piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ if (int(i->second.size()) <= r.start)\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ return { i->second.data() + r.start, std::min(r.length, int(i->second.size\n+()) - r.start) };\n+ }\n+ void writev(lt::span<char const> const b, lt::piece_index_t const piece, int\n+const offset)\n+ {\n+ auto& data = m_file_data[piece];\n+ if (data.empty())\n+ {\n+ // allocate the whole piece, otherwise we'll invalidate the pointers\n+ // we have returned back to libtorrent\n+ int const size = piece_size(piece);\n+ data.resize(std::size_t(size));\n+ }\n+ TORRENT_ASSERT(offset + b.size() <= int(data.size()));\n+ std::memcpy(data.data() + offset, b.data(), std::size_t(b.size()));\n+ }\n+ lt::sha1_hash hash(lt::piece_index_t const piece\n+ , lt::span<lt::sha256_hash> const block_hashes, lt::storage_error& ec)\n+const\n+ {\n+ auto const i = m_file_data.find(piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+ if (!block_hashes.empty())\n+ {\n+ int const piece_size2 = m_files.piece_size2(piece);\n+ int const blocks_in_piece2 = m_files.blocks_in_piece2(piece);\n+ char const* buf = i->second.data();\n+ std::int64_t offset = 0;\n+ for (int k = 0; k < blocks_in_piece2; ++k)\n+ {\n+ lt::hasher256 h2;\n+ std::ptrdiff_t const len2 = std::min(lt::default_block_size, int\n+(piece_size2 - offset));\n+ h2.update({ buf, len2 });\n+ buf += len2;\n+ offset += len2;\n+ block_hashes[k] = h2.final();\n+ }\n+ }\n+ return lt::hasher(i->second).final();\n+ }\n+ lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt::\n+storage_error& ec)\n+ {\n+ auto const i = m_file_data.find(piece);\n+ if (i == m_file_data.end())\n+ {\n+ ec.operation = lt::operation_t::file_read;\n+ ec.ec = boost::asio::error::eof;\n+ return {};\n+ }\n+\n+ int const piece_size = m_files.piece_size2(piece);\n+\n+ std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size -\n+offset);\n+\n+ lt::span<char const> b = {i->second.data() + offset, len};\n+ return lt::hasher256(b).final();\n+ }\n+\n+private:\n+ int piece_size(lt::piece_index_t piece) const\n+ {\n+ int const num_pieces = static_cast<int>((m_files.total_size() +\n+m_files.piece_length() - 1) / m_files.piece_length());\n+ return static_cast<int>(piece) < num_pieces - 1\n+ ? m_files.piece_length() : static_cast<int>(m_files.total_size() - std::\n+int64_t(num_pieces - 1) * m_files.piece_length());\n+ }\n+\n+ lt::file_storage const& m_files;\n+ std::map<lt::piece_index_t, std::vector<char>> m_file_data;\n+};\n+\n+lt::storage_index_t pop(std::vector<lt::storage_index_t>& q)\n+{\n+ TORRENT_ASSERT(!q.empty());\n+ lt::storage_index_t const ret = q.back();\n+ q.pop_back();\n+ return ret;\n+}\n+\n+struct temp_disk_io final : lt::disk_interface\n+ , lt::buffer_allocator_interface\n+{\n+ explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {}\n+\n+ void settings_updated() override {}\n+\n+ lt::storage_holder new_torrent(lt::storage_params const& params\n+ , std::shared_ptr<void> const&) override\n+ {\n+ lt::storage_index_t const idx = m_free_slots.empty()\n+ ? m_torrents.end_index()\n+ : pop(m_free_slots);\n+ auto storage = std::make_unique<temp_storage>(params.files);\n+ if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move\n+(storage));\n+ else m_torrents[idx] = std::move(storage);\n+ return lt::storage_holder(idx, *this);\n+ }\n+\n+ void remove_torrent(lt::storage_index_t const idx) override\n+ {\n+ m_torrents[idx].reset();\n+ m_free_slots.push_back(idx);\n+ }\n+\n+ void abort(bool) override {}\n+\n+ void async_read(lt::storage_index_t storage, lt::peer_request const& r\n+ , std::function<void(lt::disk_buffer_holder block, lt::storage_error const&\n+se)> handler\n+ , lt::disk_job_flags_t) override\n+ {\n+ // this buffer is owned by the storage. It will remain valid for as\n+ // long as the torrent remains in the session. We don't need any lifetime\n+ // management of it.\n+ lt::storage_error error;\n+ lt::span<char const> b = m_torrents[storage]->readv(r, error);\n+\n+ post(m_ioc, [handler, error, b, this]\n+ { handler(lt::disk_buffer_holder(*this, const_cast<char*>(b.data()), int\n+(b.size())), error); });\n+ }\n+\n+ bool async_write(lt::storage_index_t storage, lt::peer_request const& r\n+ , char const* buf, std::shared_ptr<lt::disk_observer>\n+ , std::function<void(lt::storage_error const&)> handler\n+ , lt::disk_job_flags_t) override\n+ {\n+ lt::span<char const> const b = { buf, r.length };\n+\n+ m_torrents[storage]->writev(b, r.piece, r.start);\n+\n+ post(m_ioc, [=]{ handler(lt::storage_error()); });\n+ return false;\n+ }\n+\n+ void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece\n+ , lt::span<lt::sha256_hash> block_hashes, lt::disk_job_flags_t\n+ , std::function<void(lt::piece_index_t, lt::sha1_hash const&, lt::\n+storage_error const&)> handler) override\n+ {\n+ lt::storage_error error;\n+ lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes,\n+error);\n+ post(m_ioc, [=]{ handler(piece, hash, error); });\n+ }\n+\n+ void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece\n+ , int const offset, lt::disk_job_flags_t\n+ , std::function<void(lt::piece_index_t, lt::sha256_hash const&, lt::\n+storage_error const&)> handler) override\n+ {\n+ lt::storage_error error;\n+ lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset,\n+error);\n+ post(m_ioc, [=]{ handler(piece, hash, error); });\n+ }\n+\n+ void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t\n+ , std::function<void(lt::status_t, std::string const&, lt::storage_error\n+const&)> handler) override\n+ {\n+ post(m_ioc, [=]{\n+ handler(lt::status_t::fatal_disk_error, p\n+ , lt::storage_error(lt::error_code(boost::system::errc::\n+operation_not_supported, lt::system_category())));\n+ });\n+ }\n+\n+ void async_release_files(lt::storage_index_t, std::function<void()>) override\n+{}\n+\n+ void async_delete_files(lt::storage_index_t, lt::remove_flags_t\n+ , std::function<void(lt::storage_error const&)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(lt::storage_error()); });\n+ }\n+\n+ void async_check_files(lt::storage_index_t\n+ , lt::add_torrent_params const*\n+ , lt::aux::vector<std::string, lt::file_index_t>\n+ , std::function<void(lt::status_t, lt::storage_error const&)> handler)\n+override\n+ {\n+ post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); });\n+ }\n+\n+ void async_rename_file(lt::storage_index_t\n+ , lt::file_index_t const idx\n+ , std::string const name\n+ , std::function<void(std::string const&, lt::file_index_t, lt::\n+storage_error const&)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); });\n+ }\n+\n+ void async_stop_torrent(lt::storage_index_t, std::function<void()> handler)\n+override\n+ {\n+ post(m_ioc, handler);\n+ }\n+\n+ void async_set_file_priority(lt::storage_index_t\n+ , lt::aux::vector<lt::download_priority_t, lt::file_index_t> prio\n+ , std::function<void(lt::storage_error const&\n+ , lt::aux::vector<lt::download_priority_t, lt::file_index_t>)> handler)\n+override\n+ {\n+ post(m_ioc, [=]{\n+ handler(lt::storage_error(lt::error_code(\n+ boost::system::errc::operation_not_supported, lt::system_category())),\n+std::move(prio));\n+ });\n+ }\n+\n+ void async_clear_piece(lt::storage_index_t, lt::piece_index_t index\n+ , std::function<void(lt::piece_index_t)> handler) override\n+ {\n+ post(m_ioc, [=]{ handler(index); });\n+ }\n+\n+ // implements buffer_allocator_interface\n+ void free_disk_buffer(char*) override\n+ {\n+ // never free any buffer. We only return buffers owned by the storage\n+ // object\n+ }\n+\n+ void update_stats_counters(lt::counters&) const override {}\n+\n+ std::vector<lt::open_file_state> get_status(lt::storage_index_t) const\n+override\n+ { return {}; }\n+\n+ void submit_jobs() override {}\n+\n+private:\n+\n+ lt::aux::vector<std::shared_ptr<temp_storage>, lt::storage_index_t>\n+m_torrents;\n+\n+ // slots that are unused in the m_torrents vector\n+ std::vector<lt::storage_index_t> m_free_slots;\n+\n+ // callbacks are posted on this\n+ lt::io_context& m_ioc;\n+};\n+\n+std::unique_ptr<lt::disk_interface> temp_disk_constructor(\n+ lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n+{\n+ return std::make_unique<temp_disk_io>(ioc);\n+}\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- standard_bittorrent\n- Regular bittorrent connection\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_i\bin\bnt\bt (int name, int val) = 0;\n+ virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n+ virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n+ virtual void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n+ virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const = 0;\n+ virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n+ virtual std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const = 0;\n+};\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+*\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- http_seed\n- HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b7 protocol\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- connection_type\n- the kind of connection this peer uses. See connection_type_t.\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- 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+*\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- pending_disk_read_bytes\n- number of outstanding bytes to read from disk\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- 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+*\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- 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+*\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- num_pieces\n- the number of pieces this peer has.\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- 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+*\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- 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+*\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- progress_ppm\n- indicates the download progress of the peer in the range [0, 1000000]\n- (parts per million).\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- 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+ 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- 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+ 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<void> 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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n+ , std::function<void(storage_error const&)> 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<sha256_hash> v2\n+ , disk_job_flags_t flags\n+ , std::function<void(piece_index_t, sha1_hash const&, storage_error\n+const&)> 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<void(piece_index_t, sha256_hash const&, storage_error\n+const&)> 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<void(status_t, std::string const&, storage_error const&)>\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<void()> handler = std::function<void()>()) = 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<std::string, file_index_t> links\n+ , std::function<void(status_t, storage_error const&)> 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<void()> handler = std::function<void()>()) = 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<void(std::string const&, file_index_t, storage_error\n+const&)> 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<void(storage_error const&)> 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<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 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<void(piece_index_t)> 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<open_file_state> g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n+ virtual void a\bab\bbo\bor\brt\bt (bool wait) = 0;\n+ virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n+ virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\n+\n+ static constexpr disk_job_flags_t f\bfo\bor\brc\bce\be_\b_c\bco\bop\bpy\by = 0_bit;\n+ static constexpr disk_job_flags_t s\bse\beq\bqu\bue\ben\bnt\bti\bia\bal\bl_\b_a\bac\bcc\bce\bes\bss\bs = 3_bit;\n+ static constexpr disk_job_flags_t v\bvo\bol\bla\bat\bti\bil\ble\be_\b_r\bre\bea\bad\bd = 4_bit;\n+ static constexpr disk_job_flags_t v\bv1\b1_\b_h\bha\bas\bsh\bh = 5_bit;\n+ static constexpr disk_job_flags_t f\bfl\blu\bus\bsh\bh_\b_p\bpi\bie\bec\bce\be = 7_bit;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual storage_holder n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_params const& p\n+ , std::shared_ptr<void> 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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n+ , std::function<void(storage_error const&)> 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<sha256_hash> v2\n+ , disk_job_flags_t flags\n+ , std::function<void(piece_index_t, sha1_hash const&, storage_error\n+const&)> 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<void(piece_index_t, sha256_hash const&, storage_error\n+const&)> 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<void(status_t, std::string const&, storage_error const&)>\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<void()> handler = std::function<void()>()) = 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<std::string, file_index_t> links\n+ , std::function<void(status_t, storage_error const&)> 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<void()> handler = std::function<void()>()) = 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<void(std::string const&, file_index_t, storage_error\n+const&)> 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<void(storage_error const&)> 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<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+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<void(piece_index_t)> 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<open_file_state> g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n+Return a list of all the files that are currently open for the specified\n+storage/torrent. This is is just used for the client to query the currently\n+open files, and which modes those files are open in.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bab\bbo\bor\brt\bt (bool wait) = 0;\n+this is called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is starting to shut down. The disk I/O object\n+is expected to flush any outstanding write jobs, cancel hash jobs and initiate\n+tearing down of any internal threads. If wait is true, this should be\n+asynchronous. i.e. this call should not return until all threads have stopped\n+and all jobs have either been aborted or completed and the disk I/O object is\n+ready to be destructed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n+This will be called after a batch of disk jobs has been issues (via the async_*\n+). It gives the disk I/O object an opportunity to notify any potential\n+condition variables to wake up the disk thread(s). The async_* calls can of\n+course also notify condition variables, but doing it in this call allows for\n+batching jobs, by issuing the notification once for a collection of jobs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\n+This is called to notify the disk I/O object that the settings have been\n+updated. In the disk io constructor, a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be reference is passed\n+in. Whenever these settings are updated, this function is called to allow the\n+disk I/O object to react to any changed settings relevant to its operations.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ force_copy\n+ force making a copy of the cached block, rather than getting a reference\n+ to a block already in the cache. This is used the block is expected to be\n+ overwritten very soon, by async_write()`, and we need access to the\n+ previous content.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ sequential_access\n+ hint that there may be more disk operations with sequential access to the\n+ file\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ volatile_read\n+ don't keep the read block in cache. This is a hint that this block is\n+ unlikely to be read again anytime soon, and caching it would be wasteful.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ v1_hash\n+ compute a v1 piece hash. This is only used by the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call. If\n+ this flag is not set in the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call, the SHA-1 piece hash does\n+ not need to be computed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flush_piece\n+ this flag instructs a hash job that we just completed this piece, and it\n+ should be flushed to disk\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n+a unique, owning, reference to the storage of a torrent in a disk io subsystem\n+(class that implements _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be). This is held by the internal libtorrent\n+torrent object to tie the storage object allocated for a torrent to the\n+lifetime of the internal torrent object. When a torrent is removed from the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn, this holder is destructed and will inform the disk object.\n+struct storage_holder\n+{\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n+ ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n+ explicit operator b\bbo\boo\bol\bl () const;\n+ operator s\bst\bto\bor\bra\bag\bge\be_\b_i\bin\bnd\bde\bex\bx_\b_t\bt () const;\n+ void r\bre\bes\bse\bet\bt ();\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder const&) = delete;\n+ storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder&& rhs) noexcept;\n+ storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder&& rhs) noexcept;\n+};\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* f\bfi\bil\ble\be_\b_o\bop\bpe\ben\bn_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n+ read_only\n+ open the file for reading only\n+ write_only\n+ open the file for writing only\n+ read_write\n+ open the file for reading and writing\n+ rw_mask\n+ the mask for the bits determining read or write mode\n+ sparse\n+ open the file in sparse mode (if supported by the filesystem).\n+ no_atime\n+ don't update the access timestamps on the file (if supported by the\n+ operating system and filesystem). this generally improves disk\n+ performance.\n+ random_access\n+ When this is not set, the kernel is hinted that access to this file will\n+ be made sequentially.\n+ mmapped\n+ the file is memory mapped\n+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_\bB_\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. Here are some other bootstrap nodes that may work:\n+router.bittorrent.com:6881, dht.transmissionbt.com:6881 router.bt.ouinet.work:\n+6881,\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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+|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n+announce_port is the port passed along as the port parameter to remote trackers\n+such as HTTP or DHT. This setting does not affect the effective listening port\n+nor local service discovery announcements. If left as zero (default), the\n+listening port value is used.\n+Note\n+This setting is only meant for very special cases where a seed's listening port\n+differs from the external port. As an example, if a local proxy is used and\n+that the proxy supports reverse tunnels through NAT-PMP, the tracker must\n+connect to the external NAT-PMP port (configured using announce_port) instead\n+of the actual local listening port.\n+struct settings_pack final : settings_interface\n+{\n+ friend void a\bap\bpp\bpl\bly\by_\b_p\bpa\bac\bck\bk_\b_i\bim\bmp\bpl\bl (settings_pack const*\n+ , aux::session_settings_single_thread&\n+ , std::vector<void(aux::session_impl::*)()>*);\n+ void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+ void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n+ void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> const val);\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+ 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+ 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_i\bin\bnt\bt(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> const val);\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_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+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+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* 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* 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* 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+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+ piece hashes.\n+ 4. The torrent is bencoded into a file or buffer.\n+If there are a lot of files and or deep directory hierarchies to traverse, step\n+one can be time consuming.\n+Typically step 3 is by far the most time consuming step, since it requires to\n+read all the bytes from all the files in the torrent.\n+All of these classes and functions are declared by including libtorrent/\n+create_torrent.hpp.\n+example:\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+[_\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_t\bto\bor\brr\bre\ben\bnt\bt *\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+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 (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<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n+ file_storage const& f\bfi\bil\ble\bes\bs () const;\n+ void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n+ void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n+ void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n+ void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n+ void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece,\n+sha256_hash const& h);\n+ void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n+ void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n+ void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> node);\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n+ void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n+ bool p\bpr\bri\biv\bv () const;\n+ void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n+ bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n+ bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+ index_range<piece_index_t> 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<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+ index_range<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n+ int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+ void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+\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 (file_storage& fs, int piece_size = 0\n+ , create_flags_t flags = {});\n+explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n+The piece_size is the size of each piece in bytes. It must be a power of 2 and\n+a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be\n+set automatically. Piece sizes greater than 128 MiB are considered unreasonable\n+and will be rejected (with an lt::system_error exception).\n+The flags arguments specifies options for the torrent creation. It can be any\n+combination of the flags defined by create_flags_t.\n+The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be (fs) parameter defines the files, sizes and their properties\n+for the torrent to be created. Set this up first, before passing it to the\n+_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt constructor.\n+The overload that takes a torrent_info object will make a verbatim copy of its\n+info dictionary (to preserve the info-hash). The copy of the info dictionary\n+will be used by _\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). This means that none of the member\n+functions of _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt that affects the content of the info dictionary\n+(such as _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)), will have any affect. Instead of using this overload,\n+consider using _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) instead.\n+Warning\n+The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be and _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo objects must stay alive for the entire\n+duration of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b*\n+entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n+std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n+This function will generate the .torrent file as a bencode tree, or a bencoded\n+into a buffer. In order to encode the _\be_\bn_\bt_\br_\by into a flat file, use the _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n+function.\n+The function returning an _\be_\bn_\bt_\br_\by may be useful to add custom entries to the\n+torrent file before bencoding it and saving it to disk.\n+Whether the resulting torrent object is v1, v2 or hybrid depends on whether any\n+of the v1_only or v2_only flags were set on the constructor. If neither were\n+set, the resulting torrent depends on which hashes were set. If both v1 and v2\n+hashes were set, a hybrid torrent is created.\n+Any failure will cause this function to throw system_error, with an appropriate\n+error message. These are the reasons this call may throw:\n+ * the file storage has 0 files\n+ * the total size of the file storage is 0 bytes (i.e. it only has empty\n+ files)\n+ * not all v1 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)) and not all v2 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) were\n+ set\n+ * for v2 torrents, you may not have a directory with the same name as a\n+ file. If that's encountered in the file storage, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) fails.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_storage const& f\bfi\bil\ble\bes\bs () const;\n+returns an immutable reference to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be used to create the torrent\n+from.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n+Sets the comment for the torrent. The string str should be utf-8 encoded. The\n+comment in a torrent file is optional.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n+Sets the creator of the torrent. The string str should be utf-8 encoded. This\n+is optional.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n+sets the \"creation time\" field. Defaults to the system clock at the time of\n+construction of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object. The timestamp is specified in\n+seconds, posix time. If the creation date is set to 0, the \"creation date\"\n+field will be omitted from the generated torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n+This sets the SHA-1 hash for the specified piece (index). You are required to\n+set the hash for every piece in the torrent before generating it. If you have\n+the files on disk, you can use the high level convenience function to do this.\n+See _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b). A SHA-1 hash of all zeros is internally used to\n+indicate a hash that has not been set. Setting such hash will not be considered\n+set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function will throw std::system_error if it\n+is called on an object constructed with the v2_only flag.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash\n+const& h);\n+sets the bittorrent v2 hash for filefileof the piecepiece.pieceis relative to\n+the first piece of the file, starting at 0. The first piece in the file can be\n+computed with _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b). The hash,h, is the root of\n+the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must\n+be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n+all zeros is internally used to indicate a hash that has not been set. Setting\n+such hash will not be considered set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function\n+will throw std::system_error if it is called on an object constructed with the\n+v1_only flag.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n+This adds a url seed to the torrent. You can have any number of url seeds. For\n+a single file torrent, this should be an HTTP url, pointing to a file with\n+identical content as the file of the torrent. For a multi-file torrent, it\n+should point to a directory containing a directory with the same name as this\n+torrent, and all the files of the torrent in it.\n+The second function, add_http_seed() adds an HTTP seed instead.\n+[_\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<std::string, int> node);\n+This adds a DHT node to the torrent. This especially useful if you're creating\n+a tracker less torrent. It can be used by clients to bootstrap their DHT node\n+from. The node is a hostname and a port number where there is a DHT node\n+running. You can have any number of DHT nodes in a torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n+Adds a tracker to the torrent. This is not strictly required, but most torrents\n+use a tracker as their main source of peers. The url should be an _\bh_\bt_\bt_\bp_\b:_\b/_\b/ or\n+udp:// url to a machine running a bittorrent tracker that accepts announces for\n+this torrent's info-hash. The tier is the fallback priority of the tracker. All\n+trackers with tier 0 are tried first (in any order). If all fail, trackers with\n+tier 1 are tried. If all of those fail, trackers with tier 2 are tried, and so\n+on.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n+This function sets an X.509 certificate in PEM format to the torrent. This\n+makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n+valid certificate signed by this root certificate. For SSL torrents, all peers\n+are connecting over SSL connections. For more information, see the section on\n+_\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n+The string is not the path to the cert, it's the actual content of the\n+certificate.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+bool p\bpr\bri\biv\bv () const;\n+void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n+Sets and queries the private flag of the torrent. Torrents with the private\n+flag set ask the client to not use any other sources than the tracker for\n+peers, and to not use DHT to advertise itself publicly, only the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+returns the number of pieces in the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+all piece indices in the torrent to be created\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+all file indices in the torrent to be created\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n+for v2 and hybrid torrents only, the pieces in the specified file, specified as\n+delta from the first piece in the file. i.e. the first index is 0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+the total number of bytes of all files and pad files\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+piece_length() returns the piece size of all pieces but the last one.\n+piece_size() returns the size of the specified piece. these functions are just\n+forwarding to the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+Add similar torrents (by info-hash) or collections of similar torrents. Similar\n+torrents are expected to share some files with this torrent. Torrents sharing a\n+collection name with this torrent are also expected to share files with this\n+torrent. A torrent may have more than one collection and more than one similar\n+torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ modification_time\n+ This will include the file modification time as part of the torrent. This\n+ is not enabled by default, as it might cause problems when you create a\n+ torrent from separate files with the same content, hoping to yield the\n+ same info-hash. If the files have different modification times, with this\n+ option enabled, you would get different info-hashes for the files.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ symlinks\n+ If this flag is set, files that are symlinks get a symlink attribute set\n+ on them and their data will not be included in the torrent. This is\n+ useful if you need to reconstruct a file hierarchy which contains\n+ symlinks.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ v2_only\n+ Do not generate v1 metadata. The resulting torrent will only be usable by\n+ clients which support v2. This requires setting all v2 hashes, with\n+ _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b) before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). Setting v1 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh\n+ _\b(_\b)) is an error with this flag set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ v1_only\n+ do not generate v2 metadata or enforce v2 alignment and padding rules\n+ this is mainly for tests, not recommended for production use. This\n+ requires setting all v1 hashes, with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b), before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be\n+ _\b(_\b). Setting v2 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) is an error with this flag set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ canonical_files\n+ This flag only affects v1-only torrents, and is only relevant together\n+ with the v1_only_flag. This flag will force the same file order and\n+ padding as a v2 (or hybrid) torrent would have. It has the effect of\n+ ordering files and inserting pad files to align them with piece\n+ boundaries.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ no_attributes\n+ passing this flag to _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) will ignore file attributes (such as\n+ executable or hidden) when adding the files to the file storage. Since\n+ not all filesystems and operating systems support all file attributes the\n+ resulting torrent may differ depending on where it's created. If it's\n+ important for torrents to be created consistently across systems, this\n+ flag should be set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ canonical_files_no_tail_padding\n+ this flag enforces the file layout to be canonical according to the\n+ bittorrent v2 specification (just like the canonical_files flag) with the\n+ one exception that tail padding is not added to the last file. This\n+ behavior deviates from the specification but was the way libtorrent\n+ created torrents in version up to and including 2.0.7. This flag is here\n+ for backwards compatibility.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n+ , std::function<bool(std::string)> p, create_flags_t flags = {});\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n+ , create_flags_t flags = {});\n+Adds the file specified by path to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object. In case path refers\n+to a directory, files will be added recursively from the directory.\n+If specified, the predicate p is called once for every file and directory that\n+is encountered. Files for which p returns true are added, and directories for\n+which p returns true are traversed. p must have the following signature:\n+bool Pred(std::string const& p);\n+The path that is passed in to the predicate is the full path of the file or\n+directory. If no predicate is specified, all files are added, and all\n+directories are traversed.\n+The \"..\" directory is never traversed.\n+The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n+constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+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<void(piece_index_t)> 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<void(piece_index_t)> const& f, error_code& ec);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function<void(piece_index_t)> const& f);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , std::function<void(piece_index_t)> 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<void(piece_index_t)> 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+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* w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+the _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by holds information about a web seed (also known as URL seed\n+or HTTP seed). It is essentially a URL with some state associated with it. For\n+more information, see _\bB_\bE_\bP_\b _\b1_\b7 and _\bB_\bE_\bP_\b _\b1_\b9.\n+struct web_seed_entry\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n+\n+ enum type_t\n+ {\n+ url_seed,\n+ http_seed,\n+ };\n+\n+ std::string url;\n+ std::string auth;\n+ headers_t extra_headers;\n+ std::uint8_t type;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n+URL and type comparison\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n+URL and type less-than comparison\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ url\n+ The URL of the web seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ auth\n+ Optional authentication. If this is set, it's passed in as HTTP basic\n+ auth to the web seed. The format is: username:password.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ extra_headers\n+ Any extra HTTP headers that need to be passed to the web seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ type\n+ The type of web seed (see _\bt_\by_\bp_\be_\b__\bt)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_l\bli\bim\bmi\bit\bts\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+this object holds configuration options for limits to use when loading\n+torrents. They are meant to prevent loading potentially malicious torrents that\n+cause excessive memory allocations.\n+struct load_torrent_limits\n+{\n+ int m\bma\bax\bx_\b_b\bbu\buf\bff\bfe\ber\br_\b_s\bsi\biz\bze\be = 10000000;\n+ int m\bma\bax\bx_\b_p\bpi\bie\bec\bce\bes\bs = 0x200000;\n+ int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_d\bde\bep\bpt\bth\bh = 100;\n+ int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_t\bto\bok\bke\ben\bns\bs = 3000000;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_buffer_size\n+ the max size of a .torrent file to load into RAM\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_pieces\n+ the max number of pieces allowed in the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_decode_depth\n+ the max recursion depth in the bdecoded structure\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_decode_tokens\n+ the max number of bdecode tokens\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n+class torrent_info\n+{\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 (bdecode_node const& torrent_file);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (std::string const& filename);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, error_code& ec, from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\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\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<announce_entry> const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ std::vector<std::string> c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+ void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+ std::vector<web_seed_entry> const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n+ void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+ void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector<web_seed_entry> seeds);\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+ piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+ index_range<piece_index_t> 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\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<file_slice> 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<std::pair<std::string, int>> const& n\bno\bod\bde\bes\bs () const;\n+ void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> 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<char const> i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n+ span<char const> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n+ void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (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 (bdecode_node const& torrent_file);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (std::string const& filename);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> buffer, error_code& ec, from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+The constructor that takes an info-hash will initialize the info-hash to the\n+given value, but leave all other fields empty. This is used internally when\n+downloading torrents without the metadata. The metadata will be created by\n+libtorrent as soon as it has been downloaded from the swarm.\n+The constructor that takes a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will create a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+from the information found in the given torrent_file. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n+represents a tree node in an bencoded file. To load an ordinary .torrent file\n+into a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, use _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n+The version that takes a buffer pointer and a size will decode it as a .torrent\n+file and initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object for you.\n+The version that takes a filename will simply load the torrent file and decode\n+it inside the constructor, for convenience. This might not be the most suitable\n+for applications that want to be able to report detailed errors on what might\n+go wrong.\n+There is an upper limit on the size of the torrent file that will be loaded by\n+the overload taking a filename. If it's important that even very large torrent\n+files are loaded, use one of the other overloads.\n+The overloads that takes an error_code const& never throws if an error occur,\n+they will simply set the error code to describe what went wrong and not fully\n+initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object. The overloads that do not take the extra\n+error_code parameter will always throw if an error occurs. These overloads are\n+not available when building without exception support.\n+The overload that takes a span also needs an extra parameter of type\n+from_span_t to disambiguate the std::string overload for string literals. There\n+is an object in the libtorrent namespace of this type called from_span.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n+frees all storage associated with this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_storage const& f\bfi\bil\ble\bes\bs () const;\n+file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n+The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object contains the information on how to map the pieces to\n+files. It is separated from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object because when creating\n+torrents a storage object needs to be created without having a torrent file.\n+When renaming files in a storage, the storage needs to make its own copy of the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be in order to make its mapping differ from the one in the torrent\n+file.\n+orig_files() returns the original (unmodified) file storage for this torrent.\n+This is used by the web server connection, which needs to request files with\n+the original names. Filename may be changed using torrent_info::rename_file().\n+For more information on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, see the separate document on\n+how to create torrents.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+Renames the file with the specified index to the new name. The new filename is\n+reflected by the file_storage returned by files() but not by the one returned\n+by orig_files().\n+If you want to rename the base name of the torrent (for a multi file torrent),\n+you can copy the file_storage (see _\bf_\bi_\bl_\be_\bs_\b(_\b) and _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) ), change the name,\n+and then use _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\n+The new_filename can both be a relative path, in which case the file name is\n+relative to the save_path of the torrent. If the new_filename is an absolute\n+path (i.e. is_complete(new_filename) == true), then the file is detached from\n+the save_path of the torrent. In this case the file is not moved when\n+_\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b) is invoked.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n+Warning\n+Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n+because the piece boundaries and piece hashes in v2 torrents are intimately\n+tied to the file boundaries. Instead, just rename individual files, or\n+implement a custom _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be to customize how to store files.\n+Remaps the file storage to a new file layout. This can be used to, for\n+instance, download all data in a torrent to a single file, or to a number of\n+fixed size sector aligned files, regardless of the number and sizes of the\n+files in the torrent.\n+The new specified file_storage must have the exact same size as the current\n+one.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+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<announce_entry> const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+add_tracker() adds a tracker to the announce-list. The tier determines the\n+order in which the trackers are to be tried. The trackers() function will\n+return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n+string, which is the tracker url, and a tier index. The tier index is the high-\n+level priority. No matter which trackers that works or not, the ones with lower\n+tier will always be tried before the one with higher tier number. For more\n+information, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n+trackers() returns all entries from announce-list.\n+clear_trackers() removes all trackers from announce-list.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs(\b()\b) s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+std::vector<std::string> 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) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+std::vector<web_seed_entry> const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector<web_seed_entry> seeds);\n+web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n+a web_seed_entry and may refer to either a url seed or http seed.\n+add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n+set_web_seeds() replaces all web seeds with the ones specified in the seeds\n+vector.\n+The extern_auth argument can be used for other authorization schemes than basic\n+HTTP authorization. If set, it will override any username and password found in\n+the URL itself. The string will be sent as the HTTP authorization header's\n+value (without specifying \"Basic\").\n+The extra_headers argument defaults to an empty list, but can be used to insert\n+custom HTTP headers in the requests to a specific web seed.\n+See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+total_size() returns the total number of bytes the torrent-file represents.\n+Note that this is the number of pieces times the piece size (modulo the last\n+piece possibly being smaller). With pad files, the total size will be larger\n+than the sum of all (regular) file sizes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+piece_length() and num_pieces() returns the number of byte for each piece and\n+the total number of pieces, respectively. The difference between piece_size()\n+and piece_length() is that piece_size() takes the piece index as argument and\n+gives you the exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be smaller.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+returns the number of blocks there are in the typical piece. There may be fewer\n+in the last piece)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) 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+index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n+piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+last_piece() returns the index to the last piece in the torrent and end_piece()\n+returns the index to the one-past-end piece in the torrent piece_range()\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n+returns the info-hash of the torrent. For BitTorrent v2 support, use\n+info_hashes() to get an object that may hold both a v1 and v2 info-hash\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* v\bv1\b1(\b()\b) v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+bool v\bv1\b1 () const;\n+bool v\bv2\b2 () const;\n+returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n+torrents have both. These are shortcuts for info_hashes().has_v1() and\n+info_hashes().has_v2() calls.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n+If you need index-access to files you can use the num_files() along with the\n+file_path(), file_size()-family of functions to access files using indices.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector<file_slice> 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- bw_idle\n- The peer is not waiting for any external events to send or receive data.\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- bw_limit\n- The peer is waiting for the rate limiter.\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- 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+*\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- 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+*\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- 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+*\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**\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+*\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* 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+*\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- piece\n- The index of the piece in which the range starts.\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- start\n- The byte offset within that piece where the range starts.\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- length\n- The size of the range, in bytes.\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**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n-inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n-rhs);\n+*\b**\b**\b**\b**\b* 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**\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+*\b**\b**\b**\b**\b* n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector<std::pair<std::string, int>> 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**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri);\n-void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n-This function parses out information from the magnet link and populates the\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. The overload that does not take an error_code\n-reference will throw a system_error on error The overload taking an\n-add_torrent_params reference will fill in the fields specified in the magnet\n-URI.\n+*\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<std::string, int> 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**\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+*\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**\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-\"<major>.<minor>.<tiny>.<tag>\"\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**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename);\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<char const> buffer, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span<char const> 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, 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_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-These functions load the content of a .torrent file into an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n-object. The immutable part of a torrent file (the info-dictionary) is stored in\n-the ti field in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object (as a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object). The\n-returned object is suitable to be:\n- * added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- * saved as a .torrent_file via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- * turned into a magnet link via _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+span<char const> 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**\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+*\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<char const> 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**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bc_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bs_\bl_\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b* 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* 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+*\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+ 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+ 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+ ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+ bool e\bem\bmp\bpt\bty\by () const;\n+ void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t\n+flags);\n+ std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n+ filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\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+*\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**\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+*\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**\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+*\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**\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+*\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**\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+*\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* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n- dont_download\n- Don't download the file or piece. Partial pieces may still be downloaded\n- when setting file priorities.\n- default_priority\n- The default priority for files and pieces.\n- low_priority\n- The lowest priority for files and pieces.\n- top_priority\n- The highest priority for files and pieces.\n+*\b**\b**\b**\b**\b**\b* p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+the port filter maps non-overlapping port ranges to flags. This is primarily\n+used to indicate whether a range of ports should be connected to or not. The\n+default is to have the full port range (0-65535) set to flag 0.\n+class port_filter\n+{\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const&);\n+ ~\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+ port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n+ void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t\n+flags);\n+ std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\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+*\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**\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+*\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**\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+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm a\bac\bcc\bce\bes\bss\bs_\b_f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|blocked|1 |this flag indicates that destination ports in the range should|\n+|_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\b _\bb_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\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- _\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+ _\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@@ -1481,17 +4897,17 @@\n \n unsigned bytes_progress:15;\n unsigned block_size:15;\n unsigned state:2;\n unsigned num_peers:14;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br(\b()\b) p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-_\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\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@@ -1585,96 +5001,96 @@\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<char> data,\n add_piece_flags_t flags = {}) const;\n void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n- void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector<peer_info>& v) 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<peer_info>& 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<partial_piece_info>& 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<partial_piece_info> g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+ void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector<partial_piece_info>& queue) const;\n+ void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n void 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 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 f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector<std::int64_t>& 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<std::int64_t> 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<std::int64_t>& progress,\n+file_progress_flags_t flags = {}) const;\n std::vector<open_file_state> f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs () const;\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n- std::vector<announce_entry> t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n+ std::vector<announce_entry> 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<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- std::set<std::string> u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ std::set<std::string> 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<std::string> h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n- void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n std::function<std::shared_ptr<torrent_plugin>(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<char const> metadata) const;\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void r\bre\bes\bsu\bum\bme\be () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n 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+ 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_t\bto\bop\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n+ void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\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_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params);\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n std::shared_ptr<torrent_info> 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<const torrent_info> t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n std::vector<std::vector<sha256_hash>> 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<int>& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n- std::vector<download_priority_t> g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n+ void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector<int>& 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 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<download_priority_t> const& pieces)\n const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector<std::pair<piece_index_t,\n download_priority_t>> const& pieces) const;\n- std::vector<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n+ std::vector<download_priority_t> 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 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<download_priority_t> 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+ std::vector<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n+ void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n- void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n- void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+ void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void 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@@ -1682,17 +5098,17 @@\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n void m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (std::string const& save_path\n , move_flags_t flags = move_flags_t::always_replace_files\n ) const;\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n 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+ 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<torrent> 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@@ -1759,16 +5175,16 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n Returns true if this piece has been completely downloaded and written to disk,\n and false otherwise.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector<peer_info>& v) 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<peer_info>& 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@@ -1789,29 +5205,29 @@\n It will trigger posting of a _\bs_\bt_\ba_\bt_\be_\b__\bu_\bp_\bd_\ba_\bt_\be_\b__\ba_\bl_\be_\br_\bt with a single _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n object for this torrent.\n In order to get regular updates for torrents whose status changes, consider\n calling session::post_torrent_updates()`` instead.\n By default everything is included. The flags you can use to decide what to\n i\bin\bnc\bcl\blu\bud\bde\be are defined in this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector<partial_piece_info>& queue) const;\n-void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+*\b**\b**\b**\b**\b* 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<partial_piece_info> g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector<partial_piece_info>& queue) const;\n post_download_queue() triggers a download_queue_alert to be posted.\n get_download_queue() is a synchronous call and returns a vector with\n information about pieces that are partially downloaded or not downloaded but\n partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n vector.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\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 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 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 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@@ -1820,19 +5236,19 @@\n deadline is the number of milliseconds until this piece should be completed.\n reset_piece_deadline removes the deadline from the piece. If it hasn't already\n been downloaded, it will no longer be considered a priority.\n clear_piece_deadlines() removes deadlines on all pieces in the torrent. As if\n _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) was called on all pieces.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* 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 f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector<std::int64_t>& progress, file_progress_flags_t\n-flags = {}) const;\n void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n std::vector<std::int64_t> 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<std::int64_t>& 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@@ -1855,16 +5271,16 @@\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n If the torrent is in an error state (i.e. torrent_status::error is non-empty),\n this will clear the error and start the torrent again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) 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) p\bpo\bos\bst\bt_\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-std::vector<announce_entry> t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n+std::vector<announce_entry> 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<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@@ -1874,30 +5290,30 @@\n add_tracker() will look if the specified tracker is already in the set. If it\n is, it doesn't do anything. If it's not in the current set of trackers, it will\n insert it in the tier specified in the _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n The updated set of trackers will be saved in the resume data, and when a\n torrent is started with resume data, the trackers from the resume data will\n replace the original ones.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n-std::set<std::string> u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\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<std::string> u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n add_url_seed() adds another url to the torrent's list of url seeds. If the\n given url already exists in that list, the call has no effect. The torrent will\n connect to the server and try to download pieces from it, unless it's paused,\n queued, checking or seeding. remove_url_seed() removes the given url if it\n exists already. url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from the list.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\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<std::string> h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n-void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n 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<std::shared_ptr<torrent_plugin>(torrent_handle const&,\n@@ -1928,15 +5344,15 @@\n and false afterward.\n Clients should only use _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) to determine if the result of session::\n find_torrent() was successful.\n Unlike other member functions which return a value, _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) completes\n immediately, without blocking on a result from the network thread. Also unlike\n other functions, it never throws the system_error exception.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\bes\bsu\bum\bme\be () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n pause(), and resume() will disconnect all peers and reconnect all peers\n respectively. When a torrent is paused, it will however remember all share\n ratios to all peers and remember all potential (not connected) peers. Torrents\n may be paused automatically if there is a file error (e.g. disk full) or\n something similar. See _\bf_\bi_\bl_\be_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt.\n@@ -1945,19 +5361,19 @@\n for the torrent_status::paused flag.\n Note\n Torrents that are auto-managed may be automatically resumed again. It does not\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more\n information, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\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) f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n 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+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@@ -2081,21 +5497,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_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b)\n-q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\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_t\bto\bop\bp () const;\n+*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\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_b\bbo\bot\btt\bto\bom\bm () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\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@@ -2109,15 +5525,15 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n updates the position in the queue for this torrent. The relative order of all\n other torrents remain intact but their numerical queue position shifts to make\n space for this torrent's new position\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be(\b()\b) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params);\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n@@ -2138,15 +5554,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()\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+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n std::shared_ptr<torrent_info> 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<const torrent_info> 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@@ -2174,33 +5590,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<std::vector<sha256_hash>> 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-void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector<int>& avail) const;\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<int>& 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<int> with the availability\n for each piece in this torrent. libtorrent does not keep track of availability\n for seeds, so if the torrent is seeding the availability for all pieces is\n reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<download_priority_t> 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+*\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\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector<download_priority_t> const& pieces) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector<std::pair<piece_index_t,\n download_priority_t>> const& pieces) const;\n+std::vector<download_priority_t> 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@@ -2220,19 +5636,19 @@\n where the piece index or priority is out of range, are not allowed.\n get_piece_priorities returns a vector with one element for each piece in the\n torrent. Each element is the current priority of that piece.\n It's possible to cancel the effect of f\bfi\bil\ble\be priorities by setting the priorities\n for the affected pieces. Care has to be taken when mixing usage of file- and\n piece priorities.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\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 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<download_priority_t> 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+std::vector<download_priority_t> g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () 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@@ -2251,19 +5667,19 @@\n When combining file- and piece priorities, the resume file will record both.\n When loading the resume data, the file priorities will be applied first, then\n the piece priorities.\n Moving data from a file into the part file is currently not supported. If a\n file has its priority set to 0 a\baf\bft\bte\ber\br it has already been created, it will not\n be moved into the partfile.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\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+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_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t = {})\n const;\n void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n-void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n force_reannounce() will force this torrent to do another tracker request, to\n receive new peers. The seconds argument specifies how many seconds from now to\n issue the tracker announces.\n If the tracker's min_interval has not passed since the last announce, the\n forced announce will be scheduled to happen immediately as the min_interval\n expires. This is to honor trackers minimum re-announce interval settings.\n The tracker_index argument specifies which tracker to re-announce. If set to -\n@@ -2281,18 +5697,18 @@\n A scrape request queries the tracker for statistics such as total number of\n incomplete peers, complete peers, number of downloads etc.\n This request will specifically update the num_complete and num_incomplete\n fields in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs struct once it completes. When it completes, it\n will generate a _\bs_\bc_\br_\ba_\bp_\be_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt. If it fails, it will generate a\n _\bs_\bc_\br_\ba_\bp_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n 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@@ -2396,17 +5812,17 @@\n returns the info-hash(es) of the torrent. If this handle is to a torrent that\n hasn't loaded yet (for instance by being added) by a URL, the returned value is\n undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes()\n instead.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (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 *\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@@ -2540,699 +5956,39 @@\n is announced immediately.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n std::size_t h\bha\bas\bsh\bh_\b_v\bva\bal\blu\bue\be (torrent_handle const& h);\n for std::hash (and to support using this type in unordered_map etc.)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-the _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by holds information about a web seed (also known as URL seed\n-or HTTP seed). It is essentially a URL with some state associated with it. For\n-more information, see _\bB_\bE_\bP_\b _\b1_\b7 and _\bB_\bE_\bP_\b _\b1_\b9.\n-struct web_seed_entry\n-{\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n-\n- enum type_t\n- {\n- url_seed,\n- http_seed,\n- };\n-\n- std::string url;\n- std::string auth;\n- headers_t extra_headers;\n- std::uint8_t type;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n-URL and type comparison\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n-URL and type less-than comparison\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- url\n- The URL of the web seed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- auth\n- Optional authentication. If this is set, it's passed in as HTTP basic\n- auth to the web seed. The format is: username:password.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- extra_headers\n- Any extra HTTP headers that need to be passed to the web seed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- type\n- The type of web seed (see _\bt_\by_\bp_\be_\b__\bt)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_l\bli\bim\bmi\bit\bts\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents that\n-cause excessive memory allocations.\n-struct load_torrent_limits\n-{\n- int m\bma\bax\bx_\b_b\bbu\buf\bff\bfe\ber\br_\b_s\bsi\biz\bze\be = 10000000;\n- int m\bma\bax\bx_\b_p\bpi\bie\bec\bce\bes\bs = 0x200000;\n- int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_d\bde\bep\bpt\bth\bh = 100;\n- int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_t\bto\bok\bke\ben\bns\bs = 3000000;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_buffer_size\n- the max size of a .torrent file to load into RAM\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_pieces\n- the max number of pieces allowed in the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_decode_depth\n- the max recursion depth in the bdecoded structure\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_decode_tokens\n- the max number of bdecode tokens\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n-class torrent_info\n-{\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (std::string const& filename, 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 (std::string const& filename);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n- 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 (span<char const> 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 (span<char const> buffer, load_torrent_limits const& cfg,\n-from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, 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& 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\n- , announce_entry::tracker_source source);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n- std::vector<announce_entry> 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<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n- std::vector<std::string> 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<web_seed_entry> seeds);\n- void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n- std::vector<web_seed_entry> 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- 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 l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n- piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n- index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n- sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n- info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n- bool v\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<file_slice> m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n- peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int\n-size) const;\n- string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n- bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- bool p\bpr\bri\biv\bv () const;\n- bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n- sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n- char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n- bool i\bis\bs_\b_l\blo\boa\bad\bde\bed\bd () const;\n- const std::string& n\bna\bam\bme\be () const;\n- std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n- const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n- const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n- std::vector<std::pair<std::string, int>> const& n\bno\bod\bde\bes\bs () const;\n- void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> 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<char const> i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n- span<char const> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n- void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span<char const> 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 (std::string const& filename, 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 (std::string const& filename);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n-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 (span<char const> 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 (span<char const> buffer, load_torrent_limits const& cfg,\n-from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, 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-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_storage const& f\bfi\bil\ble\bes\bs () const;\n-file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n-The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object contains the information on how to map the pieces to\n-files. It is separated from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object because when creating\n-torrents a storage object needs to be created without having a torrent file.\n-When renaming files in a storage, the storage needs to make its own copy of the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be in order to make its mapping differ from the one in the torrent\n-file.\n-orig_files() returns the original (unmodified) file storage for this torrent.\n-This is used by the web server connection, which needs to request files with\n-the original names. Filename may be changed using torrent_info::rename_file().\n-For more information on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, see the separate document on\n-how to create torrents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n-Renames the file with the specified index to the new name. The new filename is\n-reflected by the file_storage returned by files() but not by the one returned\n-by orig_files().\n-If you want to rename the base name of the torrent (for a multi file torrent),\n-you can copy the file_storage (see _\bf_\bi_\bl_\be_\bs_\b(_\b) and _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) ), change the name,\n-and then use _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\n-The new_filename can both be a relative path, in which case the file name is\n-relative to the save_path of the torrent. If the new_filename is an absolute\n-path (i.e. is_complete(new_filename) == true), then the file is detached from\n-the save_path of the torrent. In this case the file is not moved when\n-_\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b) is invoked.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n-Warning\n-Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n-because the piece boundaries and piece hashes in v2 torrents are intimately\n-tied to the file boundaries. Instead, just rename individual files, or\n-implement a custom _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be to customize how to store files.\n-Remaps the file storage to a new file layout. This can be used to, for\n-instance, download all data in a torrent to a single file, or to a number of\n-fixed size sector aligned files, regardless of the number and sizes of the\n-files in the torrent.\n-The new specified file_storage must have the exact same size as the current\n-one.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) 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\n- , announce_entry::tracker_source source);\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n-std::vector<announce_entry> 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<sha1_hash> s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n-std::vector<std::string> c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n-These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n-returned from these correspond to the \"similar\" and \"collections\" keys in the\n-.torrent file. Both info-hashes and collections from within the info-dict and\n-from outside of it are included.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector<web_seed_entry> seeds);\n-void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n-std::vector<web_seed_entry> 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-web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n-a web_seed_entry and may refer to either a url seed or http seed.\n-add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n-set_web_seeds() replaces all web seeds with the ones specified in the seeds\n-vector.\n-The extern_auth argument can be used for other authorization schemes than basic\n-HTTP authorization. If set, it will override any username and password found in\n-the URL itself. The string will be sent as the HTTP authorization header's\n-value (without specifying \"Basic\").\n-The extra_headers argument defaults to an empty list, but can be used to insert\n-custom HTTP headers in the requests to a specific web seed.\n-See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n-total_size() returns the total number of bytes the torrent-file represents.\n-Note that this is the number of pieces times the piece size (modulo the last\n-piece possibly being smaller). With pad files, the total size will be larger\n-than the sum of all (regular) file sizes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int 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* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n-piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n-index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n-last_piece() returns the index to the last piece in the torrent and end_piece()\n-returns the index to the one-past-end piece in the torrent piece_range()\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all pieces in the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n-info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n-returns the info-hash of the torrent. For BitTorrent v2 support, use\n-info_hashes() to get an object that may hold both a v1 and v2 info-hash\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* v\bv1\b1(\b()\b) v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-bool v\bv2\b2 () const;\n-bool v\bv1\b1 () const;\n-returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n-torrents have both. These are shortcuts for info_hashes().has_v1() and\n-info_hashes().has_v2() calls.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n-If you need index-access to files you can use the num_files() along with the\n-file_path(), file_size()-family of functions to access files using indices.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<file_slice> m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n-This function will map a piece index, a byte offset within that piece and a\n-size (in bytes) into the corresponding files with offsets where that data for\n-that piece is supposed to be stored. See _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int size)\n-const;\n-This function will map a range in a specific file into a range in the torrent.\n-The file_offset parameter is the offset in the file, given in bytes, where 0 is\n-the start of the file. See _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt.\n-The input range is assumed to be valid within the torrent. file_offset + size\n-is not allowed to be greater than the file size. file_index must refer to a\n-valid file, i.e. it cannot be >= num_files().\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n-Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n-Otherwise returns an empty string. The certificate is the public certificate in\n-x509 format.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-returns true if this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object has a torrent loaded. This is\n-primarily used to determine if a magnet link has had its metadata resolved yet\n-or not.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpr\bri\biv\bv () const;\n-returns true if this torrent is private. i.e., the client should not advertise\n-itself on the trackerless network (the Kademlia DHT) for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_i\bi2\b2p\bp(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n-returns true if this is an i2p torrent. This is determined by whether or not it\n-has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n-DHT and local peer discovery as well as talking to peers over anything other\n-than the i2p network.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n-returns the piece size of file with index. This will be the same as\n-_\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n-char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n-hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n-that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n-of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n-digest for the piece. Note that the string is not 0-terminated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& n\bna\bam\bme\be () const;\n-name() returns the name of the torrent. name contains UTF-8 encoded string.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n-creation_date() returns the creation date of the torrent as time_t (_\bp_\bo_\bs_\bi_\bx\n-_\bt_\bi_\bm_\be). If there's no time stamp in the torrent file, 0 is returned. .. posix\n-time: _\bh_\bt_\bt_\bp_\b:_\b/_\b/_\bw_\bw_\bw_\b._\bo_\bp_\be_\bn_\bg_\br_\bo_\bu_\bp_\b._\bo_\br_\bg_\b/_\bo_\bn_\bl_\bi_\bn_\be_\bp_\bu_\bb_\bs_\b/_\b0_\b0_\b9_\b6_\b9_\b5_\b3_\b9_\b9_\b/_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b/_\bt_\bi_\bm_\be_\b._\bh_\bt_\bm_\bl\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n-creator() returns the creator string in the torrent. If there is no creator\n-string it will return an empty string.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n-comment() returns the comment associated with the torrent. If there's no\n-comment, it will return an empty string. comment contains UTF-8 encoded string.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<std::pair<std::string, int>> 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<std::string, int> 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<char const> 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<char const> 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* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-this is a SHA-1 hash class.\n-You use it by first instantiating it, then call update() to feed it with data.\n-i.e. you don't have to keep the entire buffer of which you want to create the\n-hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n-fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n-hash of the data.\n-The constructor that takes a char const* and an integer will construct the sha1\n-context and feed it the data passed in.\n-If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n-to call reset() to reinitialize it.\n-The built-in software version of sha1-algorithm was implemented by Steve Reid\n-and released as public domain. For more info, see src/sha1.cpp.\n-class hasher\n-{\n- h\bha\bas\bsh\bhe\ber\br ();\n- hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n- h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n- explicit h\bha\bas\bsh\bhe\ber\br (span<char const> data);\n- h\bha\bas\bsh\bhe\ber\br (hasher const&);\n- hasher& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n- hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha1_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n-h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n-explicit h\bha\bas\bsh\bhe\ber\br (span<char const> data);\n-h\bha\bas\bsh\bhe\ber\br (hasher const&);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n-hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-class hasher256\n-{\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n- explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span<char const> data);\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n- hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n- hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n- hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha256_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n- ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) *\b**\b**\b**\b**\b*\n-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<char const> data);\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n-hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n-hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha256_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n-The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n-array.\n-struct bitfield\n-{\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\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- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n- 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* 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 (int bits, bool val);\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-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n-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* d\bda\bat\bta\ba () noexcept;\n-char const* d\bda\bat\bta\ba () const noexcept;\n-returns a pointer to the internal buffer of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, or nullptr if it's\n-empty.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n-swaps the bit-fields two variables refer to\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-int c\bco\bou\bun\bnt\bt () const noexcept;\n-count the number of bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd that are set to 1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n-returns the index of the first set bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 1 bit.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n-returns the index to the last cleared bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 0 bit.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* 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 ();\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 ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n };\n [_\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) s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n+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 ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n [_\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@@ -3241,46 +5997,46 @@\n apply_settings() member function. To change one or more configuration options,\n create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n it in to session::apply_settings().\n see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n struct session : session_handle\n {\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn ();\n+ 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 const& params);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\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-s\bse\bes\bss\bsi\bio\bon\bn ();\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n+s\bse\bes\bss\bsi\bio\bon\bn ();\n Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n passing in session::paused). Note that add_default_plugins do not have an\n affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n the plugins to use.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n+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@@ -3314,44 +6070,44 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n started.\n struct session_params\n {\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n , std::vector<std::shared_ptr<plugin>> 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<std::shared_ptr<plugin>> exts);\n \n settings_pack settings;\n std::vector<std::shared_ptr<plugin>> extensions;\n dht::dht_state dht_state;\n dht::dht_storage_constructor_type dht_storage_constructor;\n disk_io_constructor_type disk_io_constructor;\n std::map<std::string, std::string> ext_state;\n libtorrent::ip_filter ip_filter;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n This constructor can be used to start with the default plugins (ut_metadata,\n ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector<std::shared_ptr<plugin>> exts);\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n , std::vector<std::shared_ptr<plugin>> 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<std::shared_ptr<plugin>> 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@@ -3392,25 +6148,25 @@\n , status_flags_t flags = {}) const;\n std::vector<torrent_status> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n std::function<bool(torrent_status const&)> 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- torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\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<torrent_handle> 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 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- 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&& 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 void r\bre\bes\bsu\bum\bme\be ();\n void p\bpa\bau\bus\bse\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<std::string, int> const& node);\n void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n@@ -3425,41 +6181,41 @@\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<plugin> ext);\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function<std::shared_ptr<torrent_plugin>(\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<plugin> 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+ ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n- unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- 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+ 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 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+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n- 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+ settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function<void()> 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<alert*>* 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<port_mapping_t> 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<aux::session_impl> 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@@ -3485,15 +6241,15 @@\n all()) const;\n returns the current _\bs_\be_\bs_\bs_\bi_\bo_\bn state. This can be passed to _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n to save the state to disk and restored using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) when\n constructing a new _\bs_\be_\bs_\bs_\bi_\bo_\bn. The kind of state that's included is all settings,\n the DHT routing table, possibly plugin-specific state. the flags parameter can\n be used to only save certain parts of the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\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<torrent_status>* ret\n , status_flags_t flags = {}) const;\n std::vector<torrent_status> g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n std::function<bool(torrent_status const&)> 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@@ -3543,37 +6299,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* f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n std::vector<torrent_handle> 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, error_code& ec);\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\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 You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n torrent has been added (or failed to be added) and returns an error code and a\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n The save_path field in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs must be set to a valid path where the\n@@ -3594,15 +6350,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* i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\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 ();\n void p\bpa\bau\bus\bse\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@@ -3681,15 +6437,15 @@\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 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@@ -3724,17 +6480,17 @@\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<plugin> ext);\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function<std::shared_ptr<torrent_plugin>(\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<plugin> 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<torrent_plugin>. 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@@ -3750,16 +6506,16 @@\n A _\bp_\bl_\bu_\bg_\bi_\bn that, with a small overhead, can ban peers that sends bad data\n with very high accuracy. Should eliminate most problems on poisoned\n torrents.\n #include <libtorrent/extensions/smart_ban.hpp>\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-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+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@@ -3767,27 +6523,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* l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n-bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () 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@@ -3805,16 +6561,16 @@\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+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n assignments to peers based on what kind of socket it is.\n It does not only support assigning peer classes, it also supports removing peer\n classes based on socket type.\n The order of these rules being applied are:\n 1. peer-class IP filter\n 2. peer-class type filter, removing classes\n@@ -3884,21 +6640,21 @@\n download queue is vacated and every subsequent torrent in the queue has their\n queue positions updated. This can potentially cause a large state_update to be\n posted. When removing all torrents, it is advised to remove them from the back\n of the queue, to minimize the shifting.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n-settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n+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* 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+*\b**\b**\b**\b**\b* p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function<void()> 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<alert*>* 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@@ -3941,17 +6697,17 @@\n block. It should not perform any expensive work. It really should just notify\n the main application thread.\n The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n can also be queries from a concrete type via T::alert_type, as a static\n constant.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n std::vector<port_mapping_t> 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@@ -3997,15 +6753,15 @@\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\bbu\buf\bf(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n+*\b**\b**\b**\b**\b**\b* 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 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<char const> buf\n , save_state_flags_t flags = save_state_flags_t::all());\n session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n , save_state_flags_t flags = save_state_flags_t::all());\n std::vector<char> 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@@ -4017,14 +6773,32 @@\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+ counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n+ std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+ std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+ void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n+ void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+returns the new value\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n struct stats_metric\n {\n char const* name;\n@@ -4036,32 +6810,14 @@\n the name of the counter or gauge\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n value_index type\n the index into the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array, where the underlying value of\n this counter or gauge is found. The _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array is part of the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n-struct counters\n-{\n- c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n- c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n- counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n- std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n- std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n- void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n- void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n-std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n-returns the new value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n std::vector<stats_metric> 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@@ -4077,407 +6833,14 @@\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* 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&&);\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- 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- ~\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 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&&);\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* 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 const*) = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n- operator v\bvo\boi\bid\bd*\b* () const = delete;\n- operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-\n- template <typename T, typename U\bU = typename std::enable_if<std::\n-is_pointer<T>::value>::type>\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n-construct a nullptr client data\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bon\bns\bst\bt*\b*(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n-operator v\bvo\boi\bid\bd*\b* () const = delete;\n-operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-we don't allow type-unsafe operations\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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<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 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<std::vector<download_priority_t>> 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<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 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* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n struct announce_infohash\n {\n std::string message;\n error_code last_error;\n int s\bsc\bcr\bra\bap\bpe\be_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n@@ -4544,16 +6907,16 @@\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n this class holds information about one bittorrent tracker, as it relates to a\n specific torrent.\n struct announce_entry\n {\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n- announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+ announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n \n enum tracker_source\n {\n source_torrent,\n source_client,\n@@ -4568,16 +6931,16 @@\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 a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n-announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n constructs a tracker announce _\be_\bn_\bt_\br_\by with u as the URL.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\btr\bra\bac\bck\bke\ber\br_\b_s\bso\bou\bur\brc\bce\be *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n@@ -4608,14 +6971,602 @@\n this tracker is not used anymore. 0 means unlimited\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n source\n a bitmask specifying which sources we got this tracker from.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n verified\n set to true the first time we receive a valid response from this tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n+holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+calls.\n+struct peer_class_info\n+{\n+ bool ignore_unchoke_slots;\n+ int connection_limit_factor;\n+ std::string label;\n+ int upload_limit;\n+ int download_limit;\n+ int upload_priority;\n+ int download_priority;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ignore_unchoke_slots\n+ ignore_unchoke_slots determines whether peers should always unchoke a\n+ peer, regardless of the choking algorithm, or if it should honor the\n+ unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n+ peer classes a peer belongs to has this set to true, that peer will be\n+ unchoked at all times.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connection_limit_factor\n+ adjusts the connection limit (global and per torrent) that applies to\n+ this peer class. By default, local peers are allowed to exceed the normal\n+ connection limit for instance. This is specified as a percent factor. 100\n+ makes the peer class apply normally to the limit. 200 means as long as\n+ there are fewer connections than twice the limit, we accept this peer.\n+ This factor applies both to the global connection limit and the per-\n+ torrent limit. Note that if not used carefully one peer class can\n+ potentially completely starve out all other over time.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ label\n+ not used by libtorrent. It's intended as a potentially user-facing\n+ identifier of this peer class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_limit download_limit\n+ transfer rates limits for the whole peer class. They are specified in\n+ bytes per second and apply to the sum of all peers that are members of\n+ this class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_priority download_priority\n+ relative priorities used by the bandwidth allocator in the rate limiter.\n+ If no rate limits are in use, the priority is not used either. Priorities\n+ start at 1 (0 is not a valid priority) and may not exceed 255.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+peer_class_type_filter is a simple container for rules for adding and\n+subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n+is applied (which is based on the peer's IP address).\n+struct peer_class_type_filter\n+{\n+ void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+ void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n+ , peer_class_type_filter const& rhs);\n+\n+ enum socket_type_t\n+ {\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* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+add() and remove() adds and removes a peer class to be added to new peers based\n+on socket type.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bal\bll\blo\bow\bw(\b()\b) d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+disallow() and allow() adds and removes a peer class to be removed from new\n+peers based on socket type.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* 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* 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<download_priority_t, file_index_t> 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<download_priority_t, file_index_t> const& priorities;\n+ sha1_hash info_hash;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bsl\bli\bic\bce\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+represents a window of a file in a torrent.\n+The file_index refers to the index of the file (in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo). To get\n+the path and filename, use file_path() and give the file_index as argument. The\n+offset is the byte offset in the file where the range starts, and size is the\n+number of bytes this range is. The size + offset will never be greater than the\n+file size.\n+struct file_slice\n+{\n+ file_index_t file_index;\n+ std::int64_t offset;\n+ std::int64_t size;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ file_index\n+ the index of the file\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ offset\n+ the offset from the start of the file, in bytes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ size\n+ the size of the window, in bytes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+The file_storage class represents a file list and the piece size. Everything\n+necessary to interpret a regular bittorrent storage file structure.\n+class file_storage\n+{\n+ bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+ void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\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 (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 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<file_slice> 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<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n+ piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+ piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+ index_range<piece_index_t> 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+ 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+ std::string s\bsy\bym\bml\bli\bin\bnk\bk (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+ string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+ std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n+\"\") const;\n+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+ index_range<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+ int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n+ std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n+save_path) const;\n+ void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set<std::uint32_t>& table) const;\n+ file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n+ bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n+ piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n+ void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n+ bool v\bv2\b2 () const;\n+\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_p\bpa\bad\bd_\b_f\bfi\bil\ble\be = 0_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_h\bhi\bid\bdd\bde\ben\bn = 1_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be = 2_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_s\bsy\bym\bml\bli\bin\bnk\bk = 3_bit;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+returns true if the piece length has been initialized on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be. This\n+is typically taken as a proxy of whether the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be as a whole is\n+initialized or not.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n+allocates space for num_files in the internal file list. This can be used to\n+avoid reallocating the internal file list when the number of files to be added\n+is known up-front.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (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 (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+Adds a file to the file storage. The add_file_borrow version expects that\n+filename is the file name (without a path) of the file that's being added. This\n+memory is b\bbo\bor\brr\bro\bow\bwe\bed\bd, i.e. it is the caller's responsibility to make sure it\n+stays valid throughout the lifetime of this _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object or any copy of\n+it. The same thing applies to filehash, which is an optional pointer to a 20\n+byte binary SHA-1 hash of the file.\n+if filename is empty, the filename from path is used and not borrowed.\n+The path argument is the full path (in the torrent file) to the file to add.\n+Note that this is not supposed to be an absolute path, but it is expected to\n+include the name of the torrent as the first path element.\n+file_size is the size of the file in bytes.\n+The file_flags argument sets attributes on the file. The file attributes is an\n+extension and may not work in all bittorrent clients.\n+For possible file attributes, see file_storage::flags_t.\n+The mtime argument is optional and can be set to 0. If non-zero, it is the\n+posix time of the last modification time of this file.\n+symlink_path is the path the file is a symlink to. To make this a symlink you\n+also need to set the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bl_\ba_\bg_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk file flag.\n+root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n+tree root hash for this file. This is only used for v2 torrents. If the root\n+hash is specified for one file, it has to be specified for all, otherwise this\n+function will fail. Note that the buffer root_hash points to must out-live the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, it will not be copied. This parameter is only used when\n+l\blo\boa\bad\bdi\bin\bng\bg torrents, that already have their file hashes computed. When creating\n+torrents, the file hashes will be computed by the piece hashes.\n+If more files than one are added, certain restrictions to their paths apply. In\n+a multi-file file storage (torrent), all files must share the same root\n+directory.\n+That is, the first path element of all files must be the same. This shared path\n+element is also set to the name of the torrent. It can be changed by calling\n+set_name.\n+The overloads that take anerror_codereference will report failures via that\n+variable, otherwisesystem_erroris thrown.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+renames the file at index to new_filename. Keep in mind that filenames are\n+expected to be UTF-8 encoded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector<file_slice> m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+returns a list of _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be objects representing the portions of files the\n+specified piece index, byte offset and size range overlaps. this is the inverse\n+mapping of _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b).\n+Preconditions of this function is that the input range is within the torrents\n+address space. piece may not be negative and\n+ piece * piece_size + offset + size\n+may not exceed the total size of the torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size) const;\n+returns a _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt representing the piece index, byte offset and size the\n+specified file range overlaps. This is the inverse mapping over _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b).\n+Note that the peer_request return type is meant to hold bittorrent block\n+requests, which may not be larger than 16 kiB. Mapping a range larger than that\n+may return an overflown integer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n+returns the number of files in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n+returns the index of the one-past-end file in the file storage\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all files in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+returns the total number of bytes all the files in this torrent spans\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+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+piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+returns the index of the last piece in the torrent. The last piece is special\n+in that it may be smaller than the other pieces (and the other pieces are all\n+the same size).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+returns the piece size of index. This will be the same as _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b),\n+except for the last piece, which may be shorter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n+Returns the size of the given piece. If the piece spans multiple files, only\n+the first file is considered part of the piece. This is used for v2 torrents,\n+where all files are piece aligned and padded. i.e. The pad files are not\n+considered part of the piece for this purpose.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n+returns the number of blocks in the specified piece, for v2 torrents.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+returns the number of blocks there are in the typical piece. There may be fewer\n+in the last piece)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::string const& n\bna\bam\bme\be () const;\n+void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n+set and get the name of this torrent. For multi-file torrents, this is also the\n+name of the root directory all the files are stored in.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n+swap all content of t\bth\bhi\bis\bs with t\bti\bi.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n+arrange files and padding to match the canonical form required by BEP 52\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) h\bha\bas\bsh\bh(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\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) r\bro\boo\bot\bt(\b()\b)\n+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) m\bmt\bti\bim\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash r\bro\boo\bot\bt (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+std::string s\bsy\bym\bml\bli\bin\bnk\bk (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+string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n+const;\n+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+These functions are used to query attributes of files at a given index.\n+The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n+torrent file. This can potentially be used to join a bittorrent network with\n+other file sharing networks.\n+root() returns the SHA-256 merkle tree root of the specified file, in case this\n+is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n+SHA-256 merkle tree root hash for the specified file. The pointer points into\n+storage referred to when the file was added, it is not owned by this object.\n+Torrents that are not v2 torrents return nullptr.\n+The mtime() is the modification time is the posix time when a file was last\n+modified when the torrent was created, or 0 if it was not included in the\n+torrent file.\n+file_path() returns the full path to a file.\n+file_size() returns the size of a file.\n+pad_file_at() returns true if the file at the given index is a pad-file.\n+file_name() returns j\bju\bus\bst\bt the name of the file, whereas file_path() returns the\n+path (inside the torrent file) with the filename appended.\n+file_offset() returns the byte offset within the torrent file where this file\n+starts. It can be used to map the file to a piece index (given the piece size).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_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) 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<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n+int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n+Returns the number of pieces or blocks the file atindexspans, under the\n+assumption that the file is aligned to the start of a piece. This is only\n+meaningful for v2 torrents, where files are guaranteed such alignment. These\n+numbers are used to size and navigate the merkle hash tree for each file.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n+int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n+index of first piece node in the merkle tree\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const& save_path)\n+const;\n+returns the crc32 hash of file_path(index)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set<std::uint32_t>& table) const;\n+this will add the CRC32 hash of all directory entries to the table. No filename\n+will be included, just directories. Every depth of directories are added\n+separately to allow test for collisions with files at all levels. i.e. if one\n+path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n+bar/baz will be added to the set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n+returns a bitmask of flags from file_flags_t that apply to file at index.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n+returns true if the file at the specified index has been renamed to have an\n+absolute path, i.e. is not anchored in the save path of the torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n+returns the index of the file at the given offset in the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n+finds the file with the given root hash and returns its index if there is no\n+file with the root hash, file_index_t{-1} is returned\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n+returns the piece index the given file starts at\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n+validate any symlinks, to ensure they all point to other files or directories\n+inside this storage. Any invalid symlinks are updated to point to themselves.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+bool v\bv2\b2 () const;\n+returns true if this torrent contains v2 metadata.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_pad_file\n+ the file is a pad file. It's required to contain zeros at it will not be\n+ saved to disk. Its purpose is to make the following file start on a piece\n+ boundary.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_hidden\n+ this file has the hidden attribute set. This is primarily a windows\n+ attribute\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_executable\n+ this file has the executable attribute set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_symlink\n+ this file is a symbolic link. It should have a link target string\n+ associated with it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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<disk_interface> m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+constructs a memory mapped file disk I/O object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+std::unique_ptr<disk_interface> d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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<disk_interface> d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+creates a disk io object that discards all data written to it, and only returns\n+zero-buffers when read from. May be useful for testing and benchmarking.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr<disk_interface> p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+this is a simple posix disk I/O back-end, used for systems that don't have a 64\n+bit virtual address space or don't support memory mapped files. It's\n+implemented using portable C file functions and is single-threaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |All pieces will be written to their final |\n+| | |position, all files will be allocated in full |\n+|storage_mode_allocate|0 |when the torrent is first started. This mode |\n+| | |minimizes fragmentation but could be a costly |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |All pieces will be written to the place where |\n+|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\b _\br_\be_\bc_\bo_\bm_\bm_\be_\bn_\bd_\be_\bd_\b,_\b _\ba_\bn_\bd_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bm_\bo_\bd_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\btu\bus\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\ba_\bt_\ba_\bl_\b__\bd_\bi_\bs_\bk_\b__\be_\br_\br_\bo_\br_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\be_\be_\bd_\b__\bf_\bu_\bl_\bl_\b__\bc_\bh_\be_\bc_\bk_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\be_\bx_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |this is not an enum value, but a flag that can be set|\n+| | |in the return from async_check_files, in case an |\n+|oversized_file |16 |existing file was found larger than specified in the |\n+| | |torrent. i.e. it has garbage at the end the _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\bi_\be_\bl_\bd_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\b _\bp_\br_\be_\bs_\be_\br_\bv_\be_\b _\bA_\bB_\bI_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bmo\bov\bve\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|always_replace_files |0 |replace any files in the destination when |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\bo_\br_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |if any files that we want to copy exist in |\n+| | |the destination exist, fail the whole |\n+| | |operation and don't perform any copy or move.|\n+| | |There is an inherent race condition in this |\n+|fail_if_exist |1 |mode. The files are checked for existence |\n+| | |before the operation starts. In between the |\n+| | |check and performing the copy, the |\n+| | |destination files may be created, in which |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bs_\be_\b _\bt_\bh_\be_\by_\b _\ba_\br_\be_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |if any file exist in the target, take those |\n+|dont_replace |2 |files instead of the ones we may have in the |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bo_\bu_\br_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |don't move any source files, just forget |\n+|reset_save_path |3 |about them and begin checking files at new |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b _\bp_\ba_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|reset_save_path_unchecked|4 |don't move any source files, just change save|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bt_\bh_\b _\ba_\bn_\bd_\b _\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\ba_\bn_\by_\b _\bc_\bh_\be_\bc_\bk_\bs_\b |\n 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@@ -4628,103 +7579,14 @@\n that are generated for a specific torrent are derived from _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt, and\n tracker events derive from _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt.\n Alerts returned by _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) are only valid until the next call to\n _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). You may not copy an _\ba_\bl_\be_\br_\bt object to access it after the next call\n to _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). Internal members of alerts also become invalid once _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs\n _\b(_\b) is called again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-The alert class is the base class that specific messages are derived from.\n-_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n-struct alert\n-{\n- time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n- virtual int t\bty\byp\bpe\be () const noexcept = 0;\n- virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n- virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n- virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-\n- static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n- static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n- static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n- static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n- static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n- static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n- static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n- static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n- static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n- static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n- static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n- static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n- static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n- static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n- static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n- static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n-time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n-a timestamp is automatically created in the constructor\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual int t\bty\byp\bpe\be () const noexcept = 0;\n-returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n-against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n-_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n-cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n-e.g:\n-std::vector<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-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n-returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n-any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n-generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n-This is mainly intended for debug and development use. It is not suitable to\n-use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n-type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n-depending on the locale.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_r\bro\bou\but\bti\bin\bng\bg_\b_b\bbu\buc\bck\bke\bet\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n struct to hold information about a single DHT routing table bucket\n struct dht_routing_bucket\n {\n int num_nodes;\n int num_replacements;\n@@ -4866,25 +7728,25 @@\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n This is posted as a response to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b) call, if the\n rename operation succeeds.\n struct file_renamed_alert final : torrent_alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+ char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::\n storage;\n file_index_t const index;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bne\bew\bw_\b_n\bna\bam\bme\be(\b()\b) o\bol\bld\bd_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n returns the new and previous file name, respectively.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n index\n refers to the index of the file that was renamed,\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfa\bai\bil\ble\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n@@ -7038,18 +9900,107 @@\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<announce_entry> 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<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+[_\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* 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 <typename T> T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n template <typename T> T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n+template <typename T> T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n Note\n alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n@@ -7114,14 +10065,21 @@\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@@ -7193,1083 +10151,1263 @@\n rate.\n all\n The full bitmask, representing all available categories.\n since the enum is signed, make sure this isn't interpreted as -1. For\n instance, boost.python does that and fails when assigning it to an\n unsigned parameter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n- user_alert_id\n- user defined alerts should use IDs greater than this\n- num_alert_types\n- this constant represents \"max_alert_index\" + 1\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+this is a SHA-1 hash class.\n+You use it by first instantiating it, then call update() to feed it with data.\n+i.e. you don't have to keep the entire buffer of which you want to create the\n+hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n+fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n+hash of the data.\n+The constructor that takes a char const* and an integer will construct the sha1\n+context and feed it the data passed in.\n+If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n+to call reset() to reinitialize it.\n+The built-in software version of sha1-algorithm was implemented by Steve Reid\n+and released as public domain. For more info, see src/sha1.cpp.\n+class hasher\n+{\n+ h\bha\bas\bsh\bhe\ber\br ();\n+ h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n+ explicit h\bha\bas\bsh\bhe\ber\br (span<char const> 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 (span<char const> data);\n+ hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ sha1_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\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* 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<char const> 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* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n+hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+append the following bytes to what is being hashed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+class hasher256\n {\n- 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<download_priority_t, file_index_t> 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<download_priority_t, file_index_t> const& priorities;\n- sha1_hash info_hash;\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n+ hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+ explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span<char const> data);\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+ hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> 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**\b* f\bfi\bil\ble\be_\b_s\bsl\bli\bic\bce\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-represents a window of a file in a torrent.\n-The file_index refers to the index of the file (in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo). To get\n-the path and filename, use file_path() and give the file_index as argument. The\n-offset is the byte offset in the file where the range starts, and size is the\n-number of bytes this range is. The size + offset will never be greater than the\n-file size.\n-struct file_slice\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) *\b**\b**\b**\b**\b*\n+hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span<char const> data);\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+this is the same as default constructing followed by a call to update(data,\n+len).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher256& u\bup\bpd\bda\bat\bte\be (span<char const> data);\n+hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+append the following bytes to what is being hashed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n+The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n+array.\n+struct bitfield\n {\n- file_index_t file_index;\n- std::int64_t offset;\n- std::int64_t size;\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+ b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+ void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n+ bool 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- file_index\n- the index of the file\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 (char const* b, int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+constructs a new _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd. The default constructor creates an empty _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n+bits is the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd (specified in bits). val is the value to\n+initialize the bits to. If not specified all bits are initialized to 0.\n+The constructor taking a pointer b and bits copies a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from the\n+specified buffer, and bits number of bits (rounded up to the nearest byte\n+boundary).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- offset\n- the offset from the start of the file, in bytes\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- size\n- the size of the window, in bytes\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**\b* f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-The file_storage class represents a file list and the piece size. Everything\n-necessary to interpret a regular bittorrent storage file structure.\n-class file_storage\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+set bit at index to 0 (clear_bit) or 1 (set_bit).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n+returns true if all bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd are set\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bno\bon\bne\be_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n+returns true if no bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd is set\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int s\bsi\biz\bze\be () const noexcept;\n+returns the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in bits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n+returns the number of 32 bit words are needed to represent all bits in this\n+_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n+returns the number of bytes needed to represent all bits in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+bool e\bem\bmp\bpt\bty\by () const noexcept;\n+returns true if the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd has zero size.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n+char* d\bda\bat\bta\ba () noexcept;\n+char const* d\bda\bat\bta\ba () const noexcept;\n+returns a pointer to the internal buffer of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, or nullptr if it's\n+empty.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n+swaps the bit-fields two variables refer to\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+int c\bco\bou\bun\bnt\bt () const noexcept;\n+count the number of bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd that are set to 1.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n+returns the index of the first set bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 1 bit.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n+returns the index to the last cleared bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 0 bit.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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 i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\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 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<file_slice> 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<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n- void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n- piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n- piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n- index_range<piece_index_t> 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- 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- bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n- std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n- std::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- sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n- string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n- std::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::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- sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n- index_range<piece_index_t::diff_type> 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- int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n- int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n- std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n-save_path) const;\n- void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set<std::uint32_t>& table) const;\n- file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n- bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n- piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n- void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n- bool v\bv2\b2 () const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n \n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_p\bpa\bad\bd_\b_f\bfi\bil\ble\be = 0_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_h\bhi\bid\bdd\bde\ben\bn = 1_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be = 2_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_s\bsy\bym\bml\bli\bin\bnk\bk = 3_bit;\n+ 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* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-returns true if the piece length has been initialized on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be. This\n-is typically taken as a proxy of whether the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be as a whole is\n-initialized or not.\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n+this does.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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+ piece\n+ The index of the piece in which the range starts.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\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-Adds a file to the file storage. The add_file_borrow version expects that\n-filename is the file name (without a path) of the file that's being added. This\n-memory is b\bbo\bor\brr\bro\bow\bwe\bed\bd, i.e. it is the caller's responsibility to make sure it\n-stays valid throughout the lifetime of this _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object or any copy of\n-it. The same thing applies to filehash, which is an optional pointer to a 20\n-byte binary SHA-1 hash of the file.\n-if filename is empty, the filename from path is used and not borrowed.\n-The path argument is the full path (in the torrent file) to the file to add.\n-Note that this is not supposed to be an absolute path, but it is expected to\n-include the name of the torrent as the first path element.\n-file_size is the size of the file in bytes.\n-The file_flags argument sets attributes on the file. The file attributes is an\n-extension and may not work in all bittorrent clients.\n-For possible file attributes, see file_storage::flags_t.\n-The mtime argument is optional and can be set to 0. If non-zero, it is the\n-posix time of the last modification time of this file.\n-symlink_path is the path the file is a symlink to. To make this a symlink you\n-also need to set the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bl_\ba_\bg_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk file flag.\n-root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n-tree root hash for this file. This is only used for v2 torrents. If the root\n-hash is specified for one file, it has to be specified for all, otherwise this\n-function will fail. Note that the buffer root_hash points to must out-live the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, it will not be copied. This parameter is only used when\n-l\blo\boa\bad\bdi\bin\bng\bg torrents, that already have their file hashes computed. When creating\n-torrents, the file hashes will be computed by the piece hashes.\n-If more files than one are added, certain restrictions to their paths apply. In\n-a multi-file file storage (torrent), all files must share the same root\n-directory.\n-That is, the first path element of all files must be the same. This shared path\n-element is also set to the name of the torrent. It can be changed by calling\n-set_name.\n-The overloads that take anerror_codereference will report failures via that\n-variable, otherwisesystem_erroris thrown.\n+ 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-*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n-renames the file at index to new_filename. Keep in mind that filenames are\n-expected to be UTF-8 encoded.\n+ 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* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector<file_slice> m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n-returns a list of _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be objects representing the portions of files the\n-specified piece index, byte offset and size range overlaps. this is the inverse\n-mapping of _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b).\n-Preconditions of this function is that the input range is within the torrents\n-address space. piece may not be negative and\n- piece * piece_size + offset + size\n-may not exceed the total size of the torrent.\n+*\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n+struct piece_block\n+{\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n+\n+ static const piece_block invalid;\n+ piece_index_t piece_index {0};\n+ int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size) const;\n-returns a _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt representing the piece index, byte offset and size the\n-specified file range overlaps. This is the inverse mapping over _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b).\n-Note that the peer_request return type is meant to hold bittorrent block\n-requests, which may not be larger than 16 kiB. Mapping a range larger than that\n-may return an overflown integer.\n+*\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<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 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* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n-returns the number of files in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n+*\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* e\ben\bnd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n-returns the index of the one-past-end file in the file storage\n+ 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* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all files in the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+ 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* 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+ 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* 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+ 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* 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+ 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* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n-returns the index of the last piece in the torrent. The last piece is special\n-in that it may be smaller than the other pieces (and the other pieces are all\n-the same size).\n+ 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* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range<piece_index_t> 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+ 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* 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-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+ 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* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n-returns the piece size of index. This will be the same as _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b),\n-except for the last piece, which may be shorter.\n+ 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* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n-Returns the size of the given piece. If the piece spans multiple files, only\n-the first file is considered part of the piece. This is used for v2 torrents,\n-where all files are piece aligned and padded. i.e. The pad files are not\n-considered part of the piece for this purpose.\n+ 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* b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n-returns the number of blocks in the specified piece, for v2 torrents.\n+ 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* 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+ 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* 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-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+ 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* 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+ 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* 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+ 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* r\bro\boo\bot\bt(\b()\b) m\bmt\bti\bim\bme\be(\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) h\bha\bas\bsh\bh(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\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) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n-std::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-std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n-sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n-string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n-std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n-const;\n-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-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-storage referred to when the file was added, it is not owned by this object.\n-Torrents that are not v2 torrents return nullptr.\n-The mtime() is the modification time is the posix time when a file was last\n-modified when the torrent was created, or 0 if it was not included in the\n-torrent file.\n-file_path() returns the full path to a file.\n-file_size() returns the size of a file.\n-pad_file_at() returns true if the file at the given index is a pad-file.\n-file_name() returns j\bju\bus\bst\bt the name of the file, whereas file_path() returns the\n-path (inside the torrent file) with the filename appended.\n-file_offset() returns the byte offset within the torrent file where this file\n-starts. It can be used to map the file to a piece index (given the piece size).\n+ 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* 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<piece_index_t::diff_type> 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+ 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\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-index of first piece node in the merkle tree\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\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+ 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* a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set<std::uint32_t>& table) const;\n-this will add the CRC32 hash of all directory entries to the table. No filename\n-will be included, just directories. Every depth of directories are added\n-separately to allow test for collisions with files at all levels. i.e. if one\n-path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n-bar/baz will be added to the set.\n+ 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* f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n-returns a bitmask of flags from file_flags_t that apply to file at index.\n+ 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-*\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+ 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-*\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+ 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-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n-finds the file with the given root hash and returns its index if there is no\n-file with the root hash, file_index_t{-1} is returned\n+ 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-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n-returns the piece index the given file starts at\n+ rc4_encrypted\n+ this connection is obfuscated with RC4\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n-validate any symlinks, to ensure they all point to other files or directories\n-inside this storage. Any invalid symlinks are updated to point to themselves.\n+ 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-*\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-bool v\bv2\b2 () const;\n-returns true if this torrent contains v2 metadata.\n+ 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- flag_pad_file\n- the file is a pad file. It's required to contain zeros at it will not be\n- saved to disk. Its purpose is to make the following file start on a piece\n- boundary.\n+ tracker\n+ The peer was received from the tracker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_hidden\n- this file has the hidden attribute set. This is primarily a windows\n- attribute\n+ dht\n+ The peer was received from the kademlia DHT.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_executable\n- this file has the executable attribute set.\n+ 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- flag_symlink\n- this file is a symbolic link. It should have a link target string\n- associated with it.\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-*\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<disk_interface> d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage will\n-be constructed, otherwise the portable posix storage.\n+ 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-*\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<disk_interface> 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+ incoming\n+ we received an incoming connection from this peer\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<disk_interface> 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+ 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-*\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<disk_interface> m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n+ 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-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |All pieces will be written to their final |\n-| | |position, all files will be allocated in full |\n-|storage_mode_allocate|0 |when the torrent is first started. This mode |\n-| | |minimizes fragmentation but could be a costly |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |All pieces will be written to the place where |\n-|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\b _\br_\be_\bc_\bo_\bm_\bm_\be_\bn_\bd_\be_\bd_\b,_\b _\ba_\bn_\bd_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bm_\bo_\bd_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+ 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-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\btu\bus\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\ba_\bt_\ba_\bl_\b__\bd_\bi_\bs_\bk_\b__\be_\br_\br_\bo_\br_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\be_\be_\bd_\b__\bf_\bu_\bl_\bl_\b__\bc_\bh_\be_\bc_\bk_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\be_\bx_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |this is not an enum value, but a flag that can be set|\n-| | |in the return from async_check_files, in case an |\n-|oversized_file |16 |existing file was found larger than specified in the |\n-| | |torrent. i.e. it has garbage at the end the _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\bi_\be_\bl_\bd_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\b _\bp_\br_\be_\bs_\be_\br_\bv_\be_\b _\bA_\bB_\bI_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+ 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-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bmo\bov\bve\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|always_replace_files |0 |replace any files in the destination when |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\bo_\br_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |if any files that we want to copy exist in |\n-| | |the destination exist, fail the whole |\n-| | |operation and don't perform any copy or move.|\n-| | |There is an inherent race condition in this |\n-|fail_if_exist |1 |mode. The files are checked for existence |\n-| | |before the operation starts. In between the |\n-| | |check and performing the copy, the |\n-| | |destination files may be created, in which |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bs_\be_\b _\bt_\bh_\be_\by_\b _\ba_\br_\be_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |if any file exist in the target, take those |\n-|dont_replace |2 |files instead of the ones we may have in the |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bo_\bu_\br_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |don't move any source files, just forget |\n-|reset_save_path |3 |about them and begin checking files at new |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b _\bp_\ba_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|reset_save_path_unchecked|4 |don't move any source files, just change save|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bt_\bh_\b _\ba_\bn_\bd_\b _\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\ba_\bn_\by_\b _\bc_\bh_\be_\bc_\bk_\bs_\b |\n-libtorrent has a _\bp_\bl_\bu_\bg_\bi_\bn interface for implementing extensions to the protocol.\n-These can be general extensions for transferring metadata or peer exchange\n-extensions, or it could be used to provide a way to customize the protocol to\n-fit a particular (closed) network.\n-In short, the _\bp_\bl_\bu_\bg_\bi_\bn interface makes it possible to:\n- * register extension messages (sent in the extension handshake), see\n- _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs.\n- * add data and parse data from the extension handshake.\n- * send extension messages and standard bittorrent messages.\n- * override or block the handling of standard bittorrent messages.\n- * save and restore state via the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n- * see all alerts that are posted\n-*\b**\b**\b**\b**\b**\b* a\ba w\bwo\bor\brd\bd o\bof\bf c\bca\bau\but\bti\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Writing your own _\bp_\bl_\bu_\bg_\bi_\bn is a very easy way to introduce serious bugs such as\n-dead locks and race conditions. Since a _\bp_\bl_\bu_\bg_\bi_\bn has access to internal\n-structures it is also quite easy to sabotage libtorrent's operation.\n-All the callbacks are always called from the libtorrent network thread. In case\n-portions of your _\bp_\bl_\bu_\bg_\bi_\bn are called from other threads, typically the main\n-thread, you cannot use any of the member functions on the internal structures\n-in libtorrent, since those require being called from the libtorrent network\n-thread . Furthermore, you also need to synchronize your own shared data within\n-the _\bp_\bl_\bu_\bg_\bi_\bn, to make sure it is not accessed at the same time from the\n-libtorrent thread (through a callback). If you need to send out a message from\n-another thread, it is advised to use an internal queue, and do the actual\n-sending in tick().\n-Since the _\bp_\bl_\bu_\bg_\bi_\bn interface gives you easy access to internal structures, it is\n-not supported as a stable API. Plugins should be considered specific to a\n-specific version of libtorrent. Although, in practice the internals mostly\n-don't change that dramatically.\n-*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn-\b-i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n-The _\bp_\bl_\bu_\bg_\bi_\bn interface consists of three base classes that the _\bp_\bl_\bu_\bg_\bi_\bn may\n-implement. These are called _\bp_\bl_\bu_\bg_\bi_\bn, _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn and _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. They are\n-found in the <libtorrent/extensions.hpp> header.\n-These plugins are instantiated for each _\bs_\be_\bs_\bs_\bi_\bo_\bn, torrent and possibly each\n-peer, respectively.\n-For plugins that only need per torrent state, it is enough to only implement\n-torrent_plugin and pass a constructor function or function object to session::\n-add_extension() or torrent_handle::add_extension() (if the torrent has already\n-been started and you want to hook in the extension at run-time).\n-The signature of the function is:\n-std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);\n-The second argument is the userdata passed to session::add_torrent() or\n-torrent_handle::add_extension().\n-The function should return a std::shared_ptr<torrent_plugin> which may or may\n-not be 0. If it is a nullptr, the extension is simply ignored for this torrent.\n-If it is a valid pointer (to a class inheriting torrent_plugin), it will be\n-associated with this torrent and callbacks will be made on torrent events.\n-For more elaborate plugins which require _\bs_\be_\bs_\bs_\bi_\bo_\bn wide state, you would\n-implement plugin, construct an object (in a std::shared_ptr) and pass it in to\n-session::add_extension().\n-*\b**\b**\b**\b**\b**\b* c\bcu\bus\bst\bto\bom\bm a\bal\ble\ber\brt\bts\bs *\b**\b**\b**\b**\b**\b*\n-Since plugins are running within internal libtorrent threads, one convenient\n-way to communicate with the client is to post custom alerts.\n-The expected interface of any _\ba_\bl_\be_\br_\bt, apart from deriving from the _\ba_\bl_\be_\br_\bt base\n-class, looks like this:\n-static const int alert_type = <\b<u\bun\bni\biq\bqu\bue\be a\bal\ble\ber\brt\bt I\bID\bD>\b>;\n-virtual int type() const { return alert_type; }\n-\n-virtual std::string message() const;\n-\n-static const alert_category_t static_category = <\b<b\bbi\bit\btm\bma\bas\bsk\bk o\bof\bf a\bal\ble\ber\brt\bt:\b::\b:c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt\n-f\bfl\bla\bag\bgs\bs>\b>;\n-virtual alert_category_t category() const { return static_category; }\n-\n-virtual char const* what() const { return <\b<s\bst\btr\bri\bin\bng\bg l\bli\bit\bte\ber\bra\bal\bl o\bof\bf t\bth\bhe\be n\bna\bam\bme\be o\bof\bf t\bth\bhi\bis\bs\n-a\bal\ble\ber\brt\bt>\b>; }\n-The alert_type is used for the type-checking in alert_cast. It must not collide\n-with any other _\ba_\bl_\be_\br_\bt. The built-in alerts in libtorrent will not use _\ba_\bl_\be_\br_\bt type\n-IDs greater than user_alert_id. When defining your own _\ba_\bl_\be_\br_\bt, make sure it's\n-greater than this constant.\n-type() is the run-time equivalence of the alert_type.\n-The message() virtual function is expected to construct a useful string\n-representation of the _\ba_\bl_\be_\br_\bt and the event or data it represents. Something\n-convenient to put in a log file for instance.\n-clone() is used internally to copy alerts. The suggested implementation of\n-simply allocating a new instance as a copy of *this is all that's expected.\n-The static category is required for checking whether or not the category for a\n-specific _\ba_\bl_\be_\br_\bt is enabled or not, without instantiating the _\ba_\bl_\be_\br_\bt. The category\n-virtual function is the run-time equivalence.\n-The what() virtual function may simply be a string literal of the class name of\n-your _\ba_\bl_\be_\br_\bt.\n-For more information, see the _\ba_\bl_\be_\br_\bt_\b _\bs_\be_\bc_\bt_\bi_\bo_\bn.\n+ 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-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions\n-struct peer_connection_handle\n-{\n- explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr<peer_connection> impl);\n- connection_type t\bty\byp\bpe\be () const;\n- void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr<peer_plugin>);\n- peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n- bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n- bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n- bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n- peer_id const& p\bpi\bid\bd () const;\n- bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n- bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n- bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n- bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n- void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n- void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n- void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n- torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt 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- void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n- , disconnect_severity_t = peer_connection_interface::normal);\n- bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n- bool i\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\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n- bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n- bool f\bfa\bai\bil\ble\bed\bd () const;\n- void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n- , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n-(4,5);\n- bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n- bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n- bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n- bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n- void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n- 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- std::shared_ptr<peer_connection> n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-};\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-*\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_plugin> 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_plugin> crypto);\n- std::shared_ptr<bt_peer_connection> n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-};\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-*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-this is the base class for a _\bs_\be_\bs_\bs_\bi_\bo_\bn _\bp_\bl_\bu_\bg_\bi_\bn. One primary feature is that it is\n-notified of all torrents that are added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, and can add its own\n-torrent_plugins.\n-struct plugin\n+ 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* 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- virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n- virtual std::shared_ptr<torrent_plugin> n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n-client_data_t);\n- virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n- virtual void a\bab\bbo\bor\brt\bt ();\n- virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n- , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n- , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n- virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n- virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n- , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n- virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n- virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br\n-*\b*/\b/);\n- virtual std::map<std::string, std::string> s\bsa\bav\bve\be_\b_s\bst\bta\bat\bte\be () const;\n- virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map<std::string, std::string> const&);\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+ bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+ bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+ bool h\bha\bas\bs (protocol_version v) const;\n+ sha1_hash g\bge\bet\bt (protocol_version v) const;\n+ sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (info_hash_t const& lhs, info_hash_t const& rhs);\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (info_hash_t const& lhs, info_hash_t const& rhs)\n+noexcept;\n+ template <typename F> 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- static constexpr feature_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_f\bfe\bea\bat\btu\bur\bre\be = 1_bit;\n- static constexpr feature_flags_t t\bti\bic\bck\bk_\b_f\bfe\bea\bat\btu\bur\bre\be = 2_bit;\n- static constexpr feature_flags_t d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 3_bit;\n- static constexpr feature_flags_t a\bal\ble\ber\brt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 4_bit;\n- static constexpr feature_flags_t u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 5_bit;\n+ 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\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n-This function is expected to return a bitmask indicating which features this\n-_\bp_\bl_\bu_\bg_\bi_\bn implements. Some callbacks on this object may not be called unless the\n-corresponding feature flag is returned here. Note that callbacks may still be\n-called even if the corresponding feature is not specified in the return value\n-here. See feature_flags_t for possible flags to return.\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+The default constructor creates an object that has neither a v1 or v2 hash.\n+For backwards compatibility, make it possible to construct directly from a v1\n+hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n+implicitness is deprecated.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::shared_ptr<torrent_plugin> n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n-client_data_t);\n-this is called by the _\bs_\be_\bs_\bs_\bi_\bo_\bn every time a new torrent is added. The torrent*\n-points to the internal torrent object created for the new torrent. The\n-_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt is the userdata pointer as passed in via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n-If the _\bp_\bl_\bu_\bg_\bi_\bn returns a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance, it will be added to the new\n-torrent. Otherwise, return an empty shared_ptr to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn (the\n-default).\n+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs(\b()\b) *\b**\b**\b**\b**\b*\n+bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+bool h\bha\bas\bs (protocol_version v) const;\n+returns true if the corresponding info hash is present in this object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n-called when _\bp_\bl_\bu_\bg_\bi_\bn is added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+*\b**\b**\b**\b**\b* g\bge\bet\bt(\b()\b) *\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* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bab\bbo\bor\brt\bt ();\n-called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is aborted the _\bp_\bl_\bu_\bg_\bi_\bn should perform any cleanup\n-necessary to allow the session's destruction (e.g. cancel outstanding async\n-operations)\n+*\b**\b**\b**\b**\b* 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* o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n- , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n- , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n-called when a dht request is received. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be\n-called, make sure to include the flag dht_request_feature in the return value\n-from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n+template <typename F> 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* o\bon\bn_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n-called when an _\ba_\bl_\be_\br_\bt is posted alerts that are filtered are not posted. If your\n-_\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to include the flag alert_feature\n-in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b**\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) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename);\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<char const> buffer, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+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<char const> buffer);\n+These functions load the content of a .torrent file into an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n+object. The immutable part of a torrent file (the info-dictionary) is stored in\n+the ti field in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object (as a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object). The\n+returned object is suitable to be:\n+ * added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ * saved as a .torrent_file via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ * turned into a magnet link via _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n- , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n-return true if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs should be added\n+*\b**\b**\b**\b**\b**\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* o\bon\bn_\b_t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n-called once per second. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to\n-include the flag tick_feature in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b**\b* m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (add_torrent_params const& atp);\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_info const& info);\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n+Generates a magnet URI from the specified torrent.\n+Several fields from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs objects are recorded in the magnet\n+link. In order to not include them, they have to be cleared before calling\n+_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b). These fields are used:\n+ ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n+ name, peers.\n+Depending on what the use case for the resulting magnet link is, clearing peers\n+and dht_nodes is probably a good idea if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs came from a\n+running torrent. Those lists may be long and be ephemeral.\n+If none of the info_hashes or ti fields are set, there is not info-hash\n+available, and a magnet link cannot be created. In this case _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+returns an empty string.\n+The recommended way to generate a magnet link from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is to call\n+_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), which will post a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt containing an\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This can then be passed to _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b).\n+The overload that takes a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be will make blocking calls to query\n+information about the torrent. If the torrent handle is invalid, an empty\n+string is returned.\n+For more information about magnet links, see _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br *\b*/\b/\n-);\n-called when choosing peers to optimistically unchoke. The return value\n-indicates the peer's priority for unchoking. Lower return values correspond to\n-higher priority. Priorities above 2^63-1 are reserved. If your _\bp_\bl_\bu_\bg_\bi_\bn has no\n-priority to assign a peer it should return 2^64-1. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this\n-to be called, make sure to include the flag optimistic_unchoke_feature in the\n-return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b). If multiple plugins implement this\n-function the lowest return value (i.e. the highest priority) is used.\n+*\b**\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n+void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n+add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri);\n+add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n+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* l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map<std::string, std::string> const&);\n-called on startup while loading settings state from the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n+inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n+rhs);\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n+returns the libtorrent version as string form in this format:\n+\"<major>.<minor>.<tiny>.<tag>\"\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 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 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* 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- optimistic_unchoke_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to alter the order of the\n- optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n- callback be called.\n+*\b**\b**\b**\b**\b**\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- tick_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b) called\n+*\b**\b**\b**\b**\b**\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- dht_request_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b) called\n+*\b**\b**\b**\b**\b**\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- alert_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b) called\n+*\b**\b**\b**\b**\b**\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- unknown_torrent_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) called\n- even if there is no active torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n+ dont_download\n+ Don't download the file or piece. Partial pieces may still be downloaded\n+ when setting file priorities.\n+ default_priority\n+ The default priority for files and pieces.\n+ low_priority\n+ The lowest priority for files and pieces.\n+ top_priority\n+ The highest priority for files and pieces.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-Torrent plugins are associated with a single torrent and have a number of\n-functions called at certain events. Many of its functions have the ability to\n-change or override the default libtorrent behavior.\n-struct torrent_plugin\n+*\b**\b**\b**\b**\b**\b* 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 std::shared_ptr<peer_plugin> n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n-const&);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n- virtual void t\bti\bic\bck\bk ();\n- virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n- virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n- virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n- virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n- virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n+ 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+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+ type_t t\bty\byp\bpe\be () const noexcept;\n+ explicit operator b\bbo\boo\bol\bl () const noexcept;\n+ bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n+ std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n+ span<char const> d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n+ bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n+ string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , string_view default_val = string_view()) const;\n+ int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+ std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+ string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n+ 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_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_l\bli\bis\bst\bt (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+ std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+ std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n+ char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+ std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+ string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+ int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ void c\bcl\ble\bea\bar\br ();\n+ void s\bsw\bwa\bap\bp (bdecode_node& n);\n+ void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n+ void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n+ bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span<char> error) const;\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+ 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_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::shared_ptr<peer_plugin> n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n-const&);\n-This function is called each time a new peer is connected to the torrent. You\n-may choose to ignore this by just returning a default constructed shared_ptr\n-(in which case you don't need to override this member function).\n-If you need an extension to the peer connection (which most plugins do) you are\n-supposed to return an instance of your _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn class. Which in turn will\n-have its hook functions called on event specific to that peer.\n-The peer_connection_handle will be valid as long as the shared_ptr is being\n-held by the torrent object. So, it is generally a good idea to not keep a\n-shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n-weak_ptr.\n-If this function throws an exception, the connection will be closed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n-These hooks are called when a piece passes the hash check or fails the hash\n-check, respectively. The index is the piece index that was downloaded. It is\n-possible to access the list of peers that participated in sending the piece\n-through the torrent and the piece_picker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void t\bti\bic\bck\bk ();\n-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-virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n-These hooks are called when the torrent is paused and resumed respectively. The\n-return value indicates if the event was handled. A return value of true\n-indicates that it was handled, and no other _\bp_\bl_\bu_\bg_\bi_\bn after this one will have\n-this hook function called, and the standard handler will also not be invoked.\n-So, returning true effectively overrides the standard behavior of pause or\n-resume.\n-Note that if you call pause() or resume() on the torrent from your handler it\n-will recurse back into your handler, so in order to invoke the standard\n-handler, you have to keep your own state on whether you want standard behavior\n-or overridden behavior.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n-This function is called when the initial files of the torrent have been\n-checked. If there are no files to check, this function is called immediately.\n-i.e. This function is always called when the torrent is in a state where it can\n-start downloading.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n-called when the torrent changes state the state is one of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n-_\bs_\bt_\ba_\bt_\be_\b__\bt enum members\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n-called every time a new peer is added to the peer list. This is before the peer\n-is connected to. For flags, see torrent_plugin::flags_t. The source argument\n-refers to the source where we learned about this peer from. It's a bitmask,\n-because many sources may have told us about the same peer. For peer source\n-flags, see peer_info::peer_source_flags.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- first_time\n- this is the first time we see this peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- filtered\n- this peer was not added because it was filtered by the IP filter\n+*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n+creates a default constructed node, it will have the type none_t.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-peer plugins are associated with a specific peer. A peer could be both a\n-regular bittorrent peer (bt_peer_connection) or one of the web seed connections\n-(web_peer_connection or http_seed_connection). In order to only attach to\n-certain peers, make your torrent_plugin::new_connection only return a _\bp_\bl_\bu_\bg_\bi_\bn\n-for certain peer connection types\n-struct peer_plugin\n-{\n- virtual string_view t\bty\byp\bpe\be () const;\n- virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n- virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n- virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span<char const>);\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n- virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n- virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n- , span<char const> /\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_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n- virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_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_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_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual void s\bse\ben\bnt\bt_\b_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_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n- virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n- virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span<char const> /\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<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n- virtual void t\bti\bic\bck\bk ();\n- virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-};\n+*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+For owning nodes, the copy will create a copy of the tree, but the underlying\n+buffer remains the same.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual string_view t\bty\byp\bpe\be () const;\n-This function is expected to return the name of the _\bp_\bl_\bu_\bg_\bi_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n-can add entries to the extension handshake this is not called for web seeds\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n-called when the peer is being disconnected.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n-called when the peer is successfully connected. Note that incoming connections\n-will have been connected by the time the peer _\bp_\bl_\bu_\bg_\bi_\bn is attached to it, and\n-won't have this hook called.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span<char const>);\n-this is called when the initial bittorrent handshake is received. Returning\n-false means that the other end doesn't support this extension and will remove\n-it from the list of plugins. this is not called for web seeds\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n-called when the extension handshake from the other end is received if this\n-returns false, it means that this extension isn't supported by this peer. It\n-will result in this _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn being removed from the peer_connection and\n-destructed. this is not called for web seeds\n+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* o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\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_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b)\n-o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n-virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n-virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n-virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n-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+*\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* 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<char const> /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n-This function is called when the peer connection is receiving a piece. buf\n-points (non-owning pointer) to the data in an internal immutable disk buffer.\n-The length of the data is specified in the length member of the piece\n-parameter. returns true to indicate that the piece is handled and the rest of\n-the logic should be ignored.\n+*\b**\b**\b**\b**\b* 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* 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_n\bno\bot\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)\n-s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\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_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_h\bha\bav\bve\be (piece_index_t);\n-virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-called after a choke message has been sent to the peer\n+*\b**\b**\b**\b**\b* 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<char const> 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* s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n-called after piece data has been sent to the peer this can be used for stats\n-book keeping\n+*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_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) *\b**\b**\b**\b**\b*\n+bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n+string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , string_view default_val = string_view()) const;\n+int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , std::int64_t default_val = 0) const;\n+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* c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n-called when libtorrent think this peer should be disconnected. if the _\bp_\bl_\bu_\bg_\bi_\bn\n-returns false, the peer will not be disconnected.\n+*\b**\b**\b**\b**\b* 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_i\bin\bnt\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\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)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n+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_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_l\bli\bis\bst\bt (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+Functions with the dict_ prefix operates on dictionaries. They are only valid\n+if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n+cannot use the 0-terminated string overloads, but have to use string_view\n+instead. dict_find_list will return a valid bdecode_node if the key is found\n+_and_ it is a list. Otherwise it will return a default-constructed\n+_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n+Functions with the _value suffix return the value of the node directly, rather\n+than the nodes. In case the node is not found, or it has a different type, a\n+default value is returned (which can be specified).\n+dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n+Keys are only allowed to be strings. dict_at_node() also returns the (key,\n+value)-pair, but the key is returned as a bdecode_node (and it will always be a\n+string).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n-called when an extended message is received. If returning true, the message is\n-not processed by any other _\bp_\bl_\bu_\bg_\bi_\bn and if false is returned the next _\bp_\bl_\bu_\bg_\bi_\bn in\n-the chain will receive it to be able to handle it. This is not called for web\n-seeds. thus function may be called more than once per incoming message, but\n-only the last of the calls will the body size equal the length. i.e. Every time\n-another fragment of the message is received, this function will be called,\n-until finally the whole message has been received. The purpose of this is to\n-allow early disconnects for invalid messages and for reporting progress of\n-receiving large messages.\n+*\b**\b**\b**\b**\b* 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* 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<char const> /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n-this is not called for web seeds\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+char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+these functions are only valid if type() == string_t. They return the string\n+values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n+number of bytes in the string. string_offset() returns the byte offset from the\n+start of the parsed bencoded buffer this string can be found.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n-called when a piece that this peer participated in either fails or passes the\n-hash_check\n+*\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* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void t\bti\bic\bck\bk ();\n-called approximately once every second\n+*\b**\b**\b**\b**\b* 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* w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-called each time a request message is to be sent. If true is returned, the\n-original request message won't be sent and no other _\bp_\bl_\bu_\bg_\bi_\bn will have this\n-function called.\n+*\b**\b**\b**\b**\b* 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**\b* c\bcr\bry\byp\bpt\bto\bo_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-struct crypto_plugin\n-{\n- virtual void s\bse\bet\bt_\b_o\bou\but\btg\bgo\boi\bin\bng\bg_\b_k\bke\bey\by (span<char const> 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<char const> key) = 0;\n- e\ben\bnc\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n- virtual std::tuple<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/\n-) = 0;\n-};\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* d\bde\bec\bcr\bry\byp\bpt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::tuple<int, int, int> d\bde\bec\bcr\bry\byp\bpt\bt (span<span<char>> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n-0;\n-decrypt the provided buffers. returns is a tuple representing the values\n-(consume, produce, packet_size)\n-consume is set to the number of bytes which should be trimmed from the head of\n-the buffers, default is 0\n-produce is set to the number of bytes of payload which are now ready to be sent\n-to the upper layer. default is the number of bytes passed in receive_vec\n-packet_size is set to the minimum number of bytes which must be read to advance\n-the next step of decryption. default is 0\n+*\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<char> 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**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n-std::shared_ptr<torrent_plugin> 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+*\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* 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<torrent_plugin> 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+*\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* 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<torrent_plugin> c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n-const&, client_data_t);\n-constructor function for the ut_metadata extension. The ut_metadata extension\n-allows peers to request the .torrent file (or more specifically the info-\n-dictionary of the .torrent file) from each other. This is the main building\n-block in making magnet links work. This extension is enabled by default unless\n-explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n-This can either be passed in the add_torrent_params::extensions field, or via\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+*\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<char const> buffer\n+ , int depth_limit = 100, int token_limit = 2000000);\n+bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span<char const> buffer\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+This function decodes/parses bdecoded data (for example a .torrent file). The\n+data structure is returned in the ret argument. the buffer to parse is\n+specified by the start of the buffer as well as the end, i.e. one byte past the\n+end. If the buffer fails to parse, the function returns a non-zero value and\n+fills in ec with the error code. The optional argument error_pos, if set to\n+non-nullptr, will be set to the byte offset into the buffer where the parse\n+failure occurred.\n+depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the function,\n+be careful not to set it too high).\n+token_limit is the max number of tokens allowed to be parsed from the buffer.\n+This is simply a sanity check to not have unbounded memory usage.\n+The resulting bdecode_node is an o\bow\bwn\bni\bin\bng\bg node. That means it will be holding the\n+whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n+objects will simply have references to the root or owning bdecode_node. If the\n+root node is destructed, all other nodes that refer to anything in that tree\n+become invalid.\n+However, the underlying buffer passed in to this function (start, end) must\n+also remain valid while the bdecoded tree is used. The parsed tree produced by\n+this function does not copy any data out of the buffer, but simply produces\n+references back into it.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* 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@@ -8741,2367 +11879,399 @@\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* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n-holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n-calls.\n-struct peer_class_info\n-{\n- bool ignore_unchoke_slots;\n- int connection_limit_factor;\n- std::string label;\n- int upload_limit;\n- int download_limit;\n- int upload_priority;\n- int download_priority;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ignore_unchoke_slots\n- ignore_unchoke_slots determines whether peers should always unchoke a\n- peer, regardless of the choking algorithm, or if it should honor the\n- unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n- peer classes a peer belongs to has this set to true, that peer will be\n- unchoked at all times.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connection_limit_factor\n- adjusts the connection limit (global and per torrent) that applies to\n- this peer class. By default, local peers are allowed to exceed the normal\n- connection limit for instance. This is specified as a percent factor. 100\n- makes the peer class apply normally to the limit. 200 means as long as\n- there are fewer connections than twice the limit, we accept this peer.\n- This factor applies both to the global connection limit and the per-\n- torrent limit. Note that if not used carefully one peer class can\n- potentially completely starve out all other over time.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_limit download_limit\n- transfer rates limits for the whole peer class. They are specified in\n- bytes per second and apply to the sum of all peers that are members of\n- this class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_priority download_priority\n- relative priorities used by the bandwidth allocator in the rate limiter.\n- If no rate limits are in use, the priority is not used either. Priorities\n- start at 1 (0 is not a valid priority) and may not exceed 255.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n-peer_class_type_filter is a simple container for rules for adding and\n-subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n-is applied (which is based on the peer's IP address).\n-struct peer_class_type_filter\n+*\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- 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+ 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<char const>);\n+ e\ben\bnt\btr\bry\by (list_type);\n+ e\ben\bnt\btr\bry\by (integer_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= (bdecode_node const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n+ dictionary_type const& d\bdi\bic\bct\bt () const;\n+ string_type& s\bst\btr\bri\bin\bng\bg ();\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ list_type const& l\bli\bis\bst\bt () const;\n+ dictionary_type& d\bdi\bic\bct\bt ();\n+ list_type& l\bli\bis\bst\bt ();\n+ integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+ preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+ string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+ preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+ void s\bsw\bwa\bap\bp (entry& e);\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n+ entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n+ entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n+ entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n+ std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n \n- enum socket_type_t\n+ enum data_type\n {\n- tcp_socket,\n- utp_socket,\n- ssl_tcp_socket,\n- ssl_utp_socket,\n- i2p_socket,\n- num_socket_types,\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* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n-void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n-add() and remove() adds and removes a peer class to be added to new peers based\n-on socket type.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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-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* 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+*\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**\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+*\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<char const>);\n+e\ben\bnt\btr\bry\by (list_type);\n+e\ben\bnt\btr\bry\by (integer_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- 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+*\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- 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+*\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- last_use\n- a (high precision) timestamp of when the file was last used.\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= (bdecode_node const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (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**\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<void> 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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n- , std::function<void(storage_error const&)> 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<sha256_hash> v2\n- , disk_job_flags_t flags\n- , std::function<void(piece_index_t, sha1_hash const&, storage_error\n-const&)> 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<void(piece_index_t, sha256_hash const&, storage_error\n-const&)> 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<void(status_t, std::string const&, storage_error const&)>\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<void()> handler = std::function<void()>()) = 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<std::string, file_index_t> links\n- , std::function<void(status_t, storage_error const&)> 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<void()> handler = std::function<void()>()) = 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<void(std::string const&, file_index_t, storage_error\n-const&)> 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<void(storage_error const&)> 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<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 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<void(piece_index_t)> 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<open_file_state> 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**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) l\bli\bis\bst\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) d\bdi\bic\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+dictionary_type const& d\bdi\bic\bct\bt () const;\n+string_type& s\bst\btr\bri\bin\bng\bg ();\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+list_type const& l\bli\bis\bst\bt () const;\n+dictionary_type& d\bdi\bic\bct\bt ();\n+list_type& l\bli\bis\bst\bt ();\n+integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+The integer(), string(), list() and dict() functions are accessors that return\n+the respective type. If the entry object isn't of the type you request, the\n+accessor will throw system_error. You can ask an entry for its type through the\n+type() function.\n+If you want to create an entry you give it the type you want it to have in its\n+constructor, and then use one of the non-const accessors to get a reference\n+which you then can assign the value you want it to have.\n+The typical code to get info from a torrent file will then look like this:\n+entry torrent_file;\n+// ...\n \n- static constexpr disk_job_flags_t f\bfo\bor\brc\bce\be_\b_c\bco\bop\bpy\by = 0_bit;\n- static constexpr disk_job_flags_t s\bse\beq\bqu\bue\ben\bnt\bti\bia\bal\bl_\b_a\bac\bcc\bce\bes\bss\bs = 3_bit;\n- static constexpr disk_job_flags_t v\bvo\bol\bla\bat\bti\bil\ble\be_\b_r\bre\bea\bad\bd = 4_bit;\n- static constexpr disk_job_flags_t v\bv1\b1_\b_h\bha\bas\bsh\bh = 5_bit;\n- static constexpr disk_job_flags_t f\bfl\blu\bus\bsh\bh_\b_p\bpi\bie\bec\bce\be = 7_bit;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual storage_holder n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_params const& p\n- , std::shared_ptr<void> 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<void(disk_buffer_holder, storage_error const&)> 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<disk_observer> o\n- , std::function<void(storage_error const&)> 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<sha256_hash> v2\n- , disk_job_flags_t flags\n- , std::function<void(piece_index_t, sha1_hash const&, storage_error\n-const&)> 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<void(piece_index_t, sha256_hash const&, storage_error\n-const&)> 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<void(status_t, std::string const&, storage_error const&)>\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<void()> handler = std::function<void()>()) = 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<std::string, file_index_t> links\n- , std::function<void(status_t, storage_error const&)> 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<void()> handler = std::function<void()>()) = 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<void(std::string const&, file_index_t, storage_error\n-const&)> 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<void(storage_error const&)> 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<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-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<void(piece_index_t)> 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<open_file_state> 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- ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n- s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n- s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n- explicit operator b\bbo\boo\bol\bl () const;\n- operator s\bst\bto\bor\bra\bag\bge\be_\b_i\bin\bnd\bde\bex\bx_\b_t\bt () const;\n- void r\bre\bes\bse\bet\bt ();\n- storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n- s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder const&) = delete;\n- s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder&& rhs) noexcept;\n- storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder&& rhs) noexcept;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-the common interface to _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk and the internal representation of\n-settings.\n-struct settings_interface\n-{\n- 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 bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const = 0;\n- virtual std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const = 0;\n- virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbu\buf\bff\bfe\ber\br_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n-the interface for freeing disk buffers, used by the _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br. when\n-implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be, this must also be implemented in order to return\n-disk buffers back to libtorrent\n-struct buffer_allocator_interface\n+// 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- 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+ 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- 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- disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder const&) = delete;\n- d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (disk_buffer_holder const&) = delete;\n- d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (buffer_allocator_interface& alloc\n- , char* buf, int sz) noexcept;\n- d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br () noexcept = default;\n- ~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n- char* d\bda\bat\bta\ba () const noexcept;\n- void r\bre\bes\bse\bet\bt ();\n- void s\bsw\bwa\bap\bp (disk_buffer_holder& h) noexcept;\n- 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+ 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 (disk_buffer_holder& h) noexcept;\n-swap pointers of two disk buffer holders.\n+void s\bsw\bwa\bap\bp (entry& e);\n+swaps the content of t\bth\bhi\bis\bs with e.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_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* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n+entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n+All of these functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they\n+will throw system_error.\n+The non-const versions of the operator[] will return a reference to either the\n+existing element at the given key or, if there is no element with the given\n+key, a reference to a newly inserted element at that key.\n+The const version of operator[] will only return a reference to an existing\n+element at the given key. If the key is not found, it will throw system_error.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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* f\bfi\bin\bnd\bd_\b_k\bke\bey\by(\b()\b) *\b**\b**\b**\b**\b*\n+entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n+entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n+These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n+throw system_error.\n+They will look for an element at the given key in the dictionary, if the\n+element cannot be found, they will return nullptr. If an element with the given\n+key is found, the return a pointer to it.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_o\bop\bpe\ben\bn_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n- read_only\n- open the file for reading only\n- write_only\n- open the file for writing only\n- read_write\n- open the file for reading and writing\n- rw_mask\n- the mask for the bits determining read or write mode\n- sparse\n- open the file in sparse mode (if supported by the filesystem).\n- no_atime\n- don't update the access timestamps on the file (if supported by the\n- operating system and filesystem). this generally improves disk\n- performance.\n- random_access\n- When this is not set, the kernel is hinted that access to this file will\n- be made sequentially.\n- mmapped\n- the file is memory mapped\n-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* 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**\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_\bB_\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. Here are some other bootstrap nodes that may work:\n-router.bittorrent.com:6881, dht.transmissionbt.com:6881 router.bt.ouinet.work:\n-6881,\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\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* 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 _\b _\b _\b _\b _\b|_\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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-|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bp_\bo_\br_\bt_\b|_\bi_\bn_\bt_\b _\b|_\b0_\b _\b _\b _\b _\b _\b |\n-announce_port is the port passed along as the port parameter to remote trackers\n-such as HTTP or DHT. This setting does not affect the effective listening port\n-nor local service discovery announcements. If left as zero (default), the\n-listening port value is used.\n-Note\n-This setting is only meant for very special cases where a seed's listening port\n-differs from the external port. As an example, if a local proxy is used and\n-that the proxy supports reverse tunnels through NAT-PMP, the tracker must\n-connect to the external NAT-PMP port (configured using announce_port) instead\n-of the actual local listening port.\n-struct settings_pack final : settings_interface\n-{\n- friend void a\bap\bpp\bpl\bly\by_\b_p\bpa\bac\bck\bk_\b_i\bim\bmp\bpl\bl (settings_pack const*\n- , aux::session_settings_single_thread&\n- , std::vector<void(aux::session_impl::*)()>*);\n- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> 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_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- 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- 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- 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_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_i\bin\bnt\bt (int name, flags::bitfield_flag<Type, Tag> 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_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-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-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-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* m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-settings_pack m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be ();\n-settings_pack h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd ();\n-The default values of the _\bs_\be_\bs_\bs_\bi_\bo_\bn settings are set for a regular bittorrent\n-client running on a desktop system. There are functions that can set the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn settings to pre set settings for other environments. These can be used\n-for the basis, and should be tweaked to fit your needs better.\n-min_memory_usage returns settings that will use the minimal amount of RAM, at\n-the potential expense of upload and download performance. It adjusts the socket\n-buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n-that each connection only has at most one block in use at any one time. It\n-lowers the outstanding blocks send to the disk I/O thread so that connections\n-only have one block waiting to be flushed to disk at any given time. It lowers\n-the max number of peers in the peer list for torrents. It performs multiple\n-smaller reads when it hashes pieces, instead of reading it all into memory\n-before hashing.\n-This configuration is intended to be the starting point for embedded devices.\n-It will significantly reduce memory usage.\n-high_performance_seed returns settings optimized for a seed box, serving many\n-peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n-limit of 400 files in its file pool. It support fast upload rates by allowing\n-large send buffers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n-std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n-This is a utility function to produce a client ID fingerprint formatted to the\n-most common convention. The fingerprint can be set via the peer_fingerprint\n-setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-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+|_\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* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n-int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n-converts a setting integer (from the enums string_types, int_types or\n-bool_types) to a string, and vice versa.\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<class OutIt> 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<char> 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* 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+*\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* s\bst\bto\bor\bra\bag\bge\be_\b_e\ber\brr\bro\bor\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n used by storage to return errors also includes which underlying file the error\n happened on\n struct storage_error\n {\n explicit operator b\bbo\boo\bol\bl () const;\n- file_index_t f\bfi\bil\ble\be () const;\n void f\bfi\bil\ble\be (file_index_t f);\n+ file_index_t f\bfi\bil\ble\be () const;\n \n error_code ec;\n operation_t operation;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n explicit operator b\bbo\boo\bol\bl () const;\n explicitly converts to true if this object represents an error, and false if it\n does not.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t f\bfi\bil\ble\be () const;\n void f\bfi\bil\ble\be (file_index_t f);\n+file_index_t f\bfi\bil\ble\be () const;\n set and query the index (in the torrent) of the file this error occurred on.\n This may also have special values defined in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n ec\n the error that occurred\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n operation\n A code from _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt enum, indicating what kind of operation failed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* 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* 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* 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* 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* i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+boost::system::error_category& i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+returns the error category for I2P errors\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n return the instance of the libtorrent_error_category which maps libtorrent\n error codes to human readable error messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n returns the error_category for HTTP errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* 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* 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* 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* g\bgz\bzi\bip\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 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-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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_gzip_header |1 |the supplied gzip buffer has |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |the gzip buffer would inflate to |\n+|inflated_data_too_large |2 |more bytes than the specified |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n+|data_did_not_terminate |3 |available inflate data did not |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|space_exhausted |4 |output space exhausted before |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n+|invalid_stored_block_length |6 |stored block length did not match |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bn_\be_\b'_\bs_\b _\bc_\bo_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n+|code_lengths_codes_incomplete |8 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n+|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n+|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n+|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n+|invalid_distance_code_lengths |12 |dynamic block code description: |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n+|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n+|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|unknown_gzip_error |15 |an unknown error occurred during |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* u\bup\bpn\bnp\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 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-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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_argument |402 |One of the arguments in the request |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|value_not_in_array |714 |The specified value does not exist |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The source IP address cannot be |\n+|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|external_port_cannot_be_wildcarded|716 |The external port cannot be a |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n+| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n+|port_mapping_conflict |718 |conflicts with a mapping assigned |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|internal_port_must_match_external |724 |Internal and external port value |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The NAT implementation only supports|\n+|only_permanent_leases_supported |725 |permanent lease times on port |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |RemoteHost must be a wildcard and |\n+|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bD_\bN_\bS_\b _\bn_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\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 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 i\bi2\b2p\bp_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\br_\bs_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\ba_\bn_\bt_\b__\br_\be_\ba_\bc_\bh_\b__\bp_\be_\be_\br_\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bk_\be_\by_\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bd_\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bk_\be_\by_\b__\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b__\bi_\bd_\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_collision |1 |Two torrents has files which end |\n@@ -11498,63 +12668,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 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 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 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@@ -11563,854 +12684,32 @@\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/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_gzip_header |1 |the supplied gzip buffer has |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |the gzip buffer would inflate to |\n-|inflated_data_too_large |2 |more bytes than the specified |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n-|data_did_not_terminate |3 |available inflate data did not |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|space_exhausted |4 |output space exhausted before |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n-|invalid_stored_block_length |6 |stored block length did not match |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bn_\be_\b'_\bs_\b _\bc_\bo_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n-|code_lengths_codes_incomplete |8 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n-|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n-|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n-|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n-|invalid_distance_code_lengths |12 |dynamic block code description: |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n-|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n-|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|unknown_gzip_error |15 |an unknown error occurred during |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm 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* 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**\b* d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n+This structure helps to store and load the state of the dht_tracker. At this\n+moment the library is only a dual stack implementation of the DHT. See _\bB_\bE_\bP_\b _\b3_\b2\n+struct dht_state\n {\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- 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- 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<char const> d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n- std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , std::int64_t default_val = 0) const;\n- int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n- bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n- string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , string_view default_val = string_view()) const;\n- std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n- std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n- , std::int64_t default_val = 0) const;\n- std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_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_i\bin\bnt\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_l\bli\bis\bst\bt (string_view key) const;\n- std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n- int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n- char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n- std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n 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<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-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n-creates a default constructed node, it will have the type none_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* 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-bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n-bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n-For owning nodes, the copy will create a copy of the tree, but the underlying\n-buffer remains the same.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-type_t t\bty\byp\bpe\be () const noexcept;\n-the type of this node. See _\bt_\by_\bp_\be_\b__\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n-explicit operator b\bbo\boo\bol\bl () const noexcept;\n-returns true if _\bt_\by_\bp_\be_\b(_\b) != none_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n-return a non-owning reference to this node. This is useful to refer to the root\n-node without copying it in assignments.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n-span<char const> d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n-returns the buffer and length of the section in the original bencoded buffer\n-where this node is defined. For a dictionary for instance, this starts with d\n-and ends with e, and has all the content of the dictionary in between. the\n-data_offset() function returns the byte-offset to this node in, starting from\n-the beginning of the buffer that was parsed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_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-std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , std::int64_t default_val = 0) const;\n-int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n-bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n-string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , string_view default_val = string_view()) const;\n-functions with the list_ prefix operate on lists. These functions are only\n-valid if type() == list_t. list_at() returns the item in the list at index i. i\n-may not be greater than or equal to the size of the list. size() returns the\n-size of the list.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-std::pair<bdecode_node, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n-std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n- , std::int64_t default_val = 0) const;\n-std::pair<string_view, bdecode_node> d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_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_i\bin\bnt\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_l\bli\bis\bst\bt (string_view key) const;\n-Functions with the dict_ prefix operates on dictionaries. They are only valid\n-if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n-cannot use the 0-terminated string overloads, but have to use string_view\n-instead. dict_find_list will return a valid bdecode_node if the key is found\n-_and_ it is a list. Otherwise it will return a default-constructed\n-_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n-Functions with the _value suffix return the value of the node directly, rather\n-than the nodes. In case the node is not found, or it has a different type, a\n-default value is returned (which can be specified).\n-dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n-Keys are only allowed to be strings. dict_at_node() also returns the (key,\n-value)-pair, but the key is returned as a bdecode_node (and it will always be a\n-string).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n-this function is only valid if type() == int_t. It returns the value of the\n-integer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n-int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n-char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n-std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n-these functions are only valid if type() == string_t. They return the string\n-values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n-number of bytes in the string. string_offset() returns the byte offset from the\n-start of the parsed bencoded buffer this string can be found.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n-void c\bcl\ble\bea\bar\br ();\n-resets the bdecoded_node to a default constructed state. If this is an owning\n-node, the tree is freed and all child nodes are invalidated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (bdecode_node& n);\n-Swap contents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n-preallocate memory for the specified numbers of tokens. This is useful if you\n-know approximately how many tokens are in the file you are about to parse.\n-Doing so will save realloc operations while parsing. You should only call this\n-on the root node, before passing it in to _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n-this buffer M\bMU\bUS\bST\bT be identical to the one originally parsed. This operation is\n-only defined on owning root nodes, i.e. the one passed in to decode().\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span<char> error) const;\n-returns true if there is a non-fatal error in the bencoding of this node or its\n-children\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|none_t |0 |uninitialized or default constructed. This is also used to|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bd_\bi_\bc_\ba_\bt_\be_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bn_\bo_\bd_\be_\b _\bw_\ba_\bs_\b _\bn_\bo_\bt_\b _\bf_\bo_\bu_\bn_\bd_\b _\bi_\bn_\b _\bs_\bo_\bm_\be_\b _\bc_\ba_\bs_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bc_\bt_\b__\bt_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b |\n-|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\ba_\b _\bl_\bi_\bs_\bt_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bl_\bi_\bs_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b|_\b3_\b _\b _\b _\b _\b|_\ba_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bn_\bo_\bd_\be_\b,_\b _\bt_\bh_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\ba_\bn_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bi_\bn_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-std::string p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by (bdecode_node const& e\n- , bool single_line = false, int indent = 0);\n-print the bencoded structure in a human-readable format to a string that's\n-returned.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span<char const> buffer\n- , int depth_limit = 100, int token_limit = 2000000);\n-int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n- , 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<char const> 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-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<char const>);\n- e\ben\bnt\btr\bry\by (integer_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 (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= (list_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\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- preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n- dictionary_type const& d\bdi\bic\bct\bt () const;\n- integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n- string_type const& s\bst\btr\bri\bin\bng\bg () const;\n- string_type& s\bst\btr\bri\bin\bng\bg ();\n- list_type& l\bli\bis\bst\bt ();\n- list_type const& l\bli\bis\bst\bt () const;\n- integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n- void s\bsw\bwa\bap\bp (entry& e);\n- entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n- entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n- entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n- std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n-\n- enum data_type\n- {\n- int_t,\n- string_t,\n- list_t,\n- 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<char const>);\n-e\ben\bnt\btr\bry\by (integer_type);\n-e\ben\bnt\btr\bry\by (preformatted_type);\n-e\ben\bnt\btr\bry\by (list_type);\n-constructors directly from a specific type. The content of the argument is\n-copied into the newly constructed _\be_\bn_\bt_\br_\by\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-e\ben\bnt\btr\bry\by (data_type t);\n-construct an empty _\be_\bn_\bt_\br_\by of the specified type. see _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be enum.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-e\ben\bnt\btr\bry\by (bdecode_node const& n);\n-construct from _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be parsed form (see _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b))\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_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= (bdecode_node const&) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span<char const>) &;\n-copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) d\bdi\bic\bct\bt(\b()\b) l\bli\bis\bst\bt(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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-preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n-dictionary_type const& d\bdi\bic\bct\bt () const;\n-integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n-string_type const& s\bst\btr\bri\bin\bng\bg () const;\n-string_type& s\bst\btr\bri\bin\bng\bg ();\n-list_type& l\bli\bis\bst\bt ();\n-list_type const& l\bli\bis\bst\bt () const;\n-integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n-The integer(), string(), list() and dict() functions are accessors that return\n-the respective type. If the entry object isn't of the type you request, the\n-accessor will throw system_error. You can ask an entry for its type through the\n-type() function.\n-If you want to create an entry you give it the type you want it to have in its\n-constructor, and then use one of the non-const accessors to get a reference\n-which you then can assign the value you want it to have.\n-The typical code to get info from a torrent file will then look like this:\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find(\"announce\");\n-if (i != dict.end())\n-{\n- 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* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n-entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n-These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n-throw system_error.\n-They will look for an element at the given key in the dictionary, if the\n-element cannot be found, they will return nullptr. If an element with the given\n-key is found, the return a pointer to it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-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* 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<class OutIt> 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<char> 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* 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-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- piece hashes.\n- 4. The torrent is bencoded into a file or buffer.\n-If there are a lot of files and or deep directory hierarchies to traverse, step\n-one can be time consuming.\n-Typically step 3 is by far the most time consuming step, since it requires to\n-read all the bytes from all the files in the torrent.\n-All of these classes and functions are declared by including libtorrent/\n-create_torrent.hpp.\n-example:\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-[_\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_t\bto\bor\brr\bre\ben\bnt\bt *\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-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 (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<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n- file_storage const& f\bfi\bil\ble\bes\bs () const;\n- void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n- void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n- void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n- void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n- void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece,\n-sha256_hash const& h);\n- void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n- void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n- void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> node);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n- void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n- void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n- bool p\bpr\bri\biv\bv () const;\n- bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n- bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n- 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<piece_index_t> 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<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n- index_range<piece_index_t::diff_type> 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_l\ble\ben\bng\bgt\bth\bh () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n- void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n- void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n \n- static constexpr create_flags_t m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn_\b_t\bti\bim\bme\be = 2_bit;\n- static constexpr create_flags_t s\bsy\bym\bml\bli\bin\bnk\bks\bs = 3_bit;\n- static constexpr create_flags_t v\bv2\b2_\b_o\bon\bnl\bly\by = 5_bit;\n- static constexpr create_flags_t v\bv1\b1_\b_o\bon\bnl\bly\by = 6_bit;\n- static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs = 7_bit;\n- static constexpr create_flags_t n\bno\bo_\b_a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs = 8_bit;\n- static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs_\b_n\bno\bo_\b_t\bta\bai\bil\bl_\b_p\bpa\bad\bdd\bdi\bin\bng\bg = 9_bit;\n+ node_ids_t nids;\n+ std::vector<udp::endpoint> nodes;\n+ std::vector<udp::endpoint> nodes6;\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 (file_storage& fs, int piece_size = 0\n- , create_flags_t flags = {});\n-explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n-The piece_size is the size of each piece in bytes. It must be a power of 2 and\n-a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be\n-set automatically. Piece sizes greater than 128 MiB are considered unreasonable\n-and will be rejected (with an lt::system_error exception).\n-The flags arguments specifies options for the torrent creation. It can be any\n-combination of the flags defined by create_flags_t.\n-The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be (fs) parameter defines the files, sizes and their properties\n-for the torrent to be created. Set this up first, before passing it to the\n-_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt constructor.\n-The overload that takes a torrent_info object will make a verbatim copy of its\n-info dictionary (to preserve the info-hash). The copy of the info dictionary\n-will be used by _\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). This means that none of the member\n-functions of _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt that affects the content of the info dictionary\n-(such as _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)), will have any affect. Instead of using this overload,\n-consider using _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) instead.\n-Warning\n-The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be and _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo objects must stay alive for the entire\n-duration of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b*\n-entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n-std::vector<char> g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n-This function will generate the .torrent file as a bencode tree, or a bencoded\n-into a buffer. In order to encode the _\be_\bn_\bt_\br_\by into a flat file, use the _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n-function.\n-The function returning an _\be_\bn_\bt_\br_\by may be useful to add custom entries to the\n-torrent file before bencoding it and saving it to disk.\n-Whether the resulting torrent object is v1, v2 or hybrid depends on whether any\n-of the v1_only or v2_only flags were set on the constructor. If neither were\n-set, the resulting torrent depends on which hashes were set. If both v1 and v2\n-hashes were set, a hybrid torrent is created.\n-Any failure will cause this function to throw system_error, with an appropriate\n-error message. These are the reasons this call may throw:\n- * the file storage has 0 files\n- * the total size of the file storage is 0 bytes (i.e. it only has empty\n- files)\n- * not all v1 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)) and not all v2 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) were\n- set\n- * for v2 torrents, you may not have a directory with the same name as a\n- file. If that's encountered in the file storage, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) fails.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_storage const& f\bfi\bil\ble\bes\bs () const;\n-returns an immutable reference to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be used to create the torrent\n-from.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n-Sets the comment for the torrent. The string str should be utf-8 encoded. The\n-comment in a torrent file is optional.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n-Sets the creator of the torrent. The string str should be utf-8 encoded. This\n-is optional.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n-sets the \"creation time\" field. Defaults to the system clock at the time of\n-construction of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object. The timestamp is specified in\n-seconds, posix time. If the creation date is set to 0, the \"creation date\"\n-field will be omitted from the generated torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n-This sets the SHA-1 hash for the specified piece (index). You are required to\n-set the hash for every piece in the torrent before generating it. If you have\n-the files on disk, you can use the high level convenience function to do this.\n-See _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b). A SHA-1 hash of all zeros is internally used to\n-indicate a hash that has not been set. Setting such hash will not be considered\n-set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function will throw std::system_error if it\n-is called on an object constructed with the v2_only flag.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash\n-const& h);\n-sets the bittorrent v2 hash for filefileof the piecepiece.pieceis relative to\n-the first piece of the file, starting at 0. The first piece in the file can be\n-computed with _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b). The hash,h, is the root of\n-the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must\n-be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n-all zeros is internally used to indicate a hash that has not been set. Setting\n-such hash will not be considered set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function\n-will throw std::system_error if it is called on an object constructed with the\n-v1_only flag.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n-void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n-This adds a url seed to the torrent. You can have any number of url seeds. For\n-a single file torrent, this should be an HTTP url, pointing to a file with\n-identical content as the file of the torrent. For a multi-file torrent, it\n-should point to a directory containing a directory with the same name as this\n-torrent, and all the files of the torrent in it.\n-The second function, add_http_seed() adds an HTTP seed instead.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair<std::string, int> node);\n-This adds a DHT node to the torrent. This especially useful if you're creating\n-a tracker less torrent. It can be used by clients to bootstrap their DHT node\n-from. The node is a hostname and a port number where there is a DHT node\n-running. You can have any number of DHT nodes in a torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n-Adds a tracker to the torrent. This is not strictly required, but most torrents\n-use a tracker as their main source of peers. The url should be an _\bh_\bt_\bt_\bp_\b:_\b/_\b/ or\n-udp:// url to a machine running a bittorrent tracker that accepts announces for\n-this torrent's info-hash. The tier is the fallback priority of the tracker. All\n-trackers with tier 0 are tried first (in any order). If all fail, trackers with\n-tier 1 are tried. If all of those fail, trackers with tier 2 are tried, and so\n-on.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n-This function sets an X.509 certificate in PEM format to the torrent. This\n-makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n-valid certificate signed by this root certificate. For SSL torrents, all peers\n-are connecting over SSL connections. For more information, see the section on\n-_\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n-The string is not the path to the cert, it's the actual content of the\n-certificate.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n-bool p\bpr\bri\biv\bv () const;\n-Sets and queries the private flag of the torrent. Torrents with the private\n-flag set ask the client to not use any other sources than the tracker for\n-peers, and to not use DHT to advertise itself publicly, only the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n-returns the number of pieces in the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range<piece_index_t> p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-all piece indices in the torrent to be created\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range<file_index_t> f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-all file indices in the torrent to be created\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range<piece_index_t::diff_type> f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n-for v2 and hybrid torrents only, the pieces in the specified file, specified as\n-delta from the first piece in the file. i.e. the first index is 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n-the total number of bytes of all files and pad files\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_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-Add similar torrents (by info-hash) or collections of similar torrents. Similar\n-torrents are expected to share some files with this torrent. Torrents sharing a\n-collection name with this torrent are also expected to share files with this\n-torrent. A torrent may have more than one collection and more than one similar\n-torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- modification_time\n- This will include the file modification time as part of the torrent. This\n- is not enabled by default, as it might cause problems when you create a\n- torrent from separate files with the same content, hoping to yield the\n- same info-hash. If the files have different modification times, with this\n- option enabled, you would get different info-hashes for the files.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- symlinks\n- If this flag is set, files that are symlinks get a symlink attribute set\n- on them and their data will not be included in the torrent. This is\n- useful if you need to reconstruct a file hierarchy which contains\n- symlinks.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- v2_only\n- Do not generate v1 metadata. The resulting torrent will only be usable by\n- clients which support v2. This requires setting all v2 hashes, with\n- _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b) before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). Setting v1 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh\n- _\b(_\b)) is an error with this flag set.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- v1_only\n- do not generate v2 metadata or enforce v2 alignment and padding rules\n- this is mainly for tests, not recommended for production use. This\n- requires setting all v1 hashes, with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b), before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be\n- _\b(_\b). Setting v2 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) is an error with this flag set.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- canonical_files\n- This flag only affects v1-only torrents, and is only relevant together\n- with the v1_only_flag. This flag will force the same file order and\n- padding as a v2 (or hybrid) torrent would have. It has the effect of\n- ordering files and inserting pad files to align them with piece\n- boundaries.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- no_attributes\n- passing this flag to _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) will ignore file attributes (such as\n- executable or hidden) when adding the files to the file storage. Since\n- not all filesystems and operating systems support all file attributes the\n- resulting torrent may differ depending on where it's created. If it's\n- important for torrents to be created consistently across systems, this\n- flag should be set.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- canonical_files_no_tail_padding\n- this flag enforces the file layout to be canonical according to the\n- bittorrent v2 specification (just like the canonical_files flag) with the\n- one exception that tail padding is not added to the last file. This\n- behavior deviates from the specification but was the way libtorrent\n- created torrents in version up to and including 2.0.7. This flag is here\n- for backwards compatibility.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n- , std::function<bool(std::string)> p, create_flags_t flags = {});\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n- , create_flags_t flags = {});\n-Adds the file specified by path to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object. In case path refers\n-to a directory, files will be added recursively from the directory.\n-If specified, the predicate p is called once for every file and directory that\n-is encountered. Files for which p returns true are added, and directories for\n-which p returns true are traversed. p must have the following signature:\n-bool Pred(std::string const& p);\n-The path that is passed in to the predicate is the full path of the file or\n-directory. If no predicate is specified, all files are added, and all\n-directories are traversed.\n-The \"..\" directory is never traversed.\n-The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n-constructor.\n+ nodes\n+ the bootstrap nodes saved from the buckets node\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n-error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function<void(piece_index_t)> 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<void(piece_index_t)> const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , std::function<void(piece_index_t)> const& f);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , std::function<void(piece_index_t)> 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+ 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_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@@ -12577,33 +12876,14 @@\n For implementers: Use this functions for expire peers or items or any other\n storage cleanup.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual dht_storage_counters c\bco\bou\bun\bnt\bte\ber\brs\bs () const = 0;\n return stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the store\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n-This structure helps to store and load the state of the dht_tracker. At this\n-moment the library is only a dual stack implementation of the DHT. See _\bB_\bE_\bP_\b _\b3_\b2\n-struct dht_state\n-{\n- void c\bcl\ble\bea\bar\br ();\n-\n- node_ids_t nids;\n- std::vector<udp::endpoint> nodes;\n- std::vector<udp::endpoint> nodes6;\n-};\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<dht_storage_interface> 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@@ -12632,22 +12912,22 @@\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* 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<char const> buffer\n- , load_torrent_limits const& cfg = {});\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n , int piece_limit = 0x200000);\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n- , error_code& ec, int piece_limit = 0x200000);\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span<char const> 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<char const> 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 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@@ -12655,18 +12935,18 @@\n the torrent that may be loaded as part of the resume data, if it contains an\n info field. The overloads that take a flat buffer are instead configured with\n limits on torrent sizes via load_torrent limits.\n In order to support large torrents, it may also be necessary to raise the\n _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt setting and pass a higher limit to calls to\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\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<char> w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n+entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n this function turns the resume data in an add_torrent_params object into a\n bencoded structure\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n flags);\n@@ -12723,18 +13003,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<char const> 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-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<char, 32> 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<char, 32> 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<char, 32> 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,67 +459,338 @@\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(9)\">../src/session_handle.cpp:691</a></td><td>expose the sequence_number, public_key, secret_key and signature types to the client</td></tr><tr id=\"9\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>expose the sequence_number, public_key, secret_key and signature\n-types to the client</h2><h4>../src/session_handle.cpp:691</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tvoid session_handle::dht_get_item(sha1_hash const& target)\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(9)\">../src/ut_metadata.cpp:268</a></td><td>use the aux::write_* functions and the span here instead, it will fit better with send_buffer()</td></tr><tr id=\"9\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use the aux::write_* functions and the span here instead, it\n+will fit better with send_buffer()</h2><h4>../src/ut_metadata.cpp:268</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tchar msg[200];\n+</div>\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(10)\">../src/torrent.cpp:419</a></td><td>we could probably get away with just saving a few fields here</td></tr><tr id=\"10\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we could probably get away with just saving a few fields here</h2><h4>../src/torrent.cpp:419</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n+</div>\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-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_get_immutable_item, target);\n-#else\n-\t\tTORRENT_UNUSED(target);\n-#endif\n+\t\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 session_handle::dht_get_item(std::array<char, 32> key\n-\t\t, std::string salt)\n+\tvoid torrent::inc_stats_counter(int c, int value)\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(11)\">../src/torrent.cpp:715</a></td><td>assert there are no outstanding async operations on this torrent</td></tr><tr id=\"11\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>assert there are no outstanding async operations on this\n+torrent</h2><h4>../src/torrent.cpp:715</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt);\n-#else\n-\t\tTORRENT_UNUSED(key);\n-\t\tTORRENT_UNUSED(salt);\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>#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-<div style=\"background: #ffff00\" width=\"100%\">\tsha1_hash session_handle::dht_put_item(entry data)\n-</div>\t{\n-\t\tstd::vector<char> buf;\n-\t\tbencode(std::back_inserter(buf), data);\n-\t\tsha1_hash const ret = hasher(buf).final();\n+\tvoid torrent::read_piece(piece_index_t const piece)\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(12)\">../src/torrent.cpp:1331</a></td><td>there's some duplication between this function and peer_connection::incoming_piece(). is there a way to merge something?</td></tr><tr id=\"12\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>there's some duplication between this function and\n+peer_connection::incoming_piece(). is there a way to merge something?</h2><h4>../src/torrent.cpp:1331</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tpiece_index_t m_piece;\n+\t\tbool m_armed = true;\n+\t};\n \n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret);\n-#endif\n-\t\treturn ret;\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 session_handle::dht_put_item(std::array<char, 32> key\n-\t\t, std::function<void(entry&, std::array<char,64>&\n-\t\t\t, std::int64_t&, std::string const&)> cb\n-\t\t, std::string salt)\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::add_piece(piece_index_t const piece, char const* data\n+</div>\t\t, add_piece_flags_t const flags)\n \t{\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt);\n-#else\n-\t\tTORRENT_UNUSED(key);\n-\t\tTORRENT_UNUSED(cb);\n-\t\tTORRENT_UNUSED(salt);\n-#endif\n+\t\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(13)\">../src/torrent.cpp:3966</a></td><td>this could probably be pulled out into a free function</td></tr><tr id=\"13\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could probably be pulled out into a free function</h2><h4>../src/torrent.cpp:3966</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash)\n+\t// fills in total_wanted, total_wanted_done and total_done\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n+</div>\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(14)\">../src/torrent.cpp:4905</a></td><td>should this alert have an error code in it?</td></tr><tr id=\"14\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should this alert have an error code in it?</h2><h4>../src/torrent.cpp:4905</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+</div>\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(15)\">../src/torrent.cpp:4975</a></td><td>this should return optional<>. piece index -1 should not be allowed</td></tr><tr id=\"15\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should return optional<>. piece index -1 should not be\n+allowed</h2><h4>../src/torrent.cpp:4975</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n+\n+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+\tvoid torrent::set_super_seeding(bool const on)\n \t{\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_get_peers, info_hash);\n-#else\n-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(10)\">../src/web_peer_connection.cpp:199</a></td><td>this should be an optional<piece_index_t>, piece index -1 should not be allowed</td></tr><tr id=\"10\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be an optional<piece_index_t>, piece index -1 should\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+<div style=\"background: #ffff00\" width=\"100%\">\tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n+</div>\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(16)\">../src/web_peer_connection.cpp:199</a></td><td>this should be an optional<piece_index_t>, piece index -1 should not be allowed</td></tr><tr id=\"16\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be an optional<piece_index_t>, piece index -1 should\n not be allowed</h2><h4>../src/web_peer_connection.cpp:199</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -563,15 +834,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(11)\">../src/web_peer_connection.cpp:419</a></td><td>do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?</td></tr><tr id=\"11\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>do we really need a special case here? wouldn't the multi-file\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(17)\">../src/web_peer_connection.cpp:419</a></td><td>do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?</td></tr><tr id=\"17\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>do we really need a special case here? wouldn't the multi-file\n case handle single file torrents correctly too?</h2><h4>../src/web_peer_connection.cpp:419</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -615,15 +886,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(12)\">../src/web_peer_connection.cpp:504</a></td><td>file_index_t should not allow negative values</td></tr><tr id=\"12\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>file_index_t should not allow negative values</h2><h4>../src/web_peer_connection.cpp:504</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t\t// with the correct slashes. Don't encode it again\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(18)\">../src/web_peer_connection.cpp:504</a></td><td>file_index_t should not allow negative values</td></tr><tr id=\"18\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>file_index_t should not allow negative values</h2><h4>../src/web_peer_connection.cpp:504</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -666,15 +937,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(13)\">../src/web_peer_connection.cpp:695</a></td><td>this 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.</td></tr><tr id=\"13\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be made more efficient for the case when we use an\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(19)\">../src/web_peer_connection.cpp:695</a></td><td>this 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.</td></tr><tr id=\"19\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/web_peer_connection.cpp:695</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -719,47 +990,226 @@\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(14)\">../src/ut_metadata.cpp:268</a></td><td>use the aux::write_* functions and the span here instead, it will fit better with send_buffer()</td></tr><tr id=\"14\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use the aux::write_* functions and the span here instead, it\n-will fit better with send_buffer()</h2><h4>../src/ut_metadata.cpp:268</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tint metadata_piece_size = 0;\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(20)\">../src/peer_connection.cpp:3133</a></td><td>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 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.</td></tr><tr id=\"20\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/peer_connection.cpp:3133</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\t\tif (m_torrent.valid_metadata())\n-\t\t\t\te[\"total_size\"] = m_tp.metadata().size();\n+\t\tcheck_graceful_pause();\n \n-\t\t\tif (type == msg_t::piece)\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+</div>\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(21)\">../src/peer_connection.cpp:4044</a></td><td>once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed.</td></tr><tr id=\"21\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>once peers are properly put in graceful pause mode, they can\n+cancel all outstanding requests and this test can be removed.</h2><h4>../src/peer_connection.cpp:4044</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tif (!t) return;\n+\n+\t\tif (m_disconnecting) return;\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (t->graceful_pause()) return;\n+</div>\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-\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(22)\">../src/peer_connection.cpp:4730</a></td><td>new_piece should be an optional<piece_index_t>. piece index -1 should not be allowed</td></tr><tr id=\"22\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>new_piece should be an optional<piece_index_t>. piece index -1\n+should not be allowed</h2><h4>../src/peer_connection.cpp:4730</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\t\t\tint const offset = piece * 16 * 1024;\n-\t\t\t\tmetadata = m_tp.metadata().data() + offset;\n-\t\t\t\tmetadata_piece_size = std::min(\n-\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024);\n-\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0);\n-\t\t\t\tTORRENT_ASSERT(offset >= 0);\n-\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size());\n-\t\t\t}\n+\t}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tchar msg[200];\n-</div>\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+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid peer_connection::superseed_piece(piece_index_t const replace_piece\n+</div>\t\t, piece_index_t const new_piece)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n \n-\t\t\tm_pc.send_buffer({msg, len + 6});\n-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(15)\">../src/session_impl.cpp:1142</a></td><td>closing the udp sockets here means that the uTP connections cannot be closed gracefully</td></tr><tr id=\"15\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>closing the udp sockets here means that\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(23)\">../src/session_handle.cpp:691</a></td><td>expose the sequence_number, public_key, secret_key and signature types to the client</td></tr><tr id=\"23\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>expose the sequence_number, public_key, secret_key and signature\n+types to the client</h2><h4>../src/session_handle.cpp:691</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tvoid session_handle::dht_get_item(sha1_hash const& target)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_get_immutable_item, target);\n+#else\n+\t\tTORRENT_UNUSED(target);\n+#endif\n+\t}\n+\n+\tvoid session_handle::dht_get_item(std::array<char, 32> key\n+\t\t, std::string salt)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt);\n+#else\n+\t\tTORRENT_UNUSED(key);\n+\t\tTORRENT_UNUSED(salt);\n+#endif\n+\t}\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\tsha1_hash session_handle::dht_put_item(entry data)\n+</div>\t{\n+\t\tstd::vector<char> buf;\n+\t\tbencode(std::back_inserter(buf), data);\n+\t\tsha1_hash const ret = hasher(buf).final();\n+\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret);\n+#endif\n+\t\treturn ret;\n+\t}\n+\n+\tvoid session_handle::dht_put_item(std::array<char, 32> key\n+\t\t, std::function<void(entry&, std::array<char,64>&\n+\t\t\t, std::int64_t&, std::string const&)> cb\n+\t\t, std::string salt)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt);\n+#else\n+\t\tTORRENT_UNUSED(key);\n+\t\tTORRENT_UNUSED(cb);\n+\t\tTORRENT_UNUSED(salt);\n+#endif\n+\t}\n+\n+\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_get_peers, info_hash);\n+#else\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(24)\">../src/session_impl.cpp:1142</a></td><td>closing the udp sockets here means that the uTP connections cannot be closed gracefully</td></tr><tr id=\"24\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>closing the udp sockets here means that\n the uTP connections cannot be closed gracefully</h2><h4>../src/session_impl.cpp:1142</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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@@ -803,15 +1253,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(16)\">../src/session_impl.cpp:1638</a></td><td>the logic in this if-block should be factored out into a separate function. At least most of it</td></tr><tr id=\"16\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the logic in this if-block should be factored out into a\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(25)\">../src/session_impl.cpp:1638</a></td><td>the logic in this if-block should be factored out into a separate function. At least most of it</td></tr><tr id=\"25\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the logic in this if-block should be factored out into a\n separate function. At least most of it</h2><h4>../src/session_impl.cpp:1638</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -855,15 +1305,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(17)\">../src/session_impl.cpp:2606</a></td><td>it would be neat if the utp socket manager would handle ICMP errors too</td></tr><tr id=\"17\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be neat if the utp socket manager would\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(26)\">../src/session_impl.cpp:2606</a></td><td>it would be neat if the utp socket manager would handle ICMP errors too</td></tr><tr id=\"26\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be neat if the utp socket manager would\n handle ICMP errors too</h2><h4>../src/session_impl.cpp:2606</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -907,15 +1357,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(18)\">../src/session_impl.cpp:4155</a></td><td>it 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).</td></tr><tr id=\"18\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would probably make sense to have a separate list of peers\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(27)\">../src/session_impl.cpp:4155</a></td><td>it 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).</td></tr><tr id=\"27\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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).</h2><h4>../src/session_impl.cpp:4155</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n \n@@ -949,15 +1399,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(19)\">../src/session_impl.cpp:4178</a></td><td>peers should know whether their torrent is paused or not, instead of having to ask it over and over again</td></tr><tr id=\"19\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>peers should know whether their torrent is paused or not,\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(28)\">../src/session_impl.cpp:4178</a></td><td>peers should know whether their torrent is paused or not, instead of having to ask it over and over again</td></tr><tr id=\"28\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>peers should know whether their torrent is paused or not,\n instead of having to ask it over and over again</h2><h4>../src/session_impl.cpp:4178</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -1001,15 +1451,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(20)\">../src/session_impl.cpp:4424</a></td><td>there should be a pre-calculated list of all peers eligible for unchoking</td></tr><tr id=\"20\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>there should be a pre-calculated list of all peers eligible for\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(29)\">../src/session_impl.cpp:4424</a></td><td>there should be a pre-calculated list of all peers eligible for unchoking</td></tr><tr id=\"29\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>there should be a pre-calculated list of all peers eligible for\n unchoking</h2><h4>../src/session_impl.cpp:4424</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -1053,15 +1503,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(21)\">../src/session_impl.cpp:6136</a></td><td>use public_key here instead of std::array</td></tr><tr id=\"21\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use public_key here instead of std::array</h2><h4>../src/session_impl.cpp:6136</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(30)\">../src/session_impl.cpp:6136</a></td><td>use public_key here instead of std::array</td></tr><tr id=\"30\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use public_key here instead of std::array</h2><h4>../src/session_impl.cpp:6136</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -1104,464 +1554,14 @@\n \t\t\t\talerts.emplace_alert<dht_put_alert>(pk.bytes, sig.bytes\n \t\t\t\t\t, std::move(salt), seq.value, num);\n \t\t\t}\n \t\t}\n \n \t\tvoid put_mutable_callback(dht::item& i\n \t\t\t, std::function<void(entry&, std::array<char, 64>&\n-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(22)\">../src/peer_connection.cpp:3133</a></td><td>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 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.</td></tr><tr id=\"22\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/peer_connection.cpp:3133</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(23)\">../src/peer_connection.cpp:4044</a></td><td>once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed.</td></tr><tr id=\"23\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>once peers are properly put in graceful pause mode, they can\n-cancel all outstanding requests and this test can be removed.</h2><h4>../src/peer_connection.cpp:4044</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tif (!t) return;\n-\n-\t\tif (m_disconnecting) return;\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (t->graceful_pause()) return;\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(24)\">../src/peer_connection.cpp:4730</a></td><td>new_piece should be an optional<piece_index_t>. piece index -1 should not be allowed</td></tr><tr id=\"24\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>new_piece should be an optional<piece_index_t>. piece index -1\n-should not be allowed</h2><h4>../src/peer_connection.cpp:4730</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\tvoid peer_connection::superseed_piece(piece_index_t const replace_piece\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(25)\">../src/torrent.cpp:419</a></td><td>we could probably get away with just saving a few fields here</td></tr><tr id=\"25\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we could probably get away with just saving a few fields here</h2><h4>../src/torrent.cpp:419</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(26)\">../src/torrent.cpp:715</a></td><td>assert there are no outstanding async operations on this torrent</td></tr><tr id=\"26\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>assert there are no outstanding async operations on this\n-torrent</h2><h4>../src/torrent.cpp:715</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>#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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(27)\">../src/torrent.cpp:1331</a></td><td>there's some duplication between this function and peer_connection::incoming_piece(). is there a way to merge something?</td></tr><tr id=\"27\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>there's some duplication between this function and\n-peer_connection::incoming_piece(). is there a way to merge something?</h2><h4>../src/torrent.cpp:1331</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tpiece_index_t m_piece;\n-\t\tbool m_armed = true;\n-\t};\n-\n-\tvoid torrent::add_piece_async(piece_index_t const piece\n-\t\t, std::vector<char> data, add_piece_flags_t const flags)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\t// make sure the piece index is correct\n-\t\tif (piece >= torrent_file().end_piece())\n-\t\t\treturn;\n-\n-\t\t// make sure the piece size is correct\n-\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece)))\n-\t\t\treturn;\n-\n-\t\tadd_piece(piece, data.data(), flags);\n-\t}\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::add_piece(piece_index_t const piece, char const* data\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(28)\">../src/torrent.cpp:3966</a></td><td>this could probably be pulled out into a free function</td></tr><tr id=\"28\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could probably be pulled out into a free function</h2><h4>../src/torrent.cpp:3966</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(29)\">../src/torrent.cpp:4905</a></td><td>should this alert have an error code in it?</td></tr><tr id=\"29\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should this alert have an error code in it?</h2><h4>../src/torrent.cpp:4905</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(30)\">../src/torrent.cpp:4975</a></td><td>this should return optional<>. piece index -1 should not be allowed</td></tr><tr id=\"30\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should return optional<>. piece index -1 should not be\n-allowed</h2><h4>../src/torrent.cpp:4975</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n-</div>\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 </pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(31)\">../src/kademlia/rpc_manager.cpp:71</a></td><td>move this into it's own .cpp file</td></tr><tr id=\"31\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into it's own .cpp file</h2><h4>../src/kademlia/rpc_manager.cpp:71</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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,118 +1605,15 @@\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(32)\">../include/libtorrent/torrent_handle.hpp:535</a></td><td>unify url_seed and http_seed with just web_seed, using the web_seed_entry.</td></tr><tr id=\"32\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>unify url_seed and http_seed with just web_seed, using the\n-web_seed_entry.</h2><h4>../include/libtorrent/torrent_handle.hpp:535</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(33)\">../include/libtorrent/pe_crypto.hpp:72</a></td><td>dh_key_exchange should probably move into its own file</td></tr><tr id=\"33\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>dh_key_exchange should probably move into its own file</h2><h4>../include/libtorrent/pe_crypto.hpp:72</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-#include <list>\n-#include <array>\n-#include <cstdint>\n-\n-namespace libtorrent {\n-\n-\tnamespace mp = boost::multiprecision;\n-\n-\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>;\n-\n-\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k);\n-\n-\t// RC4 state from libtomcrypt\n-\tstruct rc4 {\n-\t\tint x;\n-\t\tint y;\n-\t\taux::array<std::uint8_t, 256> buf;\n-\t};\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tclass TORRENT_EXTRA_EXPORT dh_key_exchange\n-</div>\t{\n-\tpublic:\n-\t\tdh_key_exchange();\n-\n-\t\t// Get local public key\n-\t\tkey_t const& get_local_key() const { return m_dh_local_key; }\n-\n-\t\t// read remote_pubkey, generate and store shared secret in\n-\t\t// m_dh_shared_secret.\n-\t\tvoid compute_secret(std::uint8_t const* remote_pubkey);\n-\t\tvoid compute_secret(key_t const& remote_pubkey);\n-\n-\t\tkey_t const& get_secret() const { return m_dh_shared_secret; }\n-\n-\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; }\n-\n-\tprivate:\n-\n-\t\tkey_t m_dh_local_key;\n-\t\tkey_t m_dh_local_secret;\n-\t\tkey_t m_dh_shared_secret;\n-\t\tsha1_hash m_xor_mask;\n-\t};\n-\n-\tstruct TORRENT_EXTRA_EXPORT encryption_handler\n-\t{\n-\t\tstd::tuple<int, span<span<char const>>>\n-\t\tencrypt(span<span<char>> iovec);\n-\n-\t\tint decrypt(aux::crypto_receive_buffer& recv_buffer\n-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(34)\">../include/libtorrent/torrent.hpp:1423</a></td><td>factor out predictive pieces and all operations on it into a separate class (to use as member here instead)</td></tr><tr id=\"34\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out predictive pieces and all operations on it into a\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(32)\">../include/libtorrent/torrent.hpp:1423</a></td><td>factor out predictive pieces and all operations on it into a separate class (to use as member here instead)</td></tr><tr id=\"32\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out predictive pieces and all operations on it into a\n separate class (to use as member here instead)</h2><h4>../include/libtorrent/torrent.hpp:1423</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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@@ -1760,15 +1657,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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(35)\">../include/libtorrent/torrent.hpp:1483</a></td><td>factor out the links (as well as update_list() to a separate class that torrent can inherit)</td></tr><tr id=\"35\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out the links (as well as update_list() to a separate\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(33)\">../include/libtorrent/torrent.hpp:1483</a></td><td>factor out the links (as well as update_list() to a separate class that torrent can inherit)</td></tr><tr id=\"33\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out the links (as well as update_list() to a separate\n class that torrent can inherit)</h2><h4>../include/libtorrent/torrent.hpp:1483</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -1812,65 +1709,118 @@\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(36)\">../include/libtorrent/stat.hpp:257</a></td><td>everything but payload counters and rates could probably be removed from here</td></tr><tr id=\"36\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>everything but payload counters and rates could probably be\n-removed from here</h2><h4>../include/libtorrent/stat.hpp:257</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(34)\">../include/libtorrent/enum_net.hpp:164</a></td><td>use string_view for device_name</td></tr><tr id=\"34\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use string_view for device_name</h2><h4>../include/libtorrent/enum_net.hpp:164</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\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+\t// returns whether there is a route to the specified device for for any global\n+\t// internet address of the specified address family.\n+\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family\n+\t\t, span<ip_route const> routes);\n \n-\t\t// these are the channels we keep stats for\n-\t\tenum\n-\t\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tupload_payload,\n-</div>\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+\t// returns whether there are *any* routes to the internet in the routing\n+\t// table. This can be used to determine if the routing table is fully\n+\t// populated or not.\n+\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes);\n \n-\t\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+\t// attempt to bind socket to the device with the specified name. For systems\n+\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the\n+\t// IP addresses of the specified device. In this case it is necessary to\n+\t// verify the local endpoint of the socket once the connection is established.\n+\t// the returned address is the ip the socket was bound to (or address_v4::any()\n+\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it).\n+<div style=\"background: #ffff00\" width=\"100%\">\ttemplate <class Socket>\n+</div>\taddress bind_socket_to_device(io_context& ios, Socket& sock\n+\t\t, tcp const& protocol\n+\t\t, char const* device_name, int port, error_code& ec)\n+\t{\n+\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port));\n \n-\t\tstat_channel const& operator[](int i) const\n+\t\taddress ip = make_address(device_name, ec);\n+\t\tif (!ec)\n \t\t{\n-\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels);\n-\t\t\treturn m_stat[i];\n+\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or\n+\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n+\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n+\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n+\t\t\t\tip = address_v6::any();\n+\t\t\tbind_ep.address(ip);\n+\t\t\t// it appears to be an IP. Just bind to that address\n+\t\t\tsock.bind(bind_ep, ec);\n+\t\t\treturn bind_ep.address();\n \t\t}\n \n-\tprivate:\n+\t\tec.clear();\n \n-\t\tstat_channel m_stat[num_channels];\n-\t};\n+#if TORRENT_HAS_BINDTODEVICE\n+\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n+\t\t// fall back to the mechanism we have below\n+\t\taux::bind_device(sock, device_name, ec);\n+\t\tif (ec)\n+#endif\n+\t\t{\n+\t\t\tec.clear();\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(35)\">../include/libtorrent/torrent_handle.hpp:535</a></td><td>unify url_seed and http_seed with just web_seed, using the web_seed_entry.</td></tr><tr id=\"35\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>unify url_seed and http_seed with just web_seed, using the\n+web_seed_entry.</h2><h4>../include/libtorrent/torrent_handle.hpp:535</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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-#endif // TORRENT_STAT_HPP_INCLUDED\n-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(37)\">../include/libtorrent/web_peer_connection.hpp:119</a></td><td>if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and release_disk_receive_buffer</td></tr><tr id=\"37\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>if we make this be a disk_buffer_holder instead\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+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(36)\">../include/libtorrent/web_peer_connection.hpp:119</a></td><td>if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and release_disk_receive_buffer</td></tr><tr id=\"36\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../include/libtorrent/web_peer_connection.hpp:119</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tpiece_block_progress downloading_piece_progress() const override;\n \n \t\tvoid handle_padfile();\n \n \t\t// this has one entry per http-request\n \t\t// (might be more than the bt requests)\n@@ -1910,65 +1860,115 @@\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-</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(38)\">../include/libtorrent/enum_net.hpp:164</a></td><td>use string_view for device_name</td></tr><tr id=\"38\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use string_view for device_name</h2><h4>../include/libtorrent/enum_net.hpp:164</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t// return nullopt.\n-\tTORRENT_EXTRA_EXPORT boost::optional<address> get_gateway(\n-\t\tip_interface const& iface, span<ip_route const> routes);\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(37)\">../include/libtorrent/pe_crypto.hpp:72</a></td><td>dh_key_exchange should probably move into its own file</td></tr><tr id=\"37\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>dh_key_exchange should probably move into its own file</h2><h4>../include/libtorrent/pe_crypto.hpp:72</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+#include <list>\n+#include <array>\n+#include <cstdint>\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+namespace libtorrent {\n \n-\t// returns whether there are *any* routes to the internet in the routing\n-\t// table. This can be used to determine if the routing table is fully\n-\t// populated or not.\n-\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes);\n+\tnamespace mp = boost::multiprecision;\n \n-\t// attempt to bind socket to the device with the specified name. For systems\n-\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the\n-\t// IP addresses of the specified device. In this case it is necessary to\n-\t// verify the local endpoint of the socket once the connection is established.\n-\t// the returned address is the ip the socket was bound to (or address_v4::any()\n-\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it).\n-<div style=\"background: #ffff00\" width=\"100%\">\ttemplate <class Socket>\n-</div>\taddress bind_socket_to_device(io_context& ios, Socket& sock\n-\t\t, tcp const& protocol\n-\t\t, char const* device_name, int port, error_code& ec)\n+\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>;\n+\n+\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k);\n+\n+\t// RC4 state from libtomcrypt\n+\tstruct rc4 {\n+\t\tint x;\n+\t\tint y;\n+\t\taux::array<std::uint8_t, 256> buf;\n+\t};\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\tclass TORRENT_EXTRA_EXPORT dh_key_exchange\n+</div>\t{\n+\tpublic:\n+\t\tdh_key_exchange();\n+\n+\t\t// Get local public key\n+\t\tkey_t const& get_local_key() const { return m_dh_local_key; }\n+\n+\t\t// read remote_pubkey, generate and store shared secret in\n+\t\t// m_dh_shared_secret.\n+\t\tvoid compute_secret(std::uint8_t const* remote_pubkey);\n+\t\tvoid compute_secret(key_t const& remote_pubkey);\n+\n+\t\tkey_t const& get_secret() const { return m_dh_shared_secret; }\n+\n+\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; }\n+\n+\tprivate:\n+\n+\t\tkey_t m_dh_local_key;\n+\t\tkey_t m_dh_local_secret;\n+\t\tkey_t m_dh_shared_secret;\n+\t\tsha1_hash m_xor_mask;\n+\t};\n+\n+\tstruct TORRENT_EXTRA_EXPORT encryption_handler\n \t{\n-\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port));\n+\t\tstd::tuple<int, span<span<char const>>>\n+\t\tencrypt(span<span<char>> iovec);\n \n-\t\taddress ip = make_address(device_name, ec);\n-\t\tif (!ec)\n+\t\tint decrypt(aux::crypto_receive_buffer& recv_buffer\n+</pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(38)\">../include/libtorrent/stat.hpp:257</a></td><td>everything but payload counters and rates could probably be removed from here</td></tr><tr id=\"38\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>everything but payload counters and rates could probably be\n+removed from here</h2><h4>../include/libtorrent/stat.hpp:257</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or\n-\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n-\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n-\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n-\t\t\t\tip = address_v6::any();\n-\t\t\tbind_ep.address(ip);\n-\t\t\t// it appears to be an IP. Just bind to that address\n-\t\t\tsock.bind(bind_ep, ec);\n-\t\t\treturn bind_ep.address();\n+\t\t\tm_stat[download_payload].offset(downloaded);\n+\t\t\tm_stat[upload_payload].offset(uploaded);\n \t\t}\n \n-\t\tec.clear();\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-#if TORRENT_HAS_BINDTODEVICE\n-\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n-\t\t// fall back to the mechanism we have below\n-\t\taux::bind_device(sock, device_name, ec);\n-\t\tif (ec)\n-#endif\n+\t\t// these are the channels we keep stats for\n+\t\tenum\n \t\t{\n-\t\t\tec.clear();\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tupload_payload,\n+</div>\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 </pre></td></tr><tr style=\"background: #fcc\"><td>relevance 3</td><td><a href=\"javascript:expand(39)\">../include/libtorrent/kademlia/routing_table.hpp:153</a></td><td>to 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.</td></tr><tr id=\"39\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../include/libtorrent/kademlia/routing_table.hpp:153</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">// * 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,16 @@\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(41)\">../test/test_storage.cpp:769</a></td><td>split this test up into smaller parts</td></tr><tr id=\"41\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>split this test up into smaller parts</h2><h4>../test/test_storage.cpp:769</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tio->submit_jobs();\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(41)\">../test/test_piece_picker.cpp:2870</a></td><td>test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used</td></tr><tr id=\"41\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test picking with partial pieces and other peers present so that both\n+backup_pieces and backup_pieces2 are used</h2><h4>../test/test_piece_picker.cpp:2870</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(42)\">../test/test_storage.cpp:769</a></td><td>split this test up into smaller parts</td></tr><tr id=\"42\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>split this test up into smaller parts</h2><h4>../test/test_storage.cpp:769</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -2117,15 +2118,15 @@\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(42)\">../test/test_dht.cpp:1642</a></td><td>test num_global_nodes</td></tr><tr id=\"42\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test num_global_nodes</h2><h4>../test/test_dht.cpp:1642</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(43)\">../test/test_dht.cpp:1643</a></td><td>test need_refresh</td></tr><tr id=\"43\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test need_refresh</h2><h4>../test/test_dht.cpp:1643</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(43)\">../test/test_dht.cpp:1642</a></td><td>test num_global_nodes</td></tr><tr id=\"43\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test num_global_nodes</h2><h4>../test/test_dht.cpp:1642</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(44)\">../test/test_dht.cpp:1643</a></td><td>test need_refresh</td></tr><tr id=\"44\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test need_refresh</h2><h4>../test/test_dht.cpp:1643</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -2168,15 +2169,15 @@\n \t\tstd::vector<node_entry> temp = table.find_node(id, {}, bucket_size * 2);\n \t\tTEST_EQUAL(int(temp.size()), std::min(bucket_size * 2, int(nodes.size())));\n \n \t\tstd::sort(nodes.begin(), nodes.end(), std::bind(&compare_ref\n \t\t\t\t, std::bind(&node_entry::id, _1)\n \t\t\t\t, std::bind(&node_entry::id, _2), id));\n \n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(44)\">../test/test_dht.cpp:2828</a></td><td>split this up into smaller test cases</td></tr><tr id=\"44\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>split this up into smaller test cases</h2><h4>../test/test_dht.cpp:2828</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(45)\">../test/test_dht.cpp:2828</a></td><td>split this up into smaller test cases</td></tr><tr id=\"45\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>split this up into smaller test cases</h2><h4>../test/test_dht.cpp:2828</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -2219,831 +2220,694 @@\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(45)\">../test/test_piece_picker.cpp:2870</a></td><td>test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used</td></tr><tr id=\"45\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test picking with partial pieces and other peers present so that both\n-backup_pieces and backup_pieces2 are used</h2><h4>../test/test_piece_picker.cpp:2870</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(46)\">../src/upnp.cpp:106</a></td><td>use boost::asio::ip::network instead of netmask</td></tr><tr id=\"46\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use boost::asio::ip::network instead of netmask</h2><h4>../src/upnp.cpp:106</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(46)\">../src/storage_utils.cpp:294</a></td><td>technically, 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</td></tr><tr id=\"46\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:294</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-upnp::rootdevice::rootdevice(rootdevice const&) = default;\n-upnp::rootdevice& upnp::rootdevice::operator=(rootdevice const&) & = default;\n-upnp::rootdevice::rootdevice(rootdevice&&) noexcept = default;\n-upnp::rootdevice& upnp::rootdevice::operator=(rootdevice&&) & = default;\n+\t\t\t\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-<div style=\"background: #ffff00\" width=\"100%\">upnp::upnp(io_context& ios\n-</div>\t, aux::session_settings const& settings\n-\t, aux::portmap_callback& cb\n-\t, address_v4 const listen_address\n-\t, address_v4 const netmask\n-\t, std::string listen_device\n-\t, listen_socket_handle ls)\n-\t: m_settings(settings)\n-\t, m_callback(cb)\n-\t, m_io_service(ios)\n-\t, m_resolver(ios)\n-\t, m_multicast(ios)\n-\t, m_unicast(ios)\n-\t, m_broadcast_timer(ios)\n-\t, m_refresh_timer(ios)\n-\t, m_map_timer(ios)\n-\t, m_listen_address(listen_address)\n-\t, m_netmask(netmask)\n-\t, m_device(std::move(listen_device))\n-#if TORRENT_USE_SSL\n-\t, m_ssl_ctx(ssl::context::sslv23_client)\n-#endif\n-\t, m_listen_handle(std::move(ls))\n-{\n-#if TORRENT_USE_SSL\n-\tm_ssl_ctx.set_verify_mode(ssl::context::verify_none);\n-#endif\n-}\n+\t\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-void upnp::start()\n-{\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(47)\">../src/bdecode.cpp:826</a></td><td>attempt to simplify this implementation by embracing the span</td></tr><tr id=\"47\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>attempt to simplify this implementation by embracing the span</h2><h4>../src/bdecode.cpp:826</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\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-\tbdecode_node bdecode(span<char const> buffer\n-\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit)\n-\t{\n-\t\tbdecode_node ret;\n-\t\tec.clear();\n+\t\t\treturn { status_t::fatal_disk_error, save_path };\n+\t\t}\n \n-\t\tif (buffer.size() > bdecode_token::max_offset)\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\t\tstd::set<std::string> subdirs;\n+\t\tfor (auto const i : f.file_range())\n \t\t{\n-\t\t\tif (error_pos) *error_pos = 0;\n-\t\t\tec = bdecode_errors::limit_exceeded;\n-\t\t\treturn ret;\n-\t\t}\n+\t\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// this is the stack of bdecode_token indices, into m_tokens.\n-\t\t// sp is the stack pointer, as index into the array, stack\n-\t\tint sp = 0;\n-\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit);\n+\t\t\tif (has_parent_path(f.file_path(i)))\n+\t\t\t\tsubdirs.insert(parent_path(f.file_path(i)));\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tchar const* start = buffer.data();\n-</div>\t\tchar const* end = start + buffer.size();\n-\t\tchar const* const orig_start = start;\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\tif (start == end)\n-\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n \n-\t\twhile (start <= end)\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\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\t\t\terror_code err;\n+\t\t\tstd::string subdir = combine_path(save_path, s);\n \n-\t\t\tif (sp >= depth_limit)\n-\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\n+\t\t\twhile (!path_equal(subdir, save_path) && !err)\n+\t\t\t{\n+\t\t\t\tremove(subdir, err);\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(47)\">../src/storage_utils.cpp:486</a></td><td>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 correct</td></tr><tr id=\"47\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:486</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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--token_limit;\n-\t\t\tif (token_limit < 0)\n-\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded);\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// look for a new token\n-\t\t\tchar const t = *start;\n+\t\t\t\t\thard_link(s, file_path, err);\n+\t\t\t\t}\n \n-\t\t\tint const current_frame = sp;\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// 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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(48)\">../src/web_peer_connection.cpp:626</a></td><td>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 following pad files will make it complicated</td></tr><tr id=\"48\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/web_peer_connection.cpp:626</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-\tpeer_connection::received_invalid_data(index, single_peer);\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (err)\n+</div>\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// if we don't think we have any of the files, allow banning the web seed\n-\tif (num_have_pieces() == 0) return true;\n+\t\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// don't disconnect, we won't request anything from this file again\n-\treturn false;\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-void web_peer_connection::on_receive_padfile()\n-{\n-\thandle_padfile();\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-void web_peer_connection::handle_error(int const bytes_left)\n-{\n-\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n-\tTORRENT_ASSERT(t);\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(48)\">../src/alert.cpp:2021</a></td><td>the salt here is allocated on the heap. It would be nice to allocate in the stack_allocator</td></tr><tr id=\"48\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the salt here is allocated on the heap. It would be nice to\n+allocate in the stack_allocator</h2><h4>../src/alert.cpp:2021</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t// temporarily unavailable, retry later\n-\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\"));\n-\tif (t->alerts().should_post<url_seed_alert>())\n-\t{\n-\t\tstd::string const error_msg = to_string(m_parser.status_code()).data()\n-\t\t\t+ (\" \" + m_parser.message());\n-\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url\n-\t\t\t, error_msg);\n-\t}\n-\treceived_bytes(0, bytes_left);\n-\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n-}\n+\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-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+\tstd::string dht_immutable_item_alert::message() const\n \t{\n-\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tt->remove_web_seed_conn(this);\n-\t}\n-\tm_web = nullptr;\n-\tTORRENT_ASSERT(is_disconnecting());\n-}\n-\n-void web_peer_connection::handle_redirect(int const bytes_left)\n-{\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(49)\">../src/session_impl.cpp:599</a></td><td>is there a reason not to move all of this into init()? and just post it to the io_context?</td></tr><tr id=\"49\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>is there a reason not to move all of this into init()? and just\n-post it to the io_context?</h2><h4>../src/session_impl.cpp:599</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\ttry\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-\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-<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::start_session()\n-</div>\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(50)\">../src/session_impl.cpp:761</a></td><td>the ip filter should probably be saved here too</td></tr><tr id=\"50\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the ip filter should probably be saved here too</h2><h4>../src/session_impl.cpp:761</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tm_lsd_announce_timer.async_wait([this](error_code const& e) {\n-\t\t\twrap(&session_impl::on_lsd_announce, e); } );\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tsession_log(\" done starting session\");\n-#endif\n-\n-\t\t// this applies unchoke settings from m_settings\n-\t\trecalculate_unchoke_slots();\n \n-\t\t// apply all m_settings to this session\n-\t\trun_all_updates(*this);\n-\t\treopen_listen_sockets(false);\n+<div style=\"background: #ffff00\" width=\"100%\">\tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n+</div>\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-#if TORRENT_USE_INVARIANT_CHECKS\n-\t\tcheck_invariant();\n+\tstd::string dht_mutable_item_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tchar msg[1050];\n+\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n+\t\t\t, aux::to_hex(key).c_str()\n+\t\t\t, salt.c_str()\n+\t\t\t, seq\n+\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n+\t\t\t, item.to_string().c_str());\n+\t\treturn msg;\n #endif\n \t}\n \n-#if TORRENT_ABI_VERSION <= 2\n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::save_state(entry* eptr, save_state_flags_t const flags) const\n-</div>\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(49)\">../src/instantiate_connection.cpp:44</a></td><td>peer_connection and tracker_connection should probably be flags</td></tr><tr id=\"49\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>peer_connection and tracker_connection should probably be flags</h2><h4>../src/instantiate_connection.cpp:44</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\t\tentry& e = *eptr;\n-\t\t// make it a dict\n-\t\te.dict();\n+*/\n \n-\t\tif (flags & session::save_settings)\n-\t\t{\n-\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict();\n-\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett);\n-\t\t}\n+#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-#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+namespace libtorrent { namespace aux {\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+<div style=\"background: #ffff00\" width=\"100%\">\taux::socket_type instantiate_connection(io_context& ios\n+</div>\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-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\n-\t\t{\n-\t\t\text->save_state(*eptr);\n-\t\t}\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(51)\">../src/session_impl.cpp:3882</a></td><td>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 want to announce</td></tr><tr id=\"51\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:3882</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tif (!m_dht_torrents.empty())\n+\t\tif (sm)\n \t\t{\n-\t\t\tstd::shared_ptr<torrent> t;\n-\t\t\tdo\n+#if TORRENT_USE_SSL\n+\t\t\tif (ssl_context)\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\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\tt->dht_announce();\n-\t\t\t\treturn;\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-\t\tif (m_torrents.empty()) return;\n+#if TORRENT_USE_I2P\n+\t\telse if (ps.type == settings_pack::i2p_proxy)\n+\t\t{\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(50)\">../src/torrent.cpp:504</a></td><td>post alert</td></tr><tr id=\"50\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>post alert</h2><h4>../src/torrent.cpp:504</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t++m_next_dht_torrent;\n-</div>\t\tif (m_next_dht_torrent >= m_torrents.size())\n-\t\t\tm_next_dht_torrent = 0;\n+\t\tTORRENT_ASSERT(new_gauge_state >= 0);\n+\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state);\n+\t\tm_current_gauge_state = static_cast<std::uint32_t>(new_gauge_state);\n \t}\n-#endif\n \n-\tvoid session_impl::on_lsd_announce(error_code const& e)\n+\tvoid torrent::leave_seed_mode(seed_mode_t const checking)\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+\t\tif (!m_seed_mode) 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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(52)\">../src/session_impl.cpp:5515</a></td><td>this function should be removed and users need to deal with the more generic case of having multiple listen ports</td></tr><tr id=\"52\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this function should be removed and users need to deal with the\n-more generic case of having multiple listen ports</h2><h4>../src/session_impl.cpp:5515</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (!node_list.empty() && nodes.empty())\n+\t\tif (checking == seed_mode_t::check_files)\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+\t\t\t// this means the user promised we had all the\n+\t\t\t// files, but it turned out we didn't. This is\n+\t\t\t// an error.\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\");\n #endif\n-\t}\n+\t\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+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\"\n+\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\");\n+#endif\n+\t\tm_seed_mode = false;\n+\t\t// seed is false if we turned out not\n+\t\t// to be a seed after all\n+\t\tif (checking == seed_mode_t::check_files\n+\t\t\t&& state() != torrent_status::checking_resume_data)\n \t\t{\n-\t\t\ttp->on_inactivity_tick(ec);\n+\t\t\tm_have_all = false;\n+\t\t\tset_state(torrent_status::downloading);\n+\t\t\tforce_recheck();\n \t\t}\n-\t}\n+\t\tm_num_verified = 0;\n+\t\tm_verified.clear();\n+\t\tm_verifying.clear();\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tstd::uint16_t session_impl::listen_port() const\n-</div>\t{\n-\t\treturn listen_port(nullptr);\n+\t\tset_need_save_resume(torrent_handle::if_state_changed);\n \t}\n \n-\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const\n+\tvoid torrent::verified(piece_index_t const piece)\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\tTORRENT_ASSERT(!m_verified.get_bit(piece));\n+\t\t++m_num_verified;\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(51)\">../src/torrent.cpp:1852</a></td><td>add 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</td></tr><tr id=\"51\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/torrent.cpp:1852</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-#ifdef TORRENT_SSL_PEERS\n-\t\tfor (auto const& s : m_listen_sockets)\n+\t\tconstruct_storage();\n+\n+#ifndef TORRENT_DISABLE_SHARE_MODE\n+\t\tif (m_share_mode && valid_metadata())\n \t\t{\n-\t\t\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\t// in share mode, all pieces have their priorities initialized to 0\n+\t\t\tm_file_priority.clear();\n+\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download);\n \t\t}\n-\t\treturn 0;\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(53)\">../src/session_impl.cpp:5555</a></td><td>this function should be removed and users need to deal with the more generic case of having multiple ssl ports</td></tr><tr id=\"53\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this function should be removed and users need to deal with the\n-more generic case of having multiple ssl ports</h2><h4>../src/session_impl.cpp:5555</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\treturn 0;\n+#endif\n \n-\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t// it's important to initialize the peers early, because this is what will\n+\t\t// fix up their have-bitmasks to have the correct size\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (!m_connections_initialized)\n+</div>\t\t{\n+\t\t\tm_connections_initialized = true;\n+\t\t\t// all peer connections have to initialize themselves now that the metadata\n+\t\t\t// is available\n+\t\t\t// copy the peer list since peers may disconnect and invalidate\n+\t\t\t// m_connections as we initialize them\n+\t\t\tfor (auto c : m_connections)\n+\t\t\t{\n+\t\t\t\tauto pc = c->self();\n+\t\t\t\tif (pc->is_disconnecting()) continue;\n+\t\t\t\tpc->on_metadata_impl();\n+\t\t\t\tif (pc->is_disconnecting()) continue;\n+\t\t\t\tpc->init();\n+\t\t\t}\n \t\t}\n \n-#ifdef TORRENT_SSL_PEERS\n-\t\tfor (auto const& s : m_listen_sockets)\n+\t\t// in case file priorities were passed in via the add_torrent_params\n+\t\t// and also in the case of share mode, we need to update the priorities\n+\t\t// this has to be applied before piece priority\n+\t\tif (!m_file_priority.empty())\n \t\t{\n-\t\t\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\t// m_file_priority was loaded from the resume data, this doesn't\n+\t\t\t// alter any state that needs to be saved in the resume data\n+\t\t\tauto const ns = m_need_save_resume_data;\n+\t\t\tupdate_piece_priorities(m_file_priority);\n+\t\t\tm_need_save_resume_data = ns;\n \t\t}\n-\t\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+\n+\t\tif (m_add_torrent_params)\n+\t\t{\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(52)\">../src/torrent.cpp:4492</a></td><td>use chrono type for time duration</td></tr><tr id=\"52\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use chrono type for time duration</h2><h4>../src/torrent.cpp:4492</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t}\n+\n+\t\tm_picker->piece_passed(index);\n+\t\tupdate_gauge();\n+\t\twe_have(index);\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log())\n+\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have());\n+#endif\n+#ifndef TORRENT_DISABLE_STREAMING\n+\t\tremove_time_critical_piece(index, true);\n #endif\n \t}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tstd::uint16_t session_impl::ssl_listen_port() const\n+#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n+\t// we believe we will complete this piece very soon\n+\t// announce it to peers ahead of time to eliminate the\n+\t// round-trip times involved in announcing it, requesting it\n+\t// and sending it\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::predicted_have_piece(piece_index_t const index, int const milliseconds)\n </div>\t{\n-\t\treturn ssl_listen_port(nullptr);\n-\t}\n+\t\tauto const i = std::lower_bound(m_predictive_pieces.begin()\n+\t\t\t, m_predictive_pieces.end(), index);\n+\t\tif (i != m_predictive_pieces.end() && *i == index) return;\n \n-\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\tfor (auto p : m_connections)\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\tTORRENT_INCREMENT(m_iterating_connections);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\"\n+\t\t\t\t, static_cast<int>(index), milliseconds);\n+#else\n+\t\t\tTORRENT_UNUSED(milliseconds);\n+#endif\n+\t\t\tp->announce_piece(index);\n \t\t}\n \n-\t\tif (m_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+\t\tm_predictive_pieces.insert(i, index);\n+\t}\n+#endif\n \n-\t\tfor (auto const& s : m_listen_sockets)\n+\t// blocks may contain the block indices of the blocks that failed (if this is\n+\t// a v2 torrent).\n+\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks)\n+\t{\n+\t\t// if the last piece fails the peer connection will still\n+\t\t// think that it has received all of it until this function\n+\t\t// resets the download queue. So, we cannot do the\n+\t\t// invariant check here since it assumes:\n+\t\t// (total_done == m_torrent_file->total_size()) => is_seed()\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(53)\">../src/torrent.cpp:4919</a></td><td>abort lookups this torrent has made via the session host resolver interface</td></tr><tr id=\"53\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>abort lookups this torrent has made via the\n+session host resolver interface</h2><h4>../src/torrent.cpp:4919</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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 (!(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 (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-#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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(54)\">../src/session_impl.cpp:6390</a></td><td>this should be factored into the udp socket, so we only have the code once</td></tr><tr id=\"54\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be factored into the udp socket, so we only have the\n-code once</h2><h4>../src/session_impl.cpp:6390</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\treturn upload_rate_limit(m_local_peer_class);\n-\t}\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\t\tif (!m_apply_ip_filter)\n+\t\t{\n+\t\t\tinc_stats_counter(counters::non_filter_torrents, -1);\n+\t\t\tm_apply_ip_filter = true;\n+\t\t}\n \n-\tint session_impl::local_download_rate_limit() const\n-\t{\n-\t\treturn download_rate_limit(m_local_peer_class);\n+\t\tm_paused = false;\n+\t\tm_auto_managed = false;\n+\t\tupdate_state_list();\n+\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n+\t\t{\n+\t\t\tif (!m_links[i].in_list()) continue;\n+\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n+\t\t}\n+\t\t// don't re-add this torrent to the state-update list\n+\t\tm_state_subscription = false;\n \t}\n \n-\tint session_impl::upload_rate_limit_depr() const\n+\t// this is called when we're destructing non-gracefully. i.e. we're _just_\n+\t// destructing everything.\n+\tvoid torrent::panic()\n \t{\n-\t\treturn upload_rate_limit(m_global_class);\n-\t}\n+\t\tm_storage.reset();\n+\t\t// if there are any other peers allocated still, we need to clear them\n+\t\t// now. They can't be cleared later because the allocator will already\n+\t\t// have been destructed\n+\t\tif (m_peer_list) m_peer_list->clear();\n+\t\tm_connections.clear();\n+\t\tm_outgoing_pids.clear();\n+\t\tm_peers_to_disconnect.clear();\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(54)\">../src/torrent.cpp:8032</a></td><td>if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers (with some definition of idle)</td></tr><tr id=\"54\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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)</h2><h4>../src/torrent.cpp:8032</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1);\n+\t\tm_connections.reserve(m_connections.size() + 1);\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+#if TORRENT_USE_ASSERTS\n+\t\terror_code ec;\n+\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec);\n+#endif\n \n+\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr);\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::update_peer_dscp()\n-</div>\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// we need to do this after we've added the peer to the peer_list\n+\t\t// since that's when the peer is assigned its peer_info object,\n+\t\t// which holds the rank\n+\t\tif (maybe_replace_peer)\n \t\t{\n-\t\t\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\t// now, find the lowest rank peer and disconnect that\n+\t\t\t// if it's lower rank than the incoming connection\n+\t\t\tpeer_connection* peer = find_lowest_ranking_peer();\n \n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (peer != nullptr && peer->peer_rank() < p->peer_rank())\n+</div>\t\t\t{\n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\t\tif (should_log())\n \t\t\t\t{\n-\t\t\t\t\tsession_log(\">>> 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\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n+\t\t\t\t\t\t\"connections: %d limit: %d\"\n+\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str()\n+\t\t\t\t\t\t, num_peers()\n+\t\t\t\t\t\t, m_max_connections);\n \t\t\t\t}\n #endif\n+\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent);\n+\t\t\t\tp->peer_disconnected_other();\n \t\t\t}\n-\n-\t\t\tif (l->udp_sock)\n+\t\t\telse\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(55)\">../src/udp_tracker_connection.cpp:81</a></td><td>support authentication here. tracker_req().auth</td></tr><tr id=\"55\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support authentication here. tracker_req().auth</h2><h4>../src/udp_tracker_connection.cpp:81</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tudp_tracker_connection::m_connection_cache;\n-\n-\tstd::mutex udp_tracker_connection::m_cache_mutex;\n-\n-\tudp_tracker_connection::udp_tracker_connection(\n-\t\tio_context& ios\n-\t\t, tracker_manager& man\n-\t\t, tracker_request const& req\n-\t\t, std::weak_ptr<request_callback> c)\n-\t\t: tracker_connection(man, req, ios, std::move(c))\n-\t\t, m_transaction_id(0)\n-\t\t, m_attempts(0)\n-\t\t, m_state(action_t::error)\n-\t\t, m_abort(false)\n-\t{\n-\t\tupdate_transaction_id();\n-\t}\n-\n-\tvoid udp_tracker_connection::start()\n-\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::string hostname;\n-</div>\t\tstd::string protocol;\n-\t\tint port;\n-\t\terror_code ec;\n-\n-\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore)\n-\t\t\t= parse_url_components(tracker_req().url, ec);\n-\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443;\n-\n-\t\tif (ec)\n-\t\t{\n-\t\t\ttracker_connection::fail(ec, operation_t::parse_address);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\taux::session_settings const& settings = m_man.settings();\n-\n-\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n-\n-\t\tif (settings.get_bool(settings_pack::proxy_hostnames)\n-\t\t\t&& (proxy_type == settings_pack::socks5\n-\t\t\t\t|| proxy_type == settings_pack::socks5_pw))\n-\t\t{\n-\t\t\tm_hostname = hostname;\n-\t\t\tm_target.port(std::uint16_t(port));\n-\t\t\tstart_announce();\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tusing namespace std::placeholders;\n-\t\t\tADD_OUTSTANDING_ASYNC(\"udp_tracker_connection::name_lookup\");\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(56)\">../src/alert_manager.cpp:80</a></td><td>keep a count of the number of threads waiting. Only if it's > 0 notify them</td></tr><tr id=\"56\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>keep a count of the number of threads waiting. Only if it's\n-> 0 notify them</h2><h4>../src/alert_manager.cpp:80</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n+\t\t\t\t\t\t\"connections: %d limit: %d\"\n+\t\t\t\t\t\t, print_endpoint(p->remote()).c_str()\n+\t\t\t\t\t\t, num_peers()\n+\t\t\t\t\t\t, m_max_connections);\n+\t\t\t\t}\n+#endif\n+\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent);\n+\t\t\t\t// we have to do this here because from the peer's point of view\n+\t\t\t\t// it wasn't really attached to the torrent, but we do need\n+\t\t\t\t// to let peer_list know we're removing it\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(55)\">../src/web_peer_connection.cpp:626</a></td><td>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 following pad files will make it complicated</td></tr><tr id=\"55\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/web_peer_connection.cpp:626</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+\tpeer_connection::received_invalid_data(index, single_peer);\n \n-\t\treturn nullptr;\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 alert_manager::maybe_notify(alert* a)\n-\t{\n-\t\tif (m_alerts[m_generation].size() == 1)\n-\t\t{\n-\t\t\t// we just posted to an empty queue. If anyone is waiting for\n-\t\t\t// alerts, we need to notify them. Also (potentially) call the\n-\t\t\t// user supplied m_notify callback to let the client wake up its\n-\t\t\t// message loop to poll for alerts.\n-\t\t\tif (m_notify) m_notify();\n+\t// don't disconnect, we won't request anything from this file again\n+\treturn false;\n+}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tm_condition.notify_all();\n-</div>\t\t}\n+void web_peer_connection::on_receive_padfile()\n+{\n+\thandle_padfile();\n+}\n \n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\tfor (auto& e : m_ses_extensions)\n-\t\t\te->on_alert(a);\n-#else\n-\t\tTORRENT_UNUSED(a);\n-#endif\n-\t}\n+void web_peer_connection::handle_error(int const bytes_left)\n+{\n+\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n+\tTORRENT_ASSERT(t);\n \n-\tvoid alert_manager::set_notify_function(std::function<void()> const& fun)\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\t// temporarily unavailable, retry later\n+\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\"));\n+\tif (t->alerts().should_post<url_seed_alert>())\n \t{\n-\t\tstd::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\tstd::string const error_msg = to_string(m_parser.status_code()).data()\n+\t\t\t+ (\" \" + m_parser.message());\n+\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url\n+\t\t\t, error_msg);\n \t}\n+\treceived_bytes(0, bytes_left);\n+\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n+}\n \n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\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\tm_ses_extensions.push_back(std::move(ext));\n+\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n+\t\tTORRENT_ASSERT(t);\n+\t\tt->remove_web_seed_conn(this);\n \t}\n-#endif\n-\n-\tvoid alert_manager::get_all(std::vector<alert*>& alerts)\n-\t{\n-\t\tstd::lock_guard<std::recursive_mutex> lock(m_mutex);\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(57)\">../src/instantiate_connection.cpp:44</a></td><td>peer_connection and tracker_connection should probably be flags</td></tr><tr id=\"57\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>peer_connection and tracker_connection should probably be flags</h2><h4>../src/instantiate_connection.cpp:44</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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-<div style=\"background: #ffff00\" width=\"100%\">\taux::socket_type instantiate_connection(io_context& ios\n-</div>\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(58)\">../src/alert.cpp:2021</a></td><td>the salt here is allocated on the heap. It would be nice to allocate in the stack_allocator</td></tr><tr id=\"58\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the salt here is allocated on the heap. It would be nice to\n-allocate in the stack_allocator</h2><h4>../src/alert.cpp:2021</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n-\n-\tdht_immutable_item_alert::dht_immutable_item_alert(aux::stack_allocator&\n-\t\t, sha1_hash const& t, entry i)\n-\t\t: target(t), item(std::move(i))\n-\t{}\n+\tm_web = nullptr;\n+\tTORRENT_ASSERT(is_disconnecting());\n+}\n \n-\tstd::string dht_immutable_item_alert::message() const\n+void web_peer_connection::handle_redirect(int const bytes_left)\n+{\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(56)\">../src/peer_list.cpp:539</a></td><td>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. It would probably be more efficient</td></tr><tr id=\"56\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/peer_list.cpp:539</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t, int session_time, torrent_state* state)\n \t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\"\n-\t\t\t, aux::to_hex(target).c_str()\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n-#endif\n-\t}\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n-</div>\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\tTORRENT_ASSERT(is_single_thread());\n+\t\tINVARIANT_CHECK;\n \n-\tstd::string dht_mutable_item_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n-\t\t\t, aux::to_hex(key).c_str()\n-\t\t\t, salt.c_str()\n-\t\t\t, seq\n-\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n-#endif\n-\t}\n+\t\tconst int candidate_count = 10;\n+\t\tpeers.reserve(candidate_count);\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(59)\">../src/storage_utils.cpp:294</a></td><td>technically, 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</td></tr><tr id=\"59\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:294</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\tint erase_candidate = -1;\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+\t\tif (bool(m_finished) != state->is_finished)\n+\t\t\trecalculate_connect_candidates(state);\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+\t\texternal_ip const& external = state->ip;\n+\t\tint external_port = state->port;\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+\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n \n-\t\t\treturn { status_t::fatal_disk_error, save_path };\n-\t\t}\n+\t\tint max_peerlist_size = state->max_peerlist_size;\n \n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\tstd::set<std::string> subdirs;\n-\t\tfor (auto const i : f.file_range())\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int iterations = std::min(int(m_peers.size()), 300);\n+</div>\t\t\titerations > 0; --iterations)\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+\t\t\t++state->loop_counter;\n \n-\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n+\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\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\ttorrent_peer& pe = *m_peers[m_round_robin];\n+\t\t\tTORRENT_ASSERT(pe.in_use);\n+\t\t\tint current = m_round_robin;\n \n-\t\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+\t\t\t// if the number of peers is growing large\n+\t\t\t// we need to start weeding.\n \n-\t\t\twhile (!path_equal(subdir, save_path) && !err)\n+\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95\n+\t\t\t\t&& max_peerlist_size > 0)\n \t\t\t{\n-\t\t\t\tremove(subdir, err);\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(60)\">../src/storage_utils.cpp:486</a></td><td>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 correct</td></tr><tr id=\"60\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:486</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tif (is_erase_candidate(pe)\n+\t\t\t\t\t&& (erase_candidate == -1\n+\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe)))\n+\t\t\t\t{\n+\t\t\t\t\tif (should_erase_immediately(pe))\n \t\t\t\t\t{\n-\t\t\t\t\t\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\tif (erase_candidate > current) --erase_candidate;\n+\t\t\t\t\t\terase_peer(m_peers.begin() + current, state);\n+\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t}\n+\t\t\t\t\telse\n+\t\t\t\t\t{\n+\t\t\t\t\t\terase_candidate = current;\n \t\t\t\t\t}\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(57)\">../src/upnp.cpp:106</a></td><td>use boost::asio::ip::network instead of netmask</td></tr><tr id=\"57\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use boost::asio::ip::network instead of netmask</h2><h4>../src/upnp.cpp:106</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+static error_code ignore_error;\n \n-\t\t\t\t\thard_link(s, file_path, err);\n-\t\t\t\t}\n+upnp::rootdevice::rootdevice() = default;\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+#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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (err)\n-</div>\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+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-\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+<div style=\"background: #ffff00\" width=\"100%\">upnp::upnp(io_context& ios\n+</div>\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-\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+void upnp::start()\n+{\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(58)\">../src/path.cpp:429</a></td><td>test this on a FAT volume to see what error we get!</td></tr><tr id=\"58\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test this on a FAT volume to see what error we get!</h2><h4>../src/path.cpp:429</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\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+\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(61)\">../src/escape_string.cpp:194</a></td><td>this should probably be moved into string_util.cpp</td></tr><tr id=\"61\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should probably be moved into string_util.cpp</h2><h4>../src/escape_string.cpp:194</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{\n-\t\treturn escape_string_impl(str.data(), int(str.size()), 10);\n-\t}\n+\t\tif (ret == 0)\n+\t\t{\n+\t\t\tec.clear();\n+\t\t\treturn;\n+\t\t}\n \n-\tbool need_encoding(char const* str, int const len)\n-\t{\n-\t\tfor (int i = 0; i < len; ++i)\n+\t\t// 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+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (errno != EMLINK\n+</div>\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\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0)\n-\t\t\t\treturn true;\n-\t\t\t++str;\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-\t\treturn false;\n-\t}\n \n-\tvoid convert_path_to_posix(std::string& path)\n-\t{\n-\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n-\t}\n+\t\t// fall back to making a copy\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tstd::string read_until(char const*& str, char const delim, char const* end)\n-</div>\t{\n-\t\tTORRENT_ASSERT(str <= end);\n+#endif\n \n-\t\tstd::string ret;\n-\t\twhile (str != end && *str != delim)\n-\t\t{\n-\t\t\tret += *str;\n-\t\t\t++str;\n-\t\t}\n-\t\t// skip the delimiter as well\n-\t\twhile (str != end && *str == delim) ++str;\n-\t\treturn ret;\n+\t\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-\tstd::string maybe_url_encode(std::string const& url)\n+\tbool is_directory(std::string const& f, error_code& ec)\n \t{\n-\t\tstd::string protocol, host, auth, path;\n-\t\tint port;\n-\t\terror_code ec;\n-\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec);\n-\t\tif (ec) return url;\n-\n-\t\t// first figure out if this url contains unencoded characters\n-\t\tif (!need_encoding(path.c_str(), int(path.size())))\n-\t\t\treturn url;\n-\n-\t\tstd::string msg;\n-\t\tstd::string escaped_path { escape_path(path) };\n-\t\t// reserve enough space so further append will\n-\t\t// only copy values to existing location\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(62)\">../src/peer_connection.cpp:2562</a></td><td>this 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</td></tr><tr id=\"62\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should probably be based on time instead of number\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(59)\">../src/peer_connection.cpp:2562</a></td><td>this 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</td></tr><tr id=\"59\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/peer_connection.cpp:2562</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -3089,15 +2953,15 @@\n \t\t{\n \t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error);\n \t\t\treturn;\n \t\t}\n \n \t\tif (m_choked && fast_idx == -1)\n \t\t{\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(63)\">../src/peer_connection.cpp:3309</a></td><td>since 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?</td></tr><tr id=\"63\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>since we throw away the queue entry once we issue\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(60)\">../src/peer_connection.cpp:3309</a></td><td>since 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?</td></tr><tr id=\"60\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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?</h2><h4>../src/peer_connection.cpp:3309</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -3144,15 +3008,15 @@\n \n \t// -----------------------------\n \t// --------- HAVE ALL ----------\n \t// -----------------------------\n \n \tvoid peer_connection::incoming_have_all()\n \t{\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(64)\">../src/peer_connection.cpp:4975</a></td><td>use 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</td></tr><tr id=\"64\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use a deadline_timer for timeouts. Don't rely on second_tick()!\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(61)\">../src/peer_connection.cpp:4975</a></td><td>use 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</td></tr><tr id=\"61\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/peer_connection.cpp:4975</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -3198,14 +3062,168 @@\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(62)\">../src/bdecode.cpp:826</a></td><td>attempt to simplify this implementation by embracing the span</td></tr><tr id=\"62\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>attempt to simplify this implementation by embracing the span</h2><h4>../src/bdecode.cpp:826</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n+\n+\tbdecode_node bdecode(span<char const> buffer\n+\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit)\n+\t{\n+\t\tbdecode_node ret;\n+\t\tec.clear();\n+\n+\t\tif (buffer.size() > bdecode_token::max_offset)\n+\t\t{\n+\t\t\tif (error_pos) *error_pos = 0;\n+\t\t\tec = bdecode_errors::limit_exceeded;\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\t// this is the stack of bdecode_token indices, into m_tokens.\n+\t\t// sp is the stack pointer, as index into the array, stack\n+\t\tint sp = 0;\n+\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit);\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tchar const* start = buffer.data();\n+</div>\t\tchar const* end = start + buffer.size();\n+\t\tchar const* const orig_start = start;\n+\n+\t\tif (start == end)\n+\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\n+\t\twhile (start <= end)\n+\t\t{\n+\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\n+\t\t\tif (sp >= depth_limit)\n+\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\n+\n+\t\t\t--token_limit;\n+\t\t\tif (token_limit < 0)\n+\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded);\n+\n+\t\t\t// look for a new token\n+\t\t\tchar const t = *start;\n+\n+\t\t\tint const current_frame = sp;\n+\n+\t\t\t// if we're currently parsing a dictionary, assert that\n+\t\t\t// every other node is a string.\n+\t\t\tif (current_frame > 0\n+\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)\n+\t\t\t{\n+\t\t\t\tif (stack[current_frame - 1].state == 0)\n+\t\t\t\t{\n+\t\t\t\t\t// the current parent is a dict and we are parsing a key.\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(63)\">../src/udp_tracker_connection.cpp:81</a></td><td>support authentication here. tracker_req().auth</td></tr><tr id=\"63\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support authentication here. tracker_req().auth</h2><h4>../src/udp_tracker_connection.cpp:81</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tudp_tracker_connection::m_connection_cache;\n+\n+\tstd::mutex udp_tracker_connection::m_cache_mutex;\n+\n+\tudp_tracker_connection::udp_tracker_connection(\n+\t\tio_context& ios\n+\t\t, tracker_manager& man\n+\t\t, tracker_request const& req\n+\t\t, std::weak_ptr<request_callback> c)\n+\t\t: tracker_connection(man, req, ios, std::move(c))\n+\t\t, m_transaction_id(0)\n+\t\t, m_attempts(0)\n+\t\t, m_state(action_t::error)\n+\t\t, m_abort(false)\n+\t{\n+\t\tupdate_transaction_id();\n+\t}\n+\n+\tvoid udp_tracker_connection::start()\n+\t{\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::string hostname;\n+</div>\t\tstd::string protocol;\n+\t\tint port;\n+\t\terror_code ec;\n+\n+\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore)\n+\t\t\t= parse_url_components(tracker_req().url, ec);\n+\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443;\n+\n+\t\tif (ec)\n+\t\t{\n+\t\t\ttracker_connection::fail(ec, operation_t::parse_address);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\taux::session_settings const& settings = m_man.settings();\n+\n+\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n+\n+\t\tif (settings.get_bool(settings_pack::proxy_hostnames)\n+\t\t\t&& (proxy_type == settings_pack::socks5\n+\t\t\t\t|| proxy_type == settings_pack::socks5_pw))\n+\t\t{\n+\t\t\tm_hostname = hostname;\n+\t\t\tm_target.port(std::uint16_t(port));\n+\t\t\tstart_announce();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tusing namespace std::placeholders;\n+\t\t\tADD_OUTSTANDING_ASYNC(\"udp_tracker_connection::name_lookup\");\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(64)\">../src/alert_manager.cpp:80</a></td><td>keep a count of the number of threads waiting. Only if it's > 0 notify them</td></tr><tr id=\"64\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>keep a count of the number of threads waiting. Only if it's\n+> 0 notify them</h2><h4>../src/alert_manager.cpp:80</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\treturn m_alerts[m_generation].front();\n+\n+\t\t// this call can be interrupted prematurely by other signals\n+\t\tm_condition.wait_for(lock, max_wait);\n+\t\tif (!m_alerts[m_generation].empty())\n+\t\t\treturn m_alerts[m_generation].front();\n+\n+\t\treturn nullptr;\n+\t}\n+\n+\tvoid alert_manager::maybe_notify(alert* a)\n+\t{\n+\t\tif (m_alerts[m_generation].size() == 1)\n+\t\t{\n+\t\t\t// we just posted to an empty queue. If anyone is waiting for\n+\t\t\t// alerts, we need to notify them. Also (potentially) call the\n+\t\t\t// user supplied m_notify callback to let the client wake up its\n+\t\t\t// message loop to poll for alerts.\n+\t\t\tif (m_notify) m_notify();\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tm_condition.notify_all();\n+</div>\t\t}\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\tfor (auto& e : m_ses_extensions)\n+\t\t\te->on_alert(a);\n+#else\n+\t\tTORRENT_UNUSED(a);\n+#endif\n+\t}\n+\n+\tvoid alert_manager::set_notify_function(std::function<void()> const& fun)\n+\t{\n+\t\tstd::unique_lock<std::recursive_mutex> lock(m_mutex);\n+\t\tm_notify = fun;\n+\t\tif (!m_alerts[m_generation].empty())\n+\t\t{\n+\t\t\tif (m_notify) m_notify();\n+\t\t}\n+\t}\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\n+\t{\n+\t\tm_ses_extensions.push_back(std::move(ext));\n+\t}\n+#endif\n+\n+\tvoid alert_manager::get_all(std::vector<alert*>& alerts)\n+\t{\n+\t\tstd::lock_guard<std::recursive_mutex> lock(m_mutex);\n </pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(65)\">../src/tracker_manager.cpp:369</a></td><td>implement</td></tr><tr id=\"65\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>implement</h2><h4>../src/tracker_manager.cpp:369</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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@@ -3407,274 +3425,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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(69)\">../src/torrent.cpp:504</a></td><td>post alert</td></tr><tr id=\"69\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>post alert</h2><h4>../src/torrent.cpp:504</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(69)\">../src/escape_string.cpp:194</a></td><td>this should probably be moved into string_util.cpp</td></tr><tr id=\"69\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should probably be moved into string_util.cpp</h2><h4>../src/escape_string.cpp:194</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{\n+\t\treturn escape_string_impl(str.data(), int(str.size()), 10);\n \t}\n \n-\tvoid torrent::leave_seed_mode(seed_mode_t const checking)\n+\tbool need_encoding(char const* str, int const len)\n \t{\n-\t\tif (!m_seed_mode) return;\n-\n-\t\tif (checking == seed_mode_t::check_files)\n-\t\t{\n-\t\t\t// this means the user promised we had all the\n-\t\t\t// files, but it turned out we didn't. This is\n-\t\t\t// an error.\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\");\n-#endif\n-\t\t}\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\"\n-\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\");\n-#endif\n-\t\tm_seed_mode = false;\n-\t\t// seed is false if we turned out not\n-\t\t// to be a seed after all\n-\t\tif (checking == seed_mode_t::check_files\n-\t\t\t&& state() != torrent_status::checking_resume_data)\n+\t\tfor (int i = 0; i < len; ++i)\n \t\t{\n-\t\t\tm_have_all = false;\n-\t\t\tset_state(torrent_status::downloading);\n-\t\t\tforce_recheck();\n+\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0)\n+\t\t\t\treturn true;\n+\t\t\t++str;\n \t\t}\n-\t\tm_num_verified = 0;\n-\t\tm_verified.clear();\n-\t\tm_verifying.clear();\n-\n-\t\tset_need_save_resume(torrent_handle::if_state_changed);\n+\t\treturn false;\n \t}\n \n-\tvoid torrent::verified(piece_index_t const piece)\n+\tvoid convert_path_to_posix(std::string& path)\n \t{\n-\t\tTORRENT_ASSERT(!m_verified.get_bit(piece));\n-\t\t++m_num_verified;\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(70)\">../src/torrent.cpp:1852</a></td><td>add 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</td></tr><tr id=\"70\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/torrent.cpp:1852</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tfor (auto const& f : m_add_torrent_params->renamed_files)\n-\t\t\t{\n-\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue;\n-\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second);\n-\t\t\t}\n-\t\t}\n-\n-\t\tconstruct_storage();\n-\n-#ifndef TORRENT_DISABLE_SHARE_MODE\n-\t\tif (m_share_mode && valid_metadata())\n-\t\t{\n-\t\t\t// in share mode, all pieces have their priorities initialized to 0\n-\t\t\tm_file_priority.clear();\n-\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download);\n-\t\t}\n-#endif\n-\n-\t\t// it's important to initialize the peers early, because this is what will\n-\t\t// fix up their have-bitmasks to have the correct size\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (!m_connections_initialized)\n-</div>\t\t{\n-\t\t\tm_connections_initialized = true;\n-\t\t\t// all peer connections have to initialize themselves now that the metadata\n-\t\t\t// is available\n-\t\t\t// copy the peer list since peers may disconnect and invalidate\n-\t\t\t// m_connections as we initialize them\n-\t\t\tfor (auto c : m_connections)\n-\t\t\t{\n-\t\t\t\tauto pc = c->self();\n-\t\t\t\tif (pc->is_disconnecting()) continue;\n-\t\t\t\tpc->on_metadata_impl();\n-\t\t\t\tif (pc->is_disconnecting()) continue;\n-\t\t\t\tpc->init();\n-\t\t\t}\n-\t\t}\n-\n-\t\t// in case file priorities were passed in via the add_torrent_params\n-\t\t// and also in the case of share mode, we need to update the priorities\n-\t\t// this has to be applied before piece priority\n-\t\tif (!m_file_priority.empty())\n-\t\t{\n-\t\t\t// m_file_priority was loaded from the resume data, this doesn't\n-\t\t\t// alter any state that needs to be saved in the resume data\n-\t\t\tauto const ns = m_need_save_resume_data;\n-\t\t\tupdate_piece_priorities(m_file_priority);\n-\t\t\tm_need_save_resume_data = ns;\n-\t\t}\n-\n-\t\tif (m_add_torrent_params)\n-\t\t{\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(71)\">../src/torrent.cpp:4492</a></td><td>use chrono type for time duration</td></tr><tr id=\"71\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use chrono type for time duration</h2><h4>../src/torrent.cpp:4492</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t}\n-\n-\t\tm_picker->piece_passed(index);\n-\t\tupdate_gauge();\n-\t\twe_have(index);\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log())\n-\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have());\n-#endif\n-#ifndef TORRENT_DISABLE_STREAMING\n-\t\tremove_time_critical_piece(index, true);\n-#endif\n+\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n \t}\n \n-#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n-\t// we believe we will complete this piece very soon\n-\t// announce it to peers ahead of time to eliminate the\n-\t// round-trip times involved in announcing it, requesting it\n-\t// and sending it\n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent::predicted_have_piece(piece_index_t const index, int const milliseconds)\n+<div style=\"background: #ffff00\" width=\"100%\">\tstd::string read_until(char const*& str, char const delim, char const* end)\n </div>\t{\n-\t\tauto const i = std::lower_bound(m_predictive_pieces.begin()\n-\t\t\t, m_predictive_pieces.end(), index);\n-\t\tif (i != m_predictive_pieces.end() && *i == index) return;\n-\n-\t\tfor (auto p : m_connections)\n-\t\t{\n-\t\t\tTORRENT_INCREMENT(m_iterating_connections);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\"\n-\t\t\t\t, static_cast<int>(index), milliseconds);\n-#else\n-\t\t\tTORRENT_UNUSED(milliseconds);\n-#endif\n-\t\t\tp->announce_piece(index);\n-\t\t}\n-\n-\t\tm_predictive_pieces.insert(i, index);\n-\t}\n-#endif\n-\n-\t// blocks may contain the block indices of the blocks that failed (if this is\n-\t// a v2 torrent).\n-\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks)\n-\t{\n-\t\t// if the last piece fails the peer connection will still\n-\t\t// think that it has received all of it until this function\n-\t\t// resets the download queue. So, we cannot do the\n-\t\t// invariant check here since it assumes:\n-\t\t// (total_done == m_torrent_file->total_size()) => is_seed()\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(72)\">../src/torrent.cpp:4919</a></td><td>abort lookups this torrent has made via the session host resolver interface</td></tr><tr id=\"72\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>abort lookups this torrent has made via the\n-session host resolver interface</h2><h4>../src/torrent.cpp:4919</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\tif (!m_apply_ip_filter)\n-\t\t{\n-\t\t\tinc_stats_counter(counters::non_filter_torrents, -1);\n-\t\t\tm_apply_ip_filter = true;\n-\t\t}\n+\t\tTORRENT_ASSERT(str <= end);\n \n-\t\tm_paused = false;\n-\t\tm_auto_managed = false;\n-\t\tupdate_state_list();\n-\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n+\t\tstd::string ret;\n+\t\twhile (str != end && *str != delim)\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\tret += *str;\n+\t\t\t++str;\n \t\t}\n-\t\t// don't re-add this torrent to the state-update list\n-\t\tm_state_subscription = false;\n+\t\t// skip the delimiter as well\n+\t\twhile (str != end && *str == delim) ++str;\n+\t\treturn ret;\n \t}\n \n-\t// this is called when we're destructing non-gracefully. i.e. we're _just_\n-\t// destructing everything.\n-\tvoid torrent::panic()\n+\tstd::string maybe_url_encode(std::string const& url)\n \t{\n-\t\tm_storage.reset();\n-\t\t// if there are any other peers allocated still, we need to clear them\n-\t\t// now. They can't be cleared later because the allocator will already\n-\t\t// have been destructed\n-\t\tif (m_peer_list) m_peer_list->clear();\n-\t\tm_connections.clear();\n-\t\tm_outgoing_pids.clear();\n-\t\tm_peers_to_disconnect.clear();\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(73)\">../src/torrent.cpp:8032</a></td><td>if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers (with some definition of idle)</td></tr><tr id=\"73\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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)</h2><h4>../src/torrent.cpp:8032</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tstd::string protocol, host, auth, path;\n+\t\tint port;\n \t\terror_code ec;\n-\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec);\n-#endif\n-\n-\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr);\n+\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec);\n+\t\tif (ec) return url;\n \n-\t\t// we need to do this after we've added the peer to the peer_list\n-\t\t// since that's when the peer is assigned its peer_info object,\n-\t\t// which holds the rank\n-\t\tif (maybe_replace_peer)\n-\t\t{\n-\t\t\t// now, find the lowest rank peer and disconnect that\n-\t\t\t// if it's lower rank than the incoming connection\n-\t\t\tpeer_connection* peer = find_lowest_ranking_peer();\n+\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (peer != nullptr && peer->peer_rank() < p->peer_rank())\n-</div>\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n-\t\t\t\t\t\t\"connections: %d limit: %d\"\n-\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str()\n-\t\t\t\t\t\t, num_peers()\n-\t\t\t\t\t\t, m_max_connections);\n-\t\t\t\t}\n-#endif\n-\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent);\n-\t\t\t\tp->peer_disconnected_other();\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n-\t\t\t\t\t\t\"connections: %d limit: %d\"\n-\t\t\t\t\t\t, print_endpoint(p->remote()).c_str()\n-\t\t\t\t\t\t, num_peers()\n-\t\t\t\t\t\t, m_max_connections);\n-\t\t\t\t}\n-#endif\n-\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent);\n-\t\t\t\t// we have to do this here because from the peer's point of view\n-\t\t\t\t// it wasn't really attached to the torrent, but we do need\n-\t\t\t\t// to let peer_list know we're removing it\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(74)\">../src/http_tracker_connection.cpp:479</a></td><td>returning a bool here is redundant. Instead this function should return the peer_entry</td></tr><tr id=\"74\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>returning a bool here is redundant. Instead this function should\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(70)\">../src/http_tracker_connection.cpp:479</a></td><td>returning a bool here is redundant. Instead this function should return the peer_entry</td></tr><tr id=\"70\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>returning a bool here is redundant. Instead this function should\n return the peer_entry</h2><h4>../src/http_tracker_connection.cpp:479</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -3718,118 +3528,308 @@\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(75)\">../src/path.cpp:429</a></td><td>test this on a FAT volume to see what error we get!</td></tr><tr id=\"75\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test this on a FAT volume to see what error we get!</h2><h4>../src/path.cpp:429</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(71)\">../src/session_impl.cpp:599</a></td><td>is there a reason not to move all of this into init()? and just post it to the io_context?</td></tr><tr id=\"71\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>is there a reason not to move all of this into init()? and just\n+post it to the io_context?</h2><h4>../src/session_impl.cpp:599</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\t// fall back to making a copy\n+\t// This function is called by the creating thread, not in the message loop's\n+\t// io_context thread.\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::start_session()\n+</div>\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\"start session\");\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+#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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(72)\">../src/session_impl.cpp:761</a></td><td>the ip filter should probably be saved here too</td></tr><tr id=\"72\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the ip filter should probably be saved here too</h2><h4>../src/session_impl.cpp:761</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tm_lsd_announce_timer.async_wait([this](error_code const& e) {\n+\t\t\twrap(&session_impl::on_lsd_announce, e); } );\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\" done starting session\");\n+#endif\n+\n+\t\t// this applies unchoke settings from m_settings\n+\t\trecalculate_unchoke_slots();\n+\n+\t\t// apply all m_settings to this session\n+\t\trun_all_updates(*this);\n+\t\treopen_listen_sockets(false);\n+\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\t\tcheck_invariant();\n+#endif\n+\t}\n+\n+#if TORRENT_ABI_VERSION <= 2\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::save_state(entry* eptr, save_state_flags_t const flags) const\n+</div>\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\tec.clear();\n-\t\t\treturn;\n+\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict();\n+\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett);\n \t\t}\n \n-\t\t// 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-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (errno != EMLINK\n-</div>\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+#ifndef TORRENT_DISABLE_DHT\n+\t\tif (flags & session::save_dht_settings)\n+\t\t{\n+\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings());\n+\t\t}\n+\n+\t\tif (m_dht && (flags & session::save_dht_state))\n+\t\t{\n+\t\t\te[\"dht state\"] = dht::save_dht_state(m_dht->state());\n+\t\t}\n #endif\n-\t\t\t)\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\n \t\t{\n-\t\t\t// some error happened, report up to the caller\n-\t\t\tec.assign(errno, system_category());\n-\t\t\treturn;\n+\t\t\text->save_state(*eptr);\n \t\t}\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(73)\">../src/session_impl.cpp:3882</a></td><td>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 want to announce</td></tr><tr id=\"73\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:3882</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tif (!m_dht_torrents.empty())\n+\t\t{\n+\t\t\tstd::shared_ptr<torrent> t;\n+\t\t\tdo\n+\t\t\t{\n+\t\t\t\tt = m_dht_torrents.front().lock();\n+\t\t\t\tm_dht_torrents.pop_front();\n+\t\t\t} while (!t && !m_dht_torrents.empty());\n \n-\t\t// fall back to making a copy\n+\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t++m_next_dht_torrent;\n+</div>\t\tif (m_next_dht_torrent >= m_torrents.size())\n+\t\t\tm_next_dht_torrent = 0;\n+\t}\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+\tvoid session_impl::on_lsd_announce(error_code const& e)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\");\n+\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter);\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (e) return;\n+\n+\t\tif (m_abort) return;\n+\n+\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\");\n+\t\t// announce on local network every 5 minutes\n+\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval)\n+\t\t\t/ std::max(int(m_torrents.size()), 1), 1);\n+\t\tm_lsd_announce_timer.expires_after(seconds(delay));\n+\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) {\n+\t\t\twrap(&session_impl::on_lsd_announce, err); });\n+\n+\t\tif (m_torrents.empty()) return;\n+\n+\t\tif (m_next_lsd_torrent >= m_torrents.size())\n+\t\t\tm_next_lsd_torrent = 0;\n+\t\tm_torrents[m_next_lsd_torrent]->lsd_announce();\n+\t\t++m_next_lsd_torrent;\n+\t\tif (m_next_lsd_torrent >= m_torrents.size())\n+\t\t\tm_next_lsd_torrent = 0;\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(74)\">../src/session_impl.cpp:5515</a></td><td>this function should be removed and users need to deal with the more generic case of having multiple listen ports</td></tr><tr id=\"74\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this function should be removed and users need to deal with the\n+more generic case of having multiple listen ports</h2><h4>../src/session_impl.cpp:5515</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (!node_list.empty() && nodes.empty())\n+\t\t{\n+\t\t\tsession_log(\"ERROR: failed to parse DHT bootstrap list: %s\", node_list.c_str());\n+\t\t}\n+#endif\n+\t\tfor (auto const& n : nodes)\n+\t\t\tadd_dht_router(n);\n+#endif\n \t}\n \n-\tbool is_directory(std::string const& f, error_code& ec)\n+\tvoid session_impl::update_count_slow()\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(76)\">../src/peer_list.cpp:539</a></td><td>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. It would probably be more efficient</td></tr><tr id=\"76\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/peer_list.cpp:539</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t, int session_time, torrent_state* state)\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+<div style=\"background: #ffff00\" width=\"100%\">\tstd::uint16_t session_impl::listen_port() const\n+</div>\t{\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\tTORRENT_ASSERT(is_single_thread());\n-\t\tINVARIANT_CHECK;\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\tconst int candidate_count = 10;\n-\t\tpeers.reserve(candidate_count);\n+\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming))\n+\t\t\t\treturn 0;\n \n-\t\tint erase_candidate = -1;\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\n \n-\t\tif (bool(m_finished) != state->is_finished)\n-\t\t\trecalculate_connect_candidates(state);\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(75)\">../src/session_impl.cpp:5555</a></td><td>this function should be removed and users need to deal with the more generic case of having multiple ssl ports</td></tr><tr id=\"75\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this function should be removed and users need to deal with the\n+more generic case of having multiple ssl ports</h2><h4>../src/session_impl.cpp:5555</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\treturn 0;\n \n-\t\texternal_ip const& external = state->ip;\n-\t\tint external_port = state->port;\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\n \n-\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\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\tint max_peerlist_size = state->max_peerlist_size;\n+<div style=\"background: #ffff00\" width=\"100%\">\tstd::uint16_t session_impl::ssl_listen_port() const\n+</div>\t{\n+\t\treturn ssl_listen_port(nullptr);\n+\t}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int iterations = std::min(int(m_peers.size()), 300);\n-</div>\t\t\titerations > 0; --iterations)\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\t++state->loop_counter;\n+\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0;\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\n \n-\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\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\ttorrent_peer& pe = *m_peers[m_round_robin];\n-\t\t\tTORRENT_ASSERT(pe.in_use);\n-\t\t\tint current = m_round_robin;\n+\t\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// if the number of peers is growing large\n-\t\t\t// we need to start weeding.\n+\tint session_impl::get_listen_port(transport const ssl, aux::listen_socket_handle const& s)\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(76)\">../src/session_impl.cpp:6390</a></td><td>this should be factored into the udp socket, so we only have the code once</td></tr><tr id=\"76\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be factored into the udp socket, so we only have the\n+code once</h2><h4>../src/session_impl.cpp:6390</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\treturn upload_rate_limit(m_local_peer_class);\n+\t}\n \n-\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95\n-\t\t\t\t&& max_peerlist_size > 0)\n+\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+<div style=\"background: #ffff00\" width=\"100%\">\tvoid session_impl::update_peer_dscp()\n+</div>\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 (is_erase_candidate(pe)\n-\t\t\t\t\t&& (erase_candidate == -1\n-\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe)))\n+\t\t\t\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\tif (should_erase_immediately(pe))\n-\t\t\t\t\t{\n-\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate;\n-\t\t\t\t\t\terase_peer(m_peers.begin() + current, state);\n-\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t}\n-\t\t\t\t\telse\n-\t\t\t\t\t{\n-\t\t\t\t\t\terase_candidate = current;\n-\t\t\t\t\t}\n+\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 </pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(77)\">../src/kademlia/node.cpp:684</a></td><td>it would be nice to have a bias towards node-id prefixes that are missing in the bucket</td></tr><tr id=\"77\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to have a bias towards node-id prefixes that\n are missing in the bucket</h2><h4>../src/kademlia/node.cpp:684</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -3925,66 +3925,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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(79)\">../src/kademlia/dht_storage.cpp:87</a></td><td>make this configurable in dht_settings</td></tr><tr id=\"79\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this configurable in dht_settings</h2><h4>../src/kademlia/dht_storage.cpp:87</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\ttcp::endpoint addr;\n-\t\tbool seed = 0;\n-\t};\n-\n-\t// internal\n-\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n-\t{\n-\t\treturn lhs.addr.address() == rhs.addr.address()\n-\t\t\t? lhs.addr.port() < rhs.addr.port()\n-\t\t\t: lhs.addr.address() < rhs.addr.address();\n-\t}\n-\n-\t// this is a group. It contains a set of group members\n-\tstruct torrent_entry\n-\t{\n-\t\tstd::string name;\n-\t\tstd::vector<peer_entry> peers4;\n-\t\tstd::vector<peer_entry> peers6;\n-\t};\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tconstexpr time_duration announce_interval = minutes(30);\n-</div>\n-\tstruct dht_immutable_item\n-\t{\n-\t\t// the actual value\n-\t\tstd::unique_ptr<char[]> value;\n-\t\t// this counts the number of IPs we have seen\n-\t\t// announcing this item, this is used to determine\n-\t\t// popularity if we reach the limit of items to store\n-\t\tbloom_filter<128> ips;\n-\t\t// the last time we heard about this item\n-\t\t// the correct interpretation of this field\n-\t\t// requires a time reference\n-\t\ttime_point last_seen;\n-\t\t// number of IPs in the bloom filter\n-\t\tint num_announcers = 0;\n-\t\t// size of malloced space pointed to by value\n-\t\tint size = 0;\n-\t};\n-\n-\tstruct dht_mutable_item : dht_immutable_item\n-\t{\n-\t\tsignature sig{};\n-\t\tsequence_number seq{};\n-\t\tpublic_key key{};\n-\t\tstd::string salt;\n-\t};\n-\n-\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n-\t{\n-\t\tint const size = int(buf.size());\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(80)\">../src/kademlia/routing_table.cpp:305</a></td><td>use the non deprecated function instead of this one</td></tr><tr id=\"80\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use the non deprecated function instead of this one</h2><h4>../src/kademlia/routing_table.cpp:305</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tstatic const aux::array<int, 4> size_exceptions{{{16, 8, 4, 2}}};\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(79)\">../src/kademlia/routing_table.cpp:305</a></td><td>use the non deprecated function instead of this one</td></tr><tr id=\"79\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use the non deprecated function instead of this one</h2><h4>../src/kademlia/routing_table.cpp:305</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4004,15 +3953,15 @@\n </div>{\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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(81)\">../src/kademlia/routing_table.cpp:940</a></td><td>move the lowest priority nodes to the replacement bucket</td></tr><tr id=\"81\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move the lowest priority nodes to the replacement bucket</h2><h4>../src/kademlia/routing_table.cpp:940</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tbucket_t& rb = m_buckets[bucket_index].replacements;\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(80)\">../src/kademlia/routing_table.cpp:940</a></td><td>move the lowest priority nodes to the replacement bucket</td></tr><tr id=\"80\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move the lowest priority nodes to the replacement bucket</h2><h4>../src/kademlia/routing_table.cpp:940</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4055,14 +4004,65 @@\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(81)\">../src/kademlia/dht_storage.cpp:87</a></td><td>make this configurable in dht_settings</td></tr><tr id=\"81\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this configurable in dht_settings</h2><h4>../src/kademlia/dht_storage.cpp:87</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\ttcp::endpoint addr;\n+\t\tbool seed = 0;\n+\t};\n+\n+\t// internal\n+\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n+\t{\n+\t\treturn lhs.addr.address() == rhs.addr.address()\n+\t\t\t? lhs.addr.port() < rhs.addr.port()\n+\t\t\t: lhs.addr.address() < rhs.addr.address();\n+\t}\n+\n+\t// this is a group. It contains a set of group members\n+\tstruct torrent_entry\n+\t{\n+\t\tstd::string name;\n+\t\tstd::vector<peer_entry> peers4;\n+\t\tstd::vector<peer_entry> peers6;\n+\t};\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\tconstexpr time_duration announce_interval = minutes(30);\n+</div>\n+\tstruct dht_immutable_item\n+\t{\n+\t\t// the actual value\n+\t\tstd::unique_ptr<char[]> value;\n+\t\t// this counts the number of IPs we have seen\n+\t\t// announcing this item, this is used to determine\n+\t\t// popularity if we reach the limit of items to store\n+\t\tbloom_filter<128> ips;\n+\t\t// the last time we heard about this item\n+\t\t// the correct interpretation of this field\n+\t\t// requires a time reference\n+\t\ttime_point last_seen;\n+\t\t// number of IPs in the bloom filter\n+\t\tint num_announcers = 0;\n+\t\t// size of malloced space pointed to by value\n+\t\tint size = 0;\n+\t};\n+\n+\tstruct dht_mutable_item : dht_immutable_item\n+\t{\n+\t\tsignature sig{};\n+\t\tsequence_number seq{};\n+\t\tpublic_key key{};\n+\t\tstd::string salt;\n+\t};\n+\n+\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n+\t{\n+\t\tint const size = int(buf.size());\n </pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(82)\">../include/libtorrent/piece_picker.hpp:668</a></td><td>having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download</td></tr><tr id=\"82\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>having 8 priority levels is probably excessive. It should\n probably be changed to 3 levels + dont-download</h2><h4>../include/libtorrent/piece_picker.hpp:668</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4210,15 +4210,66 @@\n \tusing allocator_type = typename boost::asio::associated_allocator<UnderlyingHandler>::type;\n \tusing executor_type = typename boost::asio::associated_executor<UnderlyingHandler>::type;\n \n \tallocator_type get_allocator() const noexcept\n \t{ return boost::asio::get_associated_allocator(m_underlying_handler); }\n \n \texecutor_type get_executor() const noexcept\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(85)\">../include/libtorrent/peer_connection.hpp:996</a></td><td>this should really be a circular buffer</td></tr><tr id=\"85\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should really be a circular buffer</h2><h4>../include/libtorrent/peer_connection.hpp:996</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// it just serves as a queue to remember what we've sent, to avoid\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(85)\">../include/libtorrent/socks5_stream.hpp:153</a></td><td>add async_connect() that takes a hostname and port as well</td></tr><tr id=\"85\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add async_connect() that takes a hostname and port as well</h2><h4>../include/libtorrent/socks5_stream.hpp:153</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\ttemplate <class Handler>\n+</div>\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(86)\">../include/libtorrent/peer_connection.hpp:996</a></td><td>this should really be a circular buffer</td></tr><tr id=\"86\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should really be a circular buffer</h2><h4>../include/libtorrent/peer_connection.hpp:996</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4259,15 +4310,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-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(86)\">../include/libtorrent/peer_connection.hpp:1086</a></td><td>rename this target queue size</td></tr><tr id=\"86\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>rename this target queue size</h2><h4>../include/libtorrent/peer_connection.hpp:1086</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// this is the piece that is available to this peer. Only\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(87)\">../include/libtorrent/peer_connection.hpp:1086</a></td><td>rename this target queue size</td></tr><tr id=\"87\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>rename this target queue size</h2><h4>../include/libtorrent/peer_connection.hpp:1086</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4310,66 +4361,66 @@\n \t\t// could be considered: true = local, false = remote\n \t\tbool m_outgoing:1;\n \n \t\t// is true if we learn the incoming connections listening\n \t\t// during the extended handshake\n \t\tbool m_received_listen_port:1;\n \n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(87)\">../include/libtorrent/socks5_stream.hpp:153</a></td><td>add async_connect() that takes a hostname and port as well</td></tr><tr id=\"87\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add async_connect() that takes a hostname and port as well</h2><h4>../include/libtorrent/socks5_stream.hpp:153</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(88)\">../include/libtorrent/aux_/chained_buffer.hpp:59</a></td><td>this type should probably be renamed to send_buffer</td></tr><tr id=\"88\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this type should probably be renamed to send_buffer</h2><h4>../include/libtorrent/aux_/chained_buffer.hpp:59</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/aux_/buffer.hpp\"\n \n-\tvoid close(error_code& ec)\n-\t{\n-\t\tm_dst_name.clear();\n-\t\tproxy_base::close(ec);\n-\t}\n+#include <deque>\n+#include <vector>\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+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/asio/buffer.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n \n-<div style=\"background: #ffff00\" width=\"100%\">\ttemplate <class Handler>\n-</div>\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+#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\tm_remote_endpoint = endpoint;\n+namespace libtorrent {\n+namespace aux {\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+<div style=\"background: #ffff00\" width=\"100%\">\tstruct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded\n+</div>\t{\n+\t\tchained_buffer(): m_bytes(0), m_capacity(0)\n+\t\t{\n+\t\t\tthread_started();\n+#if TORRENT_USE_ASSERTS\n+\t\t\tm_destructed = false;\n+#endif\n+\t\t}\n \n-\t\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+\tprivate:\n \n-private:\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-\ttemplate <typename Handler>\n-\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n-\t\t, Handler h)\n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(88)\">../include/libtorrent/aux_/session_interface.hpp:127</a></td><td>make 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.</td></tr><tr id=\"88\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this interface a lot smaller. It could be split up into\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+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(89)\">../include/libtorrent/aux_/session_interface.hpp:127</a></td><td>make 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.</td></tr><tr id=\"89\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../include/libtorrent/aux_/session_interface.hpp:127</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t// a release build with logging disabled (which is the default) will\n \t// not have this class at all\n \tstruct TORRENT_EXTRA_EXPORT session_logger\n \t{\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tvirtual bool should_log() const = 0;\n@@ -4389,15 +4440,15 @@\n \n <div style=\"background: #ffff00\" width=\"100%\">\tstruct TORRENT_EXTRA_EXPORT session_interface\n </div>#if !defined TORRENT_DISABLE_LOGGING || TORRENT_USE_ASSERTS\n \t\t: session_logger\n #endif\n \t{\n \n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(89)\">../include/libtorrent/aux_/session_interface.hpp:136</a></td><td>the IP voting mechanism should be factored out to its own class, not part of the session and these constants should move too</td></tr><tr id=\"89\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>the IP voting mechanism should be factored out\n+</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(90)\">../include/libtorrent/aux_/session_interface.hpp:136</a></td><td>the IP voting mechanism should be factored out to its own class, not part of the session and these constants should move too</td></tr><tr id=\"90\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../include/libtorrent/aux_/session_interface.hpp:136</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tvirtual void session_log(char const* fmt, ...) const TORRENT_FORMAT(2,3) = 0;\n #endif\n \n #if TORRENT_USE_ASSERTS\n \t\tvirtual bool is_single_thread() const = 0;\n \t\tvirtual bool has_peer(peer_connection const* p) const = 0;\n@@ -4442,118 +4493,15 @@\n \t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0;\n \t\tvirtual void remove_torrent_impl(std::shared_ptr<torrent> tptr, remove_flags_t options) = 0;\n \n \t\t// port filter\n \t\tvirtual port_filter const& get_port_filter() const = 0;\n \t\tvirtual void ban_ip(address addr) = 0;\n \n-</pre></td></tr><tr style=\"background: #cfc\"><td>relevance 2</td><td><a href=\"javascript:expand(90)\">../include/libtorrent/aux_/chained_buffer.hpp:59</a></td><td>this type should probably be renamed to send_buffer</td></tr><tr id=\"90\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this type should probably be renamed to send_buffer</h2><h4>../include/libtorrent/aux_/chained_buffer.hpp:59</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/aux_/buffer.hpp\"\n-\n-#include <deque>\n-#include <vector>\n-\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <boost/asio/buffer.hpp>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-\n-#ifdef _MSC_VER\n-// visual studio requires the value in a deque to be copyable. C++11\n-// has looser requirements depending on which functions are actually used.\n-#define TORRENT_CPP98_DEQUE 1\n-#else\n-#define TORRENT_CPP98_DEQUE 0\n-#endif\n-\n-namespace libtorrent {\n-namespace aux {\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tstruct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded\n-</div>\t{\n-\t\tchained_buffer(): m_bytes(0), m_capacity(0)\n-\t\t{\n-\t\t\tthread_started();\n-#if TORRENT_USE_ASSERTS\n-\t\t\tm_destructed = false;\n-#endif\n-\t\t}\n-\n-\tprivate:\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-\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-</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(91)\">../src/session_impl.cpp:5707</a></td><td>report the proper address of the router as the source IP of this vote of our external address, instead of the empty address</td></tr><tr id=\"91\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>report the proper address of the router as the source IP of\n-this vote of our external address, instead of the empty address</h2><h4>../src/session_impl.cpp:5707</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tlisten_socket->external_address.cast_vote(external_ip, source_router, address());\n-</div>\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-</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(92)\">../src/torrent.cpp:1126</a></td><td>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 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</td></tr><tr id=\"92\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this depend on the error and on the filesystem the\n+</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(91)\">../src/torrent.cpp:1126</a></td><td>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 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</td></tr><tr id=\"91\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/torrent.cpp:1126</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(93)\">../src/torrent.cpp:8398</a></td><td>should 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</td></tr><tr id=\"93\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should disconnect all peers that have the pieces we have\n+</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(92)\">../src/torrent.cpp:8398</a></td><td>should 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</td></tr><tr id=\"92\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/torrent.cpp:8398</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(93)\">../src/session_impl.cpp:5707</a></td><td>report the proper address of the router as the source IP of this vote of our external address, instead of the empty address</td></tr><tr id=\"93\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>report the proper address of the router as the source IP of\n+this vote of our external address, instead of the empty address</h2><h4>../src/session_impl.cpp:5707</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tlisten_socket->external_address.cast_vote(external_ip, source_router, address());\n+</div>\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 </pre></td></tr><tr style=\"background: #ccf\"><td>relevance 1</td><td><a href=\"javascript:expand(94)\">../include/libtorrent/ip_voter.hpp:130</a></td><td>have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc.</td></tr><tr id=\"94\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc.</h2><h4>../include/libtorrent/ip_voter.hpp:130</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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,169 +4679,15 @@\n \t\t// [n][0] = IPv4 [n][1] = IPv6\n <div style=\"background: #ffff00\" width=\"100%\">\t\taddress m_addresses[2][2];\n </div>\t};\n \n }\n \n #endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(95)\">../test/test_ssl.cpp:407</a></td><td>test using a signed certificate with the wrong info-hash in DN</td></tr><tr id=\"95\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test using a signed certificate with the wrong info-hash in DN</h2><h4>../test/test_ssl.cpp:407</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(96)\">../test/test_ssl.cpp:509</a></td><td>also test using a hash that refers to a valid torrent but that differs from the SNI hash</td></tr><tr id=\"96\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>also test using a hash that refers to a valid torrent\n-but that differs from the SNI hash</h2><h4>../test/test_ssl.cpp:509</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::generate(handshake + 28, handshake + 48, &rand);\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(97)\">../test/test_upnp.cpp:156</a></td><td>store the log and verify that some key messages are there</td></tr><tr id=\"97\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>store the log and verify that some key messages are there</h2><h4>../test/test_upnp.cpp:156</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t, portmap_protocol const protocol, error_code const& err\n-\t\t\t, portmap_transport, aux::listen_socket_handle const&) override\n-\t\t{\n-\t\t\tcallback_info info = {mapping, port, err};\n-\t\t\tcallbacks.push_back(info);\n-\t\t\tstd::cout << \"mapping: \" << static_cast<int>(mapping)\n-\t\t\t\t<< \", port: \" << port << \", IP: \" << ip\n-\t\t\t\t<< \", proto: \" << static_cast<int>(protocol)\n-\t\t\t\t<< \", error: \\\"\" << err.message() << \"\\\"\\n\";\n-\t\t}\n-\t#ifndef TORRENT_DISABLE_LOGGING\n-\t\tbool should_log_portmap(portmap_transport) const override\n-\t\t{\n-\t\t\treturn true;\n-\t\t}\n-\n-\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t}\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(98)\">../test/test_bloom_filter.cpp:135</a></td><td>test size()</td></tr><tr id=\"98\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test size()</h2><h4>../test/test_bloom_filter.cpp:135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(99)\">../test/test_bloom_filter.cpp:136</a></td><td>test clear()</td></tr><tr id=\"99\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test clear()</h2><h4>../test/test_bloom_filter.cpp:136</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tsha1_hash k(\"\\x01\\x00\\x02\\x00 \");\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(95)\">../test/test_bloom_filter.cpp:135</a></td><td>test size()</td></tr><tr id=\"95\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test size()</h2><h4>../test/test_bloom_filter.cpp:135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(96)\">../test/test_bloom_filter.cpp:136</a></td><td>test clear()</td></tr><tr id=\"96\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test clear()</h2><h4>../test/test_bloom_filter.cpp:136</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4854,15 +4700,15 @@\n {\n \ttest_set_and_get();\n \ttest_set_bits();\n \ttest_count_zeroes();\n \ttest_to_from_string();\n \n <div style=\"background: #ffff00\" width=\"100%\">}\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(100)\">../test/test_merkle_tree.cpp:233</a></td><td>use structured bindings in C++17</td></tr><tr id=\"100\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured bindings in C++17</h2><h4>../test/test_merkle_tree.cpp:233</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tmask[std::size_t(i)] = true;\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(97)\">../test/test_merkle_tree.cpp:233</a></td><td>use structured bindings in C++17</td></tr><tr id=\"97\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured bindings in C++17</h2><h4>../test/test_merkle_tree.cpp:233</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4905,15 +4751,15 @@\n TORRENT_TEST(roundtrip_empty_tree)\n {\n \taux::merkle_tree t(num_blocks, 1, f[0].data());\n \ttest_roundtrip(t, num_blocks, 1);\n }\n \n TORRENT_TEST(roundtrip_full_tree)\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(101)\">../test/test_merkle_tree.cpp:938</a></td><td>add test for load_piece_layer()</td></tr><tr id=\"101\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for load_piece_layer()</h2><h4>../test/test_merkle_tree.cpp:938</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(102)\">../test/test_merkle_tree.cpp:939</a></td><td>add test for add_hashes() with an odd number of blocks</td></tr><tr id=\"102\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for add_hashes() with an odd number of blocks</h2><h4>../test/test_merkle_tree.cpp:939</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(103)\">../test/test_merkle_tree.cpp:940</a></td><td>add test for set_block() (setting the last block) with an odd number of blocks</td></tr><tr id=\"103\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for set_block() (setting the last block) with an odd number of blocks</h2><h4>../test/test_merkle_tree.cpp:940</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(98)\">../test/test_merkle_tree.cpp:938</a></td><td>add test for load_piece_layer()</td></tr><tr id=\"98\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for load_piece_layer()</h2><h4>../test/test_merkle_tree.cpp:938</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(99)\">../test/test_merkle_tree.cpp:939</a></td><td>add test for add_hashes() with an odd number of blocks</td></tr><tr id=\"99\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for add_hashes() with an odd number of blocks</h2><h4>../test/test_merkle_tree.cpp:939</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(100)\">../test/test_merkle_tree.cpp:940</a></td><td>add test for set_block() (setting the last block) with an odd number of blocks</td></tr><tr id=\"100\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add test for set_block() (setting the last block) with an odd number of blocks</h2><h4>../test/test_merkle_tree.cpp:940</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4926,17 +4772,119 @@\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 <div style=\"background: #ffff00\" width=\"100%\">\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(104)\">../test/test_file_storage.cpp:1208</a></td><td>test file attributes</td></tr><tr id=\"104\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test file attributes</h2><h4>../test/test_file_storage.cpp:1208</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(105)\">../test/test_file_storage.cpp:1209</a></td><td>test symlinks</td></tr><tr id=\"105\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test symlinks</h2><h4>../test/test_file_storage.cpp:1209</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(106)\">../test/test_torrent_info.cpp:459</a></td><td>test remap_files</td></tr><tr id=\"106\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test remap_files</h2><h4>../test/test_torrent_info.cpp:459</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(107)\">../test/test_torrent_info.cpp:460</a></td><td>torrent with 'p' (padfile) attribute</td></tr><tr id=\"107\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'p' (padfile) attribute</h2><h4>../test/test_torrent_info.cpp:460</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(108)\">../test/test_torrent_info.cpp:461</a></td><td>torrent with 'h' (hidden) attribute</td></tr><tr id=\"108\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'h' (hidden) attribute</h2><h4>../test/test_torrent_info.cpp:461</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(109)\">../test/test_torrent_info.cpp:462</a></td><td>torrent with 'x' (executable) attribute</td></tr><tr id=\"109\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'x' (executable) attribute</h2><h4>../test/test_torrent_info.cpp:462</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(110)\">../test/test_torrent_info.cpp:463</a></td><td>torrent with 'l' (symlink) attribute</td></tr><tr id=\"110\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'l' (symlink) attribute</h2><h4>../test/test_torrent_info.cpp:463</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(111)\">../test/test_torrent_info.cpp:464</a></td><td>torrent 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)</td></tr><tr id=\"111\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with multiple trackers in multiple tiers, making sure we\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(101)\">../test/test_flags.cpp:163</a></td><td>change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add(torrent_flags::paused);</td></tr><tr id=\"101\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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);</h2><h4>../test/test_flags.cpp:163</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\n+\t// share-mode\n+\ttest_add_and_get_flags(torrent_flags::share_mode);\n+\ttest_set_after_add(torrent_flags::share_mode);\n+\ttest_unset_after_add(torrent_flags::share_mode);\n+}\n+#endif\n+\n+TORRENT_TEST(flag_apply_ip_filter)\n+{\n+\t// apply-ip-filter\n+\ttest_add_and_get_flags(torrent_flags::apply_ip_filter);\n+\ttest_set_after_add(torrent_flags::apply_ip_filter);\n+\ttest_unset_after_add(torrent_flags::apply_ip_filter);\n+}\n+\n+TORRENT_TEST(flag_paused)\n+{\n+\t// paused\n+\ttest_add_and_get_flags(torrent_flags::paused);\n+<div style=\"background: #ffff00\" width=\"100%\">}\n+</div>\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+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(102)\">../test/test_flags.cpp:205</a></td><td>this 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.</td></tr><tr id=\"102\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../test/test_flags.cpp:205</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(103)\">../test/test_flags.cpp:209</a></td><td>change to a different test setup. currently always paused. test_set_after_add(torrent_flags::stop_when_ready);</td></tr><tr id=\"103\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>change to a different test setup. currently always paused.\n+test_set_after_add(torrent_flags::stop_when_ready);</h2><h4>../test/test_flags.cpp:209</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\ttest_set_after_add(torrent_flags::super_seeding);\n+}\n+#endif\n+#endif\n+\n+TORRENT_TEST(flag_sequential_download)\n+{\n+\t// sequential-download\n+\ttest_add_and_get_flags(torrent_flags::sequential_download);\n+\ttest_set_after_add(torrent_flags::sequential_download);\n+\ttest_unset_after_add(torrent_flags::sequential_download);\n+}\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+<div style=\"background: #ffff00\" width=\"100%\">\ttest_unset_after_add(torrent_flags::stop_when_ready);\n+</div>}\n+#endif\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+\n+\n+TORRENT_TEST(flag_disable_lsd)\n+{\n+\ttest_add_and_get_flags(torrent_flags::disable_lsd);\n+\ttest_set_after_add(torrent_flags::disable_lsd);\n+\ttest_unset_after_add(torrent_flags::disable_lsd);\n+}\n+\n+TORRENT_TEST(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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(104)\">../test/test_torrent_info.cpp:459</a></td><td>test remap_files</td></tr><tr id=\"104\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test remap_files</h2><h4>../test/test_torrent_info.cpp:459</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(105)\">../test/test_torrent_info.cpp:460</a></td><td>torrent with 'p' (padfile) attribute</td></tr><tr id=\"105\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'p' (padfile) attribute</h2><h4>../test/test_torrent_info.cpp:460</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(106)\">../test/test_torrent_info.cpp:461</a></td><td>torrent with 'h' (hidden) attribute</td></tr><tr id=\"106\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'h' (hidden) attribute</h2><h4>../test/test_torrent_info.cpp:461</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(107)\">../test/test_torrent_info.cpp:462</a></td><td>torrent with 'x' (executable) attribute</td></tr><tr id=\"107\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'x' (executable) attribute</h2><h4>../test/test_torrent_info.cpp:462</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(108)\">../test/test_torrent_info.cpp:463</a></td><td>torrent with 'l' (symlink) attribute</td></tr><tr id=\"108\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with 'l' (symlink) attribute</h2><h4>../test/test_torrent_info.cpp:463</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(109)\">../test/test_torrent_info.cpp:464</a></td><td>torrent 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)</td></tr><tr id=\"109\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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)</h2><h4>../test/test_torrent_info.cpp:464</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(112)\">../test/test_torrent_info.cpp:467</a></td><td>torrents with a zero-length name</td></tr><tr id=\"112\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrents with a zero-length name</h2><h4>../test/test_torrent_info.cpp:467</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(113)\">../test/test_torrent_info.cpp:468</a></td><td>torrent with a non-dictionary info-section</td></tr><tr id=\"113\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with a non-dictionary info-section</h2><h4>../test/test_torrent_info.cpp:468</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(114)\">../test/test_torrent_info.cpp:469</a></td><td>torrents with DHT nodes</td></tr><tr id=\"114\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrents with DHT nodes</h2><h4>../test/test_torrent_info.cpp:469</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(115)\">../test/test_torrent_info.cpp:470</a></td><td>torrent with url-list as a single string</td></tr><tr id=\"115\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with url-list as a single string</h2><h4>../test/test_torrent_info.cpp:470</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(116)\">../test/test_torrent_info.cpp:471</a></td><td>torrent with http seed as a single string</td></tr><tr id=\"116\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with http seed as a single string</h2><h4>../test/test_torrent_info.cpp:471</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(117)\">../test/test_torrent_info.cpp:472</a></td><td>torrent with a comment</td></tr><tr id=\"117\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with a comment</h2><h4>../test/test_torrent_info.cpp:472</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(118)\">../test/test_torrent_info.cpp:473</a></td><td>torrent with an SSL cert</td></tr><tr id=\"118\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with an SSL cert</h2><h4>../test/test_torrent_info.cpp:473</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(119)\">../test/test_torrent_info.cpp:474</a></td><td>torrent with attributes (executable and hidden)</td></tr><tr id=\"119\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with attributes (executable and hidden)</h2><h4>../test/test_torrent_info.cpp:474</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(120)\">../test/test_torrent_info.cpp:475</a></td><td>torrent_info constructor that takes an invalid bencoded buffer</td></tr><tr id=\"120\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent_info constructor that takes an invalid bencoded buffer</h2><h4>../test/test_torrent_info.cpp:475</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(121)\">../test/test_torrent_info.cpp:476</a></td><td>verify_encoding with a string that triggers character replacement</td></tr><tr id=\"121\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>verify_encoding with a string that triggers character replacement</h2><h4>../test/test_torrent_info.cpp:476</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{ \"v2_non_multiple_piece_layer.torrent\", errors::torrent_invalid_piece_layer},\n+sure it's in different order at least once)</h2><h4>../test/test_torrent_info.cpp:464</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(110)\">../test/test_torrent_info.cpp:467</a></td><td>torrents with a zero-length name</td></tr><tr id=\"110\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrents with a zero-length name</h2><h4>../test/test_torrent_info.cpp:467</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(111)\">../test/test_torrent_info.cpp:468</a></td><td>torrent with a non-dictionary info-section</td></tr><tr id=\"111\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with a non-dictionary info-section</h2><h4>../test/test_torrent_info.cpp:468</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(112)\">../test/test_torrent_info.cpp:469</a></td><td>torrents with DHT nodes</td></tr><tr id=\"112\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrents with DHT nodes</h2><h4>../test/test_torrent_info.cpp:469</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(113)\">../test/test_torrent_info.cpp:470</a></td><td>torrent with url-list as a single string</td></tr><tr id=\"113\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with url-list as a single string</h2><h4>../test/test_torrent_info.cpp:470</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(114)\">../test/test_torrent_info.cpp:471</a></td><td>torrent with http seed as a single string</td></tr><tr id=\"114\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with http seed as a single string</h2><h4>../test/test_torrent_info.cpp:471</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(115)\">../test/test_torrent_info.cpp:472</a></td><td>torrent with a comment</td></tr><tr id=\"115\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with a comment</h2><h4>../test/test_torrent_info.cpp:472</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(116)\">../test/test_torrent_info.cpp:473</a></td><td>torrent with an SSL cert</td></tr><tr id=\"116\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with an SSL cert</h2><h4>../test/test_torrent_info.cpp:473</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(117)\">../test/test_torrent_info.cpp:474</a></td><td>torrent with attributes (executable and hidden)</td></tr><tr id=\"117\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent with attributes (executable and hidden)</h2><h4>../test/test_torrent_info.cpp:474</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(118)\">../test/test_torrent_info.cpp:475</a></td><td>torrent_info constructor that takes an invalid bencoded buffer</td></tr><tr id=\"118\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>torrent_info constructor that takes an invalid bencoded buffer</h2><h4>../test/test_torrent_info.cpp:475</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(119)\">../test/test_torrent_info.cpp:476</a></td><td>verify_encoding with a string that triggers character replacement</td></tr><tr id=\"119\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>verify_encoding with a string that triggers character replacement</h2><h4>../test/test_torrent_info.cpp:476</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -4979,373 +4927,145 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(122)\">../test/test_transfer.cpp:173</a></td><td>these settings_pack tests belong in their own test</td></tr><tr id=\"122\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>these settings_pack tests belong in their own test</h2><h4>../test/test_transfer.cpp:173</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(120)\">../test/test_ssl.cpp:407</a></td><td>test using a signed certificate with the wrong info-hash in DN</td></tr><tr id=\"120\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test using a signed certificate with the wrong info-hash in DN</h2><h4>../test/test_ssl.cpp:407</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\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+\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-\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n+\tif (flags & invalid_certificate)\n+\t{\n+\t\tcertificate = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_certificate.pem\"));\n+\t\tprivate_key = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_private_key.pem\"));\n+\t}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tpack.set_int(settings_pack::unchoke_slots_limit, 0);\n-</div>\tses1.apply_settings(pack);\n-\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0);\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(121)\">../test/test_ssl.cpp:509</a></td><td>also test using a hash that refers to a valid torrent but that differs from the SNI hash</td></tr><tr id=\"121\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>also test using a hash that refers to a valid torrent\n+but that differs from the SNI hash</h2><h4>../test/test_ssl.cpp:509</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\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+\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-\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// 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+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::generate(handshake + 28, handshake + 48, &rand);\n+</div>\t}\n \n-\tses2.apply_settings(pack);\n+\t// fill in the peer-id\n+\tstd::generate(handshake + 48, handshake + 68, &rand);\n \n-\ttorrent_handle tor1;\n-\ttorrent_handle tor2;\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-\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+\tchar buf[68];\n+\tstd::printf(\"read bittorrent handshake\\n\");\n+\tboost::asio::read(ssl_sock, boost::asio::buffer(buf, sizeof(buf)), ec);\n+\tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n+\tif (ec)\n+\t{\n+\t\tstd::printf(\"failed to read bittorrent handshake: %s\\n\"\n+\t\t\t, ec.message().c_str());\n+\t\treturn false;\n+\t}\n \n-\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n+\tif (memcmp(buf, \"\\x13\" \"BitTorrent protocol\", 20) != 0)\n+\t{\n+\t\tstd::printf(\"invalid bittorrent handshake\\n\");\n+\t\treturn false;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(122)\">../test/test_fast_extension.cpp:1135</a></td><td>test sending invalid requests (out of bound piece index, offsets and sizes)</td></tr><tr id=\"122\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test sending invalid requests (out of bound piece index, offsets and\n+sizes)</h2><h4>../test/test_fast_extension.cpp:1135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(123)\">../test/test_peer_list.cpp:1241</a></td><td>test erasing peers</td></tr><tr id=\"123\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test erasing peers</h2><h4>../test/test_peer_list.cpp:1241</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(124)\">../test/test_peer_list.cpp:1242</a></td><td>test update_peer_port with allow_multiple_connections_per_ip and without</td></tr><tr id=\"124\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test update_peer_port with allow_multiple_connections_per_ip and without</h2><h4>../test/test_peer_list.cpp:1242</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(125)\">../test/test_peer_list.cpp:1243</a></td><td>test add i2p peers</td></tr><tr id=\"125\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test add i2p peers</h2><h4>../test/test_peer_list.cpp:1243</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(126)\">../test/test_peer_list.cpp:1244</a></td><td>test allow_i2p_mixed</td></tr><tr id=\"126\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test allow_i2p_mixed</h2><h4>../test/test_peer_list.cpp:1244</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(127)\">../test/test_peer_list.cpp:1245</a></td><td>test insert_peer failing with all error conditions</td></tr><tr id=\"127\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test insert_peer failing with all error conditions</h2><h4>../test/test_peer_list.cpp:1245</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(128)\">../test/test_peer_list.cpp:1246</a></td><td>test IPv6</td></tr><tr id=\"128\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test IPv6</h2><h4>../test/test_peer_list.cpp:1246</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(129)\">../test/test_peer_list.cpp:1247</a></td><td>test connect_to_peer() failing</td></tr><tr id=\"129\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test connect_to_peer() failing</h2><h4>../test/test_peer_list.cpp:1247</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(130)\">../test/test_peer_list.cpp:1248</a></td><td>test connection_closed</td></tr><tr id=\"130\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test connection_closed</h2><h4>../test/test_peer_list.cpp:1248</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(131)\">../test/test_peer_list.cpp:1249</a></td><td>connect candidates recalculation when incrementing failcount</td></tr><tr id=\"131\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>connect candidates recalculation when incrementing failcount</h2><h4>../test/test_peer_list.cpp:1249</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(132)\">../test/test_resume.cpp:582</a></td><td>test what happens when loading a resume file with both piece priorities and file priorities (file prio should take precedence)</td></tr><tr id=\"132\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test what happens when loading a resume file with both piece priorities\n+and file priorities (file prio should take precedence)</h2><h4>../test/test_resume.cpp:582</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t{\n+\t\t\tTEST_EQUAL(pieces[i], true);\n+\t\t}\n+\t}\n+}\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+} // anonymous namespace\n \n-\twait_for_listen(ses1, \"ses1\");\n-\twait_for_listen(ses2, \"ses2\");\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(123)\">../test/test_timestamp_history.cpp:54</a></td><td>test the case where we have > 120 samples (and have the base delay actually be updated)</td></tr><tr id=\"123\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test the case where we have > 120 samples (and have the base delay actually be updated)</h2><h4>../test/test_timestamp_history.cpp:54</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(124)\">../test/test_timestamp_history.cpp:55</a></td><td>test the case where a sample is lower than the history entry but not lower than the base</td></tr><tr id=\"124\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test the case where a sample is lower than the history entry but not lower than the base</h2><h4>../test/test_timestamp_history.cpp:55</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/aux_/timestamp_history.hpp\"\n+TORRENT_TEST(piece_slots_seed)\n+{\n+\ttest_piece_slots_seed(settings());\n+}\n \n-TORRENT_TEST(timestamp_history)\n+TORRENT_TEST(piece_slots_seed_suggest_cache)\n {\n-\tusing namespace lt;\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-\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-<div style=\"background: #ffff00\" width=\"100%\">}\n-</div>\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(125)\">../test/test_tracker.cpp:60</a></td><td>test scrape requests</td></tr><tr id=\"125\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test scrape requests</h2><h4>../test/test_tracker.cpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(126)\">../test/test_tracker.cpp:61</a></td><td>test parse peers6</td></tr><tr id=\"126\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse peers6</h2><h4>../test/test_tracker.cpp:61</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(127)\">../test/test_tracker.cpp:62</a></td><td>test parse tracker-id</td></tr><tr id=\"127\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse tracker-id</h2><h4>../test/test_tracker.cpp:62</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(128)\">../test/test_tracker.cpp:63</a></td><td>test parse failure-reason</td></tr><tr id=\"128\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse failure-reason</h2><h4>../test/test_tracker.cpp:63</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(129)\">../test/test_tracker.cpp:64</a></td><td>test 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</td></tr><tr id=\"129\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../test/test_tracker.cpp:64</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(130)\">../test/test_peer_list.cpp:1241</a></td><td>test erasing peers</td></tr><tr id=\"130\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test erasing peers</h2><h4>../test/test_peer_list.cpp:1241</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(131)\">../test/test_peer_list.cpp:1242</a></td><td>test update_peer_port with allow_multiple_connections_per_ip and without</td></tr><tr id=\"131\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test update_peer_port with allow_multiple_connections_per_ip and without</h2><h4>../test/test_peer_list.cpp:1242</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(132)\">../test/test_peer_list.cpp:1243</a></td><td>test add i2p peers</td></tr><tr id=\"132\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test add i2p peers</h2><h4>../test/test_peer_list.cpp:1243</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(133)\">../test/test_peer_list.cpp:1244</a></td><td>test allow_i2p_mixed</td></tr><tr id=\"133\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test allow_i2p_mixed</h2><h4>../test/test_peer_list.cpp:1244</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(134)\">../test/test_peer_list.cpp:1245</a></td><td>test insert_peer failing with all error conditions</td></tr><tr id=\"134\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test insert_peer failing with all error conditions</h2><h4>../test/test_peer_list.cpp:1245</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(135)\">../test/test_peer_list.cpp:1246</a></td><td>test IPv6</td></tr><tr id=\"135\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test IPv6</h2><h4>../test/test_peer_list.cpp:1246</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(136)\">../test/test_peer_list.cpp:1247</a></td><td>test connect_to_peer() failing</td></tr><tr id=\"136\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test connect_to_peer() failing</h2><h4>../test/test_peer_list.cpp:1247</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(137)\">../test/test_peer_list.cpp:1248</a></td><td>test connection_closed</td></tr><tr id=\"137\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test connection_closed</h2><h4>../test/test_peer_list.cpp:1248</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(138)\">../test/test_peer_list.cpp:1249</a></td><td>connect candidates recalculation when incrementing failcount</td></tr><tr id=\"138\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>connect candidates recalculation when incrementing failcount</h2><h4>../test/test_peer_list.cpp:1249</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(139)\">../test/test_dht.cpp:472</a></td><td>check to make sure the \"best\" items are stored</td></tr><tr id=\"139\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>check to make sure the \"best\" items are stored</h2><h4>../test/test_dht.cpp:472</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\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-<div style=\"background: #ffff00\" width=\"100%\">\tTEST_EQUAL(items_num.size(), 4);\n-</div>}\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<tcp::endpoint> g_got_peers;\n-\n-void get_peers_cb(std::vector<tcp::endpoint> const& peers)\n-{\n-\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());\n-}\n-\n-std::vector<dht::item> g_got_items;\n-dht::item g_put_item;\n-int g_put_count;\n-\n-void get_mutable_item_cb(dht::item const& i, bool a)\n-{\n-\tif (!a) return;\n-\tif (!i.empty())\n-\t\tg_got_items.push_back(i);\n-}\n-\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(140)\">../test/test_dht.cpp:3223</a></td><td>this won't work because the second node isn't pinged so it wont be added to the routing table</td></tr><tr id=\"140\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this won't work because the second node isn't pinged so it wont\n-be added to the routing table</h2><h4>../test/test_dht.cpp:3223</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\t// and no replacement nodes\n-\tTEST_EQUAL(std::get<1>(node.size()), 0);\n-\n-\t// now, disable read_only, try again.\n-\tg_sent_packets.clear();\n-\tsett.set_bool(settings_pack::dht_read_only, false);\n-\n-\tsend_dht_request(node, \"get\", source, &response);\n-\t// sender should be added to replacement bucket\n-\tTEST_EQUAL(std::get<1>(node.size()), 1);\n-\n-\tg_sent_packets.clear();\n-#if 0\n-<div style=\"background: #ffff00\" width=\"100%\">\ttarget = generate_next();\n-</div>\tnode.get_item(target, get_immutable_item_cb);\n-\n-\t// since we have 2 nodes, we should have two packets.\n-\tTEST_EQUAL(g_sent_packets.size(), 2);\n-\n-\t// both of them shouldn't have a 'ro' key.\n-\tnode_from_entry(g_sent_packets.front().second, request);\n-\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n-\n-\tTEST_CHECK(ret);\n-\tTEST_CHECK(!parsed[3]);\n-\n-\tnode_from_entry(g_sent_packets.back().second, request);\n-\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n-\n-\tTEST_CHECK(ret);\n-\tTEST_CHECK(!parsed[3]);\n-#endif\n-}\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-// these tests rely on logging being enabled\n-\n-TORRENT_TEST(invalid_error_msg)\n-{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(141)\">../test/test_dht.cpp:4081</a></td><td>test obfuscated_get_peers</td></tr><tr id=\"141\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test obfuscated_get_peers</h2><h4>../test/test_dht.cpp:4081</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\n-\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) {\n-\t\tTEST_CHECK(sm.has_quota());\n-\t\tfor (int i = 0; i < 10; ++i)\n-\t\t{\n-\t\t\tstd::this_thread::sleep_for(milliseconds(500));\n-\t\t\tTEST_CHECK(sm.has_quota());\n-\t\t}\n-\t});\n-}\n-\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>#else\n-TORRENT_TEST(dht)\n-{\n-\t// dummy dht test\n-\tTEST_CHECK(true);\n-}\n-\n-#endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(142)\">../test/test_fast_extension.cpp:1135</a></td><td>test sending invalid requests (out of bound piece index, offsets and sizes)</td></tr><tr id=\"142\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test sending invalid requests (out of bound piece index, offsets and\n-sizes)</h2><h4>../test/test_fast_extension.cpp:1135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(143)\">../test/test_resolve_links.cpp:95</a></td><td>test files with different piece size (negative test)</td></tr><tr id=\"143\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test files with different piece size (negative test)</h2><h4>../test/test_resolve_links.cpp:95</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">};\n-</div>\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(144)\">../test/test_resolve_links.cpp:98</a></td><td>it 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.</td></tr><tr id=\"144\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../test/test_resolve_links.cpp:98</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(145)\">../test/test_resume.cpp:582</a></td><td>test what happens when loading a resume file with both piece priorities and file priorities (file prio should take precedence)</td></tr><tr id=\"145\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test what happens when loading a resume file with both piece priorities\n-and file priorities (file prio should take precedence)</h2><h4>../test/test_resume.cpp:582</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t{\n-\t\t\tTEST_EQUAL(pieces[i], true);\n-\t\t}\n-\t}\n-}\n-\n-} // anonymous namespace\n-\n-TORRENT_TEST(piece_slots_seed)\n-{\n-\ttest_piece_slots_seed(settings());\n-}\n-\n-TORRENT_TEST(piece_slots_seed_suggest_cache)\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(146)\">../test/test_resume.cpp:585</a></td><td>make sure a resume file only ever contain file priorities OR piece priorities. Never both.</td></tr><tr id=\"146\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make sure a resume file only ever contain file priorities OR piece\n-priorities. Never both.</h2><h4>../test/test_resume.cpp:585</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tTEST_EQUAL(pieces[i], true);\n-\t\t}\n-\t}\n-}\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(133)\">../test/test_resume.cpp:585</a></td><td>make sure a resume file only ever contain file priorities OR piece priorities. Never both.</td></tr><tr id=\"133\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make sure a resume file only ever contain file priorities OR piece\n+priorities. Never both.</h2><h4>../test/test_resume.cpp:585</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tTEST_EQUAL(pieces[i], true);\n+\t\t}\n+\t}\n+}\n \n } // anonymous namespace\n \n TORRENT_TEST(piece_slots_seed)\n {\n \ttest_piece_slots_seed(settings());\n }\n@@ -5355,15 +5075,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 <div style=\"background: #ffff00\" width=\"100%\">\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(147)\">../test/test_resume.cpp:588</a></td><td>generally save</td></tr><tr id=\"147\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>generally save</h2><h4>../test/test_resume.cpp:588</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t}\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(134)\">../test/test_resume.cpp:588</a></td><td>generally save</td></tr><tr id=\"134\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>generally save</h2><h4>../test/test_resume.cpp:588</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t}\n \t}\n }\n \n } // anonymous namespace\n \n TORRENT_TEST(piece_slots_seed)\n {\n@@ -5406,15 +5126,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(148)\">../test/test_resume.cpp:911</a></td><td>test 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</td></tr><tr id=\"148\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test all other resume flags here too. This would require returning\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(135)\">../test/test_resume.cpp:911</a></td><td>test 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</td></tr><tr id=\"135\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../test/test_resume.cpp:911</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tTEST_EQUAL(s.connections_limit, 1345);\n \tTEST_EQUAL(s.uploads_limit, 1346);\n }\n \n TORRENT_TEST(paused_deprecated)\n {\n@@ -5459,15 +5179,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(149)\">../test/test_resume.cpp:1683</a></td><td>test 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</td></tr><tr id=\"149\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test all other resume flags here too. This would require returning\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(136)\">../test/test_resume.cpp:1683</a></td><td>test 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</td></tr><tr id=\"136\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../test/test_resume.cpp:1683</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tTEST_EQUAL(s.connections_limit, 1345);\n \tTEST_EQUAL(s.uploads_limit, 1346);\n }\n \n TORRENT_TEST(paused)\n {\n@@ -5512,1952 +5232,554 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(150)\">../test/test_flags.cpp:163</a></td><td>change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add(torrent_flags::paused);</td></tr><tr id=\"150\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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);</h2><h4>../test/test_flags.cpp:163</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\n-\t// share-mode\n-\ttest_add_and_get_flags(torrent_flags::share_mode);\n-\ttest_set_after_add(torrent_flags::share_mode);\n-\ttest_unset_after_add(torrent_flags::share_mode);\n-}\n-#endif\n-\n-TORRENT_TEST(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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(137)\">../test/test_resolve_links.cpp:95</a></td><td>test files with different piece size (negative test)</td></tr><tr id=\"137\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test files with different piece size (negative test)</h2><h4>../test/test_resolve_links.cpp:95</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{ \"test2\", \"test1_pad_files\", 0},\n+\t{ \"test3\", \"test1_pad_files\", 0},\n+\t{ \"test2\", \"test1_single\", 0},\n \n-TORRENT_TEST(flag_paused)\n-{\n-\t// paused\n-\ttest_add_and_get_flags(torrent_flags::paused);\n-<div style=\"background: #ffff00\" width=\"100%\">}\n-</div>\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+\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-// 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+\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-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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(151)\">../test/test_flags.cpp:205</a></td><td>this 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.</td></tr><tr id=\"151\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../test/test_flags.cpp:205</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(152)\">../test/test_flags.cpp:209</a></td><td>change to a different test setup. currently always paused. test_set_after_add(torrent_flags::stop_when_ready);</td></tr><tr id=\"152\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>change to a different test setup. currently always paused.\n-test_set_after_add(torrent_flags::stop_when_ready);</h2><h4>../test/test_flags.cpp:209</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\ttest_set_after_add(torrent_flags::super_seeding);\n-}\n-#endif\n-#endif\n+\t// if it's padded on the other hand, it will work\n+\t{ \"test1_pad_files\", \"test1_single_padded\", 1},\n \n-TORRENT_TEST(flag_sequential_download)\n-{\n-\t// sequential-download\n-\ttest_add_and_get_flags(torrent_flags::sequential_download);\n-\ttest_set_after_add(torrent_flags::sequential_download);\n-\ttest_unset_after_add(torrent_flags::sequential_download);\n-}\n+<div style=\"background: #ffff00\" width=\"100%\">};\n+</div>\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(138)\">../test/test_resolve_links.cpp:98</a></td><td>it 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.</td></tr><tr id=\"138\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../test/test_resolve_links.cpp:98</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{ \"test2\", \"test1_single\", 0},\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-<div style=\"background: #ffff00\" width=\"100%\">\ttest_unset_after_add(torrent_flags::stop_when_ready);\n-</div>}\n-#endif\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-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+\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-TORRENT_TEST(flag_disable_lsd)\n-{\n-\ttest_add_and_get_flags(torrent_flags::disable_lsd);\n-\ttest_set_after_add(torrent_flags::disable_lsd);\n-\ttest_unset_after_add(torrent_flags::disable_lsd);\n-}\n+};\n \n-TORRENT_TEST(flag_disable_pex)\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>TORRENT_TEST(resolve_links)\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(153)\">../src/packet_buffer.cpp:157</a></td><td>use compare_less_wrap for this comparison as well</td></tr><tr id=\"153\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use compare_less_wrap for this comparison as well</h2><h4>../src/packet_buffer.cpp:157</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{\n-\t\tINVARIANT_CHECK;\n-\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size);\n-\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity;\n-\n-\t\twhile (new_size < size)\n-\t\t\tnew_size <<= 1;\n-\n-\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]);\n-\n-\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i)\n-\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]);\n-\n-\t\tm_storage = std::move(new_storage);\n-\t\tm_capacity = new_size;\n-\t}\n+\tstd::string path = combine_path(parent_path(current_working_directory())\n+\t\t, \"mutable_test_torrents\");\n \n-\tpacket_ptr packet_buffer::remove(index_type idx)\n+\tfor (int i = 0; i < int(sizeof(test_torrents)/sizeof(test_torrents[0])); ++i)\n \t{\n-\t\tINVARIANT_CHECK;\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (idx >= m_first + m_capacity)\n-</div>\t\t\treturn packet_ptr();\n-\n-\t\tif (compare_less_wrap(idx, m_first, 0xffff))\n-\t\t\treturn packet_ptr();\n-\n-\t\tstd::size_t const mask = m_capacity - 1;\n-\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]);\n-\t\tm_storage[idx & mask].reset();\n-\n-\t\tif (old_value)\n-\t\t{\n-\t\t\t--m_size;\n-\t\t\tif (m_size == 0) m_last = m_first;\n-\t\t}\n-\n-\t\tif (idx == m_first && m_size != 0)\n-\t\t{\n-\t\t\t++m_first;\n-\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first)\n-\t\t\t\tif (m_storage[m_first & mask]) break;\n-\t\t\tm_first &= 0xffff;\n-\t\t}\n-\n-\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0)\n-\t\t{\n-\t\t\t--m_last;\n-\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last)\n-\t\t\t\tif (m_storage[m_last & mask]) break;\n-\t\t\t++m_last;\n-\t\t\tm_last &= 0xffff;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(154)\">../src/session_handle.cpp:499</a></td><td>in C++14, use unique_ptr and move it into the lambda</td></tr><tr id=\"154\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++14, use unique_ptr and move it into the lambda</h2><h4>../src/session_handle.cpp:499</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef BOOST_NO_EXCEPTIONS\n-\t\tif (params.save_path.empty())\n-\t\t\taux::throw_ex<system_error>(error_code(errors::invalid_save_path));\n-#else\n-\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty());\n-#endif\n+\t\ttest_torrent_t const& e = test_torrents[i];\n \n-#if TORRENT_ABI_VERSION < 3\n-\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti)\n-\t\t\tparams.info_hashes.v1 = params.info_hash;\n-#endif\n+\t\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\t// the internal torrent object keeps and mutates state in the\n-\t\t// torrent_info object. We can't let that leak back to the client\n-\t\tif (params.ti)\n-\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti);\n+\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\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw\n-\t\t// pointer for now. async_call uses a lambda expression to post the call\n-\t\t// to the main thread\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tauto* p = new add_torrent_params(std::move(params));\n-</div>\t\tauto guard = aux::scope_end([p]{ delete p; });\n-\t\tp->save_path = complete(p->save_path);\n+\t\tstd::printf(\"resolving\\n\");\n+\t\tresolve_links l(ti1);\n+\t\tl.match(ti2, \".\");\n \n-#if TORRENT_ABI_VERSION == 1\n-\t\thandle_backwards_compatible_resume_data(*p);\n-#endif\n+\t\taux::vector<resolve_links::link_t, file_index_t> const& links = l.get_links();\n \n-\t\tasync_call(&session_impl::async_add_torrent, p);\n-\t\tguard.disarm();\n-\t}\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-#ifndef BOOST_NO_EXCEPTIONS\n-#if TORRENT_ABI_VERSION == 1\n-\t// if the torrent already exists, this will throw duplicate_torrent\n-\ttorrent_handle session_handle::add_torrent(\n-\t\ttorrent_info const& ti\n-\t\t, std::string const& save_path\n-\t\t, entry const& resume_data\n-\t\t, storage_mode_t storage_mode\n-\t\t, bool const add_paused)\n-\t{\n-\t\tadd_torrent_params p;\n-\t\tp.ti = std::make_shared<torrent_info>(ti);\n-\t\tp.save_path = save_path;\n-\t\tif (resume_data.type() != entry::undefined_t)\n+\t\t// some debug output in case the test fails\n+\t\tif (num_matches > e.expected_matches)\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(155)\">../src/posix_part_file.cpp:337</a></td><td>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 from disk, but it may be overwritten soon, it's probably not that big of a deal</td></tr><tr id=\"155\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/posix_part_file.cpp:337</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\t\tfile_storage const& fs = ti1->files();\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(139)\">../test/test_tracker.cpp:60</a></td><td>test scrape requests</td></tr><tr id=\"139\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test scrape requests</h2><h4>../test/test_tracker.cpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(140)\">../test/test_tracker.cpp:61</a></td><td>test parse peers6</td></tr><tr id=\"140\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse peers6</h2><h4>../test/test_tracker.cpp:61</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(141)\">../test/test_tracker.cpp:62</a></td><td>test parse tracker-id</td></tr><tr id=\"141\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse tracker-id</h2><h4>../test/test_tracker.cpp:62</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(142)\">../test/test_tracker.cpp:63</a></td><td>test parse failure-reason</td></tr><tr id=\"142\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test parse failure-reason</h2><h4>../test/test_tracker.cpp:63</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(143)\">../test/test_tracker.cpp:64</a></td><td>test 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</td></tr><tr id=\"143\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../test/test_tracker.cpp:64</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-\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+using namespace lt;\n \n <div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\tm_free_slots.push_back(i->second);\n-\t\tm_piece_map.erase(i);\n-\t\tm_dirty_metadata = true;\n-\t}\n+</div>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-\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec)\n+\tTEST_EQUAL(ec, error_code());\n+\tTEST_EQUAL(resp.peers.size(), 2);\n+\tif (resp.peers.size() == 2)\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+\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\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\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(156)\">../src/posix_part_file.cpp:424</a></td><td>instead of rebuilding the whole file header and flushing it, update the slot entries as we go</td></tr><tr id=\"156\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of rebuilding the whole file header\n-and flushing it, update the slot entries as we go</h2><h4>../src/posix_part_file.cpp:424</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t}\n-\t\t\t\tauto bytes_read = std::fread(buf.get(), 1, std::size_t(block_to_copy), file.file());\n-\t\t\t\tif (int(bytes_read) != block_to_copy)\n-\t\t\t\t\tec.assign(errno, generic_category());\n-\n-\t\t\t\tif (ec) return;\n+}\n \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+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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(144)\">../test/test_upnp.cpp:156</a></td><td>store the log and verify that some key messages are there</td></tr><tr id=\"144\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>store the log and verify that some key messages are there</h2><h4>../test/test_upnp.cpp:156</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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}\n-\n-\tvoid posix_part_file::flush_metadata(error_code& ec)\n-\t{\n-\t\tflush_metadata_impl(ec);\n-\t}\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid posix_part_file::flush_metadata_impl(error_code& ec)\n-</div>\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#ifndef TORRENT_DISABLE_LOGGING\n+\t\tbool should_log_portmap(portmap_transport) const override\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\treturn true;\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\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\tauto const i = m_piece_map.find(piece);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(157)\">../src/udp_socket.cpp:659</a></td><td>perhaps an attempt should be made to bind m_socks5_sock to the device of m_listen_socket</td></tr><tr id=\"157\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps an attempt should be made to bind m_socks5_sock to the\n-device of m_listen_socket</h2><h4>../src/udp_socket.cpp:659</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\t\tstd::cout << \"UPnP: \" << msg << std::endl;\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t}\n+</div>\t#endif\n+\t};\n \n-\ttcp::endpoint const bind_ep(m_listen_socket.get_local_endpoint().address(), 0);\n-\tm_socks5_sock.bind(bind_ep, ec);\n+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\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\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\n \t}\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(158)\">../src/enum_net.cpp:144</a></td><td>in C++17, use __has_include for this. Other operating systems are likely to require this as well</td></tr><tr id=\"158\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17, use __has_include for this. Other operating systems are\n-likely to require this as well</h2><h4>../src/enum_net.cpp:144</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-#define IFA_F_DADFAILED 8\n-#endif\n-\n-#endif\n-\n-#if TORRENT_USE_IFADDRS\n-#include <ifaddrs.h>\n-#include <net/if.h>\n-#include <sys/ioctl.h>\n-#endif\n-\n-#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL\n-#ifdef TORRENT_BEOS\n-<div style=\"background: #ffff00\" width=\"100%\">#include <sys/sockio.h>\n-</div>#endif\n-// capture this here where warnings are disabled (the macro generates warnings)\n-const unsigned long siocgifmtu = SIOCGIFMTU;\n-#endif\n-\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-\n-#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n-#define IF_NAMESIZE IFNAMSIZ\n-#endif\n-\n-namespace libtorrent {\n-\n-namespace {\n-\n-#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR\n-\tstruct socket_closer\n+\tstd::vector<ip_interface> const ifs = enum_net_interfaces(ios, ec);\n+\tif (ec)\n \t{\n-\t\tsocket_closer(int s) : m_socket(s) {}\n-\t\tsocket_closer(socket_closer const&) = delete;\n-\t\tsocket_closer(socket_closer &&) = delete;\n-\t\tsocket_closer& operator=(socket_closer const&) = delete;\n-\t\tsocket_closer& operator=(socket_closer &&) = delete;\n-\t\t~socket_closer() { ::close(m_socket); }\n-\tprivate:\n-\t\tint m_socket;\n-\t};\n-#endif\n-\n-#if !defined TORRENT_BUILD_SIMULATOR\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(159)\">../src/enum_net.cpp:268</a></td><td>if we get here, the caller still assumes the error code is reported via errno</td></tr><tr id=\"159\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>if we get here, the caller still assumes the error code\n-is reported via errno</h2><h4>../src/enum_net.cpp:268</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t;\n+\t\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\n \t}\n-#endif\n-\n-#if TORRENT_USE_NETLINK\n-\n-\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n-\t\t, std::function<void(nlmsghdr const*)> on_msg)\n+\tint idx = 0;\n+\tfor (auto const& face : ifs)\n \t{\n-\t\tstd::array<char, 4096> buf;\n-\t\tfor (;;)\n-\t\t{\n-\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n-\t\t\tif (read_len < 0) return -1;\n-\n-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\n-\n-\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n-\t\t\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(160)\">../src/enum_net.cpp:274</a></td><td>if we get here, the caller still assumes the error code is reported via errno</td></tr><tr id=\"160\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>if we get here, the caller still assumes the error code\n-is reported via errno</h2><h4>../src/enum_net.cpp:274</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#if TORRENT_USE_NETLINK\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(145)\">../test/test_dht.cpp:472</a></td><td>check to make sure the \"best\" items are stored</td></tr><tr id=\"145\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>check to make sure the \"best\" items are stored</h2><h4>../test/test_dht.cpp:472</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t, msg_args().target(items[j].target));\n \n-\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n-\t\t, std::function<void(nlmsghdr const*)> on_msg)\n-\t{\n-\t\tstd::array<char, 4096> buf;\n-\t\tfor (;;)\n+\t\tkey_desc_t const desc[] =\n \t\t{\n-\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n-\t\t\tif (read_len < 0) return -1;\n-\n-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\n-\n-\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n-\t\t\t{\n-\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n-\t\t\t\t\treturn -1;\n-\t\t\t\t// this function doesn't handle multiple requests at the same time\n-\t\t\t\t// so report an error if the message does not have the expected seq and pid\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid)\n-</div>\t\t\t\t\treturn -1;\n-\n-\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0;\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\t\t\ton_msg(nl_hdr);\n+\t\tbdecode_node parsed[4];\n+\t\tchar error_string[200];\n \n-\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0;\n-\t\t\t}\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\treturn 0;\n \t}\n \n-\tint nl_dump_request(int const sock, std::uint32_t const seq\n-\t\t, nlmsghdr* const request_msg, std::function<void(nlmsghdr const*)> on_msg)\n-\t{\n-\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;\n-\t\trequest_msg->nlmsg_seq = seq;\n-\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID)\n-\t\t// of the sender, but the kernel ignores this field so it is typically set to\n-\t\t// zero\n-\t\trequest_msg->nlmsg_pid = 0;\n-\n-\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0)\n-\t\t\treturn -1;\n-\n-\t\t// get the socket's port ID so that we can verify it in the response\n-\t\tsockaddr_nl sock_addr;\n-\t\tsocklen_t sock_addr_len = sizeof(sock_addr);\n-\t\tif (::getsockname(sock, reinterpret_cast<sockaddr*>(&sock_addr), &sock_addr_len) < 0)\n-\t\t\treturn -1;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(161)\">../src/ut_metadata.cpp:281</a></td><td>we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer</td></tr><tr id=\"161\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we really need to increment the refcounter on the torrent\n-while this buffer is still in the peer's send buffer</h2><h4>../src/ut_metadata.cpp:281</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (metadata_piece_size)\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(162)\">../src/ip_notifier.cpp:41</a></td><td>simulator support</td></tr><tr id=\"162\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>simulator support</h2><h4>../src/ip_notifier.cpp:41</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"> from this software without specific prior written permission.\n-\n-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#include \"libtorrent/aux_/ip_notifier.hpp\"\n-#include \"libtorrent/assert.hpp\"\n+<div style=\"background: #ffff00\" width=\"100%\">\tTEST_EQUAL(items_num.size(), 4);\n+</div>}\n \n-#if defined TORRENT_BUILD_SIMULATOR\n-<div style=\"background: #ffff00\" width=\"100%\">#elif TORRENT_USE_NETLINK\n-</div>#include \"libtorrent/netlink.hpp\"\n-#include \"libtorrent/socket.hpp\"\n-#include <array>\n-#include <unordered_map>\n-#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY\n-#include <SystemConfiguration/SystemConfiguration.h>\n-#elif defined TORRENT_WINDOWS\n-#include \"libtorrent/aux_/throw.hpp\"\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <iphlpapi.h>\n-#ifdef TORRENT_WINRT\n-#include <netioapi.h>\n-#endif\n-#include <mutex>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-#endif\n+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-#include \"libtorrent/aux_/netlink_utils.hpp\"\n+std::vector<tcp::endpoint> g_got_peers;\n \n-namespace libtorrent { namespace aux {\n+void get_peers_cb(std::vector<tcp::endpoint> const& peers)\n+{\n+\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());\n+}\n \n-namespace {\n+std::vector<dht::item> g_got_items;\n+dht::item g_put_item;\n+int g_put_count;\n \n-#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n-\t!defined TORRENT_BUILD_SIMULATOR\n+void get_mutable_item_cb(dht::item const& i, bool a)\n+{\n+\tif (!a) return;\n+\tif (!i.empty())\n+\t\tg_got_items.push_back(i);\n+}\n \n-// 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+void put_mutable_item_data_cb(dht::item& i)\n+{\n+\tif (!i.empty())\n+\t\tg_got_items.push_back(i);\n \n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(163)\">../src/http_seed_connection.cpp:441</a></td><td>technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases</td></tr><tr id=\"163\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>technically, this isn't supposed to happen, but it seems to\n-sometimes. Some of the accounting is probably wrong in certain\n-cases</h2><h4>../src/http_seed_connection.cpp:441</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(146)\">../test/test_dht.cpp:3223</a></td><td>this won't work because the second node isn't pinged so it wont be added to the routing table</td></tr><tr id=\"146\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this won't work because the second node isn't pinged so it wont\n+be added to the routing table</h2><h4>../test/test_dht.cpp:3223</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tbool ret = verify_message(request, get_item_desc_ro, parsed, error_string);\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n-</div>\t\t\treceived_bytes(payload, 0);\n-\t\t\tincoming_piece_fragment(payload);\n-\t\t\tm_response_left -= payload;\n+\tTEST_CHECK(ret);\n+\tTEST_EQUAL(parsed[3].int_value(), 1);\n \n-\t\t\tif (m_parser.status_code() == 503)\n-\t\t\t{\n-\t\t\t\tif (!m_parser.finished()) return;\n+\t// should have one node now, which is 4.4.4.4:1234\n+\tTEST_EQUAL(std::get<0>(node.size()), 1);\n+\t// and no replacement nodes\n+\tTEST_EQUAL(std::get<1>(node.size()), 0);\n \n-\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str());\n-\t\t\t\tif (retry_time <= 0) retry_time = 60;\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time);\n-#endif\n+\t// now, disable read_only, try again.\n+\tg_sent_packets.clear();\n+\tsett.set_bool(settings_pack::dht_read_only, false);\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+\tsend_dht_request(node, \"get\", source, &response);\n+\t// sender should be added to replacement bucket\n+\tTEST_EQUAL(std::get<1>(node.size()), 1);\n \n+\tg_sent_packets.clear();\n+#if 0\n+<div style=\"background: #ffff00\" width=\"100%\">\ttarget = generate_next();\n+</div>\tnode.get_item(target, get_immutable_item_cb);\n \n-\t\t\t// we only received the header, no data\n-\t\t\tif (recv_buffer.empty()) break;\n+\t// since we have 2 nodes, we should have two packets.\n+\tTEST_EQUAL(g_sent_packets.size(), 2);\n \n-\t\t\tif (recv_buffer.size() < front_request.length) break;\n+\t// both of them shouldn't have a 'ro' key.\n+\tnode_from_entry(g_sent_packets.front().second, request);\n+\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n \n-\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(164)\">../src/session_impl.cpp:615</a></td><td>come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store</td></tr><tr id=\"164\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>come up with some abstraction to do this for gnutls as well\n-load certificates from the windows system certificate store</h2><h4>../src/session_impl.cpp:615</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tpause();\n-\t}\n-#endif\n+\tTEST_CHECK(ret);\n+\tTEST_CHECK(!parsed[3]);\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+\tnode_from_entry(g_sent_packets.back().second, request);\n+\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\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+\tTEST_CHECK(ret);\n+\tTEST_CHECK(!parsed[3]);\n #endif\n-#if defined TORRENT_WINDOWS && defined TORRENT_USE_OPENSSL && !defined TORRENT_WINRT\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tX509_STORE* store = X509_STORE_new();\n-</div>\t\tif (store)\n-\t\t{\n-\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\");\n-\t\t\t// this is best effort\n-\t\t\tif (system_store)\n-\t\t\t{\n-\t\t\t\tCERT_CONTEXT const* ctx = nullptr;\n-\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr)\n-\t\t\t\t{\n-\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded);\n-\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded);\n-\t\t\t\t\t// this is best effort\n-\t\t\t\t\tif (!x509) continue;\n-\t\t\t\t\tX509_STORE_add_cert(store, x509);\n-\t\t\t\t\tX509_free(x509);\n-\t\t\t\t}\n-\t\t\t\tCertFreeCertificateContext(ctx);\n-\t\t\t\tCertCloseStore(system_store, 0);\n-\t\t\t}\n-\t\t}\n+}\n \n-\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle();\n-\t\tSSL_CTX_set_cert_store(ssl_ctx, store);\n-#endif\n-#ifdef __APPLE__\n-\t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec);\n #ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str());\n-\t\tec.clear();\n-#endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(165)\">../src/session_impl.cpp:1484</a></td><td>it would be nice to reserve() these vectors up front</td></tr><tr id=\"165\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to reserve() these vectors up front</h2><h4>../src/session_impl.cpp:1484</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tbandwidth_channel* ch = &p->channel[peer_connection::download_channel];\n-\t\t\tif (use_quota_overhead(ch, amount_down))\n-\t\t\t\tret |= 1 << peer_connection::download_channel;\n-\t\t\tch = &p->channel[peer_connection::upload_channel];\n-\t\t\tif (use_quota_overhead(ch, amount_up))\n-\t\t\t\tret |= 1 << peer_connection::upload_channel;\n-\t\t}\n-\t\treturn ret;\n-\t}\n-\n-\t// session_impl is responsible for deleting 'pack'\n-\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\t\tapply_settings_pack_impl(*pack);\n-\t}\n-\n-\tsettings_pack session_impl::get_settings() const\n-\t{\n-\t\tsettings_pack ret;\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int i = settings_pack::string_type_base;\n-</div>\t\t\ti < settings_pack::max_string_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_str(i, m_settings.get_str(i));\n-\t\t}\n-\t\tfor (int i = settings_pack::int_type_base;\n-\t\t\ti < settings_pack::max_int_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_int(i, m_settings.get_int(i));\n-\t\t}\n-\t\tfor (int i = settings_pack::bool_type_base;\n-\t\t\ti < settings_pack::max_bool_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_bool(i, m_settings.get_bool(i));\n-\t\t}\n-\t\treturn ret;\n-\t}\n-\n-namespace {\n-\ttemplate <typename Pack>\n-\tint get_setting_impl(Pack const& p, int name, int*)\n-\t{ return p.get_int(name); }\n-\n-\ttemplate <typename Pack>\n-\tbool get_setting_impl(Pack const& p, int name, bool*)\n-\t{ return p.get_bool(name); }\n-\n-\ttemplate <typename Pack>\n-\tstd::string get_setting_impl(Pack const& p, int name, std::string*)\n-\t{ return p.get_str(name); }\n-\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(166)\">../src/session_impl.cpp:1998</a></td><td>could 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</td></tr><tr id=\"166\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:1998</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+// these tests rely on logging being enabled\n \n-\tvoid session_impl::on_ip_change(error_code const& ec)\n-\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (!ec)\n-\t\t\tsession_log(\"received ip change from internal ip_notifier\");\n-\t\telse\n-\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str());\n-#endif\n-\t\tif (ec || m_abort || !m_ip_notifier) return;\n-\t\tm_ip_notifier->async_wait([this] (error_code const& e)\n-\t\t\t{ wrap(&session_impl::on_ip_change, e); });\n-\t\treopen_network_sockets({});\n-\t}\n+TORRENT_TEST(invalid_error_msg)\n+{\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(147)\">../test/test_dht.cpp:4081</a></td><td>test obfuscated_get_peers</td></tr><tr id=\"147\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test obfuscated_get_peers</h2><h4>../test/test_dht.cpp:4081</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tTEST_CHECK(sm.has_quota());\n+\t});\n+}\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid interface_to_endpoints(listen_interface_t const& iface\n-</div>\t\t, listen_socket_flags_t flags\n-\t\t, span<ip_interface const> const ifs\n-\t\t, std::vector<listen_endpoint_t>& eps)\n-\t{\n-\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{};\n-\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext;\n+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 \n-\t\t// First, check to see if it's an IP address\n-\t\terror_code err;\n-\t\taddress const adr = make_address(iface.device.c_str(), err);\n-\t\tif (!err)\n+\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) {\n+\t\tTEST_CHECK(sm.has_quota());\n+\t\tfor (int i = 0; i < 10; ++i)\n \t\t{\n-\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags);\n+\t\t\tstd::this_thread::sleep_for(milliseconds(500));\n+\t\t\tTEST_CHECK(sm.has_quota());\n \t\t}\n-\t\telse\n-\t\t{\n-\t\t\tflags |= listen_socket_t::was_expanded;\n-\n-\t\t\t// this is the case where device names a network device. We need to\n-\t\t\t// enumerate all IPs associated with this device\n-\t\t\tfor (auto const& ipface : ifs)\n-\t\t\t{\n-\t\t\t\t// we're looking for a specific interface, and its address\n-\t\t\t\t// (which must be of the same family as the address we're\n-\t\t\t\t// connecting to)\n-\t\t\t\tif (iface.device != ipface.name) continue;\n+\t});\n+}\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(167)\">../src/session_impl.cpp:2306</a></td><td>it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to 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</td></tr><tr id=\"167\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:2306</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t{\n-\t\t\tfor (auto const& s : m_listen_sockets)\n-\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\t// new sockets need to map ports even if the caller did not request\n-\t\t\t// re-mapping\n-\t\t\tfor (auto const& s : new_sockets)\n-\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n-\t\t}\n \n-\t\tupdate_lsd();\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>#else\n+TORRENT_TEST(dht)\n+{\n+\t// dummy dht test\n+\tTEST_CHECK(true);\n+}\n \n-#if TORRENT_USE_I2P\n-\t\topen_new_incoming_i2p_connection();\n #endif\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(148)\">../test/test_file_storage.cpp:1208</a></td><td>test file attributes</td></tr><tr id=\"148\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test file attributes</h2><h4>../test/test_file_storage.cpp:1208</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(149)\">../test/test_file_storage.cpp:1209</a></td><td>test symlinks</td></tr><tr id=\"149\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test symlinks</h2><h4>../test/test_file_storage.cpp:1209</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(150)\">../test/test_timestamp_history.cpp:54</a></td><td>test the case where we have > 120 samples (and have the base delay actually be updated)</td></tr><tr id=\"150\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test the case where we have > 120 samples (and have the base delay actually be updated)</h2><h4>../test/test_timestamp_history.cpp:54</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(151)\">../test/test_timestamp_history.cpp:55</a></td><td>test the case where a sample is lower than the history entry but not lower than the base</td></tr><tr id=\"151\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>test the case where a sample is lower than the history entry but not lower than the base</h2><h4>../test/test_timestamp_history.cpp:55</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/aux_/timestamp_history.hpp\"\n \n-\t\t// trackers that were not reachable, may have become reachable now.\n-\t\t// so clear the \"disabled\" flags to let them be tried one more time\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (auto& t : m_torrents)\n-</div>\t\t\tt->enable_all_trackers();\n-\t}\n-\n-\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options)\n-\t{\n-\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports));\n-\t}\n-\n-\tnamespace {\n-\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType>\n-\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep\n-\t\t\t, port_mapping_t& map_handle, std::string const& device)\n-\t\t{\n-\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle);\n-\t\t\tmap_handle = port_mapping_t{-1};\n-\n-\t\t\taddress const addr = ep.address();\n-\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them\n-\t\t\t// based on the scope of the local address\n-\t\t\tif (addr.is_v6() && is_local(addr))\n-\t\t\t\treturn;\n-\n-\t\t\t// only update this mapping if we actually have a socket listening\n-\t\t\tif (ep != EndpointType())\n-\t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device);\n-\t\t}\n-\t}\n-\n-\tvoid session_impl::remap_ports(remap_port_mask_t const mask\n-\t\t, listen_socket_t& s)\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(168)\">../src/session_impl.cpp:2866</a></td><td>this size need to be capped</td></tr><tr id=\"168\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this size need to be capped</h2><h4>../src/session_impl.cpp:2866</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t// handshaking\n-\t\t\t\treturn socket_type(ssl_stream<tcp::socket>(tcp::socket(std::move(s)), m_peer_ssl_ctx));\n-\t\t\t}\n-\t\t\telse\n-#endif\n-\t\t\t{\n-\t\t\t\treturn socket_type(tcp::socket(std::move(s)));\n-\t\t\t}\n-\t\t}();\n+TORRENT_TEST(timestamp_history)\n+{\n+\tusing namespace lt;\n \n-#ifdef TORRENT_SSL_PEERS\n-\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c));\n-#endif\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-#ifdef TORRENT_SSL_PEERS\n-\t\tif (ssl == transport::ssl)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(is_ssl(c));\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-\t\t\t// save the socket so we can cancel the handshake\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first;\n+<div style=\"background: #ffff00\" width=\"100%\">}\n </div>\n-\t\t\tauto sock = iter->get();\n-\t\t\t// for SSL connections, incoming_connection() is called\n-\t\t\t// after the handshake is done\n-\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n-\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake(\n-\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n-\t\t}\n-\t\telse\n-#endif\n-\t\t{\n-\t\t\tincoming_connection(std::move(c));\n-\t\t}\n-\t}\n-\n-#ifdef TORRENT_SSL_PEERS\n-\n-\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n-\t{\n-\t\tTORRENT_ASSERT(is_ssl(s));\n-\n-\t\t// save the socket so we can cancel the handshake\n-\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(169)\">../src/session_impl.cpp:2891</a></td><td>this size need to be capped</td></tr><tr id=\"169\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this size need to be capped</h2><h4>../src/session_impl.cpp:2891</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t// after the handshake is done\n-\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n-\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake(\n-\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n-\t\t}\n-\t\telse\n-#endif\n-\t\t{\n-\t\t\tincoming_connection(std::move(c));\n-\t\t}\n-\t}\n-\n-#ifdef TORRENT_SSL_PEERS\n-\n-\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n-\t{\n-\t\tTORRENT_ASSERT(is_ssl(s));\n-\n-\t\t// save the socket so we can cancel the handshake\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first;\n-</div>\t\tauto sock = iter->get();\n-\n-\t\t// for SSL connections, incoming_connection() is called\n-\t\t// after the handshake is done\n-\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n-\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake(\n-\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n-\t}\n-\n-\t// to test SSL connections, one can use this openssl command template:\n-\t//\n-\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem\n-\t// -CAfile <torrent-cert>.pem -debug -connect 127.0.0.1:4433 -tls1\n-\t// -servername <hex-encoded-info-hash>\n-\n-\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\");\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(152)\">../test/test_transfer.cpp:173</a></td><td>these settings_pack tests belong in their own test</td></tr><tr id=\"152\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>these settings_pack tests belong in their own test</h2><h4>../test/test_transfer.cpp:173</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tauto iter = m_incoming_sockets.find(sock);\n+\t// make sure we announce to both http and udp trackers\n+\tpack.set_bool(settings_pack::prefer_udp_trackers, false);\n+\tpack.set_bool(settings_pack::enable_outgoing_utp, false);\n+\tpack.set_bool(settings_pack::enable_incoming_utp, false);\n+\tpack.set_bool(settings_pack::enable_lsd, false);\n+\tpack.set_bool(settings_pack::enable_natpmp, false);\n+\tpack.set_bool(settings_pack::enable_upnp, false);\n+\tpack.set_bool(settings_pack::enable_dht, false);\n \n-\t\t// this happens if the SSL connection is aborted because we're shutting\n-\t\t// down\n-\t\tif (iter == m_incoming_sockets.end()) return;\n+\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled);\n+\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled);\n \n-\t\tsocket_type s(std::move(**iter));\n-\t\tTORRENT_ASSERT(is_ssl(s));\n-\t\tm_incoming_sockets.erase(iter);\n+\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n \n-\t\terror_code e;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(170)\">../src/session_impl.cpp:3590</a></td><td>have a separate list for these connections, instead of having to loop through all of them</td></tr><tr id=\"170\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>have a separate list for these connections, instead of having to loop through all of them</h2><h4>../src/session_impl.cpp:3590</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\tpack.set_int(settings_pack::unchoke_slots_limit, 0);\n+</div>\tses1.apply_settings(pack);\n+\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0);\n \n-\t\t// --------------------------------------------------------------\n-\t\t// check for incoming connections that might have timed out\n-\t\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-\t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n-\t\t{\n-\t\t\tpeer_connection* p = (*i).get();\n-\t\t\t++i;\n-\t\t\t// ignore connections that already have a torrent, since they\n-\t\t\t// are ticked through the torrents' second_tick\n-\t\t\tif (!p->associated_torrent().expired()) continue;\n+\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint timeout = m_settings.get_int(settings_pack::handshake_timeout);\n-</div>#if TORRENT_USE_I2P\n-\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1;\n-#endif\n-\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout))\n-\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent);\n-\t\t}\n+\tses2.apply_settings(pack);\n \n-\t\t// --------------------------------------------------------------\n-\t\t// second_tick every torrent (that wants it)\n-\t\t// --------------------------------------------------------------\n+\ttorrent_handle tor1;\n+\ttorrent_handle tor2;\n \n-#if TORRENT_DEBUG_STREAMING > 0\n-\t\tstd::printf(\"\\033[2J\\033[0;0H\");\n-#endif\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-\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick];\n-\t\tfor (int i = 0; i < int(want_tick.size()); ++i)\n-\t\t{\n-\t\t\ttorrent& t = *want_tick[i];\n-\t\t\tTORRENT_ASSERT(t.want_tick());\n-\t\t\tTORRENT_ASSERT(!t.is_aborted());\n+\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n \n-\t\t\tt.second_tick(tick_interval_ms);\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-\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(171)\">../src/session_impl.cpp:3623</a></td><td>this should apply to all bandwidth channels</td></tr><tr id=\"171\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should apply to all bandwidth channels</h2><h4>../src/session_impl.cpp:3623</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#if TORRENT_DEBUG_STREAMING > 0\n-\t\tstd::printf(\"\\033[2J\\033[0;0H\");\n-#endif\n+\twait_for_listen(ses1, \"ses1\");\n+\twait_for_listen(ses2, \"ses2\");\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(153)\">../src/storage_utils.cpp:230</a></td><td>ideally, 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.</td></tr><tr id=\"153\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/storage_utils.cpp:230</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// later\n+\t\taux::vector<bool, file_index_t> copied_files(std::size_t(f.num_files()), false);\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// 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\ttorrent& t = *want_tick[i];\n-\t\t\tTORRENT_ASSERT(t.want_tick());\n-\t\t\tTORRENT_ASSERT(!t.is_aborted());\n-\n-\t\t\tt.second_tick(tick_interval_ms);\n-\n-\t\t\t// if the call to second_tick caused the torrent\n-\t\t\t// to no longer want to be ticked (i.e. it was\n-\t\t\t// removed from the list) we need to back up the counter\n-\t\t\t// to not miss the torrent after it\n-\t\t\tif (!t.want_tick()) --i;\n-\t\t}\n+\t\t\t// files moved out to absolute paths are not moved\n+\t\t\tif (f.file_absolute_path(i)) continue;\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (m_settings.get_bool(settings_pack::rate_limit_ip_overhead))\n-</div>\t\t{\n-\t\t\tint const up_limit = upload_rate_limit(m_global_class);\n-\t\t\tint const down_limit = download_rate_limit(m_global_class);\n+\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\tif (down_limit > 0\n-\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit\n-\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+\t\t\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\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n-\t\t\t\t\t, performance_alert::download_limit_too_low);\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\tif (up_limit > 0\n-\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit\n-\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tmove_file(old_path, new_path, ec);\n+</div>\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\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n-\t\t\t\t\t, performance_alert::upload_limit_too_low);\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-\t\t}\n \n-#if TORRENT_ABI_VERSION == 1\n-\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate);\n-#endif\n-\n-\t\tm_stat.second_tick(tick_interval_ms);\n-\n-\t\t// --------------------------------------------------------------\n-\t\t// scrape paused torrents that are auto managed\n-\t\t// (unless the session is paused)\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(172)\">../src/session_impl.cpp:4314</a></td><td>use 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</td></tr><tr id=\"172\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:4314</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// boost, which are done immediately on a tracker response. These\n-\t\t// connections needs to be deducted from the regular connection attempt\n-\t\t// quota for this tick\n-\t\tif (m_boost_connections > 0)\n-\t\t{\n-\t\t\tif (m_boost_connections > max_connections)\n-\t\t\t{\n-\t\t\t\tm_boost_connections -= max_connections;\n-\t\t\t\tmax_connections = 0;\n-\t\t\t}\n-\t\t\telse\n+\t\t\tif (ec)\n \t\t\t{\n-\t\t\t\tmax_connections -= m_boost_connections;\n-\t\t\t\tm_boost_connections = 0;\n+\t\t\t\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\t// zero connections speeds are allowed, we just won't make any connections\n-\t\tif (max_connections <= 0) return;\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tint const limit = std::min(m_settings.get_int(settings_pack::connections_limit)\n-</div>\t\t\t- num_connections(), std::numeric_limits<int>::max() - 1);\n-\n-\t\t// this logic is here to smooth out the number of new connection\n-\t\t// attempts over time, to prevent connecting a large number of\n-\t\t// sockets, wait 10 seconds, and then try again\n-\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2)\n-\t\t\tmax_connections = (limit + 1) / 2;\n-\n-\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download];\n-\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished];\n-\n-\t\t// if no torrent want any peers, just return\n-\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return;\n-\n-\t\t// if we don't have any connection attempt quota, return\n-\t\tif (max_connections <= 0) return;\n-\n-\t\tint steps_since_last_connect = 0;\n-\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size());\n-\t\tfor (;;)\n+\t\tif (!ec && move_partfile)\n \t\t{\n-\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size()))\n-\t\t\t\tm_next_downloading_connect_torrent = 0;\n-\n-\t\t\tif (m_next_finished_connect_torrent >= int(want_peers_finished.size()))\n-\t\t\t\tm_next_finished_connect_torrent = 0;\n+\t\t\terror_code e;\n+\t\t\tmove_partfile(new_save_path, e);\n+\t\t\tif (e)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(154)\">../src/storage_utils.cpp:538</a></td><td>it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic</td></tr><tr id=\"154\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:538</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t\tcontinue;\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(173)\">../src/session_impl.cpp:4459</a></td><td>post a message to have this happen immediately instead of waiting for the next tick</td></tr><tr id=\"173\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>post a message to have this happen\n-immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp:4459</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\tcontinue;\n-\t\t\t}\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\tif (!p->is_peer_interested()\n-\t\t\t\t|| p->is_disconnecting()\n-\t\t\t\t|| p->is_connecting())\n-\t\t\t{\n-\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n-\t\t\t\t// already, make sure to choke it.\n-\t\t\t\tif (p->is_choked())\n+\t\t\t\tif (size < fs.file_size(file_index))\n \t\t\t\t{\n-\t\t\t\t\tp->reset_choke_counters();\n-\t\t\t\t\tcontinue;\n+\t\t\t\t\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\tif (pi && pi->optimistically_unchoked)\n-\t\t\t\t{\n-\t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1);\n-\t\t\t\t\tpi->optimistically_unchoked = false;\n-\t\t\t\t\t// force a new optimistic unchoke\n-\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0;\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\t}\n-</div>\t\t\t\tt->choke_peer(*p);\n-\t\t\t\tp->reset_choke_counters();\n-\t\t\t\tcontinue;\n \t\t\t}\n-\n-\t\t\tpeers.push_back(p.get());\n-\t\t}\n-\n-\t\tint const allowed_upload_slots = unchoke_sort(peers\n-\t\t\t, unchoke_interval, m_settings);\n-\n-\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker)\n-\t\t{\n-\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit);\n-\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots);\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots\n-\t\t\t\t, allowed_upload_slots);\n-\t\t}\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log())\n-\t\t{\n-\t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \"\n-\t\t\t\t\"eligible-peers: %d\"\n-\t\t\t\t\" allowed-slots: %d ]\"\n-\t\t\t\t, int(m_connections.size())\n-\t\t\t\t, int(peers.size())\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(174)\">../src/session_impl.cpp:4786</a></td><td>it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, 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.</td></tr><tr id=\"174\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/session_impl.cpp:4786</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tt->status(&st, flags);\n-\t\t}\n-\t}\n-\n-\tvoid session_impl::post_torrent_updates(status_flags_t const flags)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tstd::vector<torrent*>& state_updates\n-\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates];\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tm_posting_torrent_updates = true;\n-#endif\n-\n-\t\tstd::vector<torrent_status> status;\n-\t\tstatus.reserve(state_updates.size());\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (auto& t : state_updates)\n-</div>\t\t{\n-\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list());\n-\t\t\tstatus.emplace_back();\n-\t\t\t// querying accurate download counters may require\n-\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another\n-\t\t\t// one will lead to calling state_updated(), which screws with\n-\t\t\t// this list while we're working on it, and break things\n-\t\t\tt->status(&status.back(), flags);\n-\t\t\tt->clear_in_state_update();\n-\t\t}\n-\t\tstate_updates.clear();\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tm_posting_torrent_updates = false;\n-#endif\n-\n-\t\tm_alerts.emplace_alert<state_update_alert>(std::move(status));\n-\t}\n-\n-\tvoid session_impl::post_session_stats()\n-\t{\n-\t\tif (!m_posted_stats_header)\n-\t\t{\n-\t\t\tm_posted_stats_header = true;\n-\t\t\tm_alerts.emplace_alert<session_stats_header_alert>();\n-\t\t}\n-\t\tm_disk_thread->update_stats_counters(m_stats_counters);\n-\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tif (m_dht)\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(175)\">../src/session_impl.cpp:5161</a></td><td>factor out this logic into a separate function for unit testing</td></tr><tr id=\"175\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out this logic into a separate function for unit\n-testing</h2><h4>../src/session_impl.cpp:5161</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tif (m_settings.get_int(settings_pack::outgoing_port) > 0)\n-\t\t{\n-#ifdef TORRENT_WINDOWS\n-\t\t\ts.set_option(exclusive_address_use(true), ec);\n-#else\n-\t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec);\n-#endif\n-\t\t\t// ignore errors because the underlying socket may not\n-\t\t\t// be opened yet. This happens when we're routing through\n-\t\t\t// a proxy. In that case, we don't yet know the address of\n-\t\t\t// the proxy server, and more importantly, we don't know\n-\t\t\t// the address family of its address. This means we can't\n-\t\t\t// open the socket yet. The socks abstraction layer defers\n-\t\t\t// opening it.\n-\t\t\tec.clear();\n-\t\t\tbind_ep.port(std::uint16_t(next_port()));\n+\t\t\treturn true;\n \t\t}\n \n-\t\tif (is_utp(s))\n-\t\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\t\tutp_socket_impl* impl = nullptr;\n-\t\t\ttransport ssl = transport::plaintext;\n-#if TORRENT_USE_SSL\n-\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr)\n-\t\t\t{\n-\t\t\t\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl();\n-\t\t\t\tssl = transport::ssl;\n-\t\t\t}\n-\t\t\telse\n-#endif\n-\t\t\t\timpl = boost::get<utp_stream>(s).get_impl();\n-\n-\t\t\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways;\n-\t\t\tstd::shared_ptr<listen_socket_t> match;\n-\t\t\tfor (auto& ls : m_listen_sockets)\n-\t\t\t{\n-\t\t\t\t// this is almost, but not quite, like can_route()\n-\t\t\t\tif (!(ls->flags & listen_socket_t::proxy)\n-\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4())\n-\t\t\t\t\tcontinue;\n-\t\t\t\tif (ls->ssl != ssl) continue;\n-\t\t\t\tif (!(ls->flags & listen_socket_t::local_network))\n-\t\t\t\t\twith_gateways.push_back(ls);\n-\n-\t\t\t\tif (ls->flags & listen_socket_t::proxy\n-\t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask))\n-\t\t\t\t{\n-\t\t\t\t\t// is this better than the previous match?\n-\t\t\t\t\tmatch = ls;\n-\t\t\t\t}\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(176)\">../src/session_impl.cpp:5880</a></td><td>refactor, move the storage to dht_tracker</td></tr><tr id=\"176\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>refactor, move the storage to dht_tracker</h2><h4>../src/session_impl.cpp:5880</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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+#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+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (added_files) return false;\n+</div>#endif\n \n-\t\tif (m_abort)\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-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tsession_log(\"not starting DHT, aborting\");\n-#endif\n-\t\t\treturn;\n-\t\t}\n+\t\t\tif (rd.have_pieces.get_bit(i) == false) continue;\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\"\n-\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups);\n-#endif\n+\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1);\n+\t\t\tTORRENT_ASSERT(!f.empty());\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tm_dht_storage = m_dht_storage_constructor(m_settings);\n-</div>\t\tm_dht = std::make_shared<dht::dht_tracker>(\n-\t\t\tstatic_cast<dht::dht_observer*>(this)\n-\t\t\t, m_io_context\n-\t\t\t, [this](aux::listen_socket_handle const& sock\n-\t\t\t\t, udp::endpoint const& ep\n-\t\t\t\t, span<char const> p\n-\t\t\t\t, error_code& ec\n-\t\t\t\t, udp_send_flags_t const flags)\n-\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); }\n-\t\t\t, m_settings\n-\t\t\t, m_stats_counters\n-\t\t\t, *m_dht_storage\n-\t\t\t, std::move(m_dht_state));\n+\t\t\tfile_index_t const file_index = f[0].file_index;\n \n-\t\tfor (auto& s : m_listen_sockets)\n-\t\t{\n-\t\t\tif (s->ssl != transport::ssl\n-\t\t\t\t&& !(s->flags & listen_socket_t::local_network))\n-\t\t\t{\n-\t\t\t\tm_dht->new_socket(s);\n-\t\t\t}\n-\t\t}\n+\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\tfor (auto const& n : m_dht_router_nodes)\n-\t\t{\n-\t\t\tm_dht->add_router_node(n);\n-\t\t}\n+\t\t\tif (fs.pad_file_at(file_index)) continue;\n \n-\t\tfor (auto const& n : m_dht_nodes)\n-\t\t{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(177)\">../src/session_impl.cpp:6267</a></td><td>asserts that no outstanding async operations are still in flight</td></tr><tr id=\"177\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>asserts that no outstanding async operations are still in flight</h2><h4>../src/session_impl.cpp:6267</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(155)\">../src/random.cpp:141</a></td><td>improve calling RAND_bytes multiple times, using fallback for now</td></tr><tr id=\"155\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>improve calling RAND_bytes multiple times, using fallback for now</h2><h4>../src/random.cpp:141</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#else\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n #endif\n-\n-\tbool session_impl::is_listening() const\n-\t{\n-\t\treturn !m_listen_sockets.empty();\n-\t}\n-\n-\tsession_impl::~session_impl()\n-\t{\n-\t\t// since we're destructing the session, no more alerts will make it out to\n-\t\t// the user. So stop posting them now\n-\t\tm_alerts.set_alert_mask({});\n-\t\tm_alerts.set_notify_function({});\n-\n-\t\t// this is not allowed to be the network thread!\n-//\t\tTORRENT_ASSERT(is_not_thread());\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\t// this can happen if we end the io_context run loop with an exception\n-\t\tm_connections.clear();\n-\t\tfor (auto& t : m_torrents)\n-\t\t{\n-\t\t\tt->panic();\n-\t\t\tt->abort();\n \t\t}\n-\t\tm_torrents.clear();\n \n-\t\t// this has probably been called already, but in case of sudden\n-\t\t// termination through an exception, it may not have been done\n-\t\tabort_stage2();\n-\n-#if defined TORRENT_ASIO_DEBUGGING\n-\t\tFILE* f = fopen(\"wakeups.log\", \"w+\");\n-\t\tif (f != nullptr)\n+\t\tvoid crypto_random_bytes(span<char> buffer)\n \t\t{\n-\t\t\ttime_point m = min_time();\n-\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp;\n-\t\t\ttime_point prev = m;\n-\t\t\tstd::uint64_t prev_csw = 0;\n-\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches;\n-\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\");\n-\t\t\tfor (wakeup_t const& w : _wakeups)\n-\t\t\t{\n-\t\t\t\tbool const idle_wakeup = w.context_switches > prev_csw;\n-\t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\"\n-\t\t\t\t\t, total_microseconds(w.timestamp - m)\n-\t\t\t\t\t, total_microseconds(w.timestamp - prev)\n-\t\t\t\t\t, w.context_switches\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(178)\">../src/part_file.cpp:300</a></td><td>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 from disk, but it may be overwritten soon, it's probably not that big of a deal</td></tr><tr id=\"178\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/part_file.cpp:300</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+#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 <div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(179)\">../src/part_file.cpp:411</a></td><td>instead of rebuilding the whole file header and flushing it, update the slot entries as we go</td></tr><tr id=\"179\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of rebuilding the whole file header\n-and flushing it, update the slot entries as we go</h2><h4>../src/part_file.cpp:411</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\tvoid part_file::flush_metadata_impl(error_code& ec)\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(180)\">../src/utp_stream.cpp:1467</a></td><td>this loop is not very efficient. It could be fixed by having a separate list of sequence numbers that need resending</td></tr><tr id=\"180\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this loop is not very efficient. It could be fixed by having\n-a separate list of sequence numbers that need resending</h2><h4>../src/utp_stream.cpp:1467</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-<div style=\"background: #ffff00\" width=\"100%\">\tfor (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK)\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(181)\">../src/torrent_handle.cpp:589</a></td><td>support moving files into this call</td></tr><tr id=\"181\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support moving files into this call</h2><h4>../src/torrent_handle.cpp:589</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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 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-\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-\n-<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n-</div>\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-\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-\t}\n-\n-#if TORRENT_ABI_VERSION == 1\n-\n-// ============ start deprecation ===============\n-\n-\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n-\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-\tstd::vector<int> torrent_handle::file_priorities() const\n-\t{\n-\t\taux::vector<download_priority_t, file_index_t> prio;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(182)\">../src/settings_pack.cpp:305</a></td><td>deprecate this</td></tr><tr id=\"182\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>deprecate this</h2><h4>../src/settings_pack.cpp:305</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tSET(max_rejects, 50, nullptr),\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(183)\">../src/settings_pack.cpp:590</a></td><td>it would be nice to reserve() these vectors up front</td></tr><tr id=\"183\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to reserve() these vectors up front</h2><h4>../src/settings_pack.cpp:590</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(184)\">../src/udp_tracker_connection.cpp:633</a></td><td>why is this a linked list?</td></tr><tr id=\"184\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>why is this a linked list?</h2><h4>../src/udp_tracker_connection.cpp:633</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::list<address> ip_list;\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(185)\">../src/magnet_uri.cpp:439</a></td><td>what's the right number here?</td></tr><tr id=\"185\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>what's the right number here?</h2><h4>../src/magnet_uri.cpp:439</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\t\tconstexpr int max_index = 10000; // can't risk out of memory\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(186)\">../src/hash_picker.cpp:309</a></td><td>use structured bindings in C++17</td></tr><tr id=\"186\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured bindings in C++17</h2><h4>../src/hash_picker.cpp:309</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\taux::merkle_tree::set_block_result result;\n-</div>\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 hash_picker::hashes_rejected(hash_request const& req)\n-\t{\n-\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n-\n-\t\tfor (int i = req.index; i < req.index + req.count; i += 512)\n-\t\t{\n-\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time();\n-\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests;\n-\t\t}\n+</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(187)\">../src/torrent_peer.cpp:192</a></td><td>how do we deal with our external address changing?</td></tr><tr id=\"187\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>how do we deal with our external address changing?</h2><h4>../src/torrent_peer.cpp:192</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// connections. If it fails, we'll\n-\t\t// retry with encryption\n-\t\t, pe_support(false)\n+#if TORRENT_BROKEN_RANDOM_DEVICE\n+\t\t\t// even pseudo random numbers rely on being able to seed the random\n+\t\t\t// generator\n+#error \"no entropy source available\"\n+#else\n+#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#else\n+#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\"\n #endif\n-\t\t, is_v6_addr(false)\n-#if TORRENT_USE_I2P\n-\t\t, is_i2p_addr(false)\n #endif\n-\t\t, on_parole(false)\n-\t\t, banned(false)\n-\t\t, supports_utp(true) // assume peers support utp\n-\t\t, confirmed_supports_utp(false)\n-\t\t, supports_holepunch(false)\n-\t\t, web_seed(false)\n-\t\t, protocol_v2(false)\n-\t{}\n \n-\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (peer_rank == 0)\n-</div>\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-#ifndef TORRENT_DISABLE_LOGGING\n-\tstd::string torrent_peer::to_string() const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-#if TORRENT_USE_I2P\n-\t\tif (is_i2p_addr) return dest().to_string();\n-#endif // TORRENT_USE_I2P\n-\t\treturn address().to_string();\n-\t}\n #endif\n-\n-\tstd::int64_t torrent_peer::total_download() const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-\t\tif (connection != nullptr)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n-\t\t\treturn connection->statistics().total_payload_download();\n \t\t}\n-\t\telse\n-\t\t{\n-\t\t\treturn std::int64_t(prev_amount_download) << 10;\n-\t\t}\n-\t}\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(188)\">../src/disabled_disk_io.cpp:106</a></td><td>it would be nice to return a valid hash of zeroes here</td></tr><tr id=\"188\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to return a valid hash of zeroes here</h2><h4>../src/disabled_disk_io.cpp:106</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(189)\">../src/alert.cpp:404</a></td><td>move this field into tracker_alert</td></tr><tr id=\"189\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this field into tracker_alert</h2><h4>../src/alert.cpp:404</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(156)\">../src/alert.cpp:404</a></td><td>move this field into tracker_alert</td></tr><tr id=\"156\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this field into tracker_alert</h2><h4>../src/alert.cpp:404</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7500,15 +5822,15 @@\n \n \ttracker_warning_alert::tracker_warning_alert(aux::stack_allocator& alloc\n \t\t, torrent_handle const& h, tcp::endpoint const& ep\n \t\t, string_view u, protocol_version v, string_view m)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, m_msg_idx(alloc.copy_string(m))\n #if TORRENT_ABI_VERSION == 1\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(190)\">../src/alert.cpp:438</a></td><td>move this into tracker_alert</td></tr><tr id=\"190\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:438</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\treturn {};\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(157)\">../src/alert.cpp:438</a></td><td>move this into tracker_alert</td></tr><tr id=\"157\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:438</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7545,15 +5867,15 @@\n \n \tscrape_reply_alert::scrape_reply_alert(aux::stack_allocator& alloc\n \t\t, torrent_handle const& h, tcp::endpoint const& ep\n \t\t, int incomp, int comp, string_view u, protocol_version const v)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, incomplete(incomp)\n \t\t, complete(comp)\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(191)\">../src/alert.cpp:464</a></td><td>move this into tracker_alert</td></tr><tr id=\"191\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:464</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tchar const* tracker_warning_alert::warning_message() const\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(158)\">../src/alert.cpp:464</a></td><td>move this into tracker_alert</td></tr><tr id=\"158\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:464</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7593,15 +5915,15 @@\n \t\t, string_view u, protocol_version const v, error_code const& e)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, error(e)\n \t\t, m_msg_idx()\n #if TORRENT_ABI_VERSION == 1\n \t\t, msg(convert_from_native(e.message()))\n #endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(192)\">../src/alert.cpp:493</a></td><td>move this into tracker_alert</td></tr><tr id=\"192\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:493</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\treturn {};\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(159)\">../src/alert.cpp:493</a></td><td>move this into tracker_alert</td></tr><tr id=\"159\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this into tracker_alert</h2><h4>../src/alert.cpp:493</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7644,15 +5966,15 @@\n \tstd::string scrape_failed_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n #else\n \t\treturn tracker_alert::message() + \" scrape failed: \" + error_message();\n #endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(193)\">../src/alert.cpp:532</a></td><td>move this field into tracker_alert</td></tr><tr id=\"193\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this field into tracker_alert</h2><h4>../src/alert.cpp:532</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tchar const* scrape_failed_alert::error_message() const\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(160)\">../src/alert.cpp:532</a></td><td>move this field into tracker_alert</td></tr><tr id=\"160\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this field into tracker_alert</h2><h4>../src/alert.cpp:532</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7695,15 +6017,15 @@\n \t{}\n \n \tstd::string dht_reply_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n #else\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(194)\">../src/alert.cpp:576</a></td><td>move this to tracker_alert</td></tr><tr id=\"194\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this to tracker_alert</h2><h4>../src/alert.cpp:576</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t, num_peers(np)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(161)\">../src/alert.cpp:576</a></td><td>move this to tracker_alert</td></tr><tr id=\"161\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this to tracker_alert</h2><h4>../src/alert.cpp:576</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -7746,632 +6068,196 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(195)\">../src/random.cpp:141</a></td><td>improve calling RAND_bytes multiple times, using fallback for now</td></tr><tr id=\"195\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>improve calling RAND_bytes multiple times, using fallback for now</h2><h4>../src/random.cpp:141</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(162)\">../src/enum_net.cpp:144</a></td><td>in C++17, use __has_include for this. Other operating systems are likely to require this as well</td></tr><tr id=\"162\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17, use __has_include for this. Other operating systems are\n+likely to require this as well</h2><h4>../src/enum_net.cpp:144</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include <arpa/inet.h>\n+#include <cstring>\n+#include <cstdlib>\n+#include <unistd.h>\n+#include <sys/types.h>\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+#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n+#define IFA_F_DADFAILED 8\n #endif\n \n #endif\n-\t\t}\n-}\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(196)\">../src/storage_utils.cpp:230</a></td><td>ideally, 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.</td></tr><tr id=\"196\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/storage_utils.cpp:230</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tmove_file(old_path, new_path, ec);\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(197)\">../src/storage_utils.cpp:538</a></td><td>it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic</td></tr><tr id=\"197\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/storage_utils.cpp:538</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+#if TORRENT_USE_IFADDRS\n+#include <ifaddrs.h>\n+#include <net/if.h>\n+#include <sys/ioctl.h>\n+#endif\n \n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\t// always trigger a full recheck when we pull in files from other\n-\t\t// torrents, via hard links\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (added_files) return false;\n+#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL\n+#ifdef TORRENT_BEOS\n+<div style=\"background: #ffff00\" width=\"100%\">#include <sys/sockio.h>\n </div>#endif\n+// capture this here where warnings are disabled (the macro generates warnings)\n+const unsigned long siocgifmtu = SIOCGIFMTU;\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(198)\">../src/peer_connection.cpp:1105</a></td><td>this should be the global download rate</td></tr><tr id=\"198\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be the global download rate</h2><h4>../src/peer_connection.cpp:1105</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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+#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n+#define IF_NAMESIZE IFNAMSIZ\n+#endif\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n-</div>\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+namespace libtorrent {\n \n-\t\t// avoid division by zero\n-\t\tif (rate < 50) rate = 50;\n+namespace {\n \n-\t\t// average of current rate and peak\n-//\t\trate = (rate + m_download_rate_peak) / 2;\n+#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR\n+\tstruct socket_closer\n+\t{\n+\t\tsocket_closer(int s) : m_socket(s) {}\n+\t\tsocket_closer(socket_closer const&) = delete;\n+\t\tsocket_closer(socket_closer &&) = delete;\n+\t\tsocket_closer& operator=(socket_closer const&) = delete;\n+\t\tsocket_closer& operator=(socket_closer &&) = delete;\n+\t\t~socket_closer() { ::close(m_socket); }\n+\tprivate:\n+\t\tint m_socket;\n+\t};\n+#endif\n \n-\t\treturn milliseconds((m_outstanding_bytes + extra_bytes\n-\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\n+#if !defined TORRENT_BUILD_SIMULATOR\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(163)\">../src/enum_net.cpp:268</a></td><td>if we get here, the caller still assumes the error code is reported via errno</td></tr><tr id=\"163\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>if we get here, the caller still assumes the error code\n+is reported via errno</h2><h4>../src/enum_net.cpp:268</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t;\n \t}\n+#endif\n \n-\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tm_statistics.add_stat(downloaded, uploaded);\n-\t}\n+#if TORRENT_USE_NETLINK\n \n-\tsha1_hash peer_connection::associated_info_hash() const\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::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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(199)\">../src/peer_connection.cpp:3536</a></td><td>sort the allowed fast set in priority order</td></tr><tr id=\"199\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:3536</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-\t\t// if the peer has the piece and we want\n-\t\t// to download it, request it\n-\t\tif (index < m_have_piece.end_index()\n-\t\t\t&& m_have_piece[index]\n-\t\t\t&& !t->have_piece(index)\n-\t\t\t&& t->valid_metadata()\n-\t\t\t&& t->has_picker()\n-\t\t\t&& t->picker().piece_priority(index) > dont_download)\n+\t\tstd::array<char, 4096> buf;\n+\t\tfor (;;)\n \t\t{\n-\t\t\tt->peer_is_interesting(*this);\n-\t\t}\n-\t}\n-\n-\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\treturn m_allowed_fast;\n-</div>\t}\n+\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n+\t\t\tif (read_len < 0) return -1;\n \n-\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+\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n+\t\t\tint len = read_len;\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+\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n+\t\t\t{\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(164)\">../src/enum_net.cpp:274</a></td><td>if we get here, the caller still assumes the error code is reported via errno</td></tr><tr id=\"164\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>if we get here, the caller still assumes the error code\n+is reported via errno</h2><h4>../src/enum_net.cpp:274</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#if TORRENT_USE_NETLINK\n \n-\tbool peer_connection::make_time_critical(piece_block const& block)\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\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(200)\">../src/performance_counters.cpp:40</a></td><td>move stats_counter_t out of counters</td></tr><tr id=\"200\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move stats_counter_t out of counters</h2><h4>../src/performance_counters.cpp:40</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(201)\">../src/performance_counters.cpp:41</a></td><td>should bittorrent keep-alive messages have a counter too?</td></tr><tr id=\"201\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should bittorrent keep-alive messages have a counter too?</h2><h4>../src/performance_counters.cpp:41</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(202)\">../src/performance_counters.cpp:42</a></td><td>It would be nice if this could be an internal type. default_disk_constructor depends on it now</td></tr><tr id=\"202\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>It would be nice if this could be an internal type. default_disk_constructor depends on it now</h2><h4>../src/performance_counters.cpp:42</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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+\t\tstd::array<char, 4096> buf;\n+\t\tfor (;;)\n+\t\t{\n+\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n+\t\t\tif (read_len < 0) return -1;\n \n-#include \"libtorrent/performance_counters.hpp\"\n-#include \"libtorrent/assert.hpp\"\n-#include <cstring> // for memset\n+\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n+\t\t\tint len = read_len;\n \n-namespace libtorrent {\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid)\n+</div>\t\t\t\t\treturn -1;\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n-</div>\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+\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0;\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+\t\t\t\ton_msg(nl_hdr);\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(203)\">../src/piece_picker.cpp:121</a></td><td>find a better place for this</td></tr><tr id=\"203\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>find a better place for this</h2><h4>../src/piece_picker.cpp:121</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tif (limit == 0)\n-\t\t\t{\n-\t\t\t\tstd::cerr << \" ...\";\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t\tif (*i == -1) break;\n-\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index)\n-\t\t\t{\n-\t\t\t\tstd::cerr << \"| \";\n-\t\t\t\t++j;\n+\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0;\n \t\t\t}\n-\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \";\n-\t\t\t--limit;\n \t\t}\n-\t\tstd::cerr << std::endl;\n+//\t\treturn 0;\n \t}\n-}\n-#endif // TORRENT_PICKER_LOG\n-namespace libtorrent {\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\tconst piece_block piece_block::invalid(\n-</div>\t\tstd::numeric_limits<piece_index_t>::max()\n-\t\t, std::numeric_limits<int>::max());\n-\n-\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index;\n-\n-\tconstexpr picker_options_t piece_picker::rarest_first;\n-\tconstexpr picker_options_t piece_picker::reverse;\n-\tconstexpr picker_options_t piece_picker::on_parole;\n-\tconstexpr picker_options_t piece_picker::prioritize_partials;\n-\tconstexpr picker_options_t piece_picker::sequential;\n-\tconstexpr picker_options_t piece_picker::align_expanded_pieces;\n-\tconstexpr picker_options_t piece_picker::piece_extent_affinity;\n-\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_full;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio;\n-\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_open;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse;\n-\n-\t// the max number of blocks to create an affinity for\n-\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size;\n \n-\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size)\n-\t\t: m_priority_boundaries(1, m_pieces.end_index())\n+\tint nl_dump_request(int const sock, std::uint32_t const seq\n+\t\t, nlmsghdr* const request_msg, std::function<void(nlmsghdr const*)> on_msg)\n \t{\n-\t\tTORRENT_ASSERT(total_size > 0);\n-\t\tTORRENT_ASSERT(piece_size > 0);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(204)\">../src/piece_picker.cpp:2067</a></td><td>this 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.</td></tr><tr id=\"204\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/piece_picker.cpp:2067</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t// now, copy over the pointers. We also apply a filter here to not\n-\t\t\t// include ineligible pieces in certain modes. For instance, a piece\n-\t\t\t// that the current peer doesn't have is not included.\n-\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading])\n-\t\t\t{\n-\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops);\n-\n-\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue;\n-\n-\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue()\n-\t\t\t\t\t== piece_pos::piece_downloading);\n-\n-\t\t\t\tordered_partials[num_ordered_partials++] = &dp;\n-\t\t\t}\n+\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;\n+\t\trequest_msg->nlmsg_seq = seq;\n+\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID)\n+\t\t// of the sender, but the kernel ignores this field so it is typically set to\n+\t\t// zero\n+\t\trequest_msg->nlmsg_pid = 0;\n \n-\t\t\t// now, sort the list.\n-\t\t\tif (options & rarest_first)\n-\t\t\t{\n-\t\t\t\tret |= picker_log_alert::rarest_first_partials;\n+\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0)\n+\t\t\treturn -1;\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tstd::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials\n-</div>\t\t\t\t\t, std::bind(&piece_picker::partial_compare_rarest_first, this\n-\t\t\t\t\t\t, _1, _2));\n+\t\t// 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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(165)\">../src/ut_metadata.cpp:281</a></td><td>we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer</td></tr><tr id=\"165\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we really need to increment the refcounter on the torrent\n+while this buffer is still in the peer's send buffer</h2><h4>../src/ut_metadata.cpp:281</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tfor (int i = 0; i < num_ordered_partials; ++i)\n-\t\t\t{\n-\t\t\t\tret |= picker_log_alert::prioritize_partials;\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\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces\n-\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2\n-\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options);\n-\t\t\t\tif (num_blocks <= 0) return ret;\n-\t\t\t\tif (int(backup_blocks.size()) >= num_blocks\n-\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks)\n-\t\t\t\t\tbreak;\n+\t\t\tm_pc.send_buffer({msg, len + 6});\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (metadata_piece_size)\n+</div>\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\tnum_blocks = append_blocks(interesting_blocks, backup_blocks\n-\t\t\t\t, num_blocks);\n-\t\t\tif (num_blocks <= 0) return ret;\n-\n-\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2\n-\t\t\t\t, num_blocks);\n-\t\t\tif (num_blocks <= 0) return ret;\n+\t\t\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\tif (!suggested_pieces.empty())\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\tfor (piece_index_t i : suggested_pieces)\n-\t\t\t{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(205)\">../src/piece_picker.cpp:2211</a></td><td>Is it a good idea that this affinity takes precedence over piece priority?</td></tr><tr id=\"205\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>Is it a good idea that this affinity takes precedence over\n-piece priority?</h2><h4>../src/piece_picker.cpp:2211</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first;\n+\t\t\tif (extended_msg != 2) return false;\n+\t\t\tif (m_message_index == 0) return false;\n \n-\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces\n-\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n-\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n-\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n-\t\t\t\t\t\t\t, options);\n-\t\t\t\t\t\tif (num_blocks <= 0) return ret;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\telse\n+\t\t\tif (length > 17 * 1024)\n \t\t\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (options & piece_extent_affinity)\n-</div>\t\t\t\t{\n-\t\t\t\t\tint to_erase = -1;\n-\t\t\t\t\tint idx = -1;\n-\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents)\n-\t\t\t\t\t{\n-\t\t\t\t\t\t++idx;\n-\t\t\t\t\t\tbool have_all = true;\n-\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e))\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false;\n-\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue;\n-\n-\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity;\n-\n-\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces\n-\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n-\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n-\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n-\t\t\t\t\t\t\t\t, options);\n-\t\t\t\t\t\t\tif (num_blocks <= 0)\n-\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n-\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n-\t\t\t\t\t\t\t\treturn ret;\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t}\n-\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n-\t\t\t\t\t\tif (have_all) to_erase = idx;\n-\t\t\t\t\t}\n-\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(206)\">../src/piece_picker.cpp:2566</a></td><td>when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense</td></tr><tr id=\"206\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>when expanding pieces for cache stripe reasons,\n-the !downloading condition doesn't make much sense</h2><h4>../src/piece_picker.cpp:2566</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tTORRENT_ASSERT(index < m_piece_map.end_index());\n-\t\tif (next(index) == m_piece_map.end_index())\n-\t\t\treturn m_blocks_in_last_piece;\n-\t\telse\n-\t\t\treturn blocks_per_piece();\n-\t}\n-\n-\tbool piece_picker::is_piece_free(piece_index_t const piece\n-\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n-\t{\n-\t\treturn bitmask[piece]\n-\t\t\t&& !m_piece_map[piece].have()\n-\t\t\t&& !m_piece_map[piece].filtered();\n-\t}\n-\n-\tbool piece_picker::can_pick(piece_index_t const piece\n-\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n-\t{\n-\t\treturn bitmask[piece]\n-\t\t\t&& !m_piece_map[piece].have()\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\t&& !m_piece_map[piece].downloading()\n-</div>\t\t\t&& !m_piece_map[piece].filtered();\n-\t}\n-\n-#if TORRENT_USE_INVARIANT_CHECKS\n-\tvoid piece_picker::check_peers()\n-\t{\n-\t\tfor (auto const& b : m_block_info)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n-\t\t}\n-\t}\n-#endif\n-\n-\tvoid piece_picker::clear_peer(torrent_peer* peer)\n-\t{\n-\t\tfor (auto& b : m_block_info)\n-\t\t{\n-\t\t\tif (b.peer == peer) b.peer = nullptr;\n-\t\t}\n-\t}\n-\n-\t// the first bool is true if this is the only peer that has requested and downloaded\n-\t// blocks from this piece.\n-\t// the second bool is true if this is the only active peer that is requesting\n-\t// and downloading blocks from this piece. Active means having a connection.\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(207)\">../src/piece_picker.cpp:3144</a></td><td>should 5 be configurable?</td></tr><tr id=\"207\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should 5 be configurable?</h2><h4>../src/piece_picker.cpp:3144</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\t\t\t// if at least one piece in this extent has a different priority than\n-\t\t\t// the one we just started downloading, don't create an affinity for\n-\t\t\t// adjacent pieces. This probably means the pieces belong to different\n-\t\t\t// files, or that some other mechanism determining the priority should\n-\t\t\t// take precedence.\n-\t\t\tif (piece_priority(piece) != this_prio) return;\n-\t\t}\n-\n-\t\t// if we already have all the *other* pieces in this extent, there's no\n-\t\t// need to inflate their priorities\n-\t\tif (have_all) return;\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (m_recent_extents.size() < 5)\n-</div>\t\t\tm_recent_extents.push_back(this_extent);\n-\n-\t\t// limit the number of extent affinities active at any given time to limit\n-\t\t// the cost of checking them. Also, don't replace them, commit to\n-\t\t// finishing them before starting another extent. This is analogous to\n-\t\t// limiting the number of partial pieces.\n-\t}\n-\n-\t// options may be 0 or piece_picker::reverse\n-\t// returns false if the block could not be marked as downloading\n-\tbool piece_picker::mark_as_downloading(piece_block const block\n-\t\t, torrent_peer* peer, picker_options_t const options)\n-\t{\n-#ifdef TORRENT_PICKER_LOG\n-\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\"\n-\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n+#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\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n-\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index);\n-\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index);\n-\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index());\n-\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index));\n-\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have());\n-\n-\t\tpiece_pos& p = m_piece_map[block.piece_index];\n-\t\tif (p.download_queue() == piece_pos::piece_open)\n-\t\t{\n-#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n-\t\t\tINVARIANT_CHECK;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(208)\">../src/create_torrent.cpp:618</a></td><td>this can be optimized</td></tr><tr id=\"208\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this can be optimized</h2><h4>../src/create_torrent.cpp:618</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::vector<char> ret;\n-</div>\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+\t\t\tif (!m_pc.packet_finished()) return true;\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(209)\">../src/torrent.cpp:1951</a></td><td>this could be optimized by looking up which files are complete and just look at those</td></tr><tr id=\"209\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be optimized by looking up which files are\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(166)\">../src/torrent.cpp:1951</a></td><td>this could be optimized by looking up which files are complete and just look at those</td></tr><tr id=\"166\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be optimized by looking up which files are\n complete and just look at those</h2><h4>../src/torrent.cpp:1951</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">//\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@@ -8395,15 +6281,15 @@\n \t\t\tfor (auto const& c : m_torrent_file->collections())\n \t\t\t{\n \t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n \n \t\t\t\tfor (auto const& t : ts)\n \t\t\t\t{\n \t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(210)\">../src/torrent.cpp:1964</a></td><td>this could be optimized by looking up which files are complete and just look at those</td></tr><tr id=\"210\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be optimized by looking up which files are\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(167)\">../src/torrent.cpp:1964</a></td><td>this could be optimized by looking up which files are complete and just look at those</td></tr><tr id=\"167\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be optimized by looking up which files are\n complete and just look at those</h2><h4>../src/torrent.cpp:1964</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8447,15 +6333,15 @@\n \n \t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files))\n \t\t{\n \t\t\tm_ses.disk_thread().async_check_files(\n \t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr\n \t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error)\n \t\t\t\t{ self->on_resume_data_checked(st, error); });\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(211)\">../src/torrent.cpp:2728</a></td><td>this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port</td></tr><tr id=\"211\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this pattern is repeated in a few places. Factor this into\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(168)\">../src/torrent.cpp:2728</a></td><td>this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port</td></tr><tr id=\"168\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/torrent.cpp:2728</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8500,15 +6386,15 @@\n \t\t}\n \t\tif (!should_announce_dht())\n \t\t{\n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\tif (should_log())\n \t\t\t{\n #if TORRENT_USE_I2P\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(212)\">../src/torrent.cpp:3885</a></td><td>add one peer per IP the hostname resolves to</td></tr><tr id=\"212\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add one peer per IP the hostname resolves to</h2><h4>../src/torrent.cpp:3885</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tcatch (...) { handle_exception(); }\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(169)\">../src/torrent.cpp:3885</a></td><td>add one peer per IP the hostname resolves to</td></tr><tr id=\"169\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>add one peer per IP the hostname resolves to</h2><h4>../src/torrent.cpp:3885</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8551,15 +6437,15 @@\n \t\t\t\t\t, host.address().to_string().c_str()\n \t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1);\n \t\t\t}\n #endif\n \t\t}\n \t\tupdate_want_peers();\n \t}\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(213)\">../src/torrent.cpp:4581</a></td><td>only do this if the piece size > 1 blocks This is a v2 torrent so we can request get block level hashes.</td></tr><tr id=\"213\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>only do this if the piece size > 1 blocks\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(170)\">../src/torrent.cpp:4581</a></td><td>only do this if the piece size > 1 blocks This is a v2 torrent so we can request get block level hashes.</td></tr><tr id=\"170\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>only do this if the piece size > 1 blocks\n This is a v2 torrent so we can request get block\n level hashes.</h2><h4>../src/torrent.cpp:4581</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8604,15 +6490,15 @@\n \t\t\tpenalize_peers(peers, index, known_bad_peer);\n \t\t}\n \n \t\t// If m_storage isn't set here, it means we're shutting down\n \t\tif (m_storage)\n \t\t{\n \t\t\t// it doesn't make much sense to fail to hash a piece\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(214)\">../src/torrent.cpp:7525</a></td><td>come up with a better way of doing this, instead of an immediately invoked lambda expression.</td></tr><tr id=\"214\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>come up with a better way of doing this, instead of an\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(171)\">../src/torrent.cpp:7525</a></td><td>come up with a better way of doing this, instead of an immediately invoked lambda expression.</td></tr><tr id=\"171\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>come up with a better way of doing this, instead of an\n immediately invoked lambda expression.</h2><h4>../src/torrent.cpp:7525</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8656,15 +6542,15 @@\n \t\telse\n #endif\n \t\t{\n \t\t\tvoid* userdata = nullptr;\n #ifdef TORRENT_SSL_PEERS\n \t\t\tif (is_ssl_torrent())\n \t\t\t{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(215)\">../src/torrent.cpp:9118</a></td><td>perhaps 0 should actually mean 0</td></tr><tr id=\"215\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps 0 should actually mean 0</h2><h4>../src/torrent.cpp:9118</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// finished torrents may not change their queue positions, as it's set to\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(172)\">../src/torrent.cpp:9118</a></td><td>perhaps 0 should actually mean 0</td></tr><tr id=\"172\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps 0 should actually mean 0</h2><h4>../src/torrent.cpp:9118</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8692,15 +6578,15 @@\n \t\tif (state_update)\n \t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n \t}\n \n \tvoid torrent::set_max_connections(int limit, bool const state_update)\n \t{\n \t\tTORRENT_ASSERT(is_single_thread());\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(216)\">../src/torrent.cpp:9135</a></td><td>perhaps 0 should actually mean 0</td></tr><tr id=\"216\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps 0 should actually mean 0</h2><h4>../src/torrent.cpp:9135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(173)\">../src/torrent.cpp:9135</a></td><td>perhaps 0 should actually mean 0</td></tr><tr id=\"173\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps 0 should actually mean 0</h2><h4>../src/torrent.cpp:9135</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8743,15 +6629,15 @@\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tdebug_log(\"*** set-upload-limit: %d\", limit);\n #endif\n \t}\n \n \tvoid torrent::set_download_limit(int const limit)\n \t{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(217)\">../src/torrent.cpp:11061</a></td><td>instead of resorting the whole list, insert the peers directly into the right place</td></tr><tr id=\"217\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of resorting the whole list, insert the peers\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(174)\">../src/torrent.cpp:11061</a></td><td>instead of resorting the whole list, insert the peers directly into the right place</td></tr><tr id=\"174\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of resorting the whole list, insert the peers\n directly into the right place</h2><h4>../src/torrent.cpp:11061</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8795,15 +6681,15 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(218)\">../src/session.cpp:540</a></td><td>In C++17. use if constexpr instead</td></tr><tr id=\"218\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>In C++17. use if constexpr instead</h2><h4>../src/session.cpp:540</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(175)\">../src/session.cpp:540</a></td><td>In C++17. use if constexpr instead</td></tr><tr id=\"175\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>In C++17. use if constexpr instead</h2><h4>../src/session.cpp:540</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8827,15 +6713,220 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(219)\">../src/cpuid.cpp:131</a></td><td>enable when aarch64 is really tested</td></tr><tr id=\"219\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>enable when aarch64 is really tested</h2><h4>../src/cpuid.cpp:131</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tbool supports_mmx() noexcept\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(176)\">../src/file_storage.cpp:457</a></td><td>maybe it would be nice to have a better index here</td></tr><tr id=\"176\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>maybe it would be nice to have a better index here</h2><h4>../src/file_storage.cpp:457</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (file_index_t const i : file_range())\n+</div>\t\t{\n+\t\t\tif (root(i) == root_hash) return i;\n+\t\t}\n+\t\treturn file_index_t{-1};\n+\t}\n+\n+\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\n+\t{\n+\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\n+\t}\n+\n+#if TORRENT_ABI_VERSION <= 2\n+\tchar const* file_storage::file_name_ptr(file_index_t const index) const\n+\t{\n+\t\treturn m_files[index].name;\n+\t}\n+\n+\tint file_storage::file_name_len(file_index_t const index) const\n+\t{\n+\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned)\n+\t\t\treturn -1;\n+\t\treturn m_files[index].name_len;\n+\t}\n+#endif\n+\n+\tstd::vector<file_slice> file_storage::map_block(piece_index_t const piece\n+\t\t, std::int64_t const offset, std::int64_t size) const\n+\t{\n+\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0});\n+\t\tTORRENT_ASSERT_PRECOND(piece < end_piece());\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(177)\">../src/file_storage.cpp:1242</a></td><td>this would be more efficient if m_paths was sorted first, such that a lower path index always meant sorted-before</td></tr><tr id=\"177\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this would be more efficient if m_paths was sorted first, such\n+that a lower path index always meant sorted-before</h2><h4>../src/file_storage.cpp:1242</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n+\n+\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n+\t{\n+\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n+\n+\t\t// use this vector to track the new ordering of files\n+\t\t// this allows the use of STL algorithms despite them\n+\t\t// not supporting a custom swap functor\n+\t\taux::vector<file_index_t, file_index_t> new_order(end_file());\n+\t\tfor (auto i : file_range())\n+\t\t\tnew_order[i] = i;\n+\n+\t\t// remove any existing pad files\n+\t\t{\n+\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end()\n+\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; });\n+\t\t\tnew_order.erase(pad_begin, new_order.end());\n+\t\t}\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(178)\">../src/file_storage.cpp:1345</a></td><td>in C++17 this could be string_view</td></tr><tr id=\"178\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17 this could be string_view</h2><h4>../src/file_storage.cpp:1345</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\tadd_pad_file(i);\n+\t\t}\n+\n+\t\tm_files = std::move(new_files);\n+\t\tm_file_hashes = std::move(new_file_hashes);\n+\t\tm_mtime = std::move(new_mtime);\n+\n+\t\tm_total_size = off;\n+\t}\n+\n+\tvoid file_storage::sanitize_symlinks()\n+\t{\n+\t\t// symlinks are unusual, this function is optimized assuming there are no\n+\t\t// symbolic links in the torrent. If we find one symbolic link, we'll\n+\t\t// build the hash table of files it's allowed to refer to, but don't pay\n+\t\t// that price up-front.\n+\t\tstd::unordered_map<std::string, file_index_t> file_map;\n+\t\tbool file_map_initialized = false;\n+\n+\t\t// lazily instantiated set of all valid directories a symlink may point to\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::unordered_set<std::string> dir_map;\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(179)\">../src/web_connection_base.cpp:72</a></td><td>introduce a web-seed default class which has a low download priority</td></tr><tr id=\"179\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>introduce a web-seed default class which has a low download priority</h2><h4>../src/web_connection_base.cpp:72</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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+\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+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(180)\">../src/cpuid.cpp:131</a></td><td>enable when aarch64 is really tested</td></tr><tr id=\"180\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>enable when aarch64 is really tested</h2><h4>../src/cpuid.cpp:131</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8878,15 +6969,456 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(220)\">../src/choker.cpp:258</a></td><td>make configurable</td></tr><tr id=\"220\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make configurable</h2><h4>../src/choker.cpp:258</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t// first reset the number of unchoke slots, because we'll calculate\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(181)\">../src/disabled_disk_io.cpp:106</a></td><td>it would be nice to return a valid hash of zeroes here</td></tr><tr id=\"181\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to return a valid hash of zeroes here</h2><h4>../src/disabled_disk_io.cpp:106</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(182)\">../src/udp_socket.cpp:659</a></td><td>perhaps an attempt should be made to bind m_socks5_sock to the device of m_listen_socket</td></tr><tr id=\"182\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>perhaps an attempt should be made to bind m_socks5_sock to the\n+device of m_listen_socket</h2><h4>../src/udp_socket.cpp:659</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(183)\">../src/posix_part_file.cpp:337</a></td><td>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 from disk, but it may be overwritten soon, it's probably not that big of a deal</td></tr><tr id=\"183\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/posix_part_file.cpp:337</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(184)\">../src/posix_part_file.cpp:424</a></td><td>instead of rebuilding the whole file header and flushing it, update the slot entries as we go</td></tr><tr id=\"184\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of rebuilding the whole file header\n+and flushing it, update the slot entries as we go</h2><h4>../src/posix_part_file.cpp:424</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t}\n+\t\t\t\tauto bytes_read = std::fread(buf.get(), 1, std::size_t(block_to_copy), file.file());\n+\t\t\t\tif (int(bytes_read) != block_to_copy)\n+\t\t\t\t\tec.assign(errno, generic_category());\n+\n+\t\t\t\tif (ec) return;\n+\n+\t\t\t\tf(file_offset, {buf.get(), block_to_copy});\n+\t\t\t}\n+\t\t\tfile_offset += block_to_copy;\n+\t\t\tpiece_offset = 0;\n+\t\t\tsize -= block_to_copy;\n+\t\t}\n+\t}\n+\n+\tvoid posix_part_file::flush_metadata(error_code& ec)\n+\t{\n+\t\tflush_metadata_impl(ec);\n+\t}\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid posix_part_file::flush_metadata_impl(error_code& ec)\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(185)\">../src/torrent_handle.cpp:589</a></td><td>support moving files into this call</td></tr><tr id=\"185\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support moving files into this call</h2><h4>../src/torrent_handle.cpp:589</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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 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+\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+\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n+</div>\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+\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+\t}\n+\n+#if TORRENT_ABI_VERSION == 1\n+\n+// ============ start deprecation ===============\n+\n+\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n+\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+\tstd::vector<int> torrent_handle::file_priorities() const\n+\t{\n+\t\taux::vector<download_priority_t, file_index_t> prio;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(186)\">../src/http_seed_connection.cpp:441</a></td><td>technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases</td></tr><tr id=\"186\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>technically, this isn't supposed to happen, but it seems to\n+sometimes. Some of the accounting is probably wrong in certain\n+cases</h2><h4>../src/http_seed_connection.cpp:441</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(187)\">../src/mmap_disk_io.cpp:578</a></td><td>in the future, propagate exceptions back to the handlers</td></tr><tr id=\"187\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in the future, propagate exceptions back to the handlers</h2><h4>../src/mmap_disk_io.cpp:578</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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+<div style=\"background: #ffff00\" width=\"100%\">\t\tstatus_t ret = status_t::no_error;\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(188)\">../src/mmap_disk_io.cpp:1017</a></td><td>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 the complexity and cost just for the edge case of receiving a corrupt piece</td></tr><tr id=\"188\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/mmap_disk_io.cpp:1017</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(189)\">../src/mmap_disk_io.cpp:1022</a></td><td>Perhaps 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</td></tr><tr id=\"189\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/mmap_disk_io.cpp:1022</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tadd_fence_job(j);\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(190)\">../src/choker.cpp:258</a></td><td>make configurable</td></tr><tr id=\"190\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make configurable</h2><h4>../src/choker.cpp:258</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8929,15 +7461,15 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(221)\">../src/merkle_tree.cpp:110</a></td><td>in C++20, use std::identity</td></tr><tr id=\"221\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++20, use std::identity</h2><h4>../src/merkle_tree.cpp:110</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tallocate_full();\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(191)\">../src/merkle_tree.cpp:110</a></td><td>in C++20, use std::identity</td></tr><tr id=\"191\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++20, use std::identity</h2><h4>../src/merkle_tree.cpp:110</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -8980,15 +7512,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(222)\">../src/merkle_tree.cpp:319</a></td><td>this can be optimized by using m_tree as storage to fill this tree into, and then clear it if the hashes fail</td></tr><tr id=\"222\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this can be optimized by using m_tree as storage to fill this\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(192)\">../src/merkle_tree.cpp:319</a></td><td>this can be optimized by using m_tree as storage to fill this tree into, and then clear it if the hashes fail</td></tr><tr id=\"192\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this can be optimized by using m_tree as storage to fill this\n tree into, and then clear it if the hashes fail</h2><h4>../src/merkle_tree.cpp:319</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9032,15 +7564,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(223)\">../src/merkle_tree.cpp:367</a></td><td>a piece outside of this range may also fail, if one of the uncle hashes is at the layer right above the block hashes</td></tr><tr id=\"223\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>a piece outside of this range may also fail, if one of the uncle\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(193)\">../src/merkle_tree.cpp:367</a></td><td>a piece outside of this range may also fail, if one of the uncle hashes is at the layer right above the block hashes</td></tr><tr id=\"193\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/merkle_tree.cpp:367</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9084,15 +7616,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(224)\">../src/merkle_tree.cpp:447</a></td><td>instead 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.</td></tr><tr id=\"224\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of overwriting the root and comparing it\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(194)\">../src/merkle_tree.cpp:447</a></td><td>instead 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.</td></tr><tr id=\"194\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/merkle_tree.cpp:447</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9127,15 +7659,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(225)\">../src/merkle_tree.cpp:471</a></td><td>this could be done more efficiently if bitfield had a function to set a range of bits</td></tr><tr id=\"225\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be done more efficiently if bitfield had a function\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(195)\">../src/merkle_tree.cpp:471</a></td><td>this could be done more efficiently if bitfield had a function to set a range of bits</td></tr><tr id=\"195\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be done more efficiently if bitfield had a function\n to set a range of bits</h2><h4>../src/merkle_tree.cpp:471</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9179,15 +7711,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(226)\">../src/merkle_tree.cpp:514</a></td><td>use structured binding in C++17</td></tr><tr id=\"226\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured binding in C++17</h2><h4>../src/merkle_tree.cpp:514</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(196)\">../src/merkle_tree.cpp:514</a></td><td>use structured binding in C++17</td></tr><tr id=\"196\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured binding in C++17</h2><h4>../src/merkle_tree.cpp:514</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9223,15 +7755,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(227)\">../src/merkle_tree.cpp:539</a></td><td>this could be done more efficiently if bitfield had a function to set a range of bits</td></tr><tr id=\"227\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be done more efficiently if bitfield had a function\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(197)\">../src/merkle_tree.cpp:539</a></td><td>this could be done more efficiently if bitfield had a function to set a range of bits</td></tr><tr id=\"197\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this could be done more efficiently if bitfield had a function\n to set a range of bits</h2><h4>../src/merkle_tree.cpp:539</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9275,251 +7807,488 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(228)\">../src/pe_crypto.cpp:60</a></td><td>it would be nice to get the literal working</td></tr><tr id=\"228\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to get the literal working</h2><h4>../src/pe_crypto.cpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include <algorithm>\n-#include <random>\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(198)\">../src/add_torrent_params.cpp:78</a></td><td>pre 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<add_torrent_params>::value , \"should be nothrow move assignable\");</td></tr><tr id=\"198\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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<add_torrent_params>::value\n+, \"should be nothrow move assignable\");</h2><h4>../src/add_torrent_params.cpp:78</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tDECL_FLAG(sequential_download);\n+\t\t\tDECL_FLAG(pinned);\n+\t\t\tDECL_FLAG(stop_when_ready);\n+\t\t\tDECL_FLAG(override_trackers);\n+\t\t\tDECL_FLAG(override_web_seeds);\n+\t\t\tDECL_FLAG(need_save_resume);\n+\t\t\tDECL_FLAG(override_resume_data);\n+\t\t\tDECL_FLAG(merge_resume_trackers);\n+\t\t\tDECL_FLAG(use_resume_save_path);\n+\t\t\tDECL_FLAG(merge_resume_http_seeds);\n+\t\t\tDECL_FLAG(default_flags);\n+#undef DECL_FLAG\n+#endif // TORRENT_ABI_VERSION\n \n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-#include <boost/multiprecision/integer.hpp>\n-#include <boost/multiprecision/cpp_int.hpp>\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(199)\">../src/add_torrent_params.cpp:84</a></td><td>it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible<add_torrent_params>::value , \"should be nothrow default constructible\");</td></tr><tr id=\"199\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice if this was nothrow default constructible\n+static_assert(std::is_nothrow_default_constructible<add_torrent_params>::value\n+, \"should be nothrow default constructible\");</h2><h4>../src/add_torrent_params.cpp:84</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tDECL_FLAG(pinned);\n+\t\t\tDECL_FLAG(stop_when_ready);\n+\t\t\tDECL_FLAG(override_trackers);\n+\t\t\tDECL_FLAG(override_web_seeds);\n+\t\t\tDECL_FLAG(need_save_resume);\n+\t\t\tDECL_FLAG(override_resume_data);\n+\t\t\tDECL_FLAG(merge_resume_trackers);\n+\t\t\tDECL_FLAG(use_resume_save_path);\n+\t\t\tDECL_FLAG(merge_resume_http_seeds);\n+\t\t\tDECL_FLAG(default_flags);\n+#undef DECL_FLAG\n+#endif // TORRENT_ABI_VERSION\n \n-#include \"libtorrent/random.hpp\"\n-#include \"libtorrent/aux_/alloca.hpp\"\n-#include \"libtorrent/pe_crypto.hpp\"\n-#include \"libtorrent/hasher.hpp\"\n+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-namespace libtorrent {\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-\tnamespace mp = boost::multiprecision;\n \n-\tnamespace {\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tkey_t const dh_prime\n-</div>\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n-\t}\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>namespace aux {\n \n-\tstd::array<char, 96> export_key(key_t const& k)\n+\t// returns whether this add_torrent_params object has \"resume-data\", i.e.\n+\t// information about which pieces we have.\n+\tbool contains_resume_data(add_torrent_params const& atp)\n \t{\n-\t\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\treturn !atp.have_pieces.empty()\n+\t\t\t|| (atp.flags & torrent_flags::seed_mode);\n+\t}\n+}\n \n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(229)\">../src/pe_crypto.cpp:71</a></td><td>it would be nice to be able to export to a fixed width field, so we wouldn't have to shift it later</td></tr><tr id=\"229\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to be able to export to a fixed width field, so\n-we wouldn't have to shift it later</h2><h4>../src/pe_crypto.cpp:71</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/random.hpp\"\n-#include \"libtorrent/aux_/alloca.hpp\"\n-#include \"libtorrent/pe_crypto.hpp\"\n-#include \"libtorrent/hasher.hpp\"\n+}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(200)\">../src/part_file.cpp:300</a></td><td>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 from disk, but it may be overwritten soon, it's probably not that big of a deal</td></tr><tr id=\"200\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/part_file.cpp:300</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-namespace libtorrent {\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-\tnamespace mp = boost::multiprecision;\n+\t\tauto const i = m_piece_map.find(piece);\n+\t\tif (i == m_piece_map.end()) return;\n \n-\tnamespace {\n-\t\tkey_t const dh_prime\n-\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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-\tstd::array<char, 96> export_key(key_t const& k)\n+\tvoid part_file::move_partfile(std::string const& path, error_code& ec)\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\tstd::lock_guard<std::mutex> l(m_mutex);\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tif (end < begin + 96)\n-</div>\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\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(201)\">../src/part_file.cpp:411</a></td><td>instead of rebuilding the whole file header and flushing it, update the slot entries as we go</td></tr><tr id=\"201\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>instead of rebuilding the whole file header\n+and flushing it, update the slot entries as we go</h2><h4>../src/part_file.cpp:411</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\treturn ret;\n \t}\n \n-\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state);\n-\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state);\n-\n-\t// Set the prime P and the generator, generate local public key\n-\tdh_key_exchange::dh_key_exchange()\n+\tvoid part_file::flush_metadata(error_code& ec)\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\tstd::lock_guard<std::mutex> l(m_mutex);\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\tflush_metadata_impl(ec);\n+\t}\n \n-\t\t// key = (2 ^ secret) % prime\n-\t\tm_dh_local_key = mp::powm(key_t(2), m_dh_local_secret, dh_prime);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(230)\">../src/file_storage.cpp:457</a></td><td>maybe it would be nice to have a better index here</td></tr><tr id=\"230\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>maybe it would be nice to have a better index here</h2><h4>../src/file_storage.cpp:457</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\tvoid part_file::flush_metadata_impl(error_code& ec)\n+</div>\t{\n+\t\t// do we need to flush the metadata?\n+\t\tif (m_dirty_metadata == false) return;\n \n-\t\tauto file_iter = std::upper_bound(\n-\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset);\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\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\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(202)\">../src/peer_connection.cpp:1105</a></td><td>this should be the global download rate</td></tr><tr id=\"202\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be the global download rate</h2><h4>../src/peer_connection.cpp:1105</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n+</div>\t\t}\n+\t\telse\n+\t\t{\n+\t\t\t// current download rate in bytes per seconds\n+\t\t\trate = m_statistics.transfer_rate(stat::download_payload);\n+\t\t}\n+\n+\t\t// avoid division by zero\n+\t\tif (rate < 50) rate = 50;\n+\n+\t\t// average of current rate and peak\n+//\t\trate = (rate + m_download_rate_peak) / 2;\n+\n+\t\treturn milliseconds((m_outstanding_bytes + extra_bytes\n+\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\n \t}\n \n-\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<int>(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-<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (file_index_t const i : file_range())\n-</div>\t\t{\n-\t\t\tif (root(i) == root_hash) return i;\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(203)\">../src/peer_connection.cpp:3536</a></td><td>sort the allowed fast set in priority order</td></tr><tr id=\"203\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:3536</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+\t\t// if the peer has the piece and we want\n+\t\t// to download it, request it\n+\t\tif (index < m_have_piece.end_index()\n+\t\t\t&& m_have_piece[index]\n+\t\t\t&& !t->have_piece(index)\n+\t\t\t&& t->valid_metadata()\n+\t\t\t&& t->has_picker()\n+\t\t\t&& t->picker().piece_priority(index) > dont_download)\n+\t\t{\n+\t\t\tt->peer_is_interesting(*this);\n \t\t}\n-\t\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+<div style=\"background: #ffff00\" width=\"100%\">\t\treturn m_allowed_fast;\n+</div>\t}\n+\n+\tbool peer_connection::can_request_time_critical() const\n \t{\n-\t\treturn m_files[index].name;\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-\tint file_storage::file_name_len(file_index_t const index) const\n+\tbool peer_connection::make_time_critical(piece_block const& block)\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+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(204)\">../src/ip_notifier.cpp:41</a></td><td>simulator support</td></tr><tr id=\"204\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>simulator support</h2><h4>../src/ip_notifier.cpp:41</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"> from this software without specific prior written permission.\n+\n+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n+*/\n+\n+#include \"libtorrent/aux_/ip_notifier.hpp\"\n+#include \"libtorrent/assert.hpp\"\n+\n+#if defined TORRENT_BUILD_SIMULATOR\n+<div style=\"background: #ffff00\" width=\"100%\">#elif TORRENT_USE_NETLINK\n+</div>#include \"libtorrent/netlink.hpp\"\n+#include \"libtorrent/socket.hpp\"\n+#include <array>\n+#include <unordered_map>\n+#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY\n+#include <SystemConfiguration/SystemConfiguration.h>\n+#elif defined TORRENT_WINDOWS\n+#include \"libtorrent/aux_/throw.hpp\"\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <iphlpapi.h>\n+#ifdef TORRENT_WINRT\n+#include <netioapi.h>\n+#endif\n+#include <mutex>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n #endif\n \n-\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(231)\">../src/file_storage.cpp:1242</a></td><td>this would be more efficient if m_paths was sorted first, such that a lower path index always meant sorted-before</td></tr><tr id=\"231\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this would be more efficient if m_paths was sorted first, such\n-that a lower path index always meant sorted-before</h2><h4>../src/file_storage.cpp:1242</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n+#include \"libtorrent/aux_/netlink_utils.hpp\"\n \n-\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n-\t{\n-\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n+namespace libtorrent { namespace aux {\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+namespace {\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+#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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(205)\">../src/settings_pack.cpp:305</a></td><td>deprecate this</td></tr><tr id=\"205\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>deprecate this</h2><h4>../src/settings_pack.cpp:305</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tSET(max_rejects, 50, nullptr),\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(206)\">../src/settings_pack.cpp:590</a></td><td>it would be nice to reserve() these vectors up front</td></tr><tr id=\"206\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to reserve() these vectors up front</h2><h4>../src/settings_pack.cpp:590</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\n \t\t{\n-\t\t\t// assuming m_paths are unique!\n-\t\t\tauto const& lf = m_files[l];\n-\t\t\tauto const& rf = m_files[r];\n-\t\t\tif (lf.path_index != rf.path_index)\n-\t\t\t{\n-\t\t\t\tint const ret = path_compare(m_paths[lf.path_index], lf.filename()\n-\t\t\t\t\t, m_paths[rf.path_index], rf.filename());\n-\t\t\t\tif (ret != 0) return ret < 0;\n-\t\t\t}\n-\t\t\treturn lf.filename() < rf.filename();\n-\t\t});\n+\t\t\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\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\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-\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+\tsettings_pack default_settings()\n+\t{\n+\t\tsettings_pack ret;\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n+</div>\t\t{\n+\t\t\tif (str_settings[i].default_value == nullptr) continue;\n+\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value);\n+\t\t}\n \n-\t\t// re-compute offsets and insert pad files as necessary\n-\t\tstd::int64_t off = 0;\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(232)\">../src/file_storage.cpp:1345</a></td><td>in C++17 this could be string_view</td></tr><tr id=\"232\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17 this could be string_view</h2><h4>../src/file_storage.cpp:1345</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\tadd_pad_file(i);\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-\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+\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\tm_total_size = off;\n-\t}\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-\tvoid file_storage::sanitize_symlinks()\n+\t\t// call the callbacks once all the settings have been applied, and\n+\t\t// only once per callback\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(207)\">../src/utp_stream.cpp:1467</a></td><td>this loop is not very efficient. It could be fixed by having a separate list of sequence numbers that need resending</td></tr><tr id=\"207\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this loop is not very efficient. It could be fixed by having\n+a separate list of sequence numbers that need resending</h2><h4>../src/utp_stream.cpp:1467</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#endif\n+\n+\tif (m_stalled)\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+\t\tif (flags & pkt_ack)\n+\t\t\tdefer_ack();\n+\t\treturn false;\n+\t}\n \n-\t\t// lazily instantiated set of all valid directories a symlink may point to\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::unordered_set<std::string> dir_map;\n-</div>\t\tbool dir_map_initialized = false;\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\t// symbolic links that points to directories\n-\t\tstd::unordered_map<std::string, std::string> dir_links;\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\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// first see if we need to resend any packets\n \n-\t\tfor (auto const i : file_range())\n+<div style=\"background: #ffff00\" width=\"100%\">\tfor (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK)\n+</div>\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\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+\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\taux::file_entry const& fe = m_files[i];\n-\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size()));\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\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// MTU DISCOVERY\n \n-\t\t\t\tif (is_complete(target))\n-\t\t\t\t{\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(233)\">../src/utp_socket_manager.cpp:204</a></td><td>this should not be heap allocated, sockets should be movable</td></tr><tr id=\"233\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should not be heap allocated, sockets should be movable</h2><h4>../src/utp_socket_manager.cpp:204</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(208)\">../src/utp_socket_manager.cpp:204</a></td><td>this should not be heap allocated, sockets should be movable</td></tr><tr id=\"208\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should not be heap allocated, sockets should be movable</h2><h4>../src/utp_socket_manager.cpp:204</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9562,194 +8331,245 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(234)\">../src/mmap_disk_io.cpp:578</a></td><td>in the future, propagate exceptions back to the handlers</td></tr><tr id=\"234\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in the future, propagate exceptions back to the handlers</h2><h4>../src/mmap_disk_io.cpp:578</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#if DEBUG_DISK_THREAD\n-\t\t{\n-\t\t\tstd::unique_lock<std::mutex> l(m_job_mutex);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(209)\">../src/performance_counters.cpp:40</a></td><td>move stats_counter_t out of counters</td></tr><tr id=\"209\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move stats_counter_t out of counters</h2><h4>../src/performance_counters.cpp:40</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(210)\">../src/performance_counters.cpp:41</a></td><td>should bittorrent keep-alive messages have a counter too?</td></tr><tr id=\"210\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should bittorrent keep-alive messages have a counter too?</h2><h4>../src/performance_counters.cpp:41</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(211)\">../src/performance_counters.cpp:42</a></td><td>It would be nice if this could be an internal type. default_disk_constructor depends on it now</td></tr><tr id=\"211\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>It would be nice if this could be an internal type. default_disk_constructor depends on it now</h2><h4>../src/performance_counters.cpp:42</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\t\t\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+*/\n+\n+#include \"libtorrent/performance_counters.hpp\"\n+#include \"libtorrent/assert.hpp\"\n+#include <cstring> // for memset\n+\n+namespace libtorrent {\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n+</div>\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-\t\tstd::shared_ptr<mmap_storage> storage = j->storage;\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-\t\tTORRENT_ASSERT(static_cast<int>(j->action) < int(job_functions.size()));\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(212)\">../src/hash_picker.cpp:309</a></td><td>use structured bindings in C++17</td></tr><tr id=\"212\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use structured bindings in C++17</h2><h4>../src/hash_picker.cpp:309</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1);\n+\t\tif (m_files.pad_file_at(f))\n+\t\t\treturn { set_block_hash_result::result::success, 0, 0 };\n \n-\t\t// call disk function\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tstatus_t ret = status_t::no_error;\n-</div>\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\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\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\tTORRENT_ASSERT_FAIL();\n+\t\t\treturn set_block_hash_result::block_hash_failed();\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+<div style=\"background: #ffff00\" width=\"100%\">\t\taux::merkle_tree::set_block_result result;\n+</div>\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\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, -1);\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(235)\">../src/mmap_disk_io.cpp:1017</a></td><td>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 the complexity and cost just for the edge case of receiving a corrupt piece</td></tr><tr id=\"235\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/mmap_disk_io.cpp:1017</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::file_priority);\n-\t\tj->storage = m_torrents[storage]->shared_from_this();\n-\t\tj->argument = std::move(prios);\n-\t\tj->callback = std::move(handler);\n+\t\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\tadd_fence_job(j);\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 mmap_disk_io::async_clear_piece(storage_index_t const storage\n-\t\t, piece_index_t const index, std::function<void(piece_index_t)> handler)\n+\tvoid hash_picker::hashes_rejected(hash_request const& req)\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+\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n \n-\t\t// regular jobs are not guaranteed to be executed in-order\n-\t\t// since clear piece must guarantee that all write jobs that\n-\t\t// have been issued finish before the clear piece job completes\n+\t\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(236)\">../src/mmap_disk_io.cpp:1022</a></td><td>Perhaps 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</td></tr><tr id=\"236\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/mmap_disk_io.cpp:1022</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tj->storage = m_torrents[storage]->shared_from_this();\n-\t\tj->argument = std::move(prios);\n-\t\tj->callback = std::move(handler);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(213)\">../src/pe_crypto.cpp:60</a></td><td>it would be nice to get the literal working</td></tr><tr id=\"213\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to get the literal working</h2><h4>../src/pe_crypto.cpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include <algorithm>\n+#include <random>\n \n-\t\tadd_fence_job(j);\n-\t}\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\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+#include <boost/multiprecision/integer.hpp>\n+#include <boost/multiprecision/cpp_int.hpp>\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+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n \n+#include \"libtorrent/random.hpp\"\n+#include \"libtorrent/aux_/alloca.hpp\"\n+#include \"libtorrent/pe_crypto.hpp\"\n+#include \"libtorrent/hasher.hpp\"\n \n-<div style=\"background: #ffff00\" width=\"100%\">\t\tadd_fence_job(j);\n-</div>\t}\n+namespace libtorrent {\n \n-\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j)\n+\tnamespace mp = boost::multiprecision;\n+\n+\tnamespace {\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tkey_t const dh_prime\n+</div>\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n+\t}\n+\n+\tstd::array<char, 96> export_key(key_t const& k)\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+\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\tbool const v1 = bool(j->flags & disk_interface::v1_hash);\n-\t\tbool const v2 = !j->d.h.block_hashes.empty();\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(214)\">../src/pe_crypto.cpp:71</a></td><td>it would be nice to be able to export to a fixed width field, so we wouldn't have to shift it later</td></tr><tr id=\"214\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to be able to export to a fixed width field, so\n+we wouldn't have to shift it later</h2><h4>../src/pe_crypto.cpp:71</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#include \"libtorrent/random.hpp\"\n+#include \"libtorrent/aux_/alloca.hpp\"\n+#include \"libtorrent/pe_crypto.hpp\"\n+#include \"libtorrent/hasher.hpp\"\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+namespace libtorrent {\n \n-\t\tTORRENT_ASSERT(!v2 || int(j->d.h.block_hashes.size()) >= blocks_in_piece2);\n-\t\tTORRENT_ASSERT(v1 || v2);\n+\tnamespace mp = boost::multiprecision;\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+\tnamespace {\n+\t\tkey_t const dh_prime\n+\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n+\t}\n \n-\t\t\tDLOG(\"do_hash: reading (piece: %d block: %d)\\n\", int(j->piece), i);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(237)\">../src/web_connection_base.cpp:72</a></td><td>introduce a web-seed default class which has a low download priority</td></tr><tr id=\"237\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>introduce a web-seed default class which has a low download priority</h2><h4>../src/web_connection_base.cpp:72</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\tstd::array<char, 96> export_key(key_t const& k)\n \t{\n-\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo);\n-\t\t// when going through a proxy, we don't necessarily have an endpoint here,\n-\t\t// since the proxy might be resolving the hostname, not us\n-\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp);\n-\n-\t\tINVARIANT_CHECK;\n+\t\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\tTORRENT_ASSERT(is_outgoing());\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (end < begin + 96)\n+</div>\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-\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\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\t// we only want left-over bandwidth\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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// 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\tif (m_port == -1 && protocol == \"http\")\n-\t\t\tm_port = 80;\n+\t\t// create local key (random)\n+\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end());\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// key = (2 ^ secret) % prime\n+\t\tm_dh_local_key = mp::powm(key_t(2), m_dh_local_secret, dh_prime);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(215)\">../src/load_torrent.cpp:121</a></td><td>move the loading logic from torrent_info constructor into here</td></tr><tr id=\"215\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move the loading logic from torrent_info constructor into here</h2><h4>../src/load_torrent.cpp:121</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-#endif\n+\t\tatp.info_hashes = atp.ti->info_hashes();\n+\t}\n+}\n \n-\t\tif (!m_basic_auth.empty())\n-\t\t\tm_basic_auth = base64encode(m_basic_auth);\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-\t\tm_server_string = m_host;\n-\t\taux::verify_encoding(m_server_string);\n+<div style=\"background: #ffff00\" width=\"100%\">\tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n+</div>\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-\tint web_connection_base::timeout() const\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\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\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(238)\">../src/torrent_info.cpp:887</a></td><td>this should be considered a failure, and the .torrent file rejected</td></tr><tr id=\"238\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be considered a failure, and the .torrent file\n+\n+}\n+\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(216)\">../src/torrent_info.cpp:887</a></td><td>this should be considered a failure, and the .torrent file rejected</td></tr><tr id=\"216\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should be considered a failure, and the .torrent file\n rejected</h2><h4>../src/torrent_info.cpp:887</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9793,120 +8613,1300 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(239)\">../src/load_torrent.cpp:121</a></td><td>move the loading logic from torrent_info constructor into here</td></tr><tr id=\"239\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move the loading logic from torrent_info constructor into here</h2><h4>../src/load_torrent.cpp:121</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(217)\">../src/session_handle.cpp:499</a></td><td>in C++14, use unique_ptr and move it into the lambda</td></tr><tr id=\"217\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++14, use unique_ptr and move it into the lambda</h2><h4>../src/session_handle.cpp:499</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef BOOST_NO_EXCEPTIONS\n+\t\tif (params.save_path.empty())\n+\t\t\taux::throw_ex<system_error>(error_code(errors::invalid_save_path));\n+#else\n+\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty());\n+#endif\n+\n+#if TORRENT_ABI_VERSION < 3\n+\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti)\n+\t\t\tparams.info_hashes.v1 = params.info_hash;\n+#endif\n+\n+\t\t// the internal torrent object keeps and mutates state in the\n+\t\t// torrent_info object. We can't let that leak back to the client\n+\t\tif (params.ti)\n+\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti);\n+\n+\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw\n+\t\t// pointer for now. async_call uses a lambda expression to post the call\n+\t\t// to the main thread\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tauto* p = new add_torrent_params(std::move(params));\n+</div>\t\tauto guard = aux::scope_end([p]{ delete p; });\n+\t\tp->save_path = complete(p->save_path);\n+\n+#if TORRENT_ABI_VERSION == 1\n+\t\thandle_backwards_compatible_resume_data(*p);\n+#endif\n+\n+\t\tasync_call(&session_impl::async_add_torrent, p);\n+\t\tguard.disarm();\n+\t}\n+\n+#ifndef BOOST_NO_EXCEPTIONS\n+#if TORRENT_ABI_VERSION == 1\n+\t// if the torrent already exists, this will throw duplicate_torrent\n+\ttorrent_handle session_handle::add_torrent(\n+\t\ttorrent_info const& ti\n+\t\t, std::string const& save_path\n+\t\t, entry const& resume_data\n+\t\t, storage_mode_t storage_mode\n+\t\t, bool const add_paused)\n+\t{\n+\t\tadd_torrent_params p;\n+\t\tp.ti = std::make_shared<torrent_info>(ti);\n+\t\tp.save_path = save_path;\n+\t\tif (resume_data.type() != entry::undefined_t)\n+\t\t{\n+\t\t\tbencode(std::back_inserter(p.resume_data), resume_data);\n+\t\t}\n+\t\tp.storage_mode = storage_mode;\n+\t\tif (add_paused) p.flags |= add_torrent_params::flag_paused;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(218)\">../src/udp_tracker_connection.cpp:633</a></td><td>why is this a linked list?</td></tr><tr id=\"218\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>why is this a linked list?</h2><h4>../src/udp_tracker_connection.cpp:633</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\tti->free_piece_layers();\n \t\t}\n-\t\tatp.info_hashes = atp.ti->info_hashes();\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::list<address> ip_list;\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(219)\">../src/piece_picker.cpp:121</a></td><td>find a better place for this</td></tr><tr id=\"219\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>find a better place for this</h2><h4>../src/piece_picker.cpp:121</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tif (limit == 0)\n+\t\t\t{\n+\t\t\t\tstd::cerr << \" ...\";\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tif (*i == -1) break;\n+\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index)\n+\t\t\t{\n+\t\t\t\tstd::cerr << \"| \";\n+\t\t\t\t++j;\n+\t\t\t}\n+\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \";\n+\t\t\t--limit;\n+\t\t}\n+\t\tstd::cerr << std::endl;\n \t}\n }\n+#endif // TORRENT_PICKER_LOG\n+namespace libtorrent {\n \n-\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+<div style=\"background: #ffff00\" width=\"100%\">\tconst piece_block piece_block::invalid(\n+</div>\t\tstd::numeric_limits<piece_index_t>::max()\n+\t\t, std::numeric_limits<int>::max());\n \n-<div style=\"background: #ffff00\" width=\"100%\">\tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n-</div>\t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(filename, cfg);\n-\t\tupdate_atp(ret);\n+\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index;\n+\n+\tconstexpr picker_options_t piece_picker::rarest_first;\n+\tconstexpr picker_options_t piece_picker::reverse;\n+\tconstexpr picker_options_t piece_picker::on_parole;\n+\tconstexpr picker_options_t piece_picker::prioritize_partials;\n+\tconstexpr picker_options_t piece_picker::sequential;\n+\tconstexpr picker_options_t piece_picker::align_expanded_pieces;\n+\tconstexpr picker_options_t piece_picker::piece_extent_affinity;\n+\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_full;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio;\n+\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_open;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse;\n+\n+\t// the max number of blocks to create an affinity for\n+\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size;\n+\n+\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size)\n+\t\t: m_priority_boundaries(1, m_pieces.end_index())\n+\t{\n+\t\tTORRENT_ASSERT(total_size > 0);\n+\t\tTORRENT_ASSERT(piece_size > 0);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(220)\">../src/piece_picker.cpp:2067</a></td><td>this 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.</td></tr><tr id=\"220\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/piece_picker.cpp:2067</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t// now, copy over the pointers. We also apply a filter here to not\n+\t\t\t// include ineligible pieces in certain modes. For instance, a piece\n+\t\t\t// that the current peer doesn't have is not included.\n+\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading])\n+\t\t\t{\n+\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops);\n+\n+\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue;\n+\n+\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue()\n+\t\t\t\t\t== piece_pos::piece_downloading);\n+\n+\t\t\t\tordered_partials[num_ordered_partials++] = &dp;\n+\t\t\t}\n+\n+\t\t\t// now, sort the list.\n+\t\t\tif (options & rarest_first)\n+\t\t\t{\n+\t\t\t\tret |= picker_log_alert::rarest_first_partials;\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tstd::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials\n+</div>\t\t\t\t\t, std::bind(&piece_picker::partial_compare_rarest_first, this\n+\t\t\t\t\t\t, _1, _2));\n+\t\t\t}\n+\n+\t\t\tfor (int i = 0; i < num_ordered_partials; ++i)\n+\t\t\t{\n+\t\t\t\tret |= picker_log_alert::prioritize_partials;\n+\n+\t\t\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces\n+\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2\n+\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options);\n+\t\t\t\tif (num_blocks <= 0) return ret;\n+\t\t\t\tif (int(backup_blocks.size()) >= num_blocks\n+\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks)\n+\t\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks\n+\t\t\t\t, num_blocks);\n+\t\t\tif (num_blocks <= 0) return ret;\n+\n+\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2\n+\t\t\t\t, num_blocks);\n+\t\t\tif (num_blocks <= 0) return ret;\n+\t\t}\n+\n+\t\tif (!suggested_pieces.empty())\n+\t\t{\n+\t\t\tfor (piece_index_t i : suggested_pieces)\n+\t\t\t{\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(221)\">../src/piece_picker.cpp:2211</a></td><td>Is it a good idea that this affinity takes precedence over piece priority?</td></tr><tr id=\"221\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>Is it a good idea that this affinity takes precedence over\n+piece priority?</h2><h4>../src/piece_picker.cpp:2211</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first;\n+\n+\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces\n+\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n+\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n+\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n+\t\t\t\t\t\t\t, options);\n+\t\t\t\t\t\tif (num_blocks <= 0) return ret;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\tif (options & piece_extent_affinity)\n+</div>\t\t\t\t{\n+\t\t\t\t\tint to_erase = -1;\n+\t\t\t\t\tint idx = -1;\n+\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents)\n+\t\t\t\t\t{\n+\t\t\t\t\t\t++idx;\n+\t\t\t\t\t\tbool have_all = true;\n+\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e))\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false;\n+\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue;\n+\n+\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity;\n+\n+\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces\n+\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n+\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n+\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n+\t\t\t\t\t\t\t\t, options);\n+\t\t\t\t\t\t\tif (num_blocks <= 0)\n+\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n+\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n+\t\t\t\t\t\t\t\treturn ret;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n+\t\t\t\t\t\tif (have_all) to_erase = idx;\n+\t\t\t\t\t}\n+\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(222)\">../src/piece_picker.cpp:2566</a></td><td>when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense</td></tr><tr id=\"222\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>when expanding pieces for cache stripe reasons,\n+the !downloading condition doesn't make much sense</h2><h4>../src/piece_picker.cpp:2566</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tTORRENT_ASSERT(index < m_piece_map.end_index());\n+\t\tif (next(index) == m_piece_map.end_index())\n+\t\t\treturn m_blocks_in_last_piece;\n+\t\telse\n+\t\t\treturn blocks_per_piece();\n+\t}\n+\n+\tbool piece_picker::is_piece_free(piece_index_t const piece\n+\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n+\t{\n+\t\treturn bitmask[piece]\n+\t\t\t&& !m_piece_map[piece].have()\n+\t\t\t&& !m_piece_map[piece].filtered();\n+\t}\n+\n+\tbool piece_picker::can_pick(piece_index_t const piece\n+\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n+\t{\n+\t\treturn bitmask[piece]\n+\t\t\t&& !m_piece_map[piece].have()\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t&& !m_piece_map[piece].downloading()\n+</div>\t\t\t&& !m_piece_map[piece].filtered();\n+\t}\n+\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\tvoid piece_picker::check_peers()\n+\t{\n+\t\tfor (auto const& b : m_block_info)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n+\t\t}\n+\t}\n+#endif\n+\n+\tvoid piece_picker::clear_peer(torrent_peer* peer)\n+\t{\n+\t\tfor (auto& b : m_block_info)\n+\t\t{\n+\t\t\tif (b.peer == peer) b.peer = nullptr;\n+\t\t}\n+\t}\n+\n+\t// the first bool is true if this is the only peer that has requested and downloaded\n+\t// blocks from this piece.\n+\t// the second bool is true if this is the only active peer that is requesting\n+\t// and downloading blocks from this piece. Active means having a connection.\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(223)\">../src/piece_picker.cpp:3144</a></td><td>should 5 be configurable?</td></tr><tr id=\"223\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should 5 be configurable?</h2><h4>../src/piece_picker.cpp:3144</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\t\t// if at least one piece in this extent has a different priority than\n+\t\t\t// the one we just started downloading, don't create an affinity for\n+\t\t\t// adjacent pieces. This probably means the pieces belong to different\n+\t\t\t// files, or that some other mechanism determining the priority should\n+\t\t\t// take precedence.\n+\t\t\tif (piece_priority(piece) != this_prio) return;\n+\t\t}\n+\n+\t\t// if we already have all the *other* pieces in this extent, there's no\n+\t\t// need to inflate their priorities\n+\t\tif (have_all) return;\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (m_recent_extents.size() < 5)\n+</div>\t\t\tm_recent_extents.push_back(this_extent);\n+\n+\t\t// limit the number of extent affinities active at any given time to limit\n+\t\t// the cost of checking them. Also, don't replace them, commit to\n+\t\t// finishing them before starting another extent. This is analogous to\n+\t\t// limiting the number of partial pieces.\n+\t}\n+\n+\t// options may be 0 or piece_picker::reverse\n+\t// returns false if the block could not be marked as downloading\n+\tbool piece_picker::mark_as_downloading(piece_block const block\n+\t\t, torrent_peer* peer, picker_options_t const options)\n+\t{\n+#ifdef TORRENT_PICKER_LOG\n+\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\"\n+\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n+#endif\n+\n+\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n+\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index);\n+\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index);\n+\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index());\n+\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index));\n+\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have());\n+\n+\t\tpiece_pos& p = m_piece_map[block.piece_index];\n+\t\tif (p.download_queue() == piece_pos::piece_open)\n+\t\t{\n+#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n+\t\t\tINVARIANT_CHECK;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(224)\">../src/torrent_peer.cpp:192</a></td><td>how do we deal with our external address changing?</td></tr><tr id=\"224\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>how do we deal with our external address changing?</h2><h4>../src/torrent_peer.cpp:192</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\n+\t{\n+\t\tTORRENT_ASSERT(in_use);\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (peer_rank == 0)\n+</div>\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+#ifndef TORRENT_DISABLE_LOGGING\n+\tstd::string torrent_peer::to_string() const\n+\t{\n+\t\tTORRENT_ASSERT(in_use);\n+#if TORRENT_USE_I2P\n+\t\tif (is_i2p_addr) return dest().to_string();\n+#endif // TORRENT_USE_I2P\n+\t\treturn address().to_string();\n+\t}\n+#endif\n+\n+\tstd::int64_t torrent_peer::total_download() const\n+\t{\n+\t\tTORRENT_ASSERT(in_use);\n+\t\tif (connection != nullptr)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n+\t\t\treturn connection->statistics().total_payload_download();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\treturn std::int64_t(prev_amount_download) << 10;\n+\t\t}\n+\t}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(225)\">../src/create_torrent.cpp:618</a></td><td>this can be optimized</td></tr><tr id=\"225\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this can be optimized</h2><h4>../src/create_torrent.cpp:618</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::vector<char> ret;\n+</div>\t\tbencode(std::back_inserter(ret), generate());\n \t\treturn ret;\n \t}\n \n-\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\n+\tentry create_torrent::generate() const\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\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(226)\">../src/magnet_uri.cpp:439</a></td><td>what's the right number here?</td></tr><tr id=\"226\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>what's the right number here?</h2><h4>../src/magnet_uri.cpp:439</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\t\tconstexpr int max_index = 10000; // can't risk out of memory\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(227)\">../src/session_impl.cpp:615</a></td><td>come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store</td></tr><tr id=\"227\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>come up with some abstraction to do this for gnutls as well\n+load certificates from the windows system certificate store</h2><h4>../src/session_impl.cpp:615</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tX509_STORE* store = X509_STORE_new();\n+</div>\t\tif (store)\n+\t\t{\n+\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\");\n+\t\t\t// this is best effort\n+\t\t\tif (system_store)\n+\t\t\t{\n+\t\t\t\tCERT_CONTEXT const* ctx = nullptr;\n+\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr)\n+\t\t\t\t{\n+\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded);\n+\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded);\n+\t\t\t\t\t// this is best effort\n+\t\t\t\t\tif (!x509) continue;\n+\t\t\t\t\tX509_STORE_add_cert(store, x509);\n+\t\t\t\t\tX509_free(x509);\n+\t\t\t\t}\n+\t\t\t\tCertFreeCertificateContext(ctx);\n+\t\t\t\tCertCloseStore(system_store, 0);\n+\t\t\t}\n+\t\t}\n+\n+\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle();\n+\t\tSSL_CTX_set_cert_store(ssl_ctx, store);\n+#endif\n+#ifdef __APPLE__\n+\t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str());\n+\t\tec.clear();\n+#endif\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(228)\">../src/session_impl.cpp:1484</a></td><td>it would be nice to reserve() these vectors up front</td></tr><tr id=\"228\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to reserve() these vectors up front</h2><h4>../src/session_impl.cpp:1484</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tbandwidth_channel* ch = &p->channel[peer_connection::download_channel];\n+\t\t\tif (use_quota_overhead(ch, amount_down))\n+\t\t\t\tret |= 1 << peer_connection::download_channel;\n+\t\t\tch = &p->channel[peer_connection::upload_channel];\n+\t\t\tif (use_quota_overhead(ch, amount_up))\n+\t\t\t\tret |= 1 << peer_connection::upload_channel;\n+\t\t}\n \t\treturn ret;\n \t}\n \n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n+\t// session_impl is responsible for deleting 'pack'\n+\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack)\n \t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(torrent_file, cfg);\n-\t\tupdate_atp(ret);\n+\t\tINVARIANT_CHECK;\n+\t\tapply_settings_pack_impl(*pack);\n+\t}\n+\n+\tsettings_pack session_impl::get_settings() const\n+\t{\n+\t\tsettings_pack ret;\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (int i = settings_pack::string_type_base;\n+</div>\t\t\ti < settings_pack::max_string_setting_internal; ++i)\n+\t\t{\n+\t\t\tret.set_str(i, m_settings.get_str(i));\n+\t\t}\n+\t\tfor (int i = settings_pack::int_type_base;\n+\t\t\ti < settings_pack::max_int_setting_internal; ++i)\n+\t\t{\n+\t\t\tret.set_int(i, m_settings.get_int(i));\n+\t\t}\n+\t\tfor (int i = settings_pack::bool_type_base;\n+\t\t\ti < settings_pack::max_bool_setting_internal; ++i)\n+\t\t{\n+\t\t\tret.set_bool(i, m_settings.get_bool(i));\n+\t\t}\n \t\treturn ret;\n \t}\n \n-}\n+namespace {\n+\ttemplate <typename Pack>\n+\tint get_setting_impl(Pack const& p, int name, int*)\n+\t{ return p.get_int(name); }\n \n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(240)\">../src/add_torrent_params.cpp:78</a></td><td>pre 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<add_torrent_params>::value , \"should be nothrow move assignable\");</td></tr><tr id=\"240\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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<add_torrent_params>::value\n-, \"should be nothrow move assignable\");</h2><h4>../src/add_torrent_params.cpp:78</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tDECL_FLAG(sequential_download);\n-\t\t\tDECL_FLAG(pinned);\n-\t\t\tDECL_FLAG(stop_when_ready);\n-\t\t\tDECL_FLAG(override_trackers);\n-\t\t\tDECL_FLAG(override_web_seeds);\n-\t\t\tDECL_FLAG(need_save_resume);\n-\t\t\tDECL_FLAG(override_resume_data);\n-\t\t\tDECL_FLAG(merge_resume_trackers);\n-\t\t\tDECL_FLAG(use_resume_save_path);\n-\t\t\tDECL_FLAG(merge_resume_http_seeds);\n-\t\t\tDECL_FLAG(default_flags);\n-#undef DECL_FLAG\n-#endif // TORRENT_ABI_VERSION\n+\ttemplate <typename Pack>\n+\tbool get_setting_impl(Pack const& p, int name, bool*)\n+\t{ return p.get_bool(name); }\n \n-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\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-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(229)\">../src/session_impl.cpp:1998</a></td><td>could 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</td></tr><tr id=\"229\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:1998</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(241)\">../src/add_torrent_params.cpp:84</a></td><td>it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible<add_torrent_params>::value , \"should be nothrow default constructible\");</td></tr><tr id=\"241\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice if this was nothrow default constructible\n-static_assert(std::is_nothrow_default_constructible<add_torrent_params>::value\n-, \"should be nothrow default constructible\");</h2><h4>../src/add_torrent_params.cpp:84</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tDECL_FLAG(pinned);\n-\t\t\tDECL_FLAG(stop_when_ready);\n-\t\t\tDECL_FLAG(override_trackers);\n-\t\t\tDECL_FLAG(override_web_seeds);\n-\t\t\tDECL_FLAG(need_save_resume);\n-\t\t\tDECL_FLAG(override_resume_data);\n-\t\t\tDECL_FLAG(merge_resume_trackers);\n-\t\t\tDECL_FLAG(use_resume_save_path);\n-\t\t\tDECL_FLAG(merge_resume_http_seeds);\n-\t\t\tDECL_FLAG(default_flags);\n-#undef DECL_FLAG\n-#endif // TORRENT_ABI_VERSION\n+\tvoid session_impl::on_ip_change(error_code const& ec)\n+\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (!ec)\n+\t\t\tsession_log(\"received ip change from internal ip_notifier\");\n+\t\telse\n+\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str());\n+#endif\n+\t\tif (ec || m_abort || !m_ip_notifier) return;\n+\t\tm_ip_notifier->async_wait([this] (error_code const& e)\n+\t\t\t{ wrap(&session_impl::on_ip_change, e); });\n+\t\treopen_network_sockets({});\n+\t}\n \n-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\n+<div style=\"background: #ffff00\" width=\"100%\">\tvoid interface_to_endpoints(listen_interface_t const& iface\n+</div>\t\t, listen_socket_flags_t flags\n+\t\t, span<ip_interface const> const ifs\n+\t\t, std::vector<listen_endpoint_t>& eps)\n+\t{\n+\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{};\n+\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext;\n \n-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n+\t\t// First, check to see if it's an IP address\n+\t\terror_code err;\n+\t\taddress const adr = make_address(iface.device.c_str(), err);\n+\t\tif (!err)\n+\t\t{\n+\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tflags |= listen_socket_t::was_expanded;\n+\n+\t\t\t// this is the case where device names a network device. We need to\n+\t\t\t// enumerate all IPs associated with this device\n+\t\t\tfor (auto const& ipface : ifs)\n+\t\t\t{\n+\t\t\t\t// we're looking for a specific interface, and its address\n+\t\t\t\t// (which must be of the same family as the address we're\n+\t\t\t\t// connecting to)\n+\t\t\t\tif (iface.device != ipface.name) continue;\n+\n+\t\t\t\tbool const local = iface.local\n+\t\t\t\t\t|| ipface.interface_address.is_loopback()\n+\t\t\t\t\t|| is_link_local(ipface.interface_address);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(230)\">../src/session_impl.cpp:2306</a></td><td>it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to 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</td></tr><tr id=\"230\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:2306</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t{\n+\t\t\tfor (auto const& s : m_listen_sockets)\n+\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\t// new sockets need to map ports even if the caller did not request\n+\t\t\t// re-mapping\n+\t\t\tfor (auto const& s : new_sockets)\n+\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n+\t\t}\n+\n+\t\tupdate_lsd();\n+\n+#if TORRENT_USE_I2P\n+\t\topen_new_incoming_i2p_connection();\n+#endif\n+\n+\t\t// trackers that were not reachable, may have become reachable now.\n+\t\t// so clear the \"disabled\" flags to let them be tried one more time\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (auto& t : m_torrents)\n+</div>\t\t\tt->enable_all_trackers();\n+\t}\n+\n+\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options)\n+\t{\n+\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports));\n+\t}\n+\n+\tnamespace {\n+\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType>\n+\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep\n+\t\t\t, port_mapping_t& map_handle, std::string const& device)\n+\t\t{\n+\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle);\n+\t\t\tmap_handle = port_mapping_t{-1};\n+\n+\t\t\taddress const addr = ep.address();\n+\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them\n+\t\t\t// based on the scope of the local address\n+\t\t\tif (addr.is_v6() && is_local(addr))\n+\t\t\t\treturn;\n+\n+\t\t\t// only update this mapping if we actually have a socket listening\n+\t\t\tif (ep != EndpointType())\n+\t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device);\n+\t\t}\n+\t}\n+\n+\tvoid session_impl::remap_ports(remap_port_mask_t const mask\n+\t\t, listen_socket_t& s)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(231)\">../src/session_impl.cpp:2866</a></td><td>this size need to be capped</td></tr><tr id=\"231\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this size need to be capped</h2><h4>../src/session_impl.cpp:2866</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\t// handshaking\n+\t\t\t\treturn socket_type(ssl_stream<tcp::socket>(tcp::socket(std::move(s)), m_peer_ssl_ctx));\n+\t\t\t}\n+\t\t\telse\n+#endif\n+\t\t\t{\n+\t\t\t\treturn socket_type(tcp::socket(std::move(s)));\n+\t\t\t}\n+\t\t}();\n+\n+#ifdef TORRENT_SSL_PEERS\n+\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c));\n+#endif\n+\n+#ifdef TORRENT_SSL_PEERS\n+\t\tif (ssl == transport::ssl)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(is_ssl(c));\n+\n+\t\t\t// save the socket so we can cancel the handshake\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first;\n+</div>\n+\t\t\tauto sock = iter->get();\n+\t\t\t// for SSL connections, incoming_connection() is called\n+\t\t\t// after the handshake is done\n+\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n+\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake(\n+\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n+\t\t}\n+\t\telse\n+#endif\n+\t\t{\n+\t\t\tincoming_connection(std::move(c));\n+\t\t}\n+\t}\n+\n+#ifdef TORRENT_SSL_PEERS\n+\n+\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n+\t{\n+\t\tTORRENT_ASSERT(is_ssl(s));\n+\n+\t\t// save the socket so we can cancel the handshake\n+\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(232)\">../src/session_impl.cpp:2891</a></td><td>this size need to be capped</td></tr><tr id=\"232\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this size need to be capped</h2><h4>../src/session_impl.cpp:2891</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t// after the handshake is done\n+\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n+\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake(\n+\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n+\t\t}\n+\t\telse\n+#endif\n+\t\t{\n+\t\t\tincoming_connection(std::move(c));\n+\t\t}\n+\t}\n+\n+#ifdef TORRENT_SSL_PEERS\n+\n+\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n+\t{\n+\t\tTORRENT_ASSERT(is_ssl(s));\n+\n+\t\t// save the socket so we can cancel the handshake\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first;\n+</div>\t\tauto sock = iter->get();\n+\n+\t\t// for SSL connections, incoming_connection() is called\n+\t\t// after the handshake is done\n+\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n+\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake(\n+\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n+\t}\n+\n+\t// to test SSL connections, one can use this openssl command template:\n+\t//\n+\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem\n+\t// -CAfile <torrent-cert>.pem -debug -connect 127.0.0.1:4433 -tls1\n+\t// -servername <hex-encoded-info-hash>\n+\n+\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\");\n+\n+\t\tauto iter = m_incoming_sockets.find(sock);\n+\n+\t\t// this happens if the SSL connection is aborted because we're shutting\n+\t\t// down\n+\t\tif (iter == m_incoming_sockets.end()) return;\n+\n+\t\tsocket_type s(std::move(**iter));\n+\t\tTORRENT_ASSERT(is_ssl(s));\n+\t\tm_incoming_sockets.erase(iter);\n+\n+\t\terror_code e;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(233)\">../src/session_impl.cpp:3590</a></td><td>have a separate list for these connections, instead of having to loop through all of them</td></tr><tr id=\"233\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>have a separate list for these connections, instead of having to loop through all of them</h2><h4>../src/session_impl.cpp:3590</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// --------------------------------------------------------------\n+\t\tif (!m_paused) m_auto_manage_time_scaler--;\n+\t\tif (m_auto_manage_time_scaler < 0)\n+\t\t{\n+\t\t\tm_auto_manage_time_scaler = settings().get_int(settings_pack::auto_manage_interval);\n+\t\t\trecalculate_auto_managed_torrents();\n+\t\t}\n+\n+\t\t// --------------------------------------------------------------\n+\t\t// check for incoming connections that might have timed out\n+\t\t// --------------------------------------------------------------\n+\n+\t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n+\t\t{\n+\t\t\tpeer_connection* p = (*i).get();\n+\t\t\t++i;\n+\t\t\t// ignore connections that already have a torrent, since they\n+\t\t\t// are ticked through the torrents' second_tick\n+\t\t\tif (!p->associated_torrent().expired()) continue;\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint timeout = m_settings.get_int(settings_pack::handshake_timeout);\n+</div>#if TORRENT_USE_I2P\n+\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1;\n+#endif\n+\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout))\n+\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent);\n+\t\t}\n+\n+\t\t// --------------------------------------------------------------\n+\t\t// second_tick every torrent (that wants it)\n+\t\t// --------------------------------------------------------------\n+\n+#if TORRENT_DEBUG_STREAMING > 0\n+\t\tstd::printf(\"\\033[2J\\033[0;0H\");\n+#endif\n+\n+\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick];\n+\t\tfor (int i = 0; i < int(want_tick.size()); ++i)\n+\t\t{\n+\t\t\ttorrent& t = *want_tick[i];\n+\t\t\tTORRENT_ASSERT(t.want_tick());\n+\t\t\tTORRENT_ASSERT(!t.is_aborted());\n+\n+\t\t\tt.second_tick(tick_interval_ms);\n+\n+\t\t\t// if the call to second_tick caused the torrent\n+\t\t\t// to no longer want to be ticked (i.e. it was\n+\t\t\t// removed from the list) we need to back up the counter\n+\t\t\t// to not miss the torrent after it\n+\t\t\tif (!t.want_tick()) --i;\n+\t\t}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(234)\">../src/session_impl.cpp:3623</a></td><td>this should apply to all bandwidth channels</td></tr><tr id=\"234\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this should apply to all bandwidth channels</h2><h4>../src/session_impl.cpp:3623</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#if TORRENT_DEBUG_STREAMING > 0\n+\t\tstd::printf(\"\\033[2J\\033[0;0H\");\n+#endif\n+\n+\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick];\n+\t\tfor (int i = 0; i < int(want_tick.size()); ++i)\n+\t\t{\n+\t\t\ttorrent& t = *want_tick[i];\n+\t\t\tTORRENT_ASSERT(t.want_tick());\n+\t\t\tTORRENT_ASSERT(!t.is_aborted());\n+\n+\t\t\tt.second_tick(tick_interval_ms);\n+\n+\t\t\t// if the call to second_tick caused the torrent\n+\t\t\t// to no longer want to be ticked (i.e. it was\n+\t\t\t// removed from the list) we need to back up the counter\n+\t\t\t// to not miss the torrent after it\n+\t\t\tif (!t.want_tick()) --i;\n+\t\t}\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (m_settings.get_bool(settings_pack::rate_limit_ip_overhead))\n+</div>\t\t{\n+\t\t\tint const up_limit = upload_rate_limit(m_global_class);\n+\t\t\tint const down_limit = download_rate_limit(m_global_class);\n+\n+\t\t\tif (down_limit > 0\n+\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit\n+\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+\t\t\t{\n+\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n+\t\t\t\t\t, performance_alert::download_limit_too_low);\n+\t\t\t}\n+\n+\t\t\tif (up_limit > 0\n+\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit\n+\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+\t\t\t{\n+\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n+\t\t\t\t\t, performance_alert::upload_limit_too_low);\n+\t\t\t}\n+\t\t}\n+\n+#if TORRENT_ABI_VERSION == 1\n+\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate);\n+#endif\n+\n+\t\tm_stat.second_tick(tick_interval_ms);\n+\n+\t\t// --------------------------------------------------------------\n+\t\t// scrape paused torrents that are auto managed\n+\t\t// (unless the session is paused)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(235)\">../src/session_impl.cpp:4314</a></td><td>use 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</td></tr><tr id=\"235\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/session_impl.cpp:4314</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// boost, which are done immediately on a tracker response. These\n+\t\t// connections needs to be deducted from the regular connection attempt\n+\t\t// quota for this tick\n+\t\tif (m_boost_connections > 0)\n+\t\t{\n+\t\t\tif (m_boost_connections > max_connections)\n+\t\t\t{\n+\t\t\t\tm_boost_connections -= max_connections;\n+\t\t\t\tmax_connections = 0;\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tmax_connections -= m_boost_connections;\n+\t\t\t\tm_boost_connections = 0;\n+\t\t\t}\n+\t\t}\n+\n+\t\t// zero connections speeds are allowed, we just won't make any connections\n+\t\tif (max_connections <= 0) return;\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tint const limit = std::min(m_settings.get_int(settings_pack::connections_limit)\n+</div>\t\t\t- num_connections(), std::numeric_limits<int>::max() - 1);\n+\n+\t\t// this logic is here to smooth out the number of new connection\n+\t\t// attempts over time, to prevent connecting a large number of\n+\t\t// sockets, wait 10 seconds, and then try again\n+\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2)\n+\t\t\tmax_connections = (limit + 1) / 2;\n+\n+\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download];\n+\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished];\n+\n+\t\t// if no torrent want any peers, just return\n+\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return;\n+\n+\t\t// if we don't have any connection attempt quota, return\n+\t\tif (max_connections <= 0) return;\n+\n+\t\tint steps_since_last_connect = 0;\n+\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size());\n+\t\tfor (;;)\n+\t\t{\n+\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size()))\n+\t\t\t\tm_next_downloading_connect_torrent = 0;\n+\n+\t\t\tif (m_next_finished_connect_torrent >= int(want_peers_finished.size()))\n+\t\t\t\tm_next_finished_connect_torrent = 0;\n+\n+\t\t\ttorrent* t = nullptr;\n+\t\t\t// there are prioritized torrents. Pick one of those\n+\t\t\twhile (!m_prio_torrents.empty())\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(236)\">../src/session_impl.cpp:4459</a></td><td>post a message to have this happen immediately instead of waiting for the next tick</td></tr><tr id=\"236\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>post a message to have this happen\n+immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp:4459</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t\tcontinue;\n+\t\t\t}\n+\n+\t\t\tif (!p->is_peer_interested()\n+\t\t\t\t|| p->is_disconnecting()\n+\t\t\t\t|| p->is_connecting())\n+\t\t\t{\n+\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n+\t\t\t\t// already, make sure to choke it.\n+\t\t\t\tif (p->is_choked())\n+\t\t\t\t{\n+\t\t\t\t\tp->reset_choke_counters();\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t\tif (pi && pi->optimistically_unchoked)\n+\t\t\t\t{\n+\t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1);\n+\t\t\t\t\tpi->optimistically_unchoked = false;\n+\t\t\t\t\t// force a new optimistic unchoke\n+\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0;\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\t\t}\n+</div>\t\t\t\tt->choke_peer(*p);\n+\t\t\t\tp->reset_choke_counters();\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n+\t\t\tpeers.push_back(p.get());\n+\t\t}\n+\n+\t\tint const allowed_upload_slots = unchoke_sort(peers\n+\t\t\t, unchoke_interval, m_settings);\n+\n+\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker)\n+\t\t{\n+\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit);\n+\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots\n+\t\t\t\t, allowed_upload_slots);\n+\t\t}\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log())\n+\t\t{\n+\t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \"\n+\t\t\t\t\"eligible-peers: %d\"\n+\t\t\t\t\" allowed-slots: %d ]\"\n+\t\t\t\t, int(m_connections.size())\n+\t\t\t\t, int(peers.size())\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(237)\">../src/session_impl.cpp:4786</a></td><td>it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, 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.</td></tr><tr id=\"237\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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.</h2><h4>../src/session_impl.cpp:4786</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\tt->status(&st, flags);\n+\t\t}\n+\t}\n+\n+\tvoid session_impl::post_torrent_updates(status_flags_t const flags)\n+\t{\n+\t\tINVARIANT_CHECK;\n+\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tstd::vector<torrent*>& state_updates\n+\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates];\n+\n+#if TORRENT_USE_ASSERTS\n+\t\tm_posting_torrent_updates = true;\n+#endif\n+\n+\t\tstd::vector<torrent_status> status;\n+\t\tstatus.reserve(state_updates.size());\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tfor (auto& t : state_updates)\n+</div>\t\t{\n+\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list());\n+\t\t\tstatus.emplace_back();\n+\t\t\t// querying accurate download counters may require\n+\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another\n+\t\t\t// one will lead to calling state_updated(), which screws with\n+\t\t\t// this list while we're working on it, and break things\n+\t\t\tt->status(&status.back(), flags);\n+\t\t\tt->clear_in_state_update();\n+\t\t}\n+\t\tstate_updates.clear();\n+\n+#if TORRENT_USE_ASSERTS\n+\t\tm_posting_torrent_updates = false;\n+#endif\n+\n+\t\tm_alerts.emplace_alert<state_update_alert>(std::move(status));\n+\t}\n \n+\tvoid session_impl::post_session_stats()\n+\t{\n+\t\tif (!m_posted_stats_header)\n+\t\t{\n+\t\t\tm_posted_stats_header = true;\n+\t\t\tm_alerts.emplace_alert<session_stats_header_alert>();\n+\t\t}\n+\t\tm_disk_thread->update_stats_counters(m_stats_counters);\n+\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tif (m_dht)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(238)\">../src/session_impl.cpp:5161</a></td><td>factor out this logic into a separate function for unit testing</td></tr><tr id=\"238\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor out this logic into a separate function for unit\n+testing</h2><h4>../src/session_impl.cpp:5161</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tif (m_settings.get_int(settings_pack::outgoing_port) > 0)\n+\t\t{\n+#ifdef TORRENT_WINDOWS\n+\t\t\ts.set_option(exclusive_address_use(true), ec);\n+#else\n+\t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec);\n+#endif\n+\t\t\t// ignore errors because the underlying socket may not\n+\t\t\t// be opened yet. This happens when we're routing through\n+\t\t\t// a proxy. In that case, we don't yet know the address of\n+\t\t\t// the proxy server, and more importantly, we don't know\n+\t\t\t// the address family of its address. This means we can't\n+\t\t\t// open the socket yet. The socks abstraction layer defers\n+\t\t\t// opening it.\n+\t\t\tec.clear();\n+\t\t\tbind_ep.port(std::uint16_t(next_port()));\n+\t\t}\n \n+\t\tif (is_utp(s))\n+\t\t{\n <div style=\"background: #ffff00\" width=\"100%\">\n-</div>namespace aux {\n+</div>\t\t\tutp_socket_impl* impl = nullptr;\n+\t\t\ttransport ssl = transport::plaintext;\n+#if TORRENT_USE_SSL\n+\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr)\n+\t\t\t{\n+\t\t\t\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl();\n+\t\t\t\tssl = transport::ssl;\n+\t\t\t}\n+\t\t\telse\n+#endif\n+\t\t\t\timpl = boost::get<utp_stream>(s).get_impl();\n \n-\t// returns whether this add_torrent_params object has \"resume-data\", i.e.\n-\t// information about which pieces we have.\n-\tbool contains_resume_data(add_torrent_params const& atp)\n+\t\t\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways;\n+\t\t\tstd::shared_ptr<listen_socket_t> match;\n+\t\t\tfor (auto& ls : m_listen_sockets)\n+\t\t\t{\n+\t\t\t\t// this is almost, but not quite, like can_route()\n+\t\t\t\tif (!(ls->flags & listen_socket_t::proxy)\n+\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4())\n+\t\t\t\t\tcontinue;\n+\t\t\t\tif (ls->ssl != ssl) continue;\n+\t\t\t\tif (!(ls->flags & listen_socket_t::local_network))\n+\t\t\t\t\twith_gateways.push_back(ls);\n+\n+\t\t\t\tif (ls->flags & listen_socket_t::proxy\n+\t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask))\n+\t\t\t\t{\n+\t\t\t\t\t// is this better than the previous match?\n+\t\t\t\t\tmatch = ls;\n+\t\t\t\t}\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(239)\">../src/session_impl.cpp:5880</a></td><td>refactor, move the storage to dht_tracker</td></tr><tr id=\"239\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>refactor, move the storage to dht_tracker</h2><h4>../src/session_impl.cpp:5880</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tsession_log(\"not starting DHT, outstanding router lookups: %d\"\n+\t\t\t\t, m_outstanding_router_lookups);\n+#endif\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (m_abort)\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tsession_log(\"not starting DHT, aborting\");\n+#endif\n+\t\t\treturn;\n+\t\t}\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\"\n+\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups);\n+#endif\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tm_dht_storage = m_dht_storage_constructor(m_settings);\n+</div>\t\tm_dht = std::make_shared<dht::dht_tracker>(\n+\t\t\tstatic_cast<dht::dht_observer*>(this)\n+\t\t\t, m_io_context\n+\t\t\t, [this](aux::listen_socket_handle const& sock\n+\t\t\t\t, udp::endpoint const& ep\n+\t\t\t\t, span<char const> p\n+\t\t\t\t, error_code& ec\n+\t\t\t\t, udp_send_flags_t const flags)\n+\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); }\n+\t\t\t, m_settings\n+\t\t\t, m_stats_counters\n+\t\t\t, *m_dht_storage\n+\t\t\t, std::move(m_dht_state));\n+\n+\t\tfor (auto& s : m_listen_sockets)\n+\t\t{\n+\t\t\tif (s->ssl != transport::ssl\n+\t\t\t\t&& !(s->flags & listen_socket_t::local_network))\n+\t\t\t{\n+\t\t\t\tm_dht->new_socket(s);\n+\t\t\t}\n+\t\t}\n+\n+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(240)\">../src/session_impl.cpp:6267</a></td><td>asserts that no outstanding async operations are still in flight</td></tr><tr id=\"240\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>asserts that no outstanding async operations are still in flight</h2><h4>../src/session_impl.cpp:6267</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\t\treturn !atp.have_pieces.empty()\n-\t\t\t|| (atp.flags & torrent_flags::seed_mode);\n+\t\treturn !m_listen_sockets.empty();\n \t}\n-}\n \n-}\n+\tsession_impl::~session_impl()\n+\t{\n+\t\t// since we're destructing the session, no more alerts will make it out to\n+\t\t// the user. So stop posting them now\n+\t\tm_alerts.set_alert_mask({});\n+\t\tm_alerts.set_notify_function({});\n+\n+\t\t// this is not allowed to be the network thread!\n+//\t\tTORRENT_ASSERT(is_not_thread());\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\t\t// this can happen if we end the io_context run loop with an exception\n+\t\tm_connections.clear();\n+\t\tfor (auto& t : m_torrents)\n+\t\t{\n+\t\t\tt->panic();\n+\t\t\tt->abort();\n+\t\t}\n+\t\tm_torrents.clear();\n+\n+\t\t// this has probably been called already, but in case of sudden\n+\t\t// termination through an exception, it may not have been done\n+\t\tabort_stage2();\n+\n+#if defined TORRENT_ASIO_DEBUGGING\n+\t\tFILE* f = fopen(\"wakeups.log\", \"w+\");\n+\t\tif (f != nullptr)\n+\t\t{\n+\t\t\ttime_point m = min_time();\n+\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp;\n+\t\t\ttime_point prev = m;\n+\t\t\tstd::uint64_t prev_csw = 0;\n+\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches;\n+\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\");\n+\t\t\tfor (wakeup_t const& w : _wakeups)\n+\t\t\t{\n+\t\t\t\tbool const idle_wakeup = w.context_switches > prev_csw;\n+\t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\"\n+\t\t\t\t\t, total_microseconds(w.timestamp - m)\n+\t\t\t\t\t, total_microseconds(w.timestamp - prev)\n+\t\t\t\t\t, w.context_switches\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(241)\">../src/packet_buffer.cpp:157</a></td><td>use compare_less_wrap for this comparison as well</td></tr><tr id=\"241\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>use compare_less_wrap for this comparison as well</h2><h4>../src/packet_buffer.cpp:157</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t{\n+\t\tINVARIANT_CHECK;\n+\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size);\n+\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity;\n+\n+\t\twhile (new_size < size)\n+\t\t\tnew_size <<= 1;\n+\n+\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]);\n+\n+\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i)\n+\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]);\n+\n+\t\tm_storage = std::move(new_storage);\n+\t\tm_capacity = new_size;\n+\t}\n+\n+\tpacket_ptr packet_buffer::remove(index_type idx)\n+\t{\n+\t\tINVARIANT_CHECK;\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tif (idx >= m_first + m_capacity)\n+</div>\t\t\treturn packet_ptr();\n+\n+\t\tif (compare_less_wrap(idx, m_first, 0xffff))\n+\t\t\treturn packet_ptr();\n+\n+\t\tstd::size_t const mask = m_capacity - 1;\n+\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]);\n+\t\tm_storage[idx & mask].reset();\n+\n+\t\tif (old_value)\n+\t\t{\n+\t\t\t--m_size;\n+\t\t\tif (m_size == 0) m_last = m_first;\n+\t\t}\n+\n+\t\tif (idx == m_first && m_size != 0)\n+\t\t{\n+\t\t\t++m_first;\n+\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first)\n+\t\t\t\tif (m_storage[m_first & mask]) break;\n+\t\t\tm_first &= 0xffff;\n+\t\t}\n+\n+\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0)\n+\t\t{\n+\t\t\t--m_last;\n+\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last)\n+\t\t\t\tif (m_storage[m_last & mask]) break;\n+\t\t\t++m_last;\n+\t\t\tm_last &= 0xffff;\n </pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(242)\">../src/kademlia/node.cpp:1177</a></td><td>keep the returned value to pass as a limit to write_nodes_entries when implemented</td></tr><tr id=\"242\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>keep the returned value to pass as a limit\n to write_nodes_entries when implemented</h2><h4>../src/kademlia/node.cpp:1177</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -9997,15 +9997,157 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(244)\">../src/kademlia/put_data.cpp:92</a></td><td>what if o is not an instance of put_data_observer? This need to be redesigned for better type safety.</td></tr><tr id=\"244\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>what if o is not an instance of put_data_observer? This need to be\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(244)\">../src/kademlia/routing_table.cpp:289</a></td><td>This 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</td></tr><tr id=\"244\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/kademlia/routing_table.cpp:289</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\tm_buckets.reserve(30);\n+}\n+\n+int routing_table::bucket_limit(int bucket) const\n+{\n+\tif (!m_settings.get_bool(settings_pack::dht_extended_routing_table)) return m_bucket_size;\n+\n+\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+<div style=\"background: #ffff00\" width=\"100%\">\tif (s.size() > m_buckets.size()) return;\n+</div>\ts.clear();\n+\tfor (auto const& i : m_buckets)\n+\t{\n+\t\tdht_routing_bucket b;\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(245)\">../src/kademlia/routing_table.cpp:314</a></td><td>arvidn 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</td></tr><tr id=\"245\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/kademlia/routing_table.cpp:314</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tif (s.size() > m_buckets.size()) return;\n+\ts.clear();\n+\tfor (auto const& i : m_buckets)\n+\t{\n+\t\tdht_routing_bucket b;\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+void routing_table::status(session_status& s) const\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+<div style=\"background: #ffff00\" width=\"100%\">\ts.dht_global_nodes += num_global_nodes();\n+</div>\n+\tfor (auto const& i : m_buckets)\n+\t{\n+\t\tdht_routing_bucket b;\n+\t\tb.num_nodes = int(i.live_nodes.size());\n+\t\tb.num_replacements = int(i.replacements.size());\n+#if TORRENT_ABI_VERSION == 1\n+\t\tb.last_active = 0;\n+#endif\n+\t\ts.dht_routing_table.push_back(b);\n+\t}\n+}\n+#endif\n+\n+std::tuple<int, int, int> routing_table::size() const\n+{\n+\tint nodes = 0;\n+\tint replacements = 0;\n+\tint confirmed = 0;\n+\tfor (auto const& i : m_buckets)\n+\t{\n+\t\tnodes += int(i.live_nodes.size());\n+\t\tconfirmed += static_cast<int>(std::count_if(i.live_nodes.begin(), i.live_nodes.end()\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(246)\">../src/kademlia/routing_table.cpp:518</a></td><td>this need to take bucket \"prefix\" into account. It should be unified with add_node_impl()</td></tr><tr id=\"246\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this need to take bucket \"prefix\" into account. It should be unified\n+with add_node_impl()</h2><h4>../src/kademlia/routing_table.cpp:518</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\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+\t\t\treturn std::make_tuple(&*j, i, &i->replacements);\n+\t\t}\n+\t\tfor (auto j = i->live_nodes.begin(); j != i->live_nodes.end(); ++j)\n+\t\t{\n+\t\t\tif (j->addr() != ep.address()) continue;\n+\t\t\tif (j->port() != ep.port()) continue;\n+\t\t\treturn std::make_tuple(&*j, i, &i->live_nodes);\n+\t\t}\n+\t}\n+\treturn std::tuple<node_entry*, routing_table::table_t::iterator, bucket_t*>\n+\t{nullptr, m_buckets.end(), nullptr};\n+}\n+\n+<div style=\"background: #ffff00\" width=\"100%\">void routing_table::fill_from_replacements(table_t::iterator bucket)\n+</div>{\n+\tbucket_t& b = bucket->live_nodes;\n+\tbucket_t& rb = bucket->replacements;\n+\tint const bucket_size = bucket_limit(int(std::distance(m_buckets.begin(), bucket)));\n+\n+\tif (int(b.size()) >= bucket_size) return;\n+\n+\t// sort by RTT first, to find the node with the lowest\n+\t// RTT that is pinged\n+\tstd::sort(rb.begin(), rb.end());\n+\n+\twhile (int(b.size()) < bucket_size && !rb.empty())\n+\t{\n+\t\tauto j = std::find_if(rb.begin(), rb.end(), std::bind(&node_entry::pinged, _1));\n+\t\tif (j == rb.end()) break;\n+\t\tb.push_back(*j);\n+\t\trb.erase(j);\n+\t}\n+}\n+\n+void routing_table::prune_empty_bucket()\n+{\n+\tif (m_buckets.back().live_nodes.empty()\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(247)\">../src/kademlia/put_data.cpp:92</a></td><td>what if o is not an instance of put_data_observer? This need to be redesigned for better type safety.</td></tr><tr id=\"247\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>what if o is not an instance of put_data_observer? This need to be\n redesigned for better type safety.</h2><h4>../src/kademlia/put_data.cpp:92</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t}\n }\n \n void put_data::done()\n {\n \tm_done = true;\n \n@@ -10043,15 +10185,15 @@\n \n \tm_node.stats_counters().inc_stats_counter(counters::dht_put_out);\n \n \treturn m_node.m_rpc.invoke(e, o->target_ep(), o);\n }\n \n } } // namespace libtorrent::dht\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(245)\">../src/kademlia/node_id.cpp:66</a></td><td>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 tuned to this expectation now, and it doesn't really matter (other than complexity)</td></tr><tr id=\"245\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it's a little bit weird to return 159 - leading zeroes. It should\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(248)\">../src/kademlia/node_id.cpp:66</a></td><td>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 tuned to this expectation now, and it doesn't really matter (other than complexity)</td></tr><tr id=\"248\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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)</h2><h4>../src/kademlia/node_id.cpp:66</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10096,66 +10238,15 @@\n \n \taddress_v4::bytes_type b4{};\n \taddress_v6::bytes_type b6{};\n \tif (ip_.is_v6())\n \t{\n \t\tb6 = ip_.to_v6().to_bytes();\n \t\tip = b6.data();\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(246)\">../src/kademlia/dht_tracker.cpp:317</a></td><td>pick the closest node rather than the first</td></tr><tr id=\"246\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>pick the closest node rather than the first</h2><h4>../src/kademlia/dht_tracker.cpp:317</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\"\n-\t\t\t, int(m_nodes.size()));\n-#endif\n-\t}\n-\n-\tvoid dht_tracker::update_storage_node_ids()\n-\t{\n-\t\tstd::vector<sha1_hash> ids;\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tids.push_back(n.second.dht.nid());\n-\t\tm_storage.update_node_ids(ids);\n-\t}\n-\n-\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name)\n-\t{\n-\t\tTORRENT_UNUSED(id);\n-\t\tfor (auto& n : m_nodes)\n-\t\t{\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (n.second.dht.protocol_family_name() == family_name)\n-</div>\t\t\t\treturn &n.second.dht;\n-\t\t}\n-\n-\t\treturn nullptr;\n-\t}\n-\n-\tvoid dht_tracker::get_peers(sha1_hash const& ih\n-\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n-\t}\n-\n-\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port\n-\t\t, announce_flags_t const flags\n-\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tn.second.dht.announce(ih, listen_port, flags, f);\n-\t}\n-\n-\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target\n-\t\t, std::function<void(node_id\n-\t\t\t, time_duration\n-\t\t\t, int, std::vector<sha1_hash>\n-\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t{\n-\t\t\tif (ep.protocol() != (n.first.get_external_address().is_v4() ? udp::v4() : udp::v6()))\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(247)\">../src/kademlia/item.cpp:143</a></td><td>implement ctor for entry from bdecode_node?</td></tr><tr id=\"247\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>implement ctor for entry from bdecode_node?</h2><h4>../src/kademlia/item.cpp:143</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t, secret_key const& sk)\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(249)\">../src/kademlia/item.cpp:143</a></td><td>implement ctor for entry from bdecode_node?</td></tr><tr id=\"249\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>implement ctor for entry from bdecode_node?</h2><h4>../src/kademlia/item.cpp:143</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t, secret_key const& sk)\n {\n \tchar str[1200];\n \tint const len = canonical_string(v, seq, salt, str);\n \n \treturn ed25519_sign({str, len}, pk, sk);\n }\n \n@@ -10198,156 +10289,65 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(248)\">../src/kademlia/routing_table.cpp:289</a></td><td>This 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</td></tr><tr id=\"248\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/kademlia/routing_table.cpp:289</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\tm_buckets.reserve(30);\n-}\n-\n-int routing_table::bucket_limit(int bucket) const\n-{\n-\tif (!m_settings.get_bool(settings_pack::dht_extended_routing_table)) return m_bucket_size;\n-\n-\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-<div style=\"background: #ffff00\" width=\"100%\">\tif (s.size() > m_buckets.size()) return;\n-</div>\ts.clear();\n-\tfor (auto const& i : m_buckets)\n-\t{\n-\t\tdht_routing_bucket b;\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(249)\">../src/kademlia/routing_table.cpp:314</a></td><td>arvidn 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</td></tr><tr id=\"249\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../src/kademlia/routing_table.cpp:314</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tif (s.size() > m_buckets.size()) return;\n-\ts.clear();\n-\tfor (auto const& i : m_buckets)\n-\t{\n-\t\tdht_routing_bucket b;\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-void routing_table::status(session_status& s) const\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-<div style=\"background: #ffff00\" width=\"100%\">\ts.dht_global_nodes += num_global_nodes();\n-</div>\n-\tfor (auto const& i : m_buckets)\n-\t{\n-\t\tdht_routing_bucket b;\n-\t\tb.num_nodes = int(i.live_nodes.size());\n-\t\tb.num_replacements = int(i.replacements.size());\n-#if TORRENT_ABI_VERSION == 1\n-\t\tb.last_active = 0;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(250)\">../src/kademlia/dht_tracker.cpp:317</a></td><td>pick the closest node rather than the first</td></tr><tr id=\"250\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>pick the closest node rather than the first</h2><h4>../src/kademlia/dht_tracker.cpp:317</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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\ts.dht_routing_table.push_back(b);\n \t}\n-}\n-#endif\n \n-std::tuple<int, int, int> routing_table::size() const\n-{\n-\tint nodes = 0;\n-\tint replacements = 0;\n-\tint confirmed = 0;\n-\tfor (auto const& i : m_buckets)\n+\tvoid dht_tracker::update_storage_node_ids()\n \t{\n-\t\tnodes += int(i.live_nodes.size());\n-\t\tconfirmed += static_cast<int>(std::count_if(i.live_nodes.begin(), i.live_nodes.end()\n-\t\t\t, [](node_entry const& k) { return k.confirmed(); } ));\n-\n-\t\treplacements += int(i.replacements.size());\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-\treturn std::make_tuple(nodes, replacements, confirmed);\n-}\n \n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(250)\">../src/kademlia/routing_table.cpp:518</a></td><td>this need to take bucket \"prefix\" into account. It should be unified with add_node_impl()</td></tr><tr id=\"250\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this need to take bucket \"prefix\" into account. It should be unified\n-with add_node_impl()</h2><h4>../src/kademlia/routing_table.cpp:518</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\n-\tfor (auto i = m_buckets.begin() , end(m_buckets.end()); i != end; ++i)\n+\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name)\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-\t\t\treturn std::make_tuple(&*j, i, &i->replacements);\n-\t\t}\n-\t\tfor (auto j = i->live_nodes.begin(); j != i->live_nodes.end(); ++j)\n+\t\tTORRENT_UNUSED(id);\n+\t\tfor (auto& n : m_nodes)\n \t\t{\n-\t\t\tif (j->addr() != ep.address()) continue;\n-\t\t\tif (j->port() != ep.port()) continue;\n-\t\t\treturn std::make_tuple(&*j, i, &i->live_nodes);\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tif (n.second.dht.protocol_family_name() == family_name)\n+</div>\t\t\t\treturn &n.second.dht;\n \t\t}\n-\t}\n-\treturn std::tuple<node_entry*, routing_table::table_t::iterator, bucket_t*>\n-\t{nullptr, m_buckets.end(), nullptr};\n-}\n \n-<div style=\"background: #ffff00\" width=\"100%\">void routing_table::fill_from_replacements(table_t::iterator bucket)\n-</div>{\n-\tbucket_t& b = bucket->live_nodes;\n-\tbucket_t& rb = bucket->replacements;\n-\tint const bucket_size = bucket_limit(int(std::distance(m_buckets.begin(), bucket)));\n-\n-\tif (int(b.size()) >= bucket_size) return;\n-\n-\t// sort by RTT first, to find the node with the lowest\n-\t// RTT that is pinged\n-\tstd::sort(rb.begin(), rb.end());\n+\t\treturn nullptr;\n+\t}\n \n-\twhile (int(b.size()) < bucket_size && !rb.empty())\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\tauto j = std::find_if(rb.begin(), rb.end(), std::bind(&node_entry::pinged, _1));\n-\t\tif (j == rb.end()) break;\n-\t\tb.push_back(*j);\n-\t\trb.erase(j);\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n \t}\n-}\n \n-void routing_table::prune_empty_bucket()\n-{\n-\tif (m_buckets.back().live_nodes.empty()\n-\t\t&& m_buckets.back().replacements.empty())\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\tm_buckets.erase(m_buckets.end() - 1);\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.announce(ih, listen_port, flags, f);\n \t}\n-}\n \n-void routing_table::remove_node(node_entry* n, bucket_t* b)\n+\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target\n+\t\t, std::function<void(node_id\n+\t\t\t, time_duration\n+\t\t\t, int, std::vector<sha1_hash>\n+\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f)\n+\t{\n+\t\tfor (auto& n : m_nodes)\n+\t\t{\n+\t\t\tif (ep.protocol() != (n.first.get_external_address().is_v4() ? udp::v4() : udp::v6()))\n </pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(251)\">../include/libtorrent/torrent_info.hpp:729</a></td><td>change the type to std::shared_ptr<char const> in C++17 it is used as if immutable, it cannot be const for technical reasons right now.</td></tr><tr id=\"251\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>change the type to std::shared_ptr<char const> in C++17\n it is used as if immutable, it cannot be const for technical reasons\n right now.</h2><h4>../include/libtorrent/torrent_info.hpp:729</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10393,144 +10393,116 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(252)\">../include/libtorrent/identify_client.hpp:48</a></td><td>hide this declaration when deprecated functions are disabled, and remove its internal use</td></tr><tr id=\"252\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>hide this declaration when deprecated functions are disabled, and\n-remove its internal use</h2><h4>../include/libtorrent/identify_client.hpp:48</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(252)\">../include/libtorrent/piece_picker.hpp:823</a></td><td>should this be allocated lazily?</td></tr><tr id=\"252\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should this be allocated lazily?</h2><h4>../include/libtorrent/piece_picker.hpp:823</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-#include \"libtorrent/config.hpp\"\n+\tprivate:\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+#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-#include \"libtorrent/peer_id.hpp\"\n-#include \"libtorrent/fingerprint.hpp\"\n+\t\t// the following vectors are mutable because they sometimes may\n+\t\t// be updated lazily, triggered by const functions\n \n-<div style=\"background: #ffff00\" width=\"100%\">namespace libtorrent {\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n </div>\n-namespace aux {\n-\n-\tTORRENT_EXTRA_EXPORT\n-\tstd::string identify_client_impl(const peer_id& p);\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-}\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// these functions don't really need to be public. This mechanism of\n-\t// advertising client software and version is also out-dated.\n+\t\t// the number of bytes of pad file set in this piece picker\n+\t\tstd::int64_t m_num_pad_bytes = 0;\n \n-\t// 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+\t\t// the number of pad blocks that we already have\n+\t\tstd::int64_t m_have_pad_bytes = 0;\n \n-#if TORRENT_ABI_VERSION == 1\n+\t\t// the number of pad blocks part of filtered pieces we don't have\n+\t\tstd::int64_t m_filtered_pad_bytes = 0;\n \n-#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n+\t\t// the number of pad blocks we have that are also filtered\n+\t\tstd::int64_t m_have_filtered_pad_bytes = 0;\n \n-\t// 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+\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-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(253)\">../include/libtorrent/socket_type.hpp:60</a></td><td>move to aux</td></tr><tr id=\"253\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move to aux</h2><h4>../include/libtorrent/socket_type.hpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">namespace libtorrent {\n+\t\t// this vector contains all piece indices that are pickable\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(253)\">../include/libtorrent/piece_picker.hpp:895</a></td><td>it would be more intuitive to account \"wanted\" pieces instead of filtered</td></tr><tr id=\"253\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be more intuitive to account \"wanted\" pieces\n+instead of filtered</h2><h4>../include/libtorrent/piece_picker.hpp:895</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-// A type describing kinds of sockets involved in various operations or events.\n-enum class socket_type_t : std::uint8_t {\n-\ttcp,\n-\tsocks5,\n-\thttp,\n-\tutp,\n-\ti2p,\n-\ttcp_ssl,\n-\tsocks5_ssl,\n-\thttp_ssl,\n-\tutp_ssl,\n+\t\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-#if TORRENT_ABI_VERSION <= 2\n-\tudp TORRENT_DEPRECATED_ENUM = utp,\n-#endif\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-// return a short human readable name for types of socket\n-<div style=\"background: #ffff00\" width=\"100%\">char const* socket_type_name(socket_type_t);\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tint m_num_filtered = 0;\n </div>\n-}\n-\n-#endif\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(254)\">../include/libtorrent/announce_entry.hpp:76</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id=\"254\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>include the number of peers received from this tracker, at last\n-announce</h2><h4>../include/libtorrent/announce_entry.hpp:76</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-\tstruct TORRENT_EXPORT announce_infohash\n-\t{\n-\t\t// internal\n-\t\tTORRENT_UNEXPORT announce_infohash();\n-\n-\t\t// if this tracker has returned an error or warning message\n-\t\t// that message is stored here\n-\t\tstd::string message;\n-\n-\t\t// if this tracker failed the last time it was contacted\n-\t\t// this error code specifies what error occurred\n-\t\terror_code last_error;\n-\n-\t\t// the time of next tracker announce\n-\t\ttime_point32 next_announce = (time_point32::min)();\n+\t\t// the number of pieces we have that also are filtered\n+\t\tint m_num_have_filtered = 0;\n \n-\t\t// no announces before this time\n-\t\ttime_point32 min_announce = (time_point32::min)();\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-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\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+\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// if this tracker has returned scrape data, these fields are filled in\n-\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts\n-\t\t// the number of current downloaders. ``complete`` counts the number of\n-\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the\n-\t\t// cumulative number of completed downloads.\n-\t\tint scrape_incomplete = -1;\n-\t\tint scrape_complete = -1;\n-\t\tint scrape_downloaded = -1;\n+\t\t// the number of pieces we have (i.e. passed hash check).\n+\t\t// This includes pieces that we have filtered but still have\n+\t\tint m_num_have = 0;\n \n-\t\t// 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// 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\t// true while we're waiting for a response from the tracker.\n-\t\tbool updating : 1;\n+\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 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+\t};\n+}\n \n-\t\t// set to true when we send a event=completed.\n-\t\tbool complete_sent : 1;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(255)\">../include/libtorrent/torrent.hpp:280</a></td><td>make this a raw pointer. perhaps keep the shared_ptr around further down the object to maintain an owner</td></tr><tr id=\"255\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a raw pointer. perhaps keep the shared_ptr\n+#endif // TORRENT_PIECE_PICKER_HPP_INCLUDED\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(254)\">../include/libtorrent/torrent.hpp:280</a></td><td>make this a raw pointer. perhaps keep the shared_ptr around further down the object to maintain an owner</td></tr><tr id=\"254\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a raw pointer. perhaps keep the shared_ptr\n around further down the object to maintain an owner</h2><h4>../include/libtorrent/torrent.hpp:280</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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@@ -10574,15 +10546,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(256)\">../include/libtorrent/torrent.hpp:463</a></td><td>make graceful pause also finish all sending blocks before disconnecting</td></tr><tr id=\"256\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make graceful pause also finish all sending blocks\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(255)\">../include/libtorrent/torrent.hpp:463</a></td><td>make graceful pause also finish all sending blocks before disconnecting</td></tr><tr id=\"255\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make graceful pause also finish all sending blocks\n before disconnecting</h2><h4>../include/libtorrent/torrent.hpp:463</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10626,15 +10598,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(257)\">../include/libtorrent/torrent.hpp:600</a></td><td>make this flag a combination of the other ones</td></tr><tr id=\"257\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this flag a combination\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(256)\">../include/libtorrent/torrent.hpp:600</a></td><td>make this flag a combination of the other ones</td></tr><tr id=\"256\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this flag a combination\n of the other ones</h2><h4>../include/libtorrent/torrent.hpp:600</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10678,15 +10650,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(258)\">../include/libtorrent/torrent.hpp:1381</a></td><td>this wastes 5 bits per file</td></tr><tr id=\"258\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this wastes 5 bits per file</h2><h4>../include/libtorrent/torrent.hpp:1381</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#ifndef TORRENT_DISABLE_EXTENSIONS\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(257)\">../include/libtorrent/torrent.hpp:1381</a></td><td>this wastes 5 bits per file</td></tr><tr id=\"257\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this wastes 5 bits per file</h2><h4>../include/libtorrent/torrent.hpp:1381</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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@@ -10729,15 +10701,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(259)\">../include/libtorrent/torrent.hpp:1696</a></td><td>this member can probably be removed</td></tr><tr id=\"259\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this member can probably be removed</h2><h4>../include/libtorrent/torrent.hpp:1696</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tunsigned int m_num_uploads:24;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(258)\">../include/libtorrent/torrent.hpp:1696</a></td><td>this member can probably be removed</td></tr><tr id=\"258\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>this member can probably be removed</h2><h4>../include/libtorrent/torrent.hpp:1696</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10780,15 +10752,101 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(260)\">../include/libtorrent/peer_connection_interface.hpp:51</a></td><td>make this interface smaller!</td></tr><tr id=\"260\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this interface smaller!</h2><h4>../include/libtorrent/peer_connection_interface.hpp:51</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(259)\">../include/libtorrent/performance_counters.hpp:485</a></td><td>some space could be saved here by making gauges 32 bits</td></tr><tr id=\"259\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>some space could be saved here by making gauges 32 bits</h2><h4>../include/libtorrent/performance_counters.hpp:485</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(260)\">../include/libtorrent/performance_counters.hpp:486</a></td><td>restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points</td></tr><tr id=\"260\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>restore these to regular integers. Instead have one copy\n+of the counters per thread and collect them at convenient\n+synchronization points</h2><h4>../include/libtorrent/performance_counters.hpp:486</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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+<div style=\"background: #ffff00\" width=\"100%\">#ifdef ATOMIC_LLONG_LOCK_FREE\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(261)\">../include/libtorrent/announce_entry.hpp:76</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id=\"261\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>include the number of peers received from this tracker, at last\n+announce</h2><h4>../include/libtorrent/announce_entry.hpp:76</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+\tstruct TORRENT_EXPORT announce_infohash\n+\t{\n+\t\t// internal\n+\t\tTORRENT_UNEXPORT announce_infohash();\n+\n+\t\t// if this tracker has returned an error or warning message\n+\t\t// that message is stored here\n+\t\tstd::string message;\n+\n+\t\t// if this tracker failed the last time it was contacted\n+\t\t// this error code specifies what error occurred\n+\t\terror_code last_error;\n+\n+\t\t// the time of next tracker announce\n+\t\ttime_point32 next_announce = (time_point32::min)();\n+\n+\t\t// no announces before this time\n+\t\ttime_point32 min_announce = (time_point32::min)();\n+\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\t\t// these are either -1 or the scrape information this tracker last\n+\t\t// responded with. *incomplete* is the current number of downloaders in\n+\t\t// the swarm, *complete* is the current number of seeds in the swarm and\n+\t\t// *downloaded* is the cumulative number of completed downloads of this\n+\t\t// torrent, since the beginning of time (from this tracker's point of\n+\t\t// view).\n+\n+\t\t// if this tracker has returned scrape data, these fields are filled in\n+\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts\n+\t\t// the number of current downloaders. ``complete`` counts the number of\n+\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the\n+\t\t// cumulative number of completed downloads.\n+\t\tint scrape_incomplete = -1;\n+\t\tint scrape_complete = -1;\n+\t\tint scrape_downloaded = -1;\n+\n+\t\t// the number of times in a row we have failed to announce to this\n+\t\t// tracker.\n+\t\tstd::uint8_t fails : 7;\n+\n+\t\t// true while we're waiting for a response from the tracker.\n+\t\tbool updating : 1;\n+\n+\t\t// set to true when we get a valid response from an announce\n+\t\t// with event=started. If it is set, we won't send start in the subsequent\n+\t\t// announces.\n+\t\tbool start_sent : 1;\n+\n+\t\t// set to true when we send a event=completed.\n+\t\tbool complete_sent : 1;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(262)\">../include/libtorrent/peer_connection_interface.hpp:51</a></td><td>make this interface smaller!</td></tr><tr id=\"262\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this interface smaller!</h2><h4>../include/libtorrent/peer_connection_interface.hpp:51</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10831,116 +10889,194 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(261)\">../include/libtorrent/piece_picker.hpp:823</a></td><td>should this be allocated lazily?</td></tr><tr id=\"261\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>should this be allocated lazily?</h2><h4>../include/libtorrent/piece_picker.hpp:823</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(263)\">../include/libtorrent/hash_picker.hpp:155</a></td><td>support batched adding of block hashes for reduced overhead?</td></tr><tr id=\"263\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support batched adding of block hashes for reduced overhead?</h2><h4>../include/libtorrent/hash_picker.hpp:155</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// the number of hashes in the range\n+\t\tint count = 0;\n+\t\tint proof_layers = 0;\n+\t};\n+\n+\t// validates the hash_request, to ensure its invariant as well as matching\n+\t// the torrent's file_storage and the number of hashes accompanying the\n+\t// request\n+\tTORRENT_EXTRA_EXPORT\n+\tbool validate_hash_request(hash_request const& hr, file_storage const& fs);\n+\n+\tclass TORRENT_EXTRA_EXPORT hash_picker\n+\t{\n+\tpublic:\n+\t\thash_picker(file_storage const& files\n+\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n+\n+\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n+\n+\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes);\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tset_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h);\n+</div>\t\tvoid hashes_rejected(hash_request const& req);\n+\t\tvoid verify_block_hashes(piece_index_t index);\n+\n+\t\t// do we know the piece layer hash for a piece\n+\t\tbool have_hash(piece_index_t index) const;\n+\t\t// do we know all the block hashes for a file?\n+\t\tbool have_all(file_index_t file) const;\n+\t\tbool have_all() const;\n+\t\tbool piece_verified(piece_index_t piece) const;\n+\n+\t\tint piece_layer() const { return m_piece_layer; }\n \n \tprivate:\n+\t\t// returns the number of proof layers needed to verify the node's hash\n+\t\tint layers_to_verify(node_index idx) const;\n+\t\tint file_num_layers(file_index_t idx) const;\n \n-#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+\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(264)\">../include/libtorrent/identify_client.hpp:48</a></td><td>hide this declaration when deprecated functions are disabled, and remove its internal use</td></tr><tr id=\"264\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>hide this declaration when deprecated functions are disabled, and\n+remove its internal use</h2><h4>../include/libtorrent/identify_client.hpp:48</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n+\n+*/\n+\n+#ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED\n+#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED\n+\n+#include \"libtorrent/config.hpp\"\n+\n+#if TORRENT_ABI_VERSION == 1\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/optional.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n #endif\n \n-\t\t// the following vectors are mutable because they sometimes may\n-\t\t// be updated lazily, triggered by const functions\n+#include \"libtorrent/peer_id.hpp\"\n+#include \"libtorrent/fingerprint.hpp\"\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n+<div style=\"background: #ffff00\" width=\"100%\">namespace libtorrent {\n </div>\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+namespace aux {\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+\tTORRENT_EXTRA_EXPORT\n+\tstd::string identify_client_impl(const peer_id& p);\n \n-\t\t// the number of bytes of pad file set in this piece picker\n-\t\tstd::int64_t m_num_pad_bytes = 0;\n+}\n \n-\t\t// the number of pad blocks that we already have\n-\t\tstd::int64_t m_have_pad_bytes = 0;\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// the number of pad blocks part of filtered pieces we don't have\n-\t\tstd::int64_t m_filtered_pad_bytes = 0;\n+\t// 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// the number of pad blocks we have that are also filtered\n-\t\tstd::int64_t m_have_filtered_pad_bytes = 0;\n+#if TORRENT_ABI_VERSION == 1\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+#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n \n-\t\t// this vector contains all piece indices that are pickable\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(262)\">../include/libtorrent/piece_picker.hpp:895</a></td><td>it would be more intuitive to account \"wanted\" pieces instead of filtered</td></tr><tr id=\"262\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be more intuitive to account \"wanted\" pieces\n-instead of filtered</h2><h4>../include/libtorrent/piece_picker.hpp:895</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-\t\t// this holds the information of the blocks in partially downloaded\n-\t\t// pieces. the downloading_piece::info index point into this vector for\n-\t\t// its storage\n-\t\taux::vector<block_info> m_block_info;\n+\t// Returns an optional fingerprint if any can be identified from the peer\n+\t// id. This can be used to automate the identification of clients. It will\n+\t// not be able to identify peers with non- standard encodings. Only Azureus\n+\t// style, Shadow's style and Mainline style.\n+\tTORRENT_DEPRECATED_EXPORT\n+\tboost::optional<fingerprint>\n+\t\tclient_fingerprint(peer_id const& p);\n \n-\t\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+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(265)\">../include/libtorrent/upnp.hpp:162</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id=\"265\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support using the windows API for UPnP operations as well</h2><h4>../include/libtorrent/upnp.hpp:162</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\n+\tbool in_error_code = false;\n+\tbool exit = false;\n+\tint error_code = -1;\n+};\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+struct ip_address_parse_state: error_code_parse_state\n+{\n+\tbool in_ip_address = false;\n+\tstd::string ip_address;\n+};\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tint m_num_filtered = 0;\n-</div>\n-\t\t// the number of pieces we have that also are filtered\n-\t\tint m_num_have_filtered = 0;\n+TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\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+TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n+\t, error_code_parse_state& state);\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+TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n+\t, ip_address_parse_state& state);\n \n-\t\t// the number of pieces we have (i.e. passed hash check).\n-\t\t// This includes pieces that we have filtered but still have\n-\t\tint m_num_have = 0;\n+<div style=\"background: #ffff00\" width=\"100%\">struct TORRENT_EXTRA_EXPORT upnp final\n+</div>\t: std::enable_shared_from_this<upnp>\n+\t, single_threaded\n+{\n+\tupnp(io_context& ios\n+\t\t, aux::session_settings const& settings\n+\t\t, aux::portmap_callback& cb\n+\t\t, address_v4 listen_address\n+\t\t, address_v4 netmask\n+\t\t, std::string listen_device\n+\t\t, aux::listen_socket_handle ls);\n+\t~upnp();\n \n-\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+\tvoid start();\n \n-\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 1 };\n+\t// Attempts to add a port mapping for the specified protocol. Valid protocols are\n+\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and\n+\t// ``natpmp::udp`` for the NAT-PMP class.\n+\t//\n+\t// ``external_port`` is the port on the external address that will be mapped. This\n+\t// is a hint, you are not guaranteed that this port will be available, and it may\n+\t// end up being something else. In the portmap_alert_ notification, the actual\n+\t// external port is reported.\n+\t//\n+\t// ``local_port`` is the port in the local machine that the mapping should forward\n+\t// to.\n+\t//\n+\t// The return value is an index that identifies this port mapping. This is used\n+\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and\n+\t// portmap_alert_ respectively. If The mapping fails immediately, the return value\n+\t// is -1, which means failure. There will not be any error alert notification for\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(266)\">../include/libtorrent/socket_type.hpp:60</a></td><td>move to aux</td></tr><tr id=\"266\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move to aux</h2><h4>../include/libtorrent/socket_type.hpp:60</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">namespace libtorrent {\n \n-\t};\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+<div style=\"background: #ffff00\" width=\"100%\">char const* socket_type_name(socket_type_t);\n+</div>\n }\n \n-#endif // TORRENT_PIECE_PICKER_HPP_INCLUDED\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(263)\">../include/libtorrent/i2p_stream.hpp:533</a></td><td>make this a string_view</td></tr><tr id=\"263\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a string_view</h2><h4>../include/libtorrent/i2p_stream.hpp:533</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+#endif\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(267)\">../include/libtorrent/i2p_stream.hpp:533</a></td><td>make this a string_view</td></tr><tr id=\"267\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a string_view</h2><h4>../include/libtorrent/i2p_stream.hpp:533</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -10983,15 +11119,67 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(264)\">../include/libtorrent/string_view.hpp:40</a></td><td>replace this by the standard string_view in C++17</td></tr><tr id=\"264\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by the standard string_view in C++17</h2><h4>../include/libtorrent/string_view.hpp:40</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(268)\">../include/libtorrent/proxy_base.hpp:227</a></td><td>it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);</td></tr><tr id=\"268\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to remember the bind port and bind once we know where the proxy is\n+m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:227</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_sock.cancel();\n+\t}\n+\n+\tvoid cancel(error_code& ec)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_sock.cancel(ec);\n+\t}\n+\n+\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\t// the reason why we ignore binds here is because we don't\n+\t\t// (necessarily) yet know what address family the proxy\n+\t\t// will resolve to, and binding to the wrong one would\n+\t\t// break our connection attempt later. The caller here\n+\t\t// doesn't necessarily know that we're proxying, so this\n+\t\t// bind address is based on the final endpoint, not the\n+\t\t// proxy.\n+<div style=\"background: #ffff00\" width=\"100%\">\t}\n+</div>\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid open(protocol_type const&)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+//\t\tm_sock.open(p);\n+\t}\n+#endif\n+\n+\tvoid open(protocol_type const&, error_code&)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\t// we need to ignore this for the same reason as stated\n+\t\t// for ignoring bind()\n+//\t\tm_sock.open(p, ec);\n+\t}\n+\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid close()\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_remote_endpoint = endpoint_type();\n+\t\tm_sock.close();\n+\t\tm_resolver.cancel();\n+\t}\n+#endif\n+\n+\tvoid close(error_code& ec)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(269)\">../include/libtorrent/string_view.hpp:40</a></td><td>replace this by the standard string_view in C++17</td></tr><tr id=\"269\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by the standard string_view in C++17</h2><h4>../include/libtorrent/string_view.hpp:40</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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@@ -11034,118 +11222,67 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(265)\">../include/libtorrent/hash_picker.hpp:155</a></td><td>support batched adding of block hashes for reduced overhead?</td></tr><tr id=\"265\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support batched adding of block hashes for reduced overhead?</h2><h4>../include/libtorrent/hash_picker.hpp:155</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t// the number of hashes in the range\n-\t\tint count = 0;\n-\t\tint proof_layers = 0;\n-\t};\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(270)\">../include/libtorrent/socks5_stream.hpp:197</a></td><td>we could bind the socket here, since we know what the target endpoint is of the proxy</td></tr><tr id=\"270\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we could bind the socket here, since we know what the\n+target endpoint is of the proxy</h2><h4>../include/libtorrent/socks5_stream.hpp:197</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\t\t}, std::move(handler)));\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+private:\n \n-\tclass TORRENT_EXTRA_EXPORT hash_picker\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-\tpublic:\n-\t\thash_picker(file_storage const& files\n-\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n-\n-\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n-\n-\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes);\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tset_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h);\n-</div>\t\tvoid hashes_rejected(hash_request const& req);\n-\t\tvoid verify_block_hashes(piece_index_t index);\n-\n-\t\t// do we know the piece layer hash for a piece\n-\t\tbool have_hash(piece_index_t index) const;\n-\t\t// do we know all the block hashes for a file?\n-\t\tbool have_all(file_index_t file) const;\n-\t\tbool have_all() const;\n-\t\tbool piece_verified(piece_index_t piece) const;\n-\n-\t\tint piece_layer() const { return m_piece_layer; }\n-\n-\tprivate:\n-\t\t// returns the number of proof layers needed to verify the node's hash\n-\t\tint layers_to_verify(node_index idx) const;\n-\t\tint file_num_layers(file_index_t idx) const;\n-\n-\t\tstruct piece_hash_request\n-\t\t{\n-\t\t\ttime_point last_request = min_time();\n-\t\t\tint num_requests = 0;\n-\t\t\tbool have = false;\n-\t\t};\n+\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\");\n+\t\tif (handle_error(e, std::move(h))) return;\n \n-\t\tstruct priority_block_request\n+\t\tauto i = ips.begin();\n+\t\tif (!m_sock.is_open())\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(266)\">../include/libtorrent/proxy_base.hpp:227</a></td><td>it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);</td></tr><tr id=\"266\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to remember the bind port and bind once we know where the proxy is\n-m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:227</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_sock.cancel();\n-\t}\n-\n-\tvoid cancel(error_code& ec)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_sock.cancel(ec);\n-\t}\n-\n-\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\t// the reason why we ignore binds here is because we don't\n-\t\t// (necessarily) yet know what address family the proxy\n-\t\t// will resolve to, and binding to the wrong one would\n-\t\t// break our connection attempt later. The caller here\n-\t\t// doesn't necessarily know that we're proxying, so this\n-\t\t// bind address is based on the final endpoint, not the\n-\t\t// proxy.\n-<div style=\"background: #ffff00\" width=\"100%\">\t}\n-</div>\n-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid open(protocol_type const&)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-//\t\tm_sock.open(p);\n-\t}\n-#endif\n+\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-\tvoid open(protocol_type const&, error_code&)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\t// we need to ignore this for the same reason as stated\n-\t\t// for ignoring bind()\n-//\t\tm_sock.open(p, ec);\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n+</div>\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-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid close()\n+\ttemplate <typename Handler>\n+\tvoid connected(error_code const& e, Handler h)\n \t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_remote_endpoint = endpoint_type();\n-\t\tm_sock.close();\n-\t\tm_resolver.cancel();\n-\t}\n-#endif\n+\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\");\n+\t\tif (handle_error(e, std::move(h))) return;\n \n-\tvoid close(error_code& ec)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(267)\">../include/libtorrent/peer_connection.hpp:218</a></td><td>make 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</td></tr><tr id=\"267\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a raw pointer (to save size in\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(271)\">../include/libtorrent/peer_connection.hpp:218</a></td><td>make 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</td></tr><tr id=\"271\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../include/libtorrent/peer_connection.hpp:218</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -11191,15 +11328,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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(268)\">../include/libtorrent/peer_connection.hpp:1026</a></td><td>factor this out into its own class with a virtual interface torrent and session should implement this interface</td></tr><tr id=\"268\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor this out into its own class with a virtual interface\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(272)\">../include/libtorrent/peer_connection.hpp:1026</a></td><td>factor this out into its own class with a virtual interface torrent and session should implement this interface</td></tr><tr id=\"272\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>factor this out into its own class with a virtual interface\n torrent and session should implement this interface</h2><h4>../include/libtorrent/peer_connection.hpp:1026</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -11243,151 +11380,14 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(269)\">../include/libtorrent/socks5_stream.hpp:197</a></td><td>we could bind the socket here, since we know what the target endpoint is of the proxy</td></tr><tr id=\"269\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>we could bind the socket here, since we know what the\n-target endpoint is of the proxy</h2><h4>../include/libtorrent/socks5_stream.hpp:197</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(270)\">../include/libtorrent/upnp.hpp:162</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id=\"270\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>support using the windows API for UPnP operations as well</h2><h4>../include/libtorrent/upnp.hpp:162</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">{\n-\tbool in_error_code = false;\n-\tbool exit = false;\n-\tint error_code = -1;\n-};\n-\n-struct ip_address_parse_state: error_code_parse_state\n-{\n-\tbool in_ip_address = false;\n-\tstd::string ip_address;\n-};\n-\n-TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\n-\n-TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n-\t, error_code_parse_state& state);\n-\n-TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n-\t, ip_address_parse_state& state);\n-\n-<div style=\"background: #ffff00\" width=\"100%\">struct TORRENT_EXTRA_EXPORT upnp final\n-</div>\t: std::enable_shared_from_this<upnp>\n-\t, single_threaded\n-{\n-\tupnp(io_context& ios\n-\t\t, aux::session_settings const& settings\n-\t\t, aux::portmap_callback& cb\n-\t\t, address_v4 listen_address\n-\t\t, address_v4 netmask\n-\t\t, std::string listen_device\n-\t\t, aux::listen_socket_handle ls);\n-\t~upnp();\n-\n-\tvoid start();\n-\n-\t// Attempts to add a port mapping for the specified protocol. Valid protocols are\n-\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and\n-\t// ``natpmp::udp`` for the NAT-PMP class.\n-\t//\n-\t// ``external_port`` is the port on the external address that will be mapped. This\n-\t// is a hint, you are not guaranteed that this port will be available, and it may\n-\t// end up being something else. In the portmap_alert_ notification, the actual\n-\t// external port is reported.\n-\t//\n-\t// ``local_port`` is the port in the local machine that the mapping should forward\n-\t// to.\n-\t//\n-\t// The return value is an index that identifies this port mapping. This is used\n-\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and\n-\t// portmap_alert_ respectively. If The mapping fails immediately, the return value\n-\t// is -1, which means failure. There will not be any error alert notification for\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(271)\">../include/libtorrent/performance_counters.hpp:485</a></td><td>some space could be saved here by making gauges 32 bits</td></tr><tr id=\"271\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>some space could be saved here by making gauges 32 bits</h2><h4>../include/libtorrent/performance_counters.hpp:485</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\"></pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(272)\">../include/libtorrent/performance_counters.hpp:486</a></td><td>restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points</td></tr><tr id=\"272\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>restore these to regular integers. Instead have one copy\n-of the counters per thread and collect them at convenient\n-synchronization points</h2><h4>../include/libtorrent/performance_counters.hpp:486</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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-<div style=\"background: #ffff00\" width=\"100%\">#ifdef ATOMIC_LLONG_LOCK_FREE\n-</div>\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 </pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(273)\">../include/libtorrent/kademlia/msg.hpp:87</a></td><td>move this to its own .hpp/.cpp pair?</td></tr><tr id=\"273\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>move this to its own .hpp/.cpp pair?</h2><h4>../include/libtorrent/kademlia/msg.hpp:87</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -11468,306 +11468,56 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(275)\">../include/libtorrent/aux_/session_interface.hpp:212</a></td><td>it would be nice to not have this be part of session_interface</td></tr><tr id=\"275\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to not have this be part of session_interface</h2><h4>../include/libtorrent/aux_/session_interface.hpp:212</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-<div style=\"background: #ffff00\" width=\"100%\">\t\tvirtual proxy_settings proxy() const = 0;\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(276)\">../include/libtorrent/aux_/session_impl.hpp:265</a></td><td>make these direct members and generate shared_ptrs to them which alias the listen_socket_t shared_ptr</td></tr><tr id=\"276\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make these direct members and generate shared_ptrs to them\n-which alias the listen_socket_t shared_ptr</h2><h4>../include/libtorrent/aux_/session_impl.hpp:265</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\t\taux::array<listen_port_mapping, 2, portmap_transport> tcp_port_mapping;\n-\t\taux::array<listen_port_mapping, 2, portmap_transport> udp_port_mapping;\n-\n-\t\t// indicates whether this is an SSL listen socket or not\n-\t\ttransport ssl = transport::plaintext;\n-\n-\t\tlisten_socket_flags_t flags = accept_incoming;\n-\n-\t\t// the actual sockets (TCP listen socket and UDP socket)\n-\t\t// An entry does not necessarily have a UDP or TCP socket. One of these\n-\t\t// pointers may be nullptr!\n-\t\t// These must be shared_ptr to avoid a dangling reference if an\n-\t\t// incoming packet is in the event queue when the socket is erased\n-<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::shared_ptr<tcp::acceptor> sock;\n-</div>\t\tstd::shared_ptr<aux::session_udp_socket> udp_sock;\n-\n-\t\t// since udp packets are expected to be dispatched frequently, this saves\n-\t\t// time on handler allocation every time we read again.\n-\t\taux::handler_storage<aux::udp_handler_max_size, aux::udp_handler> udp_handler_storage;\n-\n-\t\tstd::shared_ptr<natpmp> natpmp_mapper;\n-\t\tstd::shared_ptr<upnp> upnp_mapper;\n-\n-\t\tstd::shared_ptr<struct lsd> lsd;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(275)\">../include/libtorrent/aux_/deprecated.hpp:47</a></td><td>figure out which version of clang this is supported in</td></tr><tr id=\"275\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>figure out which version of clang this is supported in</h2><h4>../include/libtorrent/aux_/deprecated.hpp:47</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\t\t// set to true when we receive an incoming connection from this listen\n-\t\t// socket\n-\t\tbool incoming_connection = false;\n-\t};\n+*/\n \n-\t\tstruct TORRENT_EXTRA_EXPORT listen_endpoint_t\n-\t\t{\n-\t\t\tlisten_endpoint_t(address const& adr, int p, std::string dev, transport s\n-\t\t\t\t, listen_socket_flags_t f, address const& nmask = address{})\n-\t\t\t\t: addr(adr), netmask(nmask), port(p), device(std::move(dev)), ssl(s), flags(f) {}\n+#ifndef TORRENT_DEPRECATED_HPP_INCLUDED\n+#define TORRENT_DEPRECATED_HPP_INCLUDED\n \n-\t\t\tbool operator==(listen_endpoint_t const& o) const\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(277)\">../include/libtorrent/aux_/session_impl.hpp:1068</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"277\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1068</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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+#if !defined TORRENT_BUILDING_LIBRARY\n+# define TORRENT_DEPRECATED [[deprecated]]\n+#else\n+# define TORRENT_DEPRECATED\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-\t\t\tstd::shared_ptr<listen_socket_t> setup_listener(\n-\t\t\t\tlisten_endpoint_t const& lep, error_code& ec);\n+#if defined __clang__\n \n-#ifndef TORRENT_DISABLE_DHT\n-\t\t\tdht::dht_state m_dht_state;\n-#endif\n+// ====== CLANG ========\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-\t\t\t// unchoke_interval and the unchoke set is\n-\t\t\t// recomputed.\n-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_unchoke_time_scaler = 0;\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(278)\">../include/libtorrent/aux_/session_impl.hpp:1073</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"278\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1073</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n-\t\t\t// round-robin index into m_outgoing_interfaces\n-\t\t\tmutable std::uint8_t m_interface_index = 0;\n+# if !defined TORRENT_BUILDING_LIBRARY\n+<div style=\"background: #ffff00\" width=\"100%\"># define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n+</div># endif\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+#elif defined __GNUC__\n \n-#ifndef TORRENT_DISABLE_DHT\n-\t\t\tdht::dht_state m_dht_state;\n-#endif\n+// ======== GCC ========\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-\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+// deprecation markup is only enabled when libtorrent\n+// headers are included by clients, not while building\n+// libtorrent itself\n+# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY\n+# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n+# endif\n \n-\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_auto_manage_time_scaler = 0;\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(279)\">../include/libtorrent/aux_/session_impl.hpp:1080</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"279\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1080</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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-\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-\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-<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_optimistic_unchoke_time_scaler = 0;\n-</div>\n-\t\t\t// works like unchoke_time_scaler. Each time\n-\t\t\t// it reaches 0, and all the connections are\n-\t\t\t// used, the worst connection will be disconnected\n-\t\t\t// from the torrent with the most peers\n-\t\t\tint m_disconnect_time_scaler = 90;\n-\n-\t\t\t// when this scaler reaches zero, it will\n-\t\t\t// scrape one of the auto managed, paused,\n-\t\t\t// torrents.\n-\t\t\tint m_auto_scrape_time_scaler = 180;\n-\n-\t\t\t// statistics gathered from all torrents.\n-\t\t\tstat m_stat;\n-\n-\t\t\t// implements session_interface\n-\t\t\tvoid sent_bytes(int bytes_payload, int bytes_protocol) override;\n-\t\t\tvoid received_bytes(int bytes_payload, int bytes_protocol) override;\n-\t\t\tvoid trancieve_ip_packet(int bytes, bool ipv6) override;\n-\t\t\tvoid sent_syn(bool ipv6) override;\n-\t\t\tvoid received_synack(bool ipv6) override;\n-\n-#if TORRENT_ABI_VERSION == 1\n-\t\t\tint m_peak_up_rate = 0;\n+#ifndef TORRENT_DEPRECATED_ENUM\n+#define TORRENT_DEPRECATED_ENUM\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(280)\">../include/libtorrent/aux_/announce_entry.hpp:74</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id=\"280\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>include the number of peers received from this tracker, at last\n-announce</h2><h4>../include/libtorrent/aux_/announce_entry.hpp:74</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">namespace aux {\n-\n-\tstruct TORRENT_EXTRA_EXPORT announce_infohash\n-\t{\n-\t\tannounce_infohash();\n-\n-\t\t// if this tracker has returned an error or warning message\n-\t\t// that message is stored here\n-\t\tstd::string message;\n-\n-\t\t// if this tracker failed the last time it was contacted\n-\t\t// this error code specifies what error occurred\n-\t\terror_code last_error;\n-\n-\t\t// the time of next tracker announce\n-\t\ttime_point32 next_announce = (time_point32::min)();\n-\n-\t\t// no announces before this time\n-\t\ttime_point32 min_announce = (time_point32::min)();\n-\n-<div style=\"background: #ffff00\" width=\"100%\">\n-</div>\t\t// these are either -1 or the scrape information this tracker last\n-\t\t// responded with. *incomplete* is the current number of downloaders in\n-\t\t// the swarm, *complete* is the current number of seeds in the swarm and\n-\t\t// *downloaded* is the cumulative number of completed downloads of this\n-\t\t// torrent, since the beginning of time (from this tracker's point of\n-\t\t// view).\n-\n-\t\t// if this tracker has returned scrape data, these fields are filled in\n-\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts\n-\t\t// the number of current downloaders. ``complete`` counts the number of\n-\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the\n-\t\t// cumulative number of completed downloads.\n-\t\tint scrape_incomplete = -1;\n-\t\tint scrape_complete = -1;\n-\t\tint scrape_downloaded = -1;\n-\n-\t\t// the number of times in a row we have failed to announce to this\n-\t\t// tracker.\n-\t\tstd::uint8_t fails : 7;\n-\n-\t\t// true while we're waiting for a response from the tracker.\n-\t\tbool updating : 1;\n-\n-\t\t// set to true when we get a valid response from an announce\n-\t\t// with event=started. If it is set, we won't send start in the subsequent\n-\t\t// announces.\n-\t\tbool start_sent : 1;\n-\n-\t\t// set to true when we send a event=completed.\n-\t\tbool complete_sent : 1;\n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(281)\">../include/libtorrent/aux_/pool.hpp:49</a></td><td>ensure the alignment is good here</td></tr><tr id=\"281\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>ensure the alignment is good here</h2><h4>../include/libtorrent/aux_/pool.hpp:49</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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-<div style=\"background: #ffff00\" width=\"100%\">\tstatic char* malloc(size_type const bytes)\n-</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(282)\">../include/libtorrent/aux_/merkle_tree.hpp:85</a></td><td>remove 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</td></tr><tr id=\"282\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>remove this constructor. Don't support \"uninitialized\" trees. This\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(276)\">../include/libtorrent/aux_/merkle_tree.hpp:85</a></td><td>remove 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</td></tr><tr id=\"276\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>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</h2><h4>../include/libtorrent/aux_/merkle_tree.hpp:85</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">// The invariant of the tree is that all interior nodes (i.e. all but the very\n // bottom leaf nodes, representing block hashes) are either set and valid, or\n // clear. No invalid hashes are allowed, and they can only be added by also\n // providing proof of being valid.\n \n // The leaf blocks on the other hand, MAY be invalid. For instance, when adding\n@@ -11812,15 +11562,15 @@\n \n \t// returns true if the entire tree is known and verified\n \tbool is_complete() const;\n \n \t// returns true if all block hashes in the specified range have been verified\n \tbool blocks_verified(int block_idx, int num_blocks) const;\n \n-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(283)\">../include/libtorrent/aux_/merkle_tree.hpp:175</a></td><td>make this a std::unique_ptr<sha256_hash[]></td></tr><tr id=\"283\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a std::unique_ptr<sha256_hash[]></h2><h4>../include/libtorrent/aux_/merkle_tree.hpp:175</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(277)\">../include/libtorrent/aux_/merkle_tree.hpp:175</a></td><td>make this a std::unique_ptr<sha256_hash[]></td></tr><tr id=\"277\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make this a std::unique_ptr<sha256_hash[]></h2><h4>../include/libtorrent/aux_/merkle_tree.hpp:175</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n \tint blocks_per_piece() const { return 1 << m_blocks_per_piece_log; }\n \t// the number tree levels per piece. This is 0 if the block layer is also\n \t// the piece layer.\n \tint piece_levels() const { return m_blocks_per_piece_log; }\n \n \tint block_layer_start() const;\n \tint piece_layer_start() const;\n@@ -11863,56 +11613,102 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(284)\">../include/libtorrent/aux_/deprecated.hpp:47</a></td><td>figure out which version of clang this is supported in</td></tr><tr id=\"284\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>figure out which version of clang this is supported in</h2><h4>../include/libtorrent/aux_/deprecated.hpp:47</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(278)\">../include/libtorrent/aux_/announce_entry.hpp:74</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id=\"278\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>include the number of peers received from this tracker, at last\n+announce</h2><h4>../include/libtorrent/aux_/announce_entry.hpp:74</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">namespace aux {\n \n-*/\n+\tstruct TORRENT_EXTRA_EXPORT announce_infohash\n+\t{\n+\t\tannounce_infohash();\n \n-#ifndef TORRENT_DEPRECATED_HPP_INCLUDED\n-#define TORRENT_DEPRECATED_HPP_INCLUDED\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-#if !defined TORRENT_BUILDING_LIBRARY\n-# define TORRENT_DEPRECATED [[deprecated]]\n-#else\n-# define TORRENT_DEPRECATED\n-#endif\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-#if defined __clang__\n+\t\t// the time of next tracker announce\n+\t\ttime_point32 next_announce = (time_point32::min)();\n \n-// ====== CLANG ========\n+\t\t// no announces before this time\n+\t\ttime_point32 min_announce = (time_point32::min)();\n \n-# if !defined TORRENT_BUILDING_LIBRARY\n-<div style=\"background: #ffff00\" width=\"100%\"># define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n-</div># endif\n+<div style=\"background: #ffff00\" width=\"100%\">\n+</div>\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-#elif defined __GNUC__\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-// ======== GCC ========\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-// deprecation markup is only enabled when libtorrent\n-// headers are included by clients, not while building\n-// libtorrent itself\n-# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY\n-# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n-# endif\n+\t\t// true while we're waiting for a response from the tracker.\n+\t\tbool updating : 1;\n \n-#endif\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-#ifndef TORRENT_DEPRECATED_ENUM\n-#define TORRENT_DEPRECATED_ENUM\n-#endif\n+\t\t// set to true when we send a event=completed.\n+\t\tbool complete_sent : 1;\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(279)\">../include/libtorrent/aux_/pool.hpp:49</a></td><td>ensure the alignment is good here</td></tr><tr id=\"279\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>ensure the alignment is good here</h2><h4>../include/libtorrent/aux_/pool.hpp:49</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">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+<div style=\"background: #ffff00\" width=\"100%\">\tstatic char* malloc(size_type const bytes)\n+</div>\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(285)\">../include/libtorrent/aux_/allocating_handler.hpp:316</a></td><td>in C++17, Handler and Storage could just use \"auto\"</td></tr><tr id=\"285\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17, Handler and Storage could just use \"auto\"</h2><h4>../include/libtorrent/aux_/allocating_handler.hpp:316</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(280)\">../include/libtorrent/aux_/allocating_handler.hpp:316</a></td><td>in C++17, Handler and Storage could just use \"auto\"</td></tr><tr id=\"280\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>in C++17, Handler and Storage could just use \"auto\"</h2><h4>../include/libtorrent/aux_/allocating_handler.hpp:316</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -11955,15 +11751,15 @@\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-</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(286)\">../include/libtorrent/aux_/utp_stream.hpp:693</a></td><td>it would be nice to make this private</td></tr><tr id=\"286\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to make this private</h2><h4>../include/libtorrent/aux_/utp_stream.hpp:693</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\tbool consume_incoming_data(\n+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(281)\">../include/libtorrent/aux_/utp_stream.hpp:693</a></td><td>it would be nice to make this private</td></tr><tr id=\"281\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to make this private</h2><h4>../include/libtorrent/aux_/utp_stream.hpp:693</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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@@ -12006,8 +11802,212 @@\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(282)\">../include/libtorrent/aux_/session_impl.hpp:265</a></td><td>make these direct members and generate shared_ptrs to them which alias the listen_socket_t shared_ptr</td></tr><tr id=\"282\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>make these direct members and generate shared_ptrs to them\n+which alias the listen_socket_t shared_ptr</h2><h4>../include/libtorrent/aux_/session_impl.hpp:265</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\t\taux::array<listen_port_mapping, 2, portmap_transport> tcp_port_mapping;\n+\t\taux::array<listen_port_mapping, 2, portmap_transport> udp_port_mapping;\n+\n+\t\t// indicates whether this is an SSL listen socket or not\n+\t\ttransport ssl = transport::plaintext;\n+\n+\t\tlisten_socket_flags_t flags = accept_incoming;\n+\n+\t\t// the actual sockets (TCP listen socket and UDP socket)\n+\t\t// An entry does not necessarily have a UDP or TCP socket. One of these\n+\t\t// pointers may be nullptr!\n+\t\t// These must be shared_ptr to avoid a dangling reference if an\n+\t\t// incoming packet is in the event queue when the socket is erased\n+<div style=\"background: #ffff00\" width=\"100%\">\t\tstd::shared_ptr<tcp::acceptor> sock;\n+</div>\t\tstd::shared_ptr<aux::session_udp_socket> udp_sock;\n+\n+\t\t// since udp packets are expected to be dispatched frequently, this saves\n+\t\t// time on handler allocation every time we read again.\n+\t\taux::handler_storage<aux::udp_handler_max_size, aux::udp_handler> udp_handler_storage;\n+\n+\t\tstd::shared_ptr<natpmp> natpmp_mapper;\n+\t\tstd::shared_ptr<upnp> upnp_mapper;\n+\n+\t\tstd::shared_ptr<struct lsd> lsd;\n+\n+\t\t// set to true when we receive an incoming connection from this listen\n+\t\t// socket\n+\t\tbool incoming_connection = false;\n+\t};\n+\n+\t\tstruct TORRENT_EXTRA_EXPORT listen_endpoint_t\n+\t\t{\n+\t\t\tlisten_endpoint_t(address const& adr, int p, std::string dev, transport s\n+\t\t\t\t, listen_socket_flags_t f, address const& nmask = address{})\n+\t\t\t\t: addr(adr), netmask(nmask), port(p), device(std::move(dev)), ssl(s), flags(f) {}\n+\n+\t\t\tbool operator==(listen_endpoint_t const& o) const\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(283)\">../include/libtorrent/aux_/session_impl.hpp:1068</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"283\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1068</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">#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+\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+\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+\t\t\t// unchoke_interval and the unchoke set is\n+\t\t\t// recomputed.\n+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_unchoke_time_scaler = 0;\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(284)\">../include/libtorrent/aux_/session_impl.hpp:1073</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"284\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1073</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\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+\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_auto_manage_time_scaler = 0;\n+</div>\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(285)\">../include/libtorrent/aux_/session_impl.hpp:1080</a></td><td>replace this by a proper asio timer</td></tr><tr id=\"285\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>replace this by a proper asio timer</h2><h4>../include/libtorrent/aux_/session_impl.hpp:1080</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+\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+\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+<div style=\"background: #ffff00\" width=\"100%\">\t\t\tint m_optimistic_unchoke_time_scaler = 0;\n+</div>\n+\t\t\t// works like unchoke_time_scaler. Each time\n+\t\t\t// it reaches 0, and all the connections are\n+\t\t\t// used, the worst connection will be disconnected\n+\t\t\t// from the torrent with the most peers\n+\t\t\tint m_disconnect_time_scaler = 90;\n+\n+\t\t\t// when this scaler reaches zero, it will\n+\t\t\t// scrape one of the auto managed, paused,\n+\t\t\t// torrents.\n+\t\t\tint m_auto_scrape_time_scaler = 180;\n+\n+\t\t\t// statistics gathered from all torrents.\n+\t\t\tstat m_stat;\n+\n+\t\t\t// implements session_interface\n+\t\t\tvoid sent_bytes(int bytes_payload, int bytes_protocol) override;\n+\t\t\tvoid received_bytes(int bytes_payload, int bytes_protocol) override;\n+\t\t\tvoid trancieve_ip_packet(int bytes, bool ipv6) override;\n+\t\t\tvoid sent_syn(bool ipv6) override;\n+\t\t\tvoid received_synack(bool ipv6) override;\n+\n+#if TORRENT_ABI_VERSION == 1\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+</pre></td></tr><tr style=\"background: #ccc\"><td>relevance 0</td><td><a href=\"javascript:expand(286)\">../include/libtorrent/aux_/session_interface.hpp:212</a></td><td>it would be nice to not have this be part of session_interface</td></tr><tr id=\"286\" style=\"display: none;\" colspan=\"3\"><td colspan=\"3\"><h2>it would be nice to not have this be part of session_interface</h2><h4>../include/libtorrent/aux_/session_interface.hpp:212</h4><pre style=\"background: #f6f6f6; border: solid 1px #ddd;\">\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+<div style=\"background: #ffff00\" width=\"100%\">\t\tvirtual proxy_settings proxy() const = 0;\n+</div>\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 </pre></td></tr></table></body></html>\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -454,68 +454,352 @@\n | |\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 |_\b\t_\br_\bp_\bc_\b._\bi_\bn_\bv_\bo_\bk_\be_\b(_\br_\be_\bq_\b,_\b _\bs_\bo_\bu_\br_\bc_\be_\b,_\b _\bo_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b6_\b9_\b1_\b _\b|_\be_\bx_\bp_\bo_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b__\bn_\bu_\bm_\bb_\be_\br_\b,_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b,_\b _\bs_\be_\bc_\br_\be_\bt_\b__\bk_\be_\by_\b _\ba_\bn_\bd_\b _\bs_\bi_\bg_\bn_\ba_\bt_\bu_\br_\be_\b _\bt_\by_\bp_\be_\bs_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* e\bex\bxp\bpo\bos\bse\be t\bth\bhe\be s\bse\beq\bqu\bue\ben\bnc\bce\be_\b_n\bnu\bum\bmb\bbe\ber\br,\b, p\bpu\bub\bbl\bli\bic\bc_\b_k\bke\bey\by,\b, s\bse\bec\bcr\bre\bet\bt_\b_k\bke\bey\by a\ban\bnd\bd s\bsi\big\bgn\bna\bat\btu\bur\bre\be t\bty\byp\bpe\bes\bs t\bto\bo t\bth\bhe\be c\bcl\bli\bie\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:6\b69\b91\b1 *\b**\b**\b* |\n-|void session_handle::dht_get_item(sha1_hash const& target) |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b8_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\ba_\bu_\bx_\b:_\b:_\bw_\br_\bi_\bt_\be_\b__\b*_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\bs_\bp_\ba_\bn_\b _\bh_\be_\br_\be_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b,_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\bi_\bt_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\bi_\bt_\bh_\b _\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be t\bth\bhe\be a\bau\bux\bx:\b::\b:w\bwr\bri\bit\bte\be_\b_*\b* f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs a\ban\bnd\bd t\bth\bhe\be s\bsp\bpa\ban\bn h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd,\b, i\bit\bt w\bwi\bil\bll\bl f\bfi\bit\bt b\bbe\bet\btt\bte\ber\br w\bwi\bit\bth\bh s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:2\b26\b68\b8 *\b**\b**\b* |\n+|int metadata_piece_size = 0; |\n+| |\n+|\t\t\tif (m_torrent.valid_metadata()) |\n+|\t\t\t\te[\"total_size\"] = m_tp.metadata().size(); |\n+| |\n+|\t\t\tif (type == msg_t::piece) |\n+|\t\t\t{ |\n+|\t\t\t\tTORRENT_ASSERT(piece >= 0 && piece < (m_tp.metadata().size() + 16 * 1024 - 1) / (16 * 1024)); |\n+|\t\t\t\tTORRENT_ASSERT(m_pc.associated_torrent().lock()->valid_metadata()); |\n+|\t\t\t\tTORRENT_ASSERT(m_torrent.valid_metadata()); |\n+| |\n+|\t\t\t\tint const offset = piece * 16 * 1024; |\n+|\t\t\t\tmetadata = m_tp.metadata().data() + offset; |\n+|\t\t\t\tmetadata_piece_size = std::min( |\n+|\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024); |\n+|\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset >= 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size()); |\n+|\t\t\t} |\n+| |\n+|char msg[200]; |\n+|char* header = msg; |\n+|\t\t\tchar* p = &msg[6]; |\n+|\t\t\tint const len = bencode(p, e); |\n+|\t\t\tint const total_size = 2 + len + metadata_piece_size; |\n+|\t\t\tnamespace io = aux; |\n+|\t\t\tio::write_uint32(total_size, header); |\n+|\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header); |\n+|\t\t\tio::write_uint8(m_message_index, header); |\n+| |\n+|_\b\t_\b\t_\b\t_\bm_\b__\bp_\bc_\b._\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b{_\bm_\bs_\bg_\b,_\b _\bl_\be_\bn_\b _\b+_\b _\b6_\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bg_\be_\bt_\b _\ba_\bw_\ba_\by_\b _\bw_\bi_\bt_\bh_\b _\bj_\bu_\bs_\bt_\b _\bs_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bf_\be_\bw_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by g\bge\bet\bt a\baw\bwa\bay\by w\bwi\bit\bth\bh j\bju\bus\bst\bt s\bsa\bav\bvi\bin\bng\bg a\ba f\bfe\bew\bw f\bfi\bie\bel\bld\bds\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b41\b19\b9 *\b**\b**\b* |\n+|// --- V2 HASHES --- |\n+| |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n+|\t\t{ |\n+|\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<add_torrent_params>(std::move(p)); |\n+|} |\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-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tasync_call(&session_impl::dht_get_immutable_item, target); |\n-|#else |\n-|\t\tTORRENT_UNUSED(target); |\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+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b15\b5 *\b**\b**\b* |\n |#endif |\n+| |\n+|\t\tif (!m_ses.dht()) return false; |\n+|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n+|\t\tif (!m_announce_to_dht) return false; |\n+|\t\tif (m_paused) return false; |\n+| |\n+|\t\t// don't announce private torrents |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n+|\t\tif (m_trackers.empty()) return true; |\n+|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n+| |\n+|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n+|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n |\t} |\n | |\n-|\tvoid session_handle::dht_get_item(std::array<char, 32> key |\n-|\t\t, std::string salt) |\n+|#endif |\n+| |\n+|\ttorrent::~torrent() |\n |\t{ |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt); |\n-|#else |\n-|\t\tTORRENT_UNUSED(key); |\n-|\t\tTORRENT_UNUSED(salt); |\n+| |\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-|sha1_hash session_handle::dht_put_item(entry data) |\n-|{ |\n-|\t\tstd::vector<char> buf; |\n-|\t\tbencode(std::back_inserter(buf), data); |\n-|\t\tsha1_hash const ret = hasher(buf).final(); |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b33\b31\b1 *\b**\b**\b* |\n+|piece_index_t m_piece; |\n+|\t\tbool m_armed = true; |\n+|\t}; |\n | |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret); |\n-|#endif |\n-|\t\treturn ret; |\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 session_handle::dht_put_item(std::array<char, 32> key |\n-|\t\t, std::function<void(entry&, std::array<char,64>& |\n-|\t\t\t, std::int64_t&, std::string const&)> cb |\n-|\t\t, std::string salt) |\n+|void torrent::add_piece(piece_index_t const piece, char const* data |\n+|, add_piece_flags_t const flags) |\n |\t{ |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt); |\n-|#else |\n-|\t\tTORRENT_UNUSED(key); |\n-|\t\tTORRENT_UNUSED(cb); |\n-|\t\tTORRENT_UNUSED(salt); |\n-|#endif |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\t// make sure the piece index is correct |\n+|\t\tif (piece >= torrent_file().end_piece()) |\n+|\t\t\treturn; |\n+| |\n+|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n+|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n+| |\n+|\t\tif (m_deleted) return; |\n+| |\n+|\t\t// avoid crash trying to access the picker when there is none |\n+|\t\tif (m_have_all && !has_picker()) return; |\n+| |\n+|\t\t// we don't support clobbering the piece picker while checking the |\n+|\t\t// files. We may end up having the same piece multiple times |\n+|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n+|\t\t\t&& state() != torrent_status::checking_resume_data); |\n+|\t\tif (state() == torrent_status::checking_files |\n+|\t\t\t|| state() == torrent_status::checking_resume_data) |\n+|\t\t\treturn; |\n+| |\n+|\t\tneed_picker(); |\n+| |\n+|\t\tif (picker().have_piece(piece) |\n+|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n+|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b6_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b96\b66\b6 *\b**\b**\b* |\n+|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n+|\t{ |\n+|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n+| |\n+|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n+| |\n+|\t\t// if we have all pieces, we must also have the last one |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n+| |\n+|\t\t// every block should not be a pad block |\n+|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n+| |\n+|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n+|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n+|\t\t\t- std::int64_t(pc.pad_bytes); |\n |\t} |\n | |\n-|\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash) |\n+|\t// fills in total_wanted, total_wanted_done and total_done |\n+|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tst.total_done = 0; |\n+|\t\tst.total_wanted_done = 0; |\n+|\t\tst.total_wanted = m_size_on_disk; |\n+| |\n+|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n+|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n+| |\n+|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n+|\t\tif (!valid_metadata()) return; |\n+| |\n+|\t\tif (m_seed_mode || is_seed()) |\n+|\t\t{ |\n+|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n+|\t\t\t// piece- and file priority. We consider everything as being |\n+|\t\t\t// \"wanted\" |\n+|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n+|\t\t\tst.total_wanted_done = m_size_on_disk; |\n+|\t\t\tst.total_wanted = m_size_on_disk; |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n+|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\telse if (!has_picker()) |\n+|\t\t{ |\n+|\t\t\tst.total_done = 0; |\n+|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b90\b05\b5 *\b**\b**\b* |\n+|on_remove_peers(); |\n+|\t\tTORRENT_ASSERT(m_connections.empty()); |\n+| |\n+|\t\t// post a message to the main thread to destruct |\n+|\t\t// the torrent object from there |\n+|\t\tif (m_storage) |\n+|\t\t{ |\n+|\t\t\ttry { |\n+|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n+|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n+|\t\t\t} |\n+|\t\t\tcatch (std::exception const& e) |\n+|\t\t\t{ |\n+|\t\t\t\tTORRENT_UNUSED(e); |\n+|\t\t\t\tm_storage.reset(); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n+|#endif |\n+|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n+|\t\t\t\t// good idea to post it here, even though we failed |\n+|if (alerts().should_post<cache_flushed_alert>()) |\n+|alerts().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+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b97\b75\b5 *\b**\b**\b* |\n+|} |\n+| |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|\tvoid torrent::set_super_seeding(bool const on) |\n |\t{ |\n-|#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+|\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<piece_index_t> 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<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+|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/ |this should be an optional, piece index -1 should not be allowed |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ban\bn o\bop\bpt\bti\bio\bon\bna\bal\bl,\b, p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b19\b99\b9 *\b**\b**\b* |\n |\t\t\tauto const range = aux::file_piece_range_inclusive(fs, i); |\n |\t\t\tfor (piece_index_t k = std::get<0>(range); k < std::get<1>(range); ++k) |\n |\t\t\t\thave.clear_bit(k); |\n@@ -727,48 +1011,233 @@\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+| |_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent |\n+|relevance\u00a03|_\b3_\b1_\b3_\b3 |should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bd_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bq_\bu_\be_\bu_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhe\bet\bth\bhe\ber\br i\bit\bt'\b's\bs i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be o\bor\br n\bno\bot\bt,\b, t\bth\bhe\be p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bha\bat\bt s\bst\bta\bat\bte\be (\b(a\ban\bnd\bd t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt s\bsh\bho\bou\bul\bld\bd u\bup\bpd\bda\bat\bte\be t\bth\bhe\bem\bm w\bwh\bhe\ben\bn i\bit\bt e\ben\bnt\bte\ber\brs\bs |\n+|g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be)\b).\b. W\bWh\bhe\ben\bn a\ba p\bpe\bee\ber\br e\ben\bnt\bte\ber\brs\bs g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, i\bit\bt s\bsh\bho\bou\bul\bld\bd c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd c\bcl\ble\bea\bar\br i\bit\bts\bs r\bre\beq\bqu\bue\bes\bst\bt q\bqu\bue\beu\bue\be.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b31\b13\b33\b3 *\b**\b**\b* |\n+|// to disk or are in the disk write cache |\n+|\t\tif (picker.is_piece_finished(p.piece) && !was_finished) |\n+|\t\t{ |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\t\t\tcheck_postcondition post_checker2_(t, false); |\n+|#endif |\n+|\t\t\tt->verify_piece(p.piece); |\n+|\t\t} |\n | |\n-|\t\t\tif (m_torrent.valid_metadata()) |\n-|\t\t\t\te[\"total_size\"] = m_tp.metadata().size(); |\n+|\t\tcheck_graceful_pause(); |\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+|\t\tif (is_disconnecting()) return; |\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+|\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-|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+|\tvoid peer_connection::check_graceful_pause() |\n+|\t{ |\n+|std::shared_ptr<torrent> t = m_torrent.lock(); |\n+|if (!t || !t->graceful_pause()) return; |\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+|\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+|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b__\bb_\by_\bt_\be_\bs_\b _\b=_\b=_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* o\bon\bnc\bce\be p\bpe\bee\ber\brs\bs a\bar\bre\be p\bpr\bro\bop\bpe\ber\brl\bly\by p\bpu\but\bt i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, t\bth\bhe\bey\by c\bca\ban\bn c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd t\bth\bhi\bis\bs t\bte\bes\bst\bt c\bca\ban\bn b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b40\b04\b44\b4 *\b**\b**\b* |\n+|\t\t\tif (!p->m_deferred_send_block_requests) |\n+|\t\t\t\treturn; |\n+| |\n+|\t\t\tp->m_deferred_send_block_requests = false; |\n+|\t\t\tp->send_block_requests_impl(); |\n+|\t\t}); |\n+|\t\tm_deferred_send_block_requests = true; |\n+|\t} |\n+| |\n+|\tvoid peer_connection::send_block_requests_impl() |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tstd::shared_ptr<torrent> t = m_torrent.lock(); |\n+|\t\tif (!t) return; |\n+| |\n+|\t\tif (m_disconnecting) return; |\n+| |\n+|if (t->graceful_pause()) return; |\n+| |\n+|\t\t// we can't download pieces in these states |\n+|\t\tif (t->state() == torrent_status::checking_files |\n+|\t\t\t|| t->state() == torrent_status::checking_resume_data |\n+|\t\t\t|| t->state() == torrent_status::downloading_metadata) |\n+|\t\t\treturn; |\n+| |\n+|\t\tif (int(m_download_queue.size()) >= m_desired_queue_size |\n+|\t\t\t|| t->upload_mode()) return; |\n+| |\n+|\t\tbool const empty_download_queue = m_download_queue.empty(); |\n+| |\n+|\t\twhile (!m_request_queue.empty() |\n+|\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size |\n+|\t\t\t\t|| m_queued_time_critical > 0)) |\n+|\t\t{ |\n+|\t\t\tpending_block block = m_request_queue.front(); |\n+| |\n+|\t\t\tm_request_queue.erase(m_request_queue.begin()); |\n+|\t\t\tif (m_queued_time_critical) --m_queued_time_critical; |\n+| |\n+|\t\t\t// if we're a seed, we don't have a piece picker |\n+|\t\t\t// so we don't have to worry about invariants getting |\n+|\t\t\t// out of sync with it |\n+|\t\t\tif (!t->has_picker()) continue; |\n+| |\n+|\t\t\t// this can happen if a block times out, is re-requested and |\n+|\t\t\t// then arrives \"unexpectedly\" |\n+|\t\t\tif (t->picker().is_downloaded(block.block)) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |new_piece should be an optional. piece index -1 should not be allowed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b3_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_p\bpi\bie\bec\bce\be s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ban\bn o\bop\bpt\bti\bio\bon\bna\bal\bl.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b73\b30\b0 *\b**\b**\b* |\n+|\t\t// pieces may be empty if we don't have metadata yet |\n+|\t\tif (p.pieces.empty()) |\n+|\t\t{ |\n+|\t\t\tp.progress = 0.f; |\n+|\t\t\tp.progress_ppm = 0; |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|#if TORRENT_NO_FPU |\n+|\t\t\tp.progress = 0.f; |\n+|#else |\n+|\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size()); |\n+|#endif |\n+|\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size()); |\n+|\t\t} |\n+| |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|void peer_connection::superseed_piece(piece_index_t const replace_piece |\n+|, piece_index_t const new_piece) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tif (is_connecting()) return; |\n+|\t\tif (in_handshake()) return; |\n+| |\n+|\t\tif (new_piece == piece_index_t(-1)) |\n+|\t\t{ |\n+|\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return; |\n+|\t\t\tm_superseed_piece[0] = piece_index_t(-1); |\n+|\t\t\tm_superseed_piece[1] = piece_index_t(-1); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\"); |\n+|#endif |\n+|\t\t\tstd::shared_ptr<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+|_\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_\b9_\b1_\b _\b|_\be_\bx_\bp_\bo_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b__\bn_\bu_\bm_\bb_\be_\br_\b,_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b,_\b _\bs_\be_\bc_\br_\be_\bt_\b__\bk_\be_\by_\b _\ba_\bn_\bd_\b _\bs_\bi_\bg_\bn_\ba_\bt_\bu_\br_\be_\b _\bt_\by_\bp_\be_\bs_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* e\bex\bxp\bpo\bos\bse\be t\bth\bhe\be s\bse\beq\bqu\bue\ben\bnc\bce\be_\b_n\bnu\bum\bmb\bbe\ber\br,\b, p\bpu\bub\bbl\bli\bic\bc_\b_k\bke\bey\by,\b, s\bse\bec\bcr\bre\bet\bt_\b_k\bke\bey\by a\ban\bnd\bd s\bsi\big\bgn\bna\bat\btu\bur\bre\be t\bty\byp\bpe\bes\bs t\bto\bo t\bth\bhe\be c\bcl\bli\bie\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:6\b69\b91\b1 *\b**\b**\b* |\n+|void session_handle::dht_get_item(sha1_hash const& target) |\n+|\t{ |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tasync_call(&session_impl::dht_get_immutable_item, target); |\n+|#else |\n+|\t\tTORRENT_UNUSED(target); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid session_handle::dht_get_item(std::array<char, 32> key |\n+|\t\t, std::string salt) |\n+|\t{ |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt); |\n+|#else |\n+|\t\tTORRENT_UNUSED(key); |\n+|\t\tTORRENT_UNUSED(salt); |\n+|#endif |\n+|\t} |\n+| |\n+|sha1_hash session_handle::dht_put_item(entry data) |\n+|{ |\n+|\t\tstd::vector<char> buf; |\n+|\t\tbencode(std::back_inserter(buf), data); |\n+|\t\tsha1_hash const ret = hasher(buf).final(); |\n+| |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret); |\n+|#endif |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tvoid session_handle::dht_put_item(std::array<char, 32> key |\n+|\t\t, std::function<void(entry&, std::array<char,64>& |\n+|\t\t\t, std::int64_t&, std::string const&)> cb |\n+|\t\t, std::string salt) |\n+|\t{ |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt); |\n+|#else |\n+|\t\tTORRENT_UNUSED(key); |\n+|\t\tTORRENT_UNUSED(cb); |\n+|\t\tTORRENT_UNUSED(salt); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash) |\n+|\t{ |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tasync_call(&session_impl::dht_get_peers, info_hash); |\n+|_\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/_\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@@ -1126,483 +1595,14 @@\n |\t\t\t\talerts.emplace_alert<dht_put_alert>(pk.bytes, sig.bytes |\n |\t\t\t\t\t, std::move(salt), seq.value, num); |\n |\t\t\t} |\n |\t\t} |\n | |\n |\t\tvoid put_mutable_callback(dht::item& i |\n |_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b<_\bv_\bo_\bi_\bd_\b(_\be_\bn_\bt_\br_\by_\b&_\b,_\b _\bs_\bt_\bd_\b:_\b:_\ba_\br_\br_\ba_\by_\b<_\bc_\bh_\ba_\br_\b,_\b _\b6_\b4_\b>_\b&_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| |_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent |\n-|relevance\u00a03|_\b3_\b1_\b3_\b3 |should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bd_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bq_\bu_\be_\bu_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhe\bet\bth\bhe\ber\br i\bit\bt'\b's\bs i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be o\bor\br n\bno\bot\bt,\b, t\bth\bhe\be p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bha\bat\bt s\bst\bta\bat\bte\be (\b(a\ban\bnd\bd t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt s\bsh\bho\bou\bul\bld\bd u\bup\bpd\bda\bat\bte\be t\bth\bhe\bem\bm w\bwh\bhe\ben\bn i\bit\bt e\ben\bnt\bte\ber\brs\bs |\n-|g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be)\b).\b. W\bWh\bhe\ben\bn a\ba p\bpe\bee\ber\br e\ben\bnt\bte\ber\brs\bs g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, i\bit\bt s\bsh\bho\bou\bul\bld\bd c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd c\bcl\ble\bea\bar\br i\bit\bts\bs r\bre\beq\bqu\bue\bes\bst\bt q\bqu\bue\beu\bue\be.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b31\b13\b33\b3 *\b**\b**\b* |\n-|// to disk or are in the disk write cache |\n-|\t\tif (picker.is_piece_finished(p.piece) && !was_finished) |\n-|\t\t{ |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\t\tcheck_postcondition post_checker2_(t, false); |\n-|#endif |\n-|\t\t\tt->verify_piece(p.piece); |\n-|\t\t} |\n-| |\n-|\t\tcheck_graceful_pause(); |\n-| |\n-|\t\tif (is_disconnecting()) return; |\n-| |\n-|\t\tif (request_a_block(*t, *this)) |\n-|\t\t\tm_counters.inc_stats_counter(counters::incoming_piece_picks); |\n-|\t\tsend_block_requests(); |\n-|\t} |\n-| |\n-|\tvoid peer_connection::check_graceful_pause() |\n-|\t{ |\n-|std::shared_ptr<torrent> 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<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-|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b__\bb_\by_\bt_\be_\bs_\b _\b=_\b=_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed. |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* o\bon\bnc\bce\be p\bpe\bee\ber\brs\bs a\bar\bre\be p\bpr\bro\bop\bpe\ber\brl\bly\by p\bpu\but\bt i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, t\bth\bhe\bey\by c\bca\ban\bn c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd t\bth\bhi\bis\bs t\bte\bes\bst\bt c\bca\ban\bn b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b40\b04\b44\b4 *\b**\b**\b* |\n-|\t\t\tif (!p->m_deferred_send_block_requests) |\n-|\t\t\t\treturn; |\n-| |\n-|\t\t\tp->m_deferred_send_block_requests = false; |\n-|\t\t\tp->send_block_requests_impl(); |\n-|\t\t}); |\n-|\t\tm_deferred_send_block_requests = true; |\n-|\t} |\n-| |\n-|\tvoid peer_connection::send_block_requests_impl() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tstd::shared_ptr<torrent> t = m_torrent.lock(); |\n-|\t\tif (!t) return; |\n-| |\n-|\t\tif (m_disconnecting) return; |\n-| |\n-|if (t->graceful_pause()) return; |\n-| |\n-|\t\t// we can't download pieces in these states |\n-|\t\tif (t->state() == torrent_status::checking_files |\n-|\t\t\t|| t->state() == torrent_status::checking_resume_data |\n-|\t\t\t|| t->state() == torrent_status::downloading_metadata) |\n-|\t\t\treturn; |\n-| |\n-|\t\tif (int(m_download_queue.size()) >= m_desired_queue_size |\n-|\t\t\t|| t->upload_mode()) return; |\n-| |\n-|\t\tbool const empty_download_queue = m_download_queue.empty(); |\n-| |\n-|\t\twhile (!m_request_queue.empty() |\n-|\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size |\n-|\t\t\t\t|| m_queued_time_critical > 0)) |\n-|\t\t{ |\n-|\t\t\tpending_block block = m_request_queue.front(); |\n-| |\n-|\t\t\tm_request_queue.erase(m_request_queue.begin()); |\n-|\t\t\tif (m_queued_time_critical) --m_queued_time_critical; |\n-| |\n-|\t\t\t// if we're a seed, we don't have a piece picker |\n-|\t\t\t// so we don't have to worry about invariants getting |\n-|\t\t\t// out of sync with it |\n-|\t\t\tif (!t->has_picker()) continue; |\n-| |\n-|\t\t\t// this can happen if a block times out, is re-requested and |\n-|\t\t\t// then arrives \"unexpectedly\" |\n-|\t\t\tif (t->picker().is_downloaded(block.block)) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |new_piece should be an optional. piece index -1 should not be allowed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b3_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_p\bpi\bie\bec\bce\be s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ban\bn o\bop\bpt\bti\bio\bon\bna\bal\bl.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b73\b30\b0 *\b**\b**\b* |\n-|\t\t// pieces may be empty if we don't have metadata yet |\n-|\t\tif (p.pieces.empty()) |\n-|\t\t{ |\n-|\t\t\tp.progress = 0.f; |\n-|\t\t\tp.progress_ppm = 0; |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|#if TORRENT_NO_FPU |\n-|\t\t\tp.progress = 0.f; |\n-|#else |\n-|\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size()); |\n-|#endif |\n-|\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size()); |\n-|\t\t} |\n-| |\n-|\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|void peer_connection::superseed_piece(piece_index_t const replace_piece |\n-|, piece_index_t const new_piece) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tif (is_connecting()) return; |\n-|\t\tif (in_handshake()) return; |\n-| |\n-|\t\tif (new_piece == piece_index_t(-1)) |\n-|\t\t{ |\n-|\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return; |\n-|\t\t\tm_superseed_piece[0] = piece_index_t(-1); |\n-|\t\t\tm_superseed_piece[1] = piece_index_t(-1); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\"); |\n-|#endif |\n-|\t\t\tstd::shared_ptr<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-|_\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/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bg_\be_\bt_\b _\ba_\bw_\ba_\by_\b _\bw_\bi_\bt_\bh_\b _\bj_\bu_\bs_\bt_\b _\bs_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bf_\be_\bw_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by g\bge\bet\bt a\baw\bwa\bay\by w\bwi\bit\bth\bh j\bju\bus\bst\bt s\bsa\bav\bvi\bin\bng\bg a\ba f\bfe\bew\bw f\bfi\bie\bel\bld\bds\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b41\b19\b9 *\b**\b**\b* |\n-|// --- V2 HASHES --- |\n-| |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n-|\t\t{ |\n-|\t\t\tif (!p.merkle_trees.empty()) |\n-|\t\t\t\tload_merkle_trees( |\n-|\t\t\t\t\tstd::move(p.merkle_trees) |\n-|\t\t\t\t\t, std::move(p.merkle_tree_mask) |\n-|\t\t\t\t\t, std::move(p.verified_leaf_hashes)); |\n-| |\n-|\t\t\t// we really don't want to store extra copies of the trees |\n-|\t\t\tTORRENT_ASSERT(p.merkle_trees.empty()); |\n-|\t\t} |\n-| |\n-|\t\tif (valid_metadata()) |\n-|\t\t{ |\n-|\t\t\tinc_stats_counter(counters::num_total_pieces_added |\n-|\t\t\t\t, m_torrent_file->num_pieces()); |\n-|\t\t} |\n-| |\n-|m_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p)); |\n-|} |\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-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b15\b5 *\b**\b**\b* |\n-|#endif |\n-| |\n-|\t\tif (!m_ses.dht()) return false; |\n-|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n-|\t\tif (!m_announce_to_dht) return false; |\n-|\t\tif (m_paused) return false; |\n-| |\n-|\t\t// don't announce private torrents |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n-|\t\tif (m_trackers.empty()) return true; |\n-|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n-| |\n-|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n-|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n-|\t} |\n-| |\n-|#endif |\n-| |\n-|\ttorrent::~torrent() |\n-|\t{ |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (!m_links[i].in_list()) continue; |\n-|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\t// The invariant can't be maintained here, since the torrent |\n-|\t\t// is being destructed, all weak references to it have been |\n-|\t\t// reset, which means that all its peers already have an |\n-|\t\t// invalidated torrent pointer (so it cannot be verified to be correct) |\n-| |\n-|\t\t// i.e. the invariant can only be maintained if all connections have |\n-|\t\t// been closed by the time the torrent is destructed. And they are |\n-|\t\t// supposed to be closed. So we can still do the invariant check. |\n-| |\n-|\t\t// however, the torrent object may be destructed from the main |\n-|\t\t// thread when shutting down, if the disk cache has references to it. |\n-|\t\t// this means that the invariant check that this is called from the |\n-|\t\t// network thread cannot be maintained |\n-| |\n-|\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0}); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-|\t\t// just in case, make sure the session accounting is kept right |\n-|\t\tfor (auto p : m_connections) |\n-|\t\t\tm_ses.close_connection(p); |\n-|\t} |\n-| |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b33\b31\b1 *\b**\b**\b* |\n-|piece_index_t m_piece; |\n-|\t\tbool m_armed = true; |\n-|\t}; |\n-| |\n-|\tvoid torrent::add_piece_async(piece_index_t const piece |\n-|\t\t, std::vector<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-|void torrent::add_piece(piece_index_t const piece, char const* data |\n-|, add_piece_flags_t const flags) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\t// make sure the piece index is correct |\n-|\t\tif (piece >= torrent_file().end_piece()) |\n-|\t\t\treturn; |\n-| |\n-|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n-|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n-| |\n-|\t\tif (m_deleted) return; |\n-| |\n-|\t\t// avoid crash trying to access the picker when there is none |\n-|\t\tif (m_have_all && !has_picker()) return; |\n-| |\n-|\t\t// we don't support clobbering the piece picker while checking the |\n-|\t\t// files. We may end up having the same piece multiple times |\n-|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n-|\t\t\t&& state() != torrent_status::checking_resume_data); |\n-|\t\tif (state() == torrent_status::checking_files |\n-|\t\t\t|| state() == torrent_status::checking_resume_data) |\n-|\t\t\treturn; |\n-| |\n-|\t\tneed_picker(); |\n-| |\n-|\t\tif (picker().have_piece(piece) |\n-|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n-|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b6_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b96\b66\b6 *\b**\b**\b* |\n-|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n-|\t{ |\n-|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n-| |\n-|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n-| |\n-|\t\t// if we have all pieces, we must also have the last one |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n-| |\n-|\t\t// every block should not be a pad block |\n-|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n-| |\n-|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n-|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n-|\t\t\t- std::int64_t(pc.pad_bytes); |\n-|\t} |\n-| |\n-|\t// fills in total_wanted, total_wanted_done and total_done |\n-|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n-|{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tst.total_done = 0; |\n-|\t\tst.total_wanted_done = 0; |\n-|\t\tst.total_wanted = m_size_on_disk; |\n-| |\n-|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n-|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n-| |\n-|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n-|\t\tif (!valid_metadata()) return; |\n-| |\n-|\t\tif (m_seed_mode || is_seed()) |\n-|\t\t{ |\n-|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n-|\t\t\t// piece- and file priority. We consider everything as being |\n-|\t\t\t// \"wanted\" |\n-|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n-|\t\t\tst.total_wanted_done = m_size_on_disk; |\n-|\t\t\tst.total_wanted = m_size_on_disk; |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n-|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\telse if (!has_picker()) |\n-|\t\t{ |\n-|\t\t\tst.total_done = 0; |\n-|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b90\b05\b5 *\b**\b**\b* |\n-|on_remove_peers(); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-| |\n-|\t\t// post a message to the main thread to destruct |\n-|\t\t// the torrent object from there |\n-|\t\tif (m_storage) |\n-|\t\t{ |\n-|\t\t\ttry { |\n-|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n-|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n-|\t\t\t} |\n-|\t\t\tcatch (std::exception const& e) |\n-|\t\t\t{ |\n-|\t\t\t\tTORRENT_UNUSED(e); |\n-|\t\t\t\tm_storage.reset(); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n-|#endif |\n-|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n-|\t\t\t\t// good idea to post it here, even though we failed |\n-|if (alerts().should_post<cache_flushed_alert>()) |\n-|alerts().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-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b97\b75\b5 *\b**\b**\b* |\n-|} |\n-| |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|\tvoid torrent::set_super_seeding(bool const on) |\n-|\t{ |\n-|\t\tif (on == m_super_seeding) return; |\n-| |\n-|\t\tm_super_seeding = on; |\n-|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n-|\t\tstate_updated(); |\n-| |\n-|\t\tif (m_super_seeding) return; |\n-| |\n-|\t\t// disable super seeding for all peers |\n-|\t\tfor (auto pc : *this) |\n-|\t\t{ |\n-|\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1)); |\n-|\t\t} |\n-|\t} |\n-| |\n-|piece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> 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<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-|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\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 <libtorrent/kademlia/get_item.hpp> |\n |#include <libtorrent/kademlia/sample_infohashes.hpp> |\n |#include <libtorrent/aux_/session_settings.hpp> |\n@@ -1650,123 +1650,14 @@\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<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-|// ``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-|_\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/ |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 <list> |\n-|#include <array> |\n-|#include <cstdint> |\n-| |\n-|namespace libtorrent { |\n-| |\n-|\tnamespace mp = boost::multiprecision; |\n-| |\n-|\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>; |\n-| |\n-|\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k); |\n-| |\n-|\t// RC4 state from libtomcrypt |\n-|\tstruct rc4 { |\n-|\t\tint x; |\n-|\t\tint y; |\n-|\t\taux::array<std::uint8_t, 256> buf; |\n-|\t}; |\n-| |\n-|class TORRENT_EXTRA_EXPORT dh_key_exchange |\n-|{ |\n-|\tpublic: |\n-|\t\tdh_key_exchange(); |\n-| |\n-|\t\t// Get local public key |\n-|\t\tkey_t const& get_local_key() const { return m_dh_local_key; } |\n-| |\n-|\t\t// read remote_pubkey, generate and store shared secret in |\n-|\t\t// m_dh_shared_secret. |\n-|\t\tvoid compute_secret(std::uint8_t const* remote_pubkey); |\n-|\t\tvoid compute_secret(key_t const& remote_pubkey); |\n-| |\n-|\t\tkey_t const& get_secret() const { return m_dh_shared_secret; } |\n-| |\n-|\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; } |\n-| |\n-|\tprivate: |\n-| |\n-|\t\tkey_t m_dh_local_key; |\n-|\t\tkey_t m_dh_local_secret; |\n-|\t\tkey_t m_dh_shared_secret; |\n-|\t\tsha1_hash m_xor_mask; |\n-|\t}; |\n-| |\n-|\tstruct TORRENT_EXTRA_EXPORT encryption_handler |\n-|\t{ |\n-|\t\tstd::tuple<int, span<span<char const>>> |\n-|\t\tencrypt(span<span<char>> iovec); |\n-| |\n-|_\b\t_\b\t_\bi_\bn_\bt_\b _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\ba_\bu_\bx_\b:_\b:_\bc_\br_\by_\bp_\bt_\bo_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b&_\b _\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out predictive pieces and all operations on it into a separate class (to use as member here instead) |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt p\bpr\bre\bed\bdi\bic\bct\bti\biv\bve\be p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd a\bal\bll\bl o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn i\bit\bt i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be c\bcl\bla\bas\bss\bs (\b(t\bto\bo u\bus\bse\be a\bas\bs m\bme\bem\bmb\bbe\ber\br h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd)\b) *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:1\b14\b42\b23\b3 *\b**\b**\b* |\n |#endif |\n | |\n |\t\tstd::string m_trackerid; |\n@@ -1868,67 +1759,124 @@\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+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |use string_view for device_name |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw f\bfo\bor\br d\bde\bev\bvi\bic\bce\be_\b_n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b16\b64\b4 *\b**\b**\b* |\n+|// return nullopt. |\n+|\tTORRENT_EXTRA_EXPORT boost::optional<address> get_gateway( |\n+|\t\tip_interface const& iface, span<ip_route const> routes); |\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+|\t// returns whether there is a route to the specified device for for any global |\n+|\t// internet address of the specified address family. |\n+|\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family |\n+|\t\t, span<ip_route const> routes); |\n | |\n-|\t\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+|\t// returns whether there are *any* routes to the internet in the routing |\n+|\t// table. This can be used to determine if the routing table is fully |\n+|\t// populated or not. |\n+|\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes); |\n | |\n-|\t\tvoid clear() |\n+|\t// attempt to bind socket to the device with the specified name. For systems |\n+|\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the |\n+|\t// IP addresses of the specified device. In this case it is necessary to |\n+|\t// verify the local endpoint of the socket once the connection is established. |\n+|\t// the returned address is the ip the socket was bound to (or address_v4::any() |\n+|\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it). |\n+|template <class Socket> |\n+|address bind_socket_to_device(io_context& ios, Socket& sock |\n+|\t\t, tcp const& protocol |\n+|\t\t, char const* device_name, int port, error_code& ec) |\n+|\t{ |\n+|\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port)); |\n+| |\n+|\t\taddress ip = make_address(device_name, ec); |\n+|\t\tif (!ec) |\n |\t\t{ |\n-|\t\t\tfor (int i = 0; i < num_channels; ++i) |\n-|\t\t\t\tm_stat[i].clear(); |\n+|\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or |\n+|\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and |\n+|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n+|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n+|\t\t\t\tip = address_v6::any(); |\n+|\t\t\tbind_ep.address(ip); |\n+|\t\t\t// it appears to be an IP. Just bind to that address |\n+|\t\t\tsock.bind(bind_ep, ec); |\n+|\t\t\treturn bind_ep.address(); |\n |\t\t} |\n | |\n-|\t\tstat_channel const& operator[](int i) const |\n+|\t\tec.clear(); |\n+| |\n+|#if TORRENT_HAS_BINDTODEVICE |\n+|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n+|\t\t// fall back to the mechanism we have below |\n+|\t\taux::bind_device(sock, device_name, ec); |\n+|\t\tif (ec) |\n+|#endif |\n |\t\t{ |\n-|\t\t\tTORRENT_ASSERT(i >= 0 && i < num_channels); |\n-|\t\t\treturn m_stat[i]; |\n-|\t\t} |\n+|_\b\t_\b\t_\b\t_\be_\bc_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |unify url_seed and http_seed with just web_seed, using the web_seed_entry. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp_\b:_\b5_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bun\bni\bif\bfy\by u\bur\brl\bl_\b_s\bse\bee\bed\bd a\ban\bnd\bd h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd w\bwi\bit\bth\bh j\bju\bus\bst\bt w\bwe\beb\bb_\b_s\bse\bee\bed\bd,\b, u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.h\bhp\bpp\bp:\b:5\b53\b35\b5 *\b**\b**\b* |\n+|// one returned from ``trackers()`` and will replace it. If you want an |\n+|\t\t// immediate effect, you have to call force_reannounce(). See |\n+|\t\t// announce_entry. |\n+|\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-|\tprivate: |\n | |\n-|\t\tstat_channel m_stat[num_channels]; |\n-|\t}; |\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<std::string> url_seeds() const; |\n | |\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-|_\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+|\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+|_\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@@ -1971,69 +1919,121 @@\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/ |use string_view for device_name |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw f\bfo\bor\br d\bde\bev\bvi\bic\bce\be_\b_n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b16\b64\b4 *\b**\b**\b* |\n-|// return nullopt. |\n-|\tTORRENT_EXTRA_EXPORT boost::optional<address> get_gateway( |\n-|\t\tip_interface const& iface, span<ip_route const> routes); |\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 <list> |\n+|#include <array> |\n+|#include <cstdint> |\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+|namespace libtorrent { |\n | |\n-|\t// returns whether there are *any* routes to the internet in the routing |\n-|\t// table. This can be used to determine if the routing table is fully |\n-|\t// populated or not. |\n-|\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes); |\n+|\tnamespace mp = boost::multiprecision; |\n | |\n-|\t// attempt to bind socket to the device with the specified name. For systems |\n-|\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the |\n-|\t// IP addresses of the specified device. In this case it is necessary to |\n-|\t// verify the local endpoint of the socket once the connection is established. |\n-|\t// the returned address is the ip the socket was bound to (or address_v4::any() |\n-|\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it). |\n-|template <class Socket> |\n-|address bind_socket_to_device(io_context& ios, Socket& sock |\n-|\t\t, tcp const& protocol |\n-|\t\t, char const* device_name, int port, error_code& ec) |\n+|\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>; |\n+| |\n+|\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k); |\n+| |\n+|\t// RC4 state from libtomcrypt |\n+|\tstruct rc4 { |\n+|\t\tint x; |\n+|\t\tint y; |\n+|\t\taux::array<std::uint8_t, 256> buf; |\n+|\t}; |\n+| |\n+|class TORRENT_EXTRA_EXPORT dh_key_exchange |\n+|{ |\n+|\tpublic: |\n+|\t\tdh_key_exchange(); |\n+| |\n+|\t\t// Get local public key |\n+|\t\tkey_t const& get_local_key() const { return m_dh_local_key; } |\n+| |\n+|\t\t// read remote_pubkey, generate and store shared secret in |\n+|\t\t// m_dh_shared_secret. |\n+|\t\tvoid compute_secret(std::uint8_t const* remote_pubkey); |\n+|\t\tvoid compute_secret(key_t const& remote_pubkey); |\n+| |\n+|\t\tkey_t const& get_secret() const { return m_dh_shared_secret; } |\n+| |\n+|\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; } |\n+| |\n+|\tprivate: |\n+| |\n+|\t\tkey_t m_dh_local_key; |\n+|\t\tkey_t m_dh_local_secret; |\n+|\t\tkey_t m_dh_shared_secret; |\n+|\t\tsha1_hash m_xor_mask; |\n+|\t}; |\n+| |\n+|\tstruct TORRENT_EXTRA_EXPORT encryption_handler |\n |\t{ |\n-|\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port)); |\n+|\t\tstd::tuple<int, span<span<char const>>> |\n+|\t\tencrypt(span<span<char>> iovec); |\n | |\n-|\t\taddress ip = make_address(device_name, ec); |\n-|\t\tif (!ec) |\n+|_\b\t_\b\t_\bi_\bn_\bt_\b _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\ba_\bu_\bx_\b:_\b:_\bc_\br_\by_\bp_\bt_\bo_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b&_\b _\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |everything but payload counters and rates could probably be removed from here |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\ba_\bt_\b._\bh_\bp_\bp_\b:_\b2_\b5_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* e\bev\bve\ber\bry\byt\bth\bhi\bin\bng\bg b\bbu\but\bt p\bpa\bay\byl\blo\boa\bad\bd c\bco\bou\bun\bnt\bte\ber\brs\bs a\ban\bnd\bd r\bra\bat\bte\bes\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd f\bfr\bro\bom\bm h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\bta\bat\bt.\b.h\bhp\bpp\bp:\b:2\b25\b57\b7 *\b**\b**\b* |\n+|// peer_connection is opened and have some previous |\n+|\t\t// transfers from earlier connections. |\n+|\t\tvoid add_stat(std::int64_t downloaded, std::int64_t uploaded) |\n |\t\t{ |\n-|\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or |\n-|\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and |\n-|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n-|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n-|\t\t\t\tip = address_v6::any(); |\n-|\t\t\tbind_ep.address(ip); |\n-|\t\t\t// it appears to be an IP. Just bind to that address |\n-|\t\t\tsock.bind(bind_ep, ec); |\n-|\t\t\treturn bind_ep.address(); |\n+|\t\t\tm_stat[download_payload].offset(downloaded); |\n+|\t\t\tm_stat[upload_payload].offset(uploaded); |\n |\t\t} |\n | |\n-|\t\tec.clear(); |\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-|#if TORRENT_HAS_BINDTODEVICE |\n-|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n-|\t\t// fall back to the mechanism we have below |\n-|\t\taux::bind_device(sock, device_name, ec); |\n-|\t\tif (ec) |\n-|#endif |\n+|\t\t// these are the channels we keep stats for |\n+|\t\tenum |\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+|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/ |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,18 @@\n |\t\t, move_flags_t flags, storage_error& ec); |\n | |\n |\t// deletes the files on fs from save_path according to options. Options may |\n |\t// opt to only delete the partfile |\n |\tTORRENT_EXTRA_EXPORT void |\n |\tdelete_files(file_storage const& fs, std::string const& save_path |\n |_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bs_\bt_\br_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b,_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt_\b _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br_\b&_\b _\be_\bc_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:|test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b8_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpi\bic\bck\bki\bin\bng\bg w\bwi\bit\bth\bh p\bpa\bar\brt\bti\bia\bal\bl p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd o\bot\bth\bhe\ber\br p\bpe\bee\ber\brs\bs p\bpr\bre\bes\bse\ben\bnt\bt s\bso\bo t\bth\bha\bat\bt b\bbo\bot\bth\bh b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs2\b2 a\bar\bre\be u\bus\bse\bed\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\bi\bi_\be\be_\bc\bc_\be\be_\b_\b__\bp\bp_\bi\bi_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b8\b8_\b7\b7_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b7_\b6_\b9_\b _\b _\b|_\bs_\bp_\bl_\bi_\bt_\b _\bt_\bh_\bi_\bs_\b _\bt_\be_\bs_\bt_\b _\bu_\bp_\b _\bi_\bn_\bt_\bo_\b _\bs_\bm_\ba_\bl_\bl_\be_\br_\b _\bp_\ba_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* s\bsp\bpl\bli\bit\bt t\bth\bhi\bis\bs t\bte\bes\bst\bt u\bup\bp i\bin\bnt\bto\bo s\bsm\bma\bal\bll\ble\ber\br p\bpa\bar\brt\bts\bs *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:7\b76\b69\b9 *\b**\b**\b* |\n |io->submit_jobs(); |\n |\tios.restart(); |\n |\trun_until(ios, done); |\n | |\n@@ -2298,597 +2302,179 @@\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-|relevance\u00a02|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:|test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b8_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpi\bic\bck\bki\bin\bng\bg w\bwi\bit\bth\bh p\bpa\bar\brt\bti\bia\bal\bl p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd o\bot\bth\bhe\ber\br p\bpe\bee\ber\brs\bs p\bpr\bre\bes\bse\ben\bnt\bt s\bso\bo t\bth\bha\bat\bt b\bbo\bot\bth\bh b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs2\b2 a\bar\bre\be u\bus\bse\bed\bd *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\bi\bi_\be\be_\bc\bc_\be\be_\b_\b__\bp\bp_\bi\bi_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b8\b8_\b7\b7_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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/_\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<char const> buffer |\n-|\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit) |\n-|\t{ |\n-|\t\tbdecode_node ret; |\n-|\t\tec.clear(); |\n-| |\n-|\t\tif (buffer.size() > bdecode_token::max_offset) |\n-|\t\t{ |\n-|\t\t\tif (error_pos) *error_pos = 0; |\n-|\t\t\tec = bdecode_errors::limit_exceeded; |\n-|\t\t\treturn ret; |\n-|\t\t} |\n-| |\n-|\t\t// this is the stack of bdecode_token indices, into m_tokens. |\n-|\t\t// sp is the stack pointer, as index into the array, stack |\n-|\t\tint sp = 0; |\n-|\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit); |\n-| |\n-|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+| | |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\tif (stack[current_frame - 1].state == 0) |\n-|\t\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bc_\bu_\br_\br_\be_\bn_\bt_\b _\bp_\ba_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\ba_\b _\bd_\bi_\bc_\bt_\b _\ba_\bn_\bd_\b _\bw_\be_\b _\ba_\br_\be_\b _\bp_\ba_\br_\bs_\bi_\bn_\bg_\b _\ba_\b _\bk_\be_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b _\b _\b _\b|_\bf_\bo_\bl_\bl_\bo_\bw_\bi_\bn_\bg_\b _\bp_\ba_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bi_\bl_\bl_\b _\bm_\ba_\bk_\be_\b _\bi_\bt_\b _\bc_\bo_\bm_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* j\bju\bus\bst\bt m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpe\bee\ber\br n\bno\bot\bt h\bha\bav\bve\be t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd w\bwi\bit\bth\bh t\bth\bhe\be f\bfi\bil\ble\be w\bwe\be j\bju\bus\bst\bt r\bre\beq\bqu\bue\bes\bst\bte\bed\bd.\b. O\bOn\bnl\bly\by w\bwh\bhe\ben\bn i\bit\bt d\bdo\boe\bes\bsn\bn'\b't\bt h\bha\bav\bve\be a\ban\bny\by o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be d\bdo\bo t\bth\bhe\be f\bfo\bol\bll\blo\bow\bwi\bin\bng\bg p\bpa\bad\bd f\bfi\bil\ble\bes\bs w\bwi\bil\bll\bl m\bma\bak\bke\be i\bit\bt |\n-|c\bco\bom\bmp\bpl\bli\bic\bca\bat\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b62\b26\b6 *\b**\b**\b* |\n-|\tpeer_connection::received_invalid_data(index, single_peer); |\n-| |\n-|\t// if we don't think we have any of the files, allow banning the web seed |\n-|\tif (num_have_pieces() == 0) return true; |\n-| |\n-|\t// don't disconnect, we won't request anything from this file again |\n-|\treturn false; |\n-|} |\n-| |\n-|void web_peer_connection::on_receive_padfile() |\n-|{ |\n-|\thandle_padfile(); |\n-|} |\n-| |\n-|void web_peer_connection::handle_error(int const bytes_left) |\n-|{ |\n-|\tstd::shared_ptr<torrent> 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<url_seed_alert>()) |\n-|\t{ |\n-|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n-|\t\t\t+ (\" \" + m_parser.message()); |\n-|\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url |\n-|\t\t\t, error_msg); |\n-|\t} |\n-|\treceived_bytes(0, bytes_left); |\n-|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n-|} |\n-| |\n-|void web_peer_connection::disable(error_code const& ec) |\n-|{ |\n-|\t// we should not try this server again. |\n-|\tm_web->disabled = true; |\n-|\tdisconnect(ec, operation_t::bittorrent, peer_error); |\n-|\tif (m_web->ephemeral) |\n-|\t{ |\n-|\t\tstd::shared_ptr<torrent> t = associated_torrent().lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tt->remove_web_seed_conn(this); |\n-|\t} |\n-|\tm_web = nullptr; |\n-|\tTORRENT_ASSERT(is_disconnecting()); |\n-|} |\n-| |\n-|void web_peer_connection::handle_redirect(int const bytes_left) |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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<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-|void session_impl::start_session() |\n-|{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\"start session\"); |\n-|#endif |\n-| |\n-|#if TORRENT_USE_SSL |\n-|\t\terror_code ec; |\n-|\t\tm_ssl_ctx.set_default_verify_paths(ec); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (ec) session_log(\"SSL set_default verify_paths failed: %s\", ec.message().c_str()); |\n-|\t\tec.clear(); |\n-|#endif |\n-|_\b#_\bi_\bf_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bD_\bO_\bW_\bS_\b _\b&_\b&_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bO_\bP_\bE_\bN_\bS_\bS_\bL_\b _\b&_\b&_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bR_\bT_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b7_\b6_\b1_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bi_\bp_\b _\bf_\bi_\bl_\bt_\be_\br_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bs_\ba_\bv_\be_\bd_\b _\bh_\be_\br_\be_\b _\bt_\bo_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be i\bip\bp f\bfi\bil\blt\bte\ber\br s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be t\bto\boo\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:7\b76\b61\b1 *\b**\b**\b* |\n-|m_lsd_announce_timer.async_wait([this](error_code const& e) { |\n-|\t\t\twrap(&session_impl::on_lsd_announce, e); } ); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\" done starting session\"); |\n-|#endif |\n-| |\n-|\t\t// this applies unchoke settings from m_settings |\n-|\t\trecalculate_unchoke_slots(); |\n-| |\n-|\t\t// apply all m_settings to this session |\n-|\t\trun_all_updates(*this); |\n-|\t\treopen_listen_sockets(false); |\n-| |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tcheck_invariant(); |\n-|#endif |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const |\n-|{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tentry& e = *eptr; |\n-|\t\t// make it a dict |\n-|\t\te.dict(); |\n-| |\n-|\t\tif (flags & session::save_settings) |\n-|\t\t{ |\n-|\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict(); |\n-|\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett); |\n-|\t\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tif (flags & session::save_dht_settings) |\n-|\t\t{ |\n-|\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings()); |\n-|\t\t} |\n+|\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\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\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-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx]) |\n-|\t\t{ |\n-|\t\t\text->save_state(*eptr); |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b2 |make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\ba_\bn_\bt_\b _\bt_\bo_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be a\ba l\bli\bis\bst\bt f\bfo\bor\br t\bto\bor\brr\bre\ben\bnt\bts\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo b\bbe\be a\ban\bnn\bno\bou\bun\bnc\bce\bed\bd o\bon\bn t\bth\bhe\be D\bDH\bHT\bT s\bso\bo w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be t\bto\bo l\blo\boo\bop\bp o\bov\bve\ber\br a\bal\bll\bl t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, j\bju\bus\bst\bt t\bto\bo f\bfi\bin\bnd\bd t\bth\bhe\be o\bon\bne\bes\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b38\b88\b82\b2 *\b**\b**\b* |\n-|if (!m_dht_torrents.empty()) |\n-|\t\t{ |\n-|\t\t\tstd::shared_ptr<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+|\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\tif (t) |\n-|\t\t\t{ |\n-|\t\t\t\tt->dht_announce(); |\n-|\t\t\t\treturn; |\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-|\t\t} |\n-|\t\tif (m_torrents.empty()) return; |\n-| |\n-|\t\tif (m_next_dht_torrent >= m_torrents.size()) |\n-|\t\t\tm_next_dht_torrent = 0; |\n-|\t\tm_torrents[m_next_dht_torrent]->dht_announce(); |\n-|++m_next_dht_torrent; |\n-|if (m_next_dht_torrent >= m_torrents.size()) |\n-|\t\t\tm_next_dht_torrent = 0; |\n-|\t} |\n-|#endif |\n-| |\n-|\tvoid session_impl::on_lsd_announce(error_code const& e) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\"); |\n-|\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter); |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (e) return; |\n-| |\n-|\t\tif (m_abort) return; |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\"); |\n-|\t\t// announce on local network every 5 minutes |\n-|\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval) |\n-|\t\t\t/ std::max(int(m_torrents.size()), 1), 1); |\n-|\t\tm_lsd_announce_timer.expires_after(seconds(delay)); |\n-|\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) { |\n-|\t\t\twrap(&session_impl::on_lsd_announce, err); }); |\n-| |\n-|\t\tif (m_torrents.empty()) return; |\n-| |\n-|\t\tif (m_next_lsd_torrent >= m_torrents.size()) |\n-|\t\t\tm_next_lsd_torrent = 0; |\n-|\t\tm_torrents[m_next_lsd_torrent]->lsd_announce(); |\n-|\t\t++m_next_lsd_torrent; |\n-|\t\tif (m_next_lsd_torrent >= m_torrents.size()) |\n-|_\b\t_\b\t_\b\t_\bm_\b__\bn_\be_\bx_\bt_\b__\bl_\bs_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b1_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b55\b51\b15\b5 *\b**\b**\b* |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (!node_list.empty() && nodes.empty()) |\n-|\t\t{ |\n-|\t\t\tsession_log(\"ERROR: failed to parse DHT bootstrap list: %s\", node_list.c_str()); |\n-|\t\t} |\n-|#endif |\n-|\t\tfor (auto const& n : nodes) |\n-|\t\t\tadd_dht_router(n); |\n-|#endif |\n-|\t} |\n | |\n-|\tvoid session_impl::update_count_slow() |\n-|\t{ |\n-|\t\terror_code ec; |\n-|\t\tfor (auto const& tp : m_torrents) |\n-|\t\t{ |\n-|\t\t\ttp->on_inactivity_tick(ec); |\n+|\t\t\treturn { status_t::fatal_disk_error, save_path }; |\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 | |\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+|std::set<std::string> subdirs; |\n+|\t\tfor (auto const i : f.file_range()) |\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+|\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 (!(sock->flags & listen_socket_t::accept_incoming)) |\n-|\t\t\t\treturn 0; |\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\treturn std::uint16_t(sock->tcp_external_port()); |\n-|\t\t} |\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-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tfor (auto const& s : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue; |\n-|\t\t\tif (s->ssl == transport::plaintext) |\n-|\t\t\t\treturn std::uint16_t(s->tcp_external_port()); |\n-|\t\t} |\n-|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b5_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bs_\bs_\bl_\b _\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be s\bss\bsl\bl p\bpo\bor\brt\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b55\b55\b55\b5 *\b**\b**\b* |\n-|return 0; |\n+|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n | |\n-|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\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-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tfor (auto const& s : m_listen_sockets) |\n+|\t\tfor (std::string const& s : subdirs) |\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+|\t\t\terror_code err; |\n+|\t\t\tstd::string subdir = combine_path(save_path, s); |\n | |\n-|std::uint16_t session_impl::ssl_listen_port() const |\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\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 (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n-|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n-|\t\t} |\n-| |\n-|\t\tif (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none |\n-|\t\t\t&& m_settings.get_bool(settings_pack::proxy_peer_connections)) |\n-|\t\t\treturn 0; |\n-| |\n-|\t\tfor (auto const& s : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue; |\n-|\t\t\tif (s->ssl == transport::ssl) |\n-|\t\t\t\treturn std::uint16_t(s->tcp_external_port()); |\n-|\t\t} |\n-|#else |\n-|\t\tTORRENT_UNUSED(sock); |\n-|#endif |\n-|\t\treturn 0; |\n-|\t} |\n-| |\n-|_\b\t_\bi_\bn_\bt_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b:_\b:_\bg_\be_\bt_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bs_\bl_\b,_\b _\ba_\bu_\bx_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b9_\b0_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bo_\bn_\bl_\by_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bc_\bo_\bd_\be_\b _\bo_\bn_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd i\bin\bnt\bto\bo t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bt,\b, s\bso\bo w\bwe\be o\bon\bnl\bly\by h\bha\bav\bve\be t\bth\bhe\be c\bco\bod\bde\be o\bon\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b63\b39\b90\b0 *\b**\b**\b* |\n-|return upload_rate_limit(m_local_peer_class); |\n-|\t} |\n-| |\n-|\tint session_impl::local_download_rate_limit() const |\n-|\t{ |\n-|\t\treturn download_rate_limit(m_local_peer_class); |\n-|\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-|\tint session_impl::upload_rate_limit_depr() const |\n-|\t{ |\n-|\t\treturn upload_rate_limit(m_global_class); |\n-|\t} |\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-|\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+|\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-|void session_impl::update_peer_dscp() |\n+|if (err) |\n |{ |\n-|\t\tint const value = m_settings.get_int(settings_pack::peer_dscp); |\n-|\t\tfor (auto const& l : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (l->sock) |\n-|\t\t\t{ |\n-|\t\t\t\terror_code ec; |\n-|\t\t\t\tset_traffic_class(*l->sock, value, ec); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tsession_log(\">>> SET_DSCP [ tcp (%s %d) value: %x e: %s ]\" |\n-|\t\t\t\t\t\t, l->sock->local_endpoint().address().to_string().c_str() |\n-|\t\t\t\t\t\t, l->sock->local_endpoint().port(), value, ec.message().c_str()); |\n+|\t\t\t\t\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-|#endif |\n+|\t\t\t\tadded_files = true; |\n+|\t\t\t\tstat.set_dirty(idx); |\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-|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<request_callback> c) |\n-|\t\t: tracker_connection(man, req, ios, std::move(c)) |\n-|\t\t, m_transaction_id(0) |\n-|\t\t, m_attempts(0) |\n-|\t\t, m_state(action_t::error) |\n-|\t\t, m_abort(false) |\n-|\t{ |\n-|\t\tupdate_transaction_id(); |\n-|\t} |\n-| |\n-|\tvoid udp_tracker_connection::start() |\n-|\t{ |\n-|std::string hostname; |\n-|std::string protocol; |\n-|\t\tint port; |\n-|\t\terror_code ec; |\n-| |\n-|\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore) |\n-|\t\t\t= parse_url_components(tracker_req().url, ec); |\n-|\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443; |\n-| |\n-|\t\tif (ec) |\n-|\t\t{ |\n-|\t\t\ttracker_connection::fail(ec, operation_t::parse_address); |\n-|\t\t\treturn; |\n |\t\t} |\n+|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n | |\n-|\t\taux::session_settings const& settings = m_man.settings(); |\n-| |\n-|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\n+|\t\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 (settings.get_bool(settings_pack::proxy_hostnames) |\n-|\t\t\t&& (proxy_type == settings_pack::socks5 |\n-|\t\t\t\t|| proxy_type == settings_pack::socks5_pw)) |\n-|\t\t{ |\n-|\t\t\tm_hostname = hostname; |\n-|\t\t\tm_target.port(std::uint16_t(port)); |\n-|\t\t\tstart_announce(); |\n-|\t\t} |\n-|\t\telse |\n+|\t\tif (seed) |\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__\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+|\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// 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+|\t\t\t\t// files with priority zero may not have been saved to disk at their |\n+|\t\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n+|\t\t\t\t// from checking |\n+|\t\t\t\tif (file_index < file_priority.end_index() |\n+|\t\t\t\t\t&& file_priority[file_index] == dont_download |\n+|\t\t\t\t\t&& !(rd.flags & torrent_flags::seed_mode)) |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b._\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\treturn nullptr; |\n-|\t} |\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 alert_manager::maybe_notify(alert* a) |\n+|\tstd::string dht_immutable_item_alert::message() const |\n |\t{ |\n-|\t\tif (m_alerts[m_generation].size() == 1) |\n-|\t\t{ |\n-|\t\t\t// we just posted to an empty queue. If anyone is waiting for |\n-|\t\t\t// alerts, we need to notify them. Also (potentially) call the |\n-|\t\t\t// user supplied m_notify callback to let the client wake up its |\n-|\t\t\t// message loop to poll for alerts. |\n-|\t\t\tif (m_notify) m_notify(); |\n-| |\n-|m_condition.notify_all(); |\n-|} |\n-| |\n-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\t\tfor (auto& e : m_ses_extensions) |\n-|\t\t\te->on_alert(a); |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n |#else |\n-|\t\tTORRENT_UNUSED(a); |\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 alert_manager::set_notify_function(std::function<void()> const& fun) |\n-|\t{ |\n-|\t\tstd::unique_lock<std::recursive_mutex> lock(m_mutex); |\n-|\t\tm_notify = fun; |\n-|\t\tif (!m_alerts[m_generation].empty()) |\n-|\t\t{ |\n-|\t\t\tif (m_notify) m_notify(); |\n-|\t\t} |\n-|\t} |\n+|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n+|, 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-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext) |\n+|\tstd::string dht_mutable_item_alert::message() const |\n |\t{ |\n-|\t\tm_ses_extensions.push_back(std::move(ext)); |\n-|\t} |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tchar msg[1050]; |\n+|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n+|\t\t\t, aux::to_hex(key).c_str() |\n+|\t\t\t, salt.c_str() |\n+|\t\t\t, seq |\n+|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n+|\t\t\t, item.to_string().c_str()); |\n+|\t\treturn msg; |\n |#endif |\n+|\t} |\n | |\n-|\tvoid alert_manager::get_all(std::vector<alert*>& 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+|\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/ |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@@ -2936,233 +2522,502 @@\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/_\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+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:5\b50\b04\b4 *\b**\b**\b* |\n+|if (m_current_gauge_state != no_gauge_state) |\n+|\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1); |\n+|\t\tif (new_gauge_state != no_gauge_state) |\n+|\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1); |\n | |\n-|\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\tTORRENT_ASSERT(new_gauge_state >= 0); |\n+|\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state); |\n+|\t\tm_current_gauge_state = static_cast<std::uint32_t>(new_gauge_state); |\n+|\t} |\n | |\n-|\tstd::string dht_immutable_item_alert::message() const |\n+|\tvoid torrent::leave_seed_mode(seed_mode_t const checking) |\n |\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\" |\n-|\t\t\t, aux::to_hex(target).c_str() |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n-|#endif |\n-|\t} |\n+|\t\tif (!m_seed_mode) return; |\n | |\n-|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n-|, 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\tif (checking == seed_mode_t::check_files) |\n+|\t\t{ |\n+|\t\t\t// this means the user promised we had all the |\n+|\t\t\t// files, but it turned out we didn't. This is |\n+|\t\t\t// an error. |\n | |\n-|\tstd::string dht_mutable_item_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n-|\t\t\t, aux::to_hex(key).c_str() |\n-|\t\t\t, salt.c_str() |\n-|\t\t\t, seq |\n-|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\"); |\n+|#endif |\n+|\t\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\" |\n+|\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\"); |\n |#endif |\n+|\t\tm_seed_mode = false; |\n+|\t\t// seed is false if we turned out not |\n+|\t\t// to be a seed after all |\n+|\t\tif (checking == seed_mode_t::check_files |\n+|\t\t\t&& state() != torrent_status::checking_resume_data) |\n+|\t\t{ |\n+|\t\t\tm_have_all = false; |\n+|\t\t\tset_state(torrent_status::downloading); |\n+|\t\t\tforce_recheck(); |\n+|\t\t} |\n+|\t\tm_num_verified = 0; |\n+|\t\tm_verified.clear(); |\n+|\t\tm_verifying.clear(); |\n+| |\n+|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n |\t} |\n | |\n-|\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-| | |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+|\tvoid torrent::verified(piece_index_t const piece) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(!m_verified.get_bit(piece)); |\n+|_\b\t_\b\t_\b+_\b+_\bm_\b__\bn_\bu_\bm_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b8_\b5_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\ba_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\b _\bw_\bh_\be_\br_\be_\b _\bw_\be_\b _\bd_\bo_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b,_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\bt_\bo_\b _\ba_\b _\bp_\be_\be_\br_\b _\bt_\bh_\ba_\bt_\b _\bs_\be_\bn_\bd_\bs_\b _\ba_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bt_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b,_\b _\bt_\bh_\be_\bn_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\ba u\bun\bni\bit\bt t\bte\bes\bst\bt w\bwh\bhe\ber\bre\be w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be m\bme\bet\bta\bad\bda\bat\bta\ba,\b, c\bco\bon\bnn\bne\bec\bct\bt t\bto\bo a\ba p\bpe\bee\ber\br t\bth\bha\bat\bt s\bse\ben\bnd\bds\bs a\ba b\bbi\bit\btf\bfi\bie\bel\bld\bd t\bth\bha\bat\bt'\b's\bs t\bto\boo\bo l\bla\bar\brg\bge\be,\b, t\bth\bhe\ben\bn w\bwe\be g\bge\bet\bt t\bth\bhe\be m\bme\bet\bta\bad\bda\bat\bta\ba *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b18\b85\b52\b2 *\b**\b**\b* |\n+|for (auto const& f : m_add_torrent_params->renamed_files) |\n |\t\t\t{ |\n-|\t\t\t\t// files moved out to absolute paths are not moved |\n-|\t\t\t\tif (f.file_absolute_path(file_index)) continue; |\n+|\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue; |\n+|\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second); |\n+|\t\t\t} |\n+|\t\t} |\n | |\n-|\t\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+|\t\tconstruct_storage(); |\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+|#ifndef TORRENT_DISABLE_SHARE_MODE |\n+|\t\tif (m_share_mode && valid_metadata()) |\n+|\t\t{ |\n+|\t\t\t// in share mode, all pieces have their priorities initialized to 0 |\n+|\t\t\tm_file_priority.clear(); |\n+|\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download); |\n+|\t\t} |\n+|#endif |\n | |\n-|\t\t\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// it's important to initialize the peers early, because this is what will |\n+|\t\t// fix up their have-bitmasks to have the correct size |\n+|if (!m_connections_initialized) |\n+|{ |\n+|\t\t\tm_connections_initialized = true; |\n+|\t\t\t// all peer connections have to initialize themselves now that the metadata |\n+|\t\t\t// is available |\n+|\t\t\t// copy the peer list since peers may disconnect and invalidate |\n+|\t\t\t// m_connections as we initialize them |\n+|\t\t\tfor (auto c : m_connections) |\n+|\t\t\t{ |\n+|\t\t\t\tauto pc = c->self(); |\n+|\t\t\t\tif (pc->is_disconnecting()) continue; |\n+|\t\t\t\tpc->on_metadata_impl(); |\n+|\t\t\t\tif (pc->is_disconnecting()) continue; |\n+|\t\t\t\tpc->init(); |\n |\t\t\t} |\n+|\t\t} |\n | |\n-|\t\t\treturn { status_t::fatal_disk_error, save_path }; |\n+|\t\t// in case file priorities were passed in via the add_torrent_params |\n+|\t\t// and also in the case of share mode, we need to update the priorities |\n+|\t\t// this has to be applied before piece priority |\n+|\t\tif (!m_file_priority.empty()) |\n+|\t\t{ |\n+|\t\t\t// m_file_priority was loaded from the resume data, this doesn't |\n+|\t\t\t// alter any state that needs to be saved in the resume data |\n+|\t\t\tauto const ns = m_need_save_resume_data; |\n+|\t\t\tupdate_piece_priorities(m_file_priority); |\n+|\t\t\tm_need_save_resume_data = ns; |\n |\t\t} |\n | |\n+|\t\tif (m_add_torrent_params) |\n+|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bh_\br_\bo_\bn_\bo_\b _\bt_\by_\bp_\be_\b _\bf_\bo_\br_\b _\bt_\bi_\bm_\be_\b _\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be c\bch\bhr\bro\bon\bno\bo t\bty\byp\bpe\be f\bfo\bor\br t\bti\bim\bme\be d\bdu\bur\bra\bat\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b44\b49\b92\b2 *\b**\b**\b* |\n+|} |\n | |\n-|std::set<std::string> subdirs; |\n-|\t\tfor (auto const i : f.file_range()) |\n+|\t\tm_picker->piece_passed(index); |\n+|\t\tupdate_gauge(); |\n+|\t\twe_have(index); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log()) |\n+|\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have()); |\n+|#endif |\n+|#ifndef TORRENT_DISABLE_STREAMING |\n+|\t\tremove_time_critical_piece(index, true); |\n+|#endif |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n+|\t// we believe we will complete this piece very soon |\n+|\t// announce it to peers ahead of time to eliminate the |\n+|\t// round-trip times involved in announcing it, requesting it |\n+|\t// and sending it |\n+|void torrent::predicted_have_piece(piece_index_t const index, int const milliseconds) |\n+|{ |\n+|\t\tauto const i = std::lower_bound(m_predictive_pieces.begin() |\n+|\t\t\t, m_predictive_pieces.end(), index); |\n+|\t\tif (i != m_predictive_pieces.end() && *i == index) return; |\n+| |\n+|\t\tfor (auto p : m_connections) |\n |\t\t{ |\n-|\t\t\t// files moved out to absolute paths are not moved |\n-|\t\t\tif (f.file_absolute_path(i)) continue; |\n+|\t\t\tTORRENT_INCREMENT(m_iterating_connections); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\" |\n+|\t\t\t\t, static_cast<int>(index), milliseconds); |\n+|#else |\n+|\t\t\tTORRENT_UNUSED(milliseconds); |\n+|#endif |\n+|\t\t\tp->announce_piece(index); |\n+|\t\t} |\n | |\n-|\t\t\tif (has_parent_path(f.file_path(i))) |\n-|\t\t\t\tsubdirs.insert(parent_path(f.file_path(i))); |\n+|\t\tm_predictive_pieces.insert(i, index); |\n+|\t} |\n+|#endif |\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+|\t// blocks may contain the block indices of the blocks that failed (if this is |\n+|\t// a v2 torrent). |\n+|\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks) |\n+|\t{ |\n+|\t\t// if the last piece fails the peer connection will still |\n+|\t\t// think that it has received all of it until this function |\n+|\t\t// resets the download queue. So, we cannot do the |\n+|\t\t// invariant check here since it assumes: |\n+|_\b\t_\b\t_\b/_\b/_\b _\b(_\bt_\bo_\bt_\ba_\bl_\b__\bd_\bo_\bn_\be_\b _\b=_\b=_\b _\bm_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b-_\b>_\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b=_\b>_\b _\bi_\bs_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bb_\bo_\br_\bt_\b _\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bh_\ba_\bs_\b _\bm_\ba_\bd_\be_\b _\bv_\bi_\ba_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bh_\bo_\bs_\bt_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt l\blo\boo\bok\bku\bup\bps\bs t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt h\bha\bas\bs m\bma\bad\bde\be v\bvi\bia\ba t\bth\bhe\be s\bse\bes\bss\bsi\bio\bon\bn h\bho\bos\bst\bt r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b91\b19\b9 *\b**\b**\b* |\n+|TORRENT_UNUSED(e); |\n+|\t\t\t\tm_storage.reset(); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n+|#endif |\n+|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n+|\t\t\t\t// good idea to post it here, even though we failed |\n+|\t\t\t\tif (alerts().should_post<cache_flushed_alert>()) |\n+|\t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle()); |\n+|\t\t\t} |\n+|\t\t\tm_ses.deferred_submit_jobs(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tif (alerts().should_post<cache_flushed_alert>()) |\n+|\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle()); |\n+|\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle() |\n+|\t\t\t\t, info_hash(), get_userdata()); |\n+|\t\t} |\n | |\n-|\t\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+|if (!m_apply_ip_filter) |\n+|\t\t{ |\n+|\t\t\tinc_stats_counter(counters::non_filter_torrents, -1); |\n+|\t\t\tm_apply_ip_filter = true; |\n |\t\t} |\n | |\n-|\t\tfor (std::string const& s : subdirs) |\n+|\t\tm_paused = false; |\n+|\t\tm_auto_managed = false; |\n+|\t\tupdate_state_list(); |\n+|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n |\t\t{ |\n-|\t\t\terror_code err; |\n-|\t\t\tstd::string subdir = combine_path(save_path, s); |\n+|\t\t\tif (!m_links[i].in_list()) continue; |\n+|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n+|\t\t} |\n+|\t\t// don't re-add this torrent to the state-update list |\n+|\t\tm_state_subscription = false; |\n+|\t} |\n | |\n-|\t\t\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+|\t// this is called when we're destructing non-gracefully. i.e. we're _just_ |\n+|\t// destructing everything. |\n+|\tvoid torrent::panic() |\n+|\t{ |\n+|\t\tm_storage.reset(); |\n+|\t\t// if there are any other peers allocated still, we need to clear them |\n+|\t\t// now. They can't be cleared later because the allocator will already |\n+|\t\t// have been destructed |\n+|\t\tif (m_peer_list) m_peer_list->clear(); |\n+|\t\tm_connections.clear(); |\n+|\t\tm_outgoing_pids.clear(); |\n+|_\b\t_\b\t_\bm_\b__\bp_\be_\be_\br_\bs_\b__\bt_\bo_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b3_\b2 |if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bw_\bi_\bt_\bh_\b _\bs_\bo_\bm_\be_\b _\bd_\be_\bf_\bi_\bn_\bi_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bi_\bd_\bl_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bif\bf p\bpe\bee\ber\br i\bis\bs a\ba r\bre\bea\bal\bll\bly\by g\bgo\boo\bod\bd p\bpe\bee\ber\br,\b, m\bma\bay\byb\bbe\be w\bwe\be s\bsh\bho\bou\bul\bld\bdn\bn'\b't\bt d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt i\bit\bt p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd i\bif\bf w\bwe\be h\bha\bav\bve\be t\bto\boo\bo m\bma\ban\bny\by i\bid\bdl\ble\be p\bpe\bee\ber\brs\bs (\b(w\bwi\bit\bth\bh s\bso\bom\bme\be d\bde\bef\bfi\bin\bni\bit\bti\bio\bon\bn o\bof\bf i\bid\bdl\ble\be)\b) *\b**\b**\b**\b**\b*|\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:8\b80\b03\b32\b2 *\b**\b**\b* |\n+|\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1); |\n+|\t\tm_connections.reserve(m_connections.size() + 1); |\n | |\n-|\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+|#if TORRENT_USE_ASSERTS |\n+|\t\terror_code ec; |\n+|\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec); |\n+|#endif |\n | |\n-|\t\t\t\t\thard_link(s, file_path, err); |\n-|\t\t\t\t} |\n+|\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr); |\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+|\t\t// we need to do this after we've added the peer to the peer_list |\n+|\t\t// since that's when the peer is assigned its peer_info object, |\n+|\t\t// which holds the rank |\n+|\t\tif (maybe_replace_peer) |\n+|\t\t{ |\n+|\t\t\t// now, find the lowest rank peer and disconnect that |\n+|\t\t\t// if it's lower rank than the incoming connection |\n+|\t\t\tpeer_connection* peer = find_lowest_ranking_peer(); |\n | |\n-|if (err) |\n+|if (peer != nullptr && peer->peer_rank() < p->peer_rank()) |\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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n+|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n+|\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str() |\n+|\t\t\t\t\t\t, num_peers() |\n+|\t\t\t\t\t\t, m_max_connections); |\n |\t\t\t\t} |\n-|\t\t\t\tadded_files = true; |\n-|\t\t\t\tstat.set_dirty(idx); |\n+|#endif |\n+|\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n+|\t\t\t\tp->peer_disconnected_other(); |\n |\t\t\t} |\n-|\t\t} |\n-|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n+|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n+|\t\t\t\t\t\t, print_endpoint(p->remote()).c_str() |\n+|\t\t\t\t\t\t, num_peers() |\n+|\t\t\t\t\t\t, m_max_connections); |\n+|\t\t\t\t} |\n+|#endif |\n+|\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n+|\t\t\t\t// we have to do this here because from the peer's point of view |\n+|\t\t\t\t// it wasn't really attached to the torrent, but we do need |\n+|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\b _\bl_\be_\bt_\b _\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b _\bk_\bn_\bo_\bw_\b _\bw_\be_\b'_\br_\be_\b _\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|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\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+|\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\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+|\t// don't disconnect, we won't request anything from this file again |\n+|\treturn false; |\n+|} |\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/_\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+|void web_peer_connection::on_receive_padfile() |\n |{ |\n-|\t\treturn escape_string_impl(str.data(), int(str.size()), 10); |\n-|\t} |\n+|\thandle_padfile(); |\n+|} |\n | |\n-|\tbool need_encoding(char const* str, int const len) |\n+|void web_peer_connection::handle_error(int const bytes_left) |\n+|{ |\n+|\tstd::shared_ptr<torrent> t = associated_torrent().lock(); |\n+|\tTORRENT_ASSERT(t); |\n+| |\n+| |\n+|// temporarily unavailable, retry later |\n+|\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\")); |\n+|\tif (t->alerts().should_post<url_seed_alert>()) |\n |\t{ |\n-|\t\tfor (int i = 0; i < len; ++i) |\n-|\t\t{ |\n-|\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n-|\t\t\t\treturn true; |\n-|\t\t\t++str; |\n-|\t\t} |\n-|\t\treturn false; |\n+|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n+|\t\t\t+ (\" \" + m_parser.message()); |\n+|\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url |\n+|\t\t\t, error_msg); |\n |\t} |\n+|\treceived_bytes(0, bytes_left); |\n+|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n+|} |\n | |\n-|\tvoid convert_path_to_posix(std::string& path) |\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::replace(path.begin(), path.end(), '\\\\', '/'); |\n+|\t\tstd::shared_ptr<torrent> t = associated_torrent().lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|\t\tt->remove_web_seed_conn(this); |\n |\t} |\n+|\tm_web = nullptr; |\n+|\tTORRENT_ASSERT(is_disconnecting()); |\n+|} |\n | |\n-|std::string read_until(char const*& str, char const delim, char const* end) |\n+|void web_peer_connection::handle_redirect(int const bytes_left) |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9 |it would be nice if there was a way to iterate over these torrent_peer objects in the order they are allocated in the pool instead. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhe\ber\bre\be w\bwa\bas\bs a\ba w\bwa\bay\by t\bto\bo i\bit\bte\ber\bra\bat\bte\be o\bov\bve\ber\br t\bth\bhe\bes\bse\be t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br o\bob\bbj\bje\bec\bct\bts\bs i\bin\bn t\bth\bhe\be o\bor\brd\bde\ber\br t\bth\bhe\bey\by a\bar\bre\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd i\bin\bn t\bth\bhe\be p\bpo\boo\bol\bl i\bin\bns\bst\bte\bea\bad\bd.\b. I\bIt\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt |\n+|*\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_l\bli\bis\bst\bt.\b.c\bcp\bpp\bp:\b:5\b53\b39\b9 *\b**\b**\b* |\n+|, int session_time, torrent_state* state) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tconst int candidate_count = 10; |\n+|\t\tpeers.reserve(candidate_count); |\n+| |\n+|\t\tint erase_candidate = -1; |\n+| |\n+|\t\tif (bool(m_finished) != state->is_finished) |\n+|\t\t\trecalculate_connect_candidates(state); |\n+| |\n+|\t\texternal_ip const& external = state->ip; |\n+|\t\tint external_port = state->port; |\n+| |\n+|\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n+| |\n+|\t\tint max_peerlist_size = state->max_peerlist_size; |\n+| |\n+|for (int iterations = std::min(int(m_peers.size()), 300); |\n+|iterations > 0; --iterations) |\n+|\t\t{ |\n+|\t\t\t++state->loop_counter; |\n+| |\n+|\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n+| |\n+|\t\t\ttorrent_peer& pe = *m_peers[m_round_robin]; |\n+|\t\t\tTORRENT_ASSERT(pe.in_use); |\n+|\t\t\tint current = m_round_robin; |\n+| |\n+|\t\t\t// if the number of peers is growing large |\n+|\t\t\t// we need to start weeding. |\n+| |\n+|\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95 |\n+|\t\t\t\t&& max_peerlist_size > 0) |\n+|\t\t\t{ |\n+|\t\t\t\tif (is_erase_candidate(pe) |\n+|\t\t\t\t\t&& (erase_candidate == -1 |\n+|\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe))) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tif (should_erase_immediately(pe)) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate; |\n+|\t\t\t\t\t\terase_peer(m_peers.begin() + current, state); |\n+|\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t\telse |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\terase_candidate = current; |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\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-|\t\tTORRENT_ASSERT(str <= end); |\n+|\tTORRENT_ASSERT(magic == 1337); |\n+|\tmagic = 0; |\n+|} |\n+|#else |\n+|upnp::rootdevice::~rootdevice() = default; |\n+|#endif |\n | |\n-|\t\tstd::string ret; |\n-|\t\twhile (str != end && *str != delim) |\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/_\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\tret += *str; |\n-|\t\t\t++str; |\n+|\t\t\tec.clear(); |\n+|\t\t\treturn; |\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\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// 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// fall back to making a copy |\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+|#endif |\n+| |\n+|\t\t// if we get here, we should copy the file |\n+|\t\tstorage_error se; |\n+|\t\taux::copy_file(file, link, se); |\n+|\t\tec = se.ec; |\n+|\t} |\n+| |\n+|\tbool is_directory(std::string const& f, error_code& ec) |\n+|\t{ |\n+|\t\tec.clear(); |\n+|\t\terror_code e; |\n+|\t\tfile_status s; |\n+|\t\tstat_file(f, &s, e); |\n+|\t\tif (!e && s.mode & file_status::directory) return true; |\n+|_\b\t_\b\t_\be_\bc_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |this should probably be based on time instead of number of request messages. For a very high throughput connection, 300 may be a |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b5_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\be_\bg_\bi_\bt_\bi_\bm_\ba_\bt_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bi_\bn_\b _\bf_\bl_\bi_\bg_\bh_\bt_\b _\bw_\bh_\be_\bn_\b _\bg_\be_\bt_\bt_\bi_\bn_\bg_\b _\bc_\bh_\bo_\bk_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bba\bas\bse\bed\bd o\bon\bn t\bti\bim\bme\be i\bin\bns\bst\bte\bea\bad\bd o\bof\bf n\bnu\bum\bmb\bbe\ber\br o\bof\bf r\bre\beq\bqu\bue\bes\bst\bt m\bme\bes\bss\bsa\bag\bge\bes\bs.\b. F\bFo\bor\br a\ba v\bve\ber\bry\by h\bhi\big\bgh\bh t\bth\bhr\bro\bou\bug\bgh\bhp\bpu\but\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn,\b, 3\b30\b00\b0 m\bma\bay\by b\bbe\be a\ba l\ble\beg\bgi\bit\bti\bim\bma\bat\bte\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf r\bre\beq\bqu\bue\bes\bst\bts\bs t\bto\bo h\bha\bav\bve\be i\bin\bn|\n |f\bfl\bli\big\bgh\bht\bt w\bwh\bhe\ben\bn g\bge\bet\btt\bti\bin\bng\bg c\bch\bho\bok\bke\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:2\b25\b56\b62\b2 *\b**\b**\b* |\n |} |\n |#endif |\n@@ -3323,14 +3178,177 @@\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/_\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<char const> buffer |\n+|\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit) |\n+|\t{ |\n+|\t\tbdecode_node ret; |\n+|\t\tec.clear(); |\n+| |\n+|\t\tif (buffer.size() > bdecode_token::max_offset) |\n+|\t\t{ |\n+|\t\t\tif (error_pos) *error_pos = 0; |\n+|\t\t\tec = bdecode_errors::limit_exceeded; |\n+|\t\t\treturn ret; |\n+|\t\t} |\n+| |\n+|\t\t// this is the stack of bdecode_token indices, into m_tokens. |\n+|\t\t// sp is the stack pointer, as index into the array, stack |\n+|\t\tint sp = 0; |\n+|\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit); |\n+| |\n+|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+|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<request_callback> c) |\n+|\t\t: tracker_connection(man, req, ios, std::move(c)) |\n+|\t\t, m_transaction_id(0) |\n+|\t\t, m_attempts(0) |\n+|\t\t, m_state(action_t::error) |\n+|\t\t, m_abort(false) |\n+|\t{ |\n+|\t\tupdate_transaction_id(); |\n+|\t} |\n+| |\n+|\tvoid udp_tracker_connection::start() |\n+|\t{ |\n+|std::string hostname; |\n+|std::string protocol; |\n+|\t\tint port; |\n+|\t\terror_code ec; |\n+| |\n+|\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore) |\n+|\t\t\t= parse_url_components(tracker_req().url, ec); |\n+|\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443; |\n+| |\n+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\ttracker_connection::fail(ec, operation_t::parse_address); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\taux::session_settings const& settings = m_man.settings(); |\n+| |\n+|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\n+| |\n+|\t\tif (settings.get_bool(settings_pack::proxy_hostnames) |\n+|\t\t\t&& (proxy_type == settings_pack::socks5 |\n+|\t\t\t\t|| proxy_type == settings_pack::socks5_pw)) |\n+|\t\t{ |\n+|\t\t\tm_hostname = hostname; |\n+|\t\t\tm_target.port(std::uint16_t(port)); |\n+|\t\t\tstart_announce(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tusing namespace std::placeholders; |\n+|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b _\b _\b _\b|_\bk_\be_\be_\bp_\b _\ba_\b _\bc_\bo_\bu_\bn_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bt_\bh_\br_\be_\ba_\bd_\bs_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b._\b _\bO_\bn_\bl_\by_\b _\bi_\bf_\b _\bi_\bt_\b'_\bs_\b _\b>_\b _\b0_\b _\bn_\bo_\bt_\bi_\bf_\by_\b _\bt_\bh_\be_\bm_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* k\bke\bee\bep\bp a\ba c\bco\bou\bun\bnt\bt o\bof\bf t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bth\bhr\bre\bea\bad\bds\bs w\bwa\bai\bit\bti\bin\bng\bg.\b. O\bOn\bnl\bly\by i\bif\bf i\bit\bt'\b's\bs >\b> 0\b0 n\bno\bot\bti\bif\bfy\by t\bth\bhe\bem\bm *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:8\b80\b0 *\b**\b**\b* |\n+|return m_alerts[m_generation].front(); |\n+| |\n+|\t\t// this call can be interrupted prematurely by other signals |\n+|\t\tm_condition.wait_for(lock, max_wait); |\n+|\t\tif (!m_alerts[m_generation].empty()) |\n+|\t\t\treturn m_alerts[m_generation].front(); |\n+| |\n+|\t\treturn nullptr; |\n+|\t} |\n+| |\n+|\tvoid alert_manager::maybe_notify(alert* a) |\n+|\t{ |\n+|\t\tif (m_alerts[m_generation].size() == 1) |\n+|\t\t{ |\n+|\t\t\t// we just posted to an empty queue. If anyone is waiting for |\n+|\t\t\t// alerts, we need to notify them. Also (potentially) call the |\n+|\t\t\t// user supplied m_notify callback to let the client wake up its |\n+|\t\t\t// message loop to poll for alerts. |\n+|\t\t\tif (m_notify) m_notify(); |\n+| |\n+|m_condition.notify_all(); |\n+|} |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\tfor (auto& e : m_ses_extensions) |\n+|\t\t\te->on_alert(a); |\n+|#else |\n+|\t\tTORRENT_UNUSED(a); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid alert_manager::set_notify_function(std::function<void()> const& fun) |\n+|\t{ |\n+|\t\tstd::unique_lock<std::recursive_mutex> lock(m_mutex); |\n+|\t\tm_notify = fun; |\n+|\t\tif (!m_alerts[m_generation].empty()) |\n+|\t\t{ |\n+|\t\t\tif (m_notify) m_notify(); |\n+|\t\t} |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext) |\n+|\t{ |\n+|\t\tm_ses_extensions.push_back(std::move(ext)); |\n+|\t} |\n+|#endif |\n+| |\n+|\tvoid alert_manager::get_all(std::vector<alert*>& alerts) |\n+|\t{ |\n+|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bl_\bo_\bc_\bk_\b__\bg_\bu_\ba_\br_\bd_\b<_\bs_\bt_\bd_\b:_\b:_\br_\be_\bc_\bu_\br_\bs_\bi_\bv_\be_\b__\bm_\bu_\bt_\be_\bx_\b>_\b _\bl_\bo_\bc_\bk_\b(_\bm_\b__\bm_\bu_\bt_\be_\bx_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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@@ -3540,284 +3558,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_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:5\b50\b04\b4 *\b**\b**\b* |\n-|if (m_current_gauge_state != no_gauge_state) |\n-|\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1); |\n-|\t\tif (new_gauge_state != no_gauge_state) |\n-|\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1); |\n-| |\n-|\t\tTORRENT_ASSERT(new_gauge_state >= 0); |\n-|\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state); |\n-|\t\tm_current_gauge_state = static_cast<std::uint32_t>(new_gauge_state); |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bs_\bc_\ba_\bp_\be_\b__\bs_\bt_\br_\bi_\bn_\bg_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b4_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\bv_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bu_\bt_\bi_\bl_\b._\bc_\bp_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bov\bve\bed\bd i\bin\bnt\bto\bo s\bst\btr\bri\bin\bng\bg_\b_u\but\bti\bil\bl.\b.c\bcp\bpp\bp *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\bes\bsc\bca\bap\bpe\be_\b_s\bst\btr\bri\bin\bng\bg.\b.c\bcp\bpp\bp:\b:1\b19\b94\b4 *\b**\b**\b* |\n+|{ |\n+|\t\treturn escape_string_impl(str.data(), int(str.size()), 10); |\n |\t} |\n | |\n-|\tvoid torrent::leave_seed_mode(seed_mode_t const checking) |\n+|\tbool need_encoding(char const* str, int const len) |\n |\t{ |\n-|\t\tif (!m_seed_mode) return; |\n-| |\n-|\t\tif (checking == seed_mode_t::check_files) |\n-|\t\t{ |\n-|\t\t\t// this means the user promised we had all the |\n-|\t\t\t// files, but it turned out we didn't. This is |\n-|\t\t\t// an error. |\n-| |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\"); |\n-|#endif |\n-|\t\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\" |\n-|\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\"); |\n-|#endif |\n-|\t\tm_seed_mode = false; |\n-|\t\t// seed is false if we turned out not |\n-|\t\t// to be a seed after all |\n-|\t\tif (checking == seed_mode_t::check_files |\n-|\t\t\t&& state() != torrent_status::checking_resume_data) |\n+|\t\tfor (int i = 0; i < len; ++i) |\n |\t\t{ |\n-|\t\t\tm_have_all = false; |\n-|\t\t\tset_state(torrent_status::downloading); |\n-|\t\t\tforce_recheck(); |\n+|\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n+|\t\t\t\treturn true; |\n+|\t\t\t++str; |\n |\t\t} |\n-|\t\tm_num_verified = 0; |\n-|\t\tm_verified.clear(); |\n-|\t\tm_verifying.clear(); |\n-| |\n-|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n+|\t\treturn false; |\n |\t} |\n | |\n-|\tvoid torrent::verified(piece_index_t const piece) |\n+|\tvoid convert_path_to_posix(std::string& path) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(!m_verified.get_bit(piece)); |\n-|_\b\t_\b\t_\b+_\b+_\bm_\b__\bn_\bu_\bm_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b8_\b5_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\ba_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\b _\bw_\bh_\be_\br_\be_\b _\bw_\be_\b _\bd_\bo_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b,_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\bt_\bo_\b _\ba_\b _\bp_\be_\be_\br_\b _\bt_\bh_\ba_\bt_\b _\bs_\be_\bn_\bd_\bs_\b _\ba_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bt_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b,_\b _\bt_\bh_\be_\bn_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\ba u\bun\bni\bit\bt t\bte\bes\bst\bt w\bwh\bhe\ber\bre\be w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be m\bme\bet\bta\bad\bda\bat\bta\ba,\b, c\bco\bon\bnn\bne\bec\bct\bt t\bto\bo a\ba p\bpe\bee\ber\br t\bth\bha\bat\bt s\bse\ben\bnd\bds\bs a\ba b\bbi\bit\btf\bfi\bie\bel\bld\bd t\bth\bha\bat\bt'\b's\bs t\bto\boo\bo l\bla\bar\brg\bge\be,\b, t\bth\bhe\ben\bn w\bwe\be g\bge\bet\bt t\bth\bhe\be m\bme\bet\bta\bad\bda\bat\bta\ba *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b18\b85\b52\b2 *\b**\b**\b* |\n-|for (auto const& f : m_add_torrent_params->renamed_files) |\n-|\t\t\t{ |\n-|\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue; |\n-|\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tconstruct_storage(); |\n-| |\n-|#ifndef TORRENT_DISABLE_SHARE_MODE |\n-|\t\tif (m_share_mode && valid_metadata()) |\n-|\t\t{ |\n-|\t\t\t// in share mode, all pieces have their priorities initialized to 0 |\n-|\t\t\tm_file_priority.clear(); |\n-|\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\t// it's important to initialize the peers early, because this is what will |\n-|\t\t// fix up their have-bitmasks to have the correct size |\n-|if (!m_connections_initialized) |\n-|{ |\n-|\t\t\tm_connections_initialized = true; |\n-|\t\t\t// all peer connections have to initialize themselves now that the metadata |\n-|\t\t\t// is available |\n-|\t\t\t// copy the peer list since peers may disconnect and invalidate |\n-|\t\t\t// m_connections as we initialize them |\n-|\t\t\tfor (auto c : m_connections) |\n-|\t\t\t{ |\n-|\t\t\t\tauto pc = c->self(); |\n-|\t\t\t\tif (pc->is_disconnecting()) continue; |\n-|\t\t\t\tpc->on_metadata_impl(); |\n-|\t\t\t\tif (pc->is_disconnecting()) continue; |\n-|\t\t\t\tpc->init(); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\t// in case file priorities were passed in via the add_torrent_params |\n-|\t\t// and also in the case of share mode, we need to update the priorities |\n-|\t\t// this has to be applied before piece priority |\n-|\t\tif (!m_file_priority.empty()) |\n-|\t\t{ |\n-|\t\t\t// m_file_priority was loaded from the resume data, this doesn't |\n-|\t\t\t// alter any state that needs to be saved in the resume data |\n-|\t\t\tauto const ns = m_need_save_resume_data; |\n-|\t\t\tupdate_piece_priorities(m_file_priority); |\n-|\t\t\tm_need_save_resume_data = ns; |\n-|\t\t} |\n-| |\n-|\t\tif (m_add_torrent_params) |\n-|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bh_\br_\bo_\bn_\bo_\b _\bt_\by_\bp_\be_\b _\bf_\bo_\br_\b _\bt_\bi_\bm_\be_\b _\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be c\bch\bhr\bro\bon\bno\bo t\bty\byp\bpe\be f\bfo\bor\br t\bti\bim\bme\be d\bdu\bur\bra\bat\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b44\b49\b92\b2 *\b**\b**\b* |\n-|} |\n-| |\n-|\t\tm_picker->piece_passed(index); |\n-|\t\tupdate_gauge(); |\n-|\t\twe_have(index); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log()) |\n-|\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have()); |\n-|#endif |\n-|#ifndef TORRENT_DISABLE_STREAMING |\n-|\t\tremove_time_critical_piece(index, true); |\n-|#endif |\n+|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\n |\t} |\n | |\n-|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n-|\t// we believe we will complete this piece very soon |\n-|\t// announce it to peers ahead of time to eliminate the |\n-|\t// round-trip times involved in announcing it, requesting it |\n-|\t// and sending it |\n-|void torrent::predicted_have_piece(piece_index_t const index, int const milliseconds) |\n+|std::string read_until(char const*& str, char const delim, char const* end) |\n |{ |\n-|\t\tauto const i = std::lower_bound(m_predictive_pieces.begin() |\n-|\t\t\t, m_predictive_pieces.end(), index); |\n-|\t\tif (i != m_predictive_pieces.end() && *i == index) return; |\n-| |\n-|\t\tfor (auto p : m_connections) |\n-|\t\t{ |\n-|\t\t\tTORRENT_INCREMENT(m_iterating_connections); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\" |\n-|\t\t\t\t, static_cast<int>(index), milliseconds); |\n-|#else |\n-|\t\t\tTORRENT_UNUSED(milliseconds); |\n-|#endif |\n-|\t\t\tp->announce_piece(index); |\n-|\t\t} |\n-| |\n-|\t\tm_predictive_pieces.insert(i, index); |\n-|\t} |\n-|#endif |\n-| |\n-|\t// blocks may contain the block indices of the blocks that failed (if this is |\n-|\t// a v2 torrent). |\n-|\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks) |\n-|\t{ |\n-|\t\t// if the last piece fails the peer connection will still |\n-|\t\t// think that it has received all of it until this function |\n-|\t\t// resets the download queue. So, we cannot do the |\n-|\t\t// invariant check here since it assumes: |\n-|_\b\t_\b\t_\b/_\b/_\b _\b(_\bt_\bo_\bt_\ba_\bl_\b__\bd_\bo_\bn_\be_\b _\b=_\b=_\b _\bm_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b-_\b>_\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b=_\b>_\b _\bi_\bs_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bb_\bo_\br_\bt_\b _\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bh_\ba_\bs_\b _\bm_\ba_\bd_\be_\b _\bv_\bi_\ba_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bh_\bo_\bs_\bt_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt l\blo\boo\bok\bku\bup\bps\bs t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt h\bha\bas\bs m\bma\bad\bde\be v\bvi\bia\ba t\bth\bhe\be s\bse\bes\bss\bsi\bio\bon\bn h\bho\bos\bst\bt r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b91\b19\b9 *\b**\b**\b* |\n-|TORRENT_UNUSED(e); |\n-|\t\t\t\tm_storage.reset(); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n-|#endif |\n-|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n-|\t\t\t\t// good idea to post it here, even though we failed |\n-|\t\t\t\tif (alerts().should_post<cache_flushed_alert>()) |\n-|\t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle()); |\n-|\t\t\t} |\n-|\t\t\tm_ses.deferred_submit_jobs(); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tif (alerts().should_post<cache_flushed_alert>()) |\n-|\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle()); |\n-|\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle() |\n-|\t\t\t\t, info_hash(), get_userdata()); |\n-|\t\t} |\n-| |\n-| |\n-|if (!m_apply_ip_filter) |\n-|\t\t{ |\n-|\t\t\tinc_stats_counter(counters::non_filter_torrents, -1); |\n-|\t\t\tm_apply_ip_filter = true; |\n-|\t\t} |\n+|\t\tTORRENT_ASSERT(str <= end); |\n | |\n-|\t\tm_paused = false; |\n-|\t\tm_auto_managed = false; |\n-|\t\tupdate_state_list(); |\n-|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n+|\t\tstd::string ret; |\n+|\t\twhile (str != end && *str != delim) |\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\tret += *str; |\n+|\t\t\t++str; |\n |\t\t} |\n-|\t\t// don't re-add this torrent to the state-update list |\n-|\t\tm_state_subscription = false; |\n+|\t\t// skip the delimiter as well |\n+|\t\twhile (str != end && *str == delim) ++str; |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|\t// this is called when we're destructing non-gracefully. i.e. we're _just_ |\n-|\t// destructing everything. |\n-|\tvoid torrent::panic() |\n+|\tstd::string maybe_url_encode(std::string const& url) |\n |\t{ |\n-|\t\tm_storage.reset(); |\n-|\t\t// if there are any other peers allocated still, we need to clear them |\n-|\t\t// now. They can't be cleared later because the allocator will already |\n-|\t\t// have been destructed |\n-|\t\tif (m_peer_list) m_peer_list->clear(); |\n-|\t\tm_connections.clear(); |\n-|\t\tm_outgoing_pids.clear(); |\n-|_\b\t_\b\t_\bm_\b__\bp_\be_\be_\br_\bs_\b__\bt_\bo_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b3_\b2 |if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bw_\bi_\bt_\bh_\b _\bs_\bo_\bm_\be_\b _\bd_\be_\bf_\bi_\bn_\bi_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bi_\bd_\bl_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bif\bf p\bpe\bee\ber\br i\bis\bs a\ba r\bre\bea\bal\bll\bly\by g\bgo\boo\bod\bd p\bpe\bee\ber\br,\b, m\bma\bay\byb\bbe\be w\bwe\be s\bsh\bho\bou\bul\bld\bdn\bn'\b't\bt d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt i\bit\bt p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd i\bif\bf w\bwe\be h\bha\bav\bve\be t\bto\boo\bo m\bma\ban\bny\by i\bid\bdl\ble\be p\bpe\bee\ber\brs\bs (\b(w\bwi\bit\bth\bh s\bso\bom\bme\be d\bde\bef\bfi\bin\bni\bit\bti\bio\bon\bn o\bof\bf i\bid\bdl\ble\be)\b) *\b**\b**\b**\b**\b*|\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:8\b80\b03\b32\b2 *\b**\b**\b* |\n-|\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1); |\n-|\t\tm_connections.reserve(m_connections.size() + 1); |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n+|\t\tstd::string protocol, host, auth, path; |\n+|\t\tint port; |\n |\t\terror_code ec; |\n-|\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec); |\n-|#endif |\n-| |\n-|\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr); |\n+|\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec); |\n+|\t\tif (ec) return url; |\n | |\n-|\t\t// we need to do this after we've added the peer to the peer_list |\n-|\t\t// since that's when the peer is assigned its peer_info object, |\n-|\t\t// which holds the rank |\n-|\t\tif (maybe_replace_peer) |\n-|\t\t{ |\n-|\t\t\t// now, find the lowest rank peer and disconnect that |\n-|\t\t\t// if it's lower rank than the incoming connection |\n-|\t\t\tpeer_connection* peer = find_lowest_ranking_peer(); |\n+|\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-|if (peer != nullptr && peer->peer_rank() < p->peer_rank()) |\n-|{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n-|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n-|\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str() |\n-|\t\t\t\t\t\t, num_peers() |\n-|\t\t\t\t\t\t, m_max_connections); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n-|\t\t\t\tp->peer_disconnected_other(); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n-|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n-|\t\t\t\t\t\t, print_endpoint(p->remote()).c_str() |\n-|\t\t\t\t\t\t, num_peers() |\n-|\t\t\t\t\t\t, m_max_connections); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n-|\t\t\t\t// we have to do this here because from the peer's point of view |\n-|\t\t\t\t// it wasn't really attached to the torrent, but we do need |\n-|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\b _\bl_\be_\bt_\b _\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b _\bk_\bn_\bo_\bw_\b _\bw_\be_\b'_\br_\be_\b _\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\tstd::string msg; |\n+|\t\tstd::string escaped_path { escape_path(path) }; |\n+|\t\t// reserve enough space so further append will |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bc_\bo_\bp_\by_\b _\bv_\ba_\bl_\bu_\be_\bs_\b _\bt_\bo_\b _\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | |_\b._\b._\b/_\bs_\br_\bc_\b/ | |\n |relevance\u00a02|_\bh_\bt_\bt_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |returning a bool here is redundant. Instead this function should return the peer_entry |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* r\bre\bet\btu\bur\brn\bni\bin\bng\bg a\ba b\bbo\boo\bol\bl h\bhe\ber\bre\be i\bis\bs r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt.\b. I\bIn\bns\bst\bte\bea\bad\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn t\bth\bhe\be p\bpe\bee\ber\br_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b79\b9 *\b**\b**\b* |\n |{ |\n |\t\t\tcb->tracker_scrape_response(tracker_req(), resp.complete |\n@@ -3866,124 +3668,322 @@\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/_\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+|_\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<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\t// fall back to making a copy |\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-|#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+|#if TORRENT_USE_SSL |\n+|\t\terror_code ec; |\n+|\t\tm_ssl_ctx.set_default_verify_paths(ec); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (ec) session_log(\"SSL set_default verify_paths failed: %s\", ec.message().c_str()); |\n+|\t\tec.clear(); |\n+|#endif |\n+|_\b#_\bi_\bf_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bD_\bO_\bW_\bS_\b _\b&_\b&_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bO_\bP_\bE_\bN_\bS_\bS_\bL_\b _\b&_\b&_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bR_\bT_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b7_\b6_\b1_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bi_\bp_\b _\bf_\bi_\bl_\bt_\be_\br_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bs_\ba_\bv_\be_\bd_\b _\bh_\be_\br_\be_\b _\bt_\bo_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be i\bip\bp f\bfi\bil\blt\bte\ber\br s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be t\bto\boo\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:7\b76\b61\b1 *\b**\b**\b* |\n+|m_lsd_announce_timer.async_wait([this](error_code const& e) { |\n+|\t\t\twrap(&session_impl::on_lsd_announce, e); } ); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tsession_log(\" done starting session\"); |\n+|#endif |\n+| |\n+|\t\t// this applies unchoke settings from m_settings |\n+|\t\trecalculate_unchoke_slots(); |\n+| |\n+|\t\t// apply all m_settings to this session |\n+|\t\trun_all_updates(*this); |\n+|\t\treopen_listen_sockets(false); |\n+| |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\t\tcheck_invariant(); |\n+|#endif |\n+|\t} |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const |\n+|{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tentry& e = *eptr; |\n+|\t\t// make it a dict |\n+|\t\te.dict(); |\n+| |\n+|\t\tif (flags & session::save_settings) |\n |\t\t{ |\n-|\t\t\tec.clear(); |\n-|\t\t\treturn; |\n+|\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict(); |\n+|\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett); |\n |\t\t} |\n | |\n-|\t\t// 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+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tif (flags & session::save_dht_settings) |\n |\t\t{ |\n-|\t\t\t// some error happened, report up to the caller |\n-|\t\t\tec.assign(errno, system_category()); |\n-|\t\t\treturn; |\n+|\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings()); |\n |\t\t} |\n | |\n-|\t\t// fall back to making a copy |\n+|\t\tif (m_dht && (flags & session::save_dht_state)) |\n+|\t\t{ |\n+|\t\t\te[\"dht state\"] = dht::save_dht_state(m_dht->state()); |\n+|\t\t} |\n+|#endif |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx]) |\n+|\t\t{ |\n+|\t\t\text->save_state(*eptr); |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b2 |make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\ba_\bn_\bt_\b _\bt_\bo_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be a\ba l\bli\bis\bst\bt f\bfo\bor\br t\bto\bor\brr\bre\ben\bnt\bts\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo b\bbe\be a\ban\bnn\bno\bou\bun\bnc\bce\bed\bd o\bon\bn t\bth\bhe\be D\bDH\bHT\bT s\bso\bo w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be t\bto\bo l\blo\boo\bop\bp o\bov\bve\ber\br a\bal\bll\bl t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, j\bju\bus\bst\bt t\bto\bo f\bfi\bin\bnd\bd t\bth\bhe\be o\bon\bne\bes\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b38\b88\b82\b2 *\b**\b**\b* |\n+|if (!m_dht_torrents.empty()) |\n+|\t\t{ |\n+|\t\t\tstd::shared_ptr<torrent> t; |\n+|\t\t\tdo |\n+|\t\t\t{ |\n+|\t\t\t\tt = m_dht_torrents.front().lock(); |\n+|\t\t\t\tm_dht_torrents.pop_front(); |\n+|\t\t\t} while (!t && !m_dht_torrents.empty()); |\n+| |\n+|\t\t\tif (t) |\n+|\t\t\t{ |\n+|\t\t\t\tt->dht_announce(); |\n+|\t\t\t\treturn; |\n+|\t\t\t} |\n+|\t\t} |\n+|\t\tif (m_torrents.empty()) return; |\n | |\n+|\t\tif (m_next_dht_torrent >= m_torrents.size()) |\n+|\t\t\tm_next_dht_torrent = 0; |\n+|\t\tm_torrents[m_next_dht_torrent]->dht_announce(); |\n+|++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-|\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+|\tvoid session_impl::on_lsd_announce(error_code const& e) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\"); |\n+|\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter); |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (e) return; |\n+| |\n+|\t\tif (m_abort) return; |\n+| |\n+|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\"); |\n+|\t\t// announce on local network every 5 minutes |\n+|\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval) |\n+|\t\t\t/ std::max(int(m_torrents.size()), 1), 1); |\n+|\t\tm_lsd_announce_timer.expires_after(seconds(delay)); |\n+|\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) { |\n+|\t\t\twrap(&session_impl::on_lsd_announce, err); }); |\n+| |\n+|\t\tif (m_torrents.empty()) return; |\n+| |\n+|\t\tif (m_next_lsd_torrent >= m_torrents.size()) |\n+|\t\t\tm_next_lsd_torrent = 0; |\n+|\t\tm_torrents[m_next_lsd_torrent]->lsd_announce(); |\n+|\t\t++m_next_lsd_torrent; |\n+|\t\tif (m_next_lsd_torrent >= m_torrents.size()) |\n+|_\b\t_\b\t_\b\t_\bm_\b__\bn_\be_\bx_\bt_\b__\bl_\bs_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b1_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b55\b51\b15\b5 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (!node_list.empty() && nodes.empty()) |\n+|\t\t{ |\n+|\t\t\tsession_log(\"ERROR: failed to parse DHT bootstrap list: %s\", node_list.c_str()); |\n+|\t\t} |\n+|#endif |\n+|\t\tfor (auto const& n : nodes) |\n+|\t\t\tadd_dht_router(n); |\n+|#endif |\n |\t} |\n | |\n-|\tbool is_directory(std::string const& f, error_code& ec) |\n+|\tvoid session_impl::update_count_slow() |\n |\t{ |\n-|\t\tec.clear(); |\n-|\t\terror_code e; |\n-|\t\tfile_status s; |\n-|\t\tstat_file(f, &s, e); |\n-|\t\tif (!e && s.mode & file_status::directory) return true; |\n-|_\b\t_\b\t_\be_\bc_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\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\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+| |\n+|\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tINVARIANT_CHECK; |\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\tconst int candidate_count = 10; |\n-|\t\tpeers.reserve(candidate_count); |\n+|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) |\n+|\t\t\t\treturn 0; |\n | |\n-|\t\tint erase_candidate = -1; |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\tif (bool(m_finished) != state->is_finished) |\n-|\t\t\trecalculate_connect_candidates(state); |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tfor (auto const& s : m_listen_sockets) |\n+|\t\t{ |\n+|\t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue; |\n+|\t\t\tif (s->ssl == transport::plaintext) |\n+|\t\t\t\treturn std::uint16_t(s->tcp_external_port()); |\n+|\t\t} |\n+|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b5_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bs_\bs_\bl_\b _\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be s\bss\bsl\bl p\bpo\bor\brt\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b55\b55\b55\b5 *\b**\b**\b* |\n+|return 0; |\n | |\n-|\t\texternal_ip const& external = state->ip; |\n-|\t\tint external_port = state->port; |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\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\tint max_peerlist_size = state->max_peerlist_size; |\n+|std::uint16_t session_impl::ssl_listen_port() const |\n+|{ |\n+|\t\treturn ssl_listen_port(nullptr); |\n+|\t} |\n | |\n-|for (int iterations = std::min(int(m_peers.size()), 300); |\n-|iterations > 0; --iterations) |\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\t++state->loop_counter; |\n+|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\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\ttorrent_peer& pe = *m_peers[m_round_robin]; |\n-|\t\t\tTORRENT_ASSERT(pe.in_use); |\n-|\t\t\tint current = m_round_robin; |\n+|\t\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// if the number of peers is growing large |\n-|\t\t\t// we need to start weeding. |\n+|_\b\t_\bi_\bn_\bt_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b:_\b:_\bg_\be_\bt_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bs_\bl_\b,_\b _\ba_\bu_\bx_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b9_\b0_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bo_\bn_\bl_\by_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bc_\bo_\bd_\be_\b _\bo_\bn_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd i\bin\bnt\bto\bo t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bt,\b, s\bso\bo w\bwe\be o\bon\bnl\bly\by h\bha\bav\bve\be t\bth\bhe\be c\bco\bod\bde\be o\bon\bnc\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b63\b39\b90\b0 *\b**\b**\b* |\n+|return upload_rate_limit(m_local_peer_class); |\n+|\t} |\n | |\n-|\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95 |\n-|\t\t\t\t&& max_peerlist_size > 0) |\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+|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 (is_erase_candidate(pe) |\n-|\t\t\t\t\t&& (erase_candidate == -1 |\n-|\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe))) |\n+|\t\t\t\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\tif (should_erase_immediately(pe)) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate; |\n-|\t\t\t\t\t\terase_peer(m_peers.begin() + current, state); |\n-|\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t\telse |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\terase_candidate = current; |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\t\t\t\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/_\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@@ -4084,69 +4084,14 @@\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 |_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bc_\bo_\bp_\by_\b(_\bn_\b._\bi_\bd_\b._\bb_\be_\bg_\bi_\bn_\b(_\b)_\b,_\b _\bn_\b._\bi_\bd_\b._\be_\bn_\bd_\b(_\b)_\b,_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |make this configurable in dht_settings |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b8_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be i\bin\bn d\bdh\bht\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:8\b87\b7 *\b**\b**\b* |\n-|tcp::endpoint addr; |\n-|\t\tbool seed = 0; |\n-|\t}; |\n-| |\n-|\t// internal |\n-|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n-|\t{ |\n-|\t\treturn lhs.addr.address() == rhs.addr.address() |\n-|\t\t\t? lhs.addr.port() < rhs.addr.port() |\n-|\t\t\t: lhs.addr.address() < rhs.addr.address(); |\n-|\t} |\n-| |\n-|\t// this is a group. It contains a set of group members |\n-|\tstruct torrent_entry |\n-|\t{ |\n-|\t\tstd::string name; |\n-|\t\tstd::vector<peer_entry> peers4; |\n-|\t\tstd::vector<peer_entry> peers6; |\n-|\t}; |\n-| |\n-|constexpr time_duration announce_interval = minutes(30); |\n-| |\n-|\tstruct dht_immutable_item |\n-|\t{ |\n-|\t\t// the actual value |\n-|\t\tstd::unique_ptr<char[]> value; |\n-|\t\t// this counts the number of IPs we have seen |\n-|\t\t// announcing this item, this is used to determine |\n-|\t\t// popularity if we reach the limit of items to store |\n-|\t\tbloom_filter<128> ips; |\n-|\t\t// the last time we heard about this item |\n-|\t\t// the correct interpretation of this field |\n-|\t\t// requires a time reference |\n-|\t\ttime_point last_seen; |\n-|\t\t// number of IPs in the bloom filter |\n-|\t\tint num_announcers = 0; |\n-|\t\t// size of malloced space pointed to by value |\n-|\t\tint size = 0; |\n-|\t}; |\n-| |\n-|\tstruct dht_mutable_item : dht_immutable_item |\n-|\t{ |\n-|\t\tsignature sig{}; |\n-|\t\tsequence_number seq{}; |\n-|\t\tpublic_key key{}; |\n-|\t\tstd::string salt; |\n-|\t}; |\n-| |\n-|\tvoid set_value(dht_immutable_item& item, span<char const> buf) |\n-|\t{ |\n-|_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bi_\bz_\be_\b _\b=_\b _\bi_\bn_\bt_\b(_\bb_\bu_\bf_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |use the non deprecated function instead of this one |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* u\bus\bse\be t\bth\bhe\be n\bno\bon\bn d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd f\bfu\bun\bnc\bct\bti\bio\bon\bn i\bin\bns\bst\bte\bea\bad\bd o\bof\bf t\bth\bhi\bis\bs o\bon\bne\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\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:3\b30\b05\b5 *\b**\b**\b* |\n |static 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@@ -4226,14 +4171,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+| |\n+|\t// internal |\n+|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n+|\t{ |\n+|\t\treturn lhs.addr.address() == rhs.addr.address() |\n+|\t\t\t? lhs.addr.port() < rhs.addr.port() |\n+|\t\t\t: lhs.addr.address() < rhs.addr.address(); |\n+|\t} |\n+| |\n+|\t// this is a group. It contains a set of group members |\n+|\tstruct torrent_entry |\n+|\t{ |\n+|\t\tstd::string name; |\n+|\t\tstd::vector<peer_entry> peers4; |\n+|\t\tstd::vector<peer_entry> peers6; |\n+|\t}; |\n+| |\n+|constexpr time_duration announce_interval = minutes(30); |\n+| |\n+|\tstruct dht_immutable_item |\n+|\t{ |\n+|\t\t// the actual value |\n+|\t\tstd::unique_ptr<char[]> value; |\n+|\t\t// this counts the number of IPs we have seen |\n+|\t\t// announcing this item, this is used to determine |\n+|\t\t// popularity if we reach the limit of items to store |\n+|\t\tbloom_filter<128> ips; |\n+|\t\t// the last time we heard about this item |\n+|\t\t// the correct interpretation of this field |\n+|\t\t// requires a time reference |\n+|\t\ttime_point last_seen; |\n+|\t\t// number of IPs in the bloom filter |\n+|\t\tint num_announcers = 0; |\n+|\t\t// size of malloced space pointed to by value |\n+|\t\tint size = 0; |\n+|\t}; |\n+| |\n+|\tstruct dht_mutable_item : dht_immutable_item |\n+|\t{ |\n+|\t\tsignature sig{}; |\n+|\t\tsequence_number seq{}; |\n+|\t\tpublic_key key{}; |\n+|\t\tstd::string salt; |\n+|\t}; |\n+| |\n+|\tvoid set_value(dht_immutable_item& item, span<char const> buf) |\n+|\t{ |\n+|_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bi_\bz_\be_\b _\b=_\b _\bi_\bn_\bt_\b(_\bb_\bu_\bf_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b6_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* h\bha\bav\bvi\bin\bng\bg 8\b8 p\bpr\bri\bio\bor\bri\bit\bty\by l\ble\bev\bve\bel\bls\bs i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by e\bex\bxc\bce\bes\bss\bsi\biv\bve\be.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be c\bch\bha\ban\bng\bge\bed\bd t\bto\bo 3\b3 l\ble\bev\bve\bel\bls\bs +\b+ d\bdo\bon\bnt\bt-\b-d\bdo\bow\bwn\bnl\blo\boa\bad\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:6\b66\b68\b8 *\b**\b**\b* |\n |else if (state() == piece_full) |\n |\t\t\t\t\t\tstate(piece_full_reverse); |\n |\t\t\t} |\n@@ -4390,14 +4390,69 @@\n |\tusing allocator_type = typename boost::asio::associated_allocator<UnderlyingHandler>::type; |\n |\tusing executor_type = typename boost::asio::associated_executor<UnderlyingHandler>::type; |\n | |\n |\tallocator_type get_allocator() const noexcept |\n |\t{ return boost::asio::get_associated_allocator(m_underlying_handler); } |\n | |\n |_\b\t_\be_\bx_\be_\bc_\bu_\bt_\bo_\br_\b__\bt_\by_\bp_\be_\b _\bg_\be_\bt_\b__\be_\bx_\be_\bc_\bu_\bt_\bo_\br_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b _\bn_\bo_\be_\bx_\bc_\be_\bp_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |add async_connect() that takes a hostname and port as well |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\bas\bsy\byn\bnc\bc_\b_c\bco\bon\bnn\bne\bec\bct\bt(\b()\b) t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ba h\bho\bos\bst\btn\bna\bam\bme\be a\ban\bnd\bd p\bpo\bor\brt\bt a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n+|TORRENT_ASSERT(!aux::is_ip_address(host)); |\n+|\t\tm_dst_name = host; |\n+|\t\tif (m_dst_name.size() > 255) |\n+|\t\t\tm_dst_name.resize(255); |\n+|\t} |\n+| |\n+|\tvoid close(error_code& ec) |\n+|\t{ |\n+|\t\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(ec); |\n+|\t} |\n+| |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\n+|\t{ |\n+|\t\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(); |\n+|\t} |\n+|#endif |\n+| |\n+|template <class Handler> |\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 <typename Handler> |\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@@ -4497,69 +4552,69 @@\n |\t\t// and false if we got an incoming connection |\n |\t\t// could be considered: true = local, false = remote |\n |\t\tbool m_outgoing:1; |\n | |\n |\t\t// is true if we learn the incoming connections listening |\n |\t\t// during the extended handshake |\n |_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bm_\b__\br_\be_\bc_\be_\bi_\bv_\be_\bd_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b:_\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |add async_connect() that takes a hostname and port as well |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\bas\bsy\byn\bnc\bc_\b_c\bco\bon\bnn\bne\bec\bct\bt(\b()\b) t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ba h\bho\bos\bst\btn\bna\bam\bme\be a\ban\bnd\bd p\bpo\bor\brt\bt a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n-|TORRENT_ASSERT(!aux::is_ip_address(host)); |\n-|\t\tm_dst_name = host; |\n-|\t\tif (m_dst_name.size() > 255) |\n-|\t\t\tm_dst_name.resize(255); |\n-|\t} |\n+|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |this type should probably be renamed to send_buffer |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bi_\bn_\be_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bh_\bp_\bp_\b:_\b5_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bty\byp\bpe\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be r\bre\ben\bna\bam\bme\bed\bd t\bto\bo s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/c\bch\bha\bai\bin\bne\bed\bd_\b_b\bbu\buf\bff\bfe\ber\br.\b.h\bhp\bpp\bp:\b:5\b59\b9 *\b**\b**\b* |\n+|#include \"libtorrent/aux_/buffer.hpp\" |\n | |\n-|\tvoid close(error_code& ec) |\n-|\t{ |\n-|\t\tm_dst_name.clear(); |\n-|\t\tproxy_base::close(ec); |\n-|\t} |\n+|#include <deque> |\n+|#include <vector> |\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+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include <boost/asio/buffer.hpp> |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n | |\n-|template <class Handler> |\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+|#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\tm_remote_endpoint = endpoint; |\n+|namespace libtorrent { |\n+|namespace aux { |\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+|struct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded |\n+|{ |\n+|\t\tchained_buffer(): m_bytes(0), m_capacity(0) |\n+|\t\t{ |\n+|\t\t\tthread_started(); |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\t\tm_destructed = false; |\n+|#endif |\n+|\t\t} |\n | |\n-|\t\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+|\tprivate: |\n | |\n-|private: |\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-|\ttemplate <typename Handler> |\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+|\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 |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |make this interface a lot smaller. It could be split up into several smaller interfaces. Each subsystem could then limit the size of|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp_\b:_\b1_\b2_\b7_\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bm_\bo_\bc_\bk_\b _\bo_\bb_\bj_\be_\bc_\bt_\b _\bt_\bo_\b _\bt_\be_\bs_\bt_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs i\bin\bnt\bte\ber\brf\bfa\bac\bce\be a\ba l\blo\bot\bt s\bsm\bma\bal\bll\ble\ber\br.\b. I\bIt\bt c\bco\bou\bul\bld\bd b\bbe\be s\bsp\bpl\bli\bit\bt u\bup\bp i\bin\bnt\bto\bo s\bse\bev\bve\ber\bra\bal\bl s\bsm\bma\bal\bll\ble\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\bes\bs.\b. E\bEa\bac\bch\bh s\bsu\bub\bbs\bsy\bys\bst\bte\bem\bm c\bco\bou\bul\bld\bd t\bth\bhe\ben\bn l\bli\bim\bmi\bit\bt t\bth\bhe\be s\bsi\biz\bze\be o\bof\bf t\bth\bhe\be m\bmo\boc\bck\bk o\bob\bbj\bje\bec\bct\bt t\bto\bo t\bte\bes\bst\bt i\bit\bt.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be.\b.h\bhp\bpp\bp:\b:1\b12\b27\b7 *\b**\b**\b* |\n |// a release build with logging disabled (which is the default) will |\n |\t// not have this class at all |\n |\tstruct TORRENT_EXTRA_EXPORT session_logger |\n@@ -4635,123 +4690,14 @@\n | |\n |\t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0; |\n |\t\tvirtual void remove_torrent_impl(std::shared_ptr<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 |_\b\t_\b\t_\bv_\bi_\br_\bt_\bu_\ba_\bl_\b _\bv_\bo_\bi_\bd_\b _\bb_\ba_\bn_\b__\bi_\bp_\b(_\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\ba_\bd_\bd_\br_\b)_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |this type should probably be renamed to send_buffer |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bi_\bn_\be_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bh_\bp_\bp_\b:_\b5_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bty\byp\bpe\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be r\bre\ben\bna\bam\bme\bed\bd t\bto\bo s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/c\bch\bha\bai\bin\bne\bed\bd_\b_b\bbu\buf\bff\bfe\ber\br.\b.h\bhp\bpp\bp:\b:5\b59\b9 *\b**\b**\b* |\n-|#include \"libtorrent/aux_/buffer.hpp\" |\n-| |\n-|#include <deque> |\n-|#include <vector> |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include <boost/asio/buffer.hpp> |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-| |\n-|#ifdef _MSC_VER |\n-|// visual studio requires the value in a deque to be copyable. C++11 |\n-|// has looser requirements depending on which functions are actually used. |\n-|#define TORRENT_CPP98_DEQUE 1 |\n-|#else |\n-|#define TORRENT_CPP98_DEQUE 0 |\n-|#endif |\n-| |\n-|namespace libtorrent { |\n-|namespace aux { |\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-|#endif |\n-|\t\t} |\n-| |\n-|\tprivate: |\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-| |\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-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b7_\b _\b _\b|_\br_\be_\bp_\bo_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\br_\bo_\bp_\be_\br_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\be_\br_\b _\ba_\bs_\b _\bt_\bh_\be_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bI_\bP_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bv_\bo_\bt_\be_\b _\bo_\bf_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\be_\bm_\bp_\bt_\by_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be p\bpr\bro\bop\bpe\ber\br a\bad\bdd\bdr\bre\bes\bss\bs o\bof\bf t\bth\bhe\be r\bro\bou\but\bte\ber\br a\bas\bs t\bth\bhe\be s\bso\bou\bur\brc\bce\be I\bIP\bP o\bof\bf t\bth\bhi\bis\bs v\bvo\bot\bte\be o\bof\bf o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf t\bth\bhe\be e\bem\bmp\bpt\bty\by a\bad\bdd\bdr\bre\bes\bss\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b57\b70\b07\b7 *\b**\b**\b* |\n-|, listen_socket_handle const& ls) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tlisten_socket_t* listen_socket = ls.get(); |\n-| |\n-|\t\t// NOTE: don't assume that if ec != 0, the rest of the logic |\n-|\t\t// is not necessary, the ports still need to be set, in other |\n-|\t\t// words, don't early return without careful review of the |\n-|\t\t// remaining logic |\n-|\t\tif (ec && m_alerts.should_post<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-|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<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-|_\b\t_\b\t_\bs_\b._\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b _\b=_\b _\bi_\bn_\bt_\b(_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b[_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b]_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and |\n |relevance\u00a01|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b2_\b6 |the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bv_\be_\br_\by_\bt_\bh_\bi_\bn_\bg_\b _\bu_\bp_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bh_\bi_\bg_\bh_\be_\bs_\bt_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\b _\be_\ba_\bc_\bh_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs d\bde\bep\bpe\ben\bnd\bd o\bon\bn t\bth\bhe\be e\ber\brr\bro\bor\br a\ban\bnd\bd o\bon\bn t\bth\bhe\be f\bfi\bil\ble\bes\bsy\bys\bst\bte\bem\bm t\bth\bhe\be f\bfi\bil\ble\bes\bs a\bar\bre\be b\bbe\bei\bin\bng\bg d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd t\bto\bo.\b. I\bIf\bf t\bth\bhe\be e\ber\brr\bro\bor\br i\bis\bs n\bno\bo_\b_s\bsp\bpa\bac\bce\be_\b_l\ble\bef\bft\bt_\b_o\bon\bn_\b_d\bde\bev\bvi\bic\bce\be a\ban\bnd\bd t\bth\bhe\be f\bfi\bil\ble\bes\bsy\bys\bst\bte\bem\bm d\bdo\boe\bes\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bor\brt\bt s\bsp\bpa\bar\brs\bse\be |\n |f\bfi\bil\ble\bes\bs,\b, o\bon\bnl\bly\by z\bze\ber\bro\bo t\bth\bhe\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs o\bof\bf t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs t\bth\bha\bat\bt a\bar\bre\be a\bat\bt t\bth\bhe\be t\bta\bai\bil\bls\bs o\bof\bf a\bal\bll\bl f\bfi\bil\ble\bes\bs,\b, l\ble\bea\bav\bvi\bin\bng\bg e\bev\bve\ber\bry\byt\bth\bhi\bin\bng\bg u\bup\bp t\bto\bo t\bth\bhe\be h\bhi\big\bgh\bhe\bes\bst\bt w\bwr\bri\bit\btt\bte\ben\bn p\bpi\bie\bec\bce\be i\bin\bn e\bea\bac\bch\bh f\bfi\bil\ble\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b12\b26\b6 *\b**\b**\b* |\n |\t\t// notify the user of the error |\n@@ -4853,14 +4799,68 @@\n |\t\t\t// we need to keep the object alive during this operation |\n |\t\t\tm_ses.disk_thread().async_release_files(m_storage |\n |\t\t\t\t, std::bind(&torrent::on_cache_flushed, shared_from_this(), false)); |\n |\t\t\tm_ses.deferred_submit_jobs(); |\n |\t\t} |\n | |\n |_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bj_\bu_\bs_\bt_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b7_\b _\b _\b|_\br_\be_\bp_\bo_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\br_\bo_\bp_\be_\br_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\be_\br_\b _\ba_\bs_\b _\bt_\bh_\be_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bI_\bP_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bv_\bo_\bt_\be_\b _\bo_\bf_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\be_\bm_\bp_\bt_\by_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be p\bpr\bro\bop\bpe\ber\br a\bad\bdd\bdr\bre\bes\bss\bs o\bof\bf t\bth\bhe\be r\bro\bou\but\bte\ber\br a\bas\bs t\bth\bhe\be s\bso\bou\bur\brc\bce\be I\bIP\bP o\bof\bf t\bth\bhi\bis\bs v\bvo\bot\bte\be o\bof\bf o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf t\bth\bhe\be e\bem\bmp\bpt\bty\by a\bad\bdd\bdr\bre\bes\bss\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b57\b70\b07\b7 *\b**\b**\b* |\n+|, listen_socket_handle const& ls) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tlisten_socket_t* listen_socket = ls.get(); |\n+| |\n+|\t\t// NOTE: don't assume that if ec != 0, the rest of the logic |\n+|\t\t// is not necessary, the ports still need to be set, in other |\n+|\t\t// words, don't early return without careful review of the |\n+|\t\t// remaining logic |\n+|\t\tif (ec && m_alerts.should_post<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+|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<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+|_\b\t_\b\t_\bs_\b._\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b _\b=_\b _\bi_\bn_\bt_\b(_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b[_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b]_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a01|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bp_\b__\bv_\bo_\bt_\be_\br_\b._\bh_\bp_\bp_\b:_\b1_\b3_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* h\bha\bav\bve\be o\bon\bne\be i\bin\bns\bst\bta\ban\bnc\bce\be p\bpe\ber\br p\bpo\bos\bss\bsi\bib\bbl\ble\be s\bsu\bub\bbn\bne\bet\bt,\b, 1\b19\b92\b2.\b.1\b16\b68\b8.\b.x\bx.\b.x\bx,\b, 1\b10\b0.\b.x\bx.\b.x\bx.\b.x\bx,\b, e\bet\btc\bc.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bip\bp_\b_v\bvo\bot\bte\ber\br.\b.h\bhp\bpp\bp:\b:1\b13\b30\b0 *\b**\b**\b* |\n |// stores one address for each combination of local/global and ipv4/ipv6 |\n |\t// use of this class should be avoided, get the IP from the appropriate |\n |\t// listen interface wherever possible |\n@@ -4883,251 +4883,89 @@\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-|_\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+|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::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+|\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa}; |\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+|\tbits_out = filter.to_string(); |\n+|\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0); |\n+|} |\n | |\n+|} // anonymous namespace |\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+|TORRENT_TEST(bloom_filter) |\n+|{ |\n+|\ttest_set_and_get(); |\n+|\ttest_set_bits(); |\n+|\ttest_count_zeroes(); |\n+|\ttest_to_from_string(); |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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<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\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\tTEST_CHECK(t.has_node(i)); |\n+|\t\t\tTEST_CHECK(t.compare_node(i, f[i])); |\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\tfor (int i = end_piece_layer; i < num_nodes; ++i) |\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\tTEST_CHECK(!t.has_node(i)); |\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 | |\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+|namespace { |\n+|void test_roundtrip(aux::merkle_tree const& t |\n+|\t, int const block_count |\n+|\t, int const blocks_per_piece) |\n+|{ |\n+|aux::vector<bool> mask; |\n+|std::vector<sha256_hash> tree; |\n+|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n | |\n-|\t// fill in the info-hash |\n-|\tif (flags & valid_bittorrent_hash) |\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\tstd::memcpy(handshake + 28, &t->info_hashes().v1[0], 20); |\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-|\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__\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<int>(mapping) |\n-|\t\t\t\t<< \", port: \" << port << \", IP: \" << ip |\n-|\t\t\t\t<< \", proto: \" << static_cast<int>(protocol) |\n-|\t\t\t\t<< \", error: \\\"\" << err.message() << \"\\\"\\n\"; |\n-|\t\t} |\n-|\t#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tbool should_log_portmap(portmap_transport) const override |\n-|\t\t{ |\n-|\t\t\treturn true; |\n-|\t\t} |\n-| |\n-|\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<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-|_\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__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test size() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bb\bb_\bl\bl_\bo\bo_\bo\bo_\bm\bm_\b_\b__\bf\bf_\bi\bi_\bl\bl_\bt\bt_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test clear() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_b\bbl\blo\boo\bom\bm_\b_f\bfi\bil\blt\bte\ber\br.\b.c\bcp\bpp\bp:\b:1\b13\b36\b6 *\b**\b**\b* |\n-|sha1_hash k(\"\\x01\\x00\\x02\\x00 \"); |\n-|\tTEST_CHECK(!filter.find(k)); |\n-|\tfilter.set(k); |\n-|\tTEST_CHECK(filter.find(k)); |\n-| |\n-|\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa}; |\n-| |\n-|\tbits_out = filter.to_string(); |\n-|\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0); |\n-|} |\n-| |\n-|} // anonymous namespace |\n-| |\n-|TORRENT_TEST(bloom_filter) |\n-|{ |\n-|\ttest_set_and_get(); |\n-|\ttest_set_bits(); |\n-|\ttest_count_zeroes(); |\n-|\ttest_to_from_string(); |\n-| |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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<sha256_hash const>(f).subspan(first_piece, num_pieces), mask, empty_verified); |\n-|\t\tint const end_piece_layer = first_piece + merkle_num_leafs(num_pieces); |\n-|\t\tfor (int i = 0; i < end_piece_layer; ++i) |\n-|\t\t{ |\n-|\t\t\tTEST_CHECK(t.has_node(i)); |\n-|\t\t\tTEST_CHECK(t.compare_node(i, f[i])); |\n-|\t\t} |\n-|\t\tfor (int i = end_piece_layer; i < num_nodes; ++i) |\n-|\t\t{ |\n-|\t\t\tTEST_CHECK(!t.has_node(i)); |\n-|\t\t} |\n-|\t} |\n-|} |\n-| |\n-|namespace { |\n-|void test_roundtrip(aux::merkle_tree const& t |\n-|\t, int const block_count |\n-|\t, int const blocks_per_piece) |\n-|{ |\n-|aux::vector<bool> mask; |\n-|std::vector<sha256_hash> tree; |\n-|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n-| |\n-|\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data()); |\n-|\tt2.load_sparse_tree(tree, mask, empty_verified); |\n-| |\n-|\tTEST_CHECK(t.build_vector() == t2.build_vector()); |\n-|\tfor (int i = 0; i < int(t.size()); ++i) |\n-|\t{ |\n-|\t\tTEST_EQUAL(t[i], t2[i]); |\n-|\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i)); |\n-| |\n-|\t\tif (!t.has_node(i)) |\n-|\t\t\tTEST_CHECK(t[i].is_all_zeros()); |\n-|\t\tif (!t2.has_node(i)) |\n-|\t\t\tTEST_CHECK(t2[i].is_all_zeros()); |\n-| |\n-|\t\tTEST_CHECK(t.compare_node(i, t2[i])); |\n-|\t\tTEST_CHECK(t2.compare_node(i, t[i])); |\n-|\t} |\n-|} |\n+|} |\n |} |\n | |\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@@ -5161,22 +4999,122 @@\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+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3 |change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bp_\ba_\bu_\bs_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; t\bte\bes\bst\bt_\b_u\bun\bns\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:1\b16\b63\b3 *\b**\b**\b* |\n+|{ |\n+|\t// share-mode |\n+|\ttest_add_and_get_flags(torrent_flags::share_mode); |\n+|\ttest_set_after_add(torrent_flags::share_mode); |\n+|\ttest_unset_after_add(torrent_flags::share_mode); |\n+|} |\n+|#endif |\n+| |\n+|TORRENT_TEST(flag_apply_ip_filter) |\n+|{ |\n+|\t// apply-ip-filter |\n+|\ttest_add_and_get_flags(torrent_flags::apply_ip_filter); |\n+|\ttest_set_after_add(torrent_flags::apply_ip_filter); |\n+|\ttest_unset_after_add(torrent_flags::apply_ip_filter); |\n+|} |\n+| |\n+|TORRENT_TEST(flag_paused) |\n+|{ |\n+|\t// paused |\n+|\ttest_add_and_get_flags(torrent_flags::paused); |\n+|} |\n+| |\n+|TORRENT_TEST(flag_auto_managed) |\n+|{ |\n+|\t// auto-managed |\n+|\ttest_add_and_get_flags(torrent_flags::auto_managed); |\n+|\ttest_set_after_add(torrent_flags::auto_managed); |\n+|\ttest_unset_after_add(torrent_flags::auto_managed); |\n+|} |\n+| |\n+|// super seeding mode is automatically turned off if we're not a seed |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|TORRENT_TEST(flag_super_seeding) |\n+|{ |\n+|\t// super-seeding |\n+|\ttest_add_and_get_flags(torrent_flags::super_seeding); |\n+|\ttest_unset_after_add(torrent_flags::super_seeding); |\n+|\ttest_set_after_add(torrent_flags::super_seeding); |\n+|} |\n+|#endif |\n+|#endif |\n+| |\n+|TORRENT_TEST(flag_sequential_download) |\n+|{ |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b5 |this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bl_\be_\ba_\br_\be_\bd_\b _\bt_\be_\bs_\bt_\b__\ba_\bd_\bd_\b__\ba_\bn_\bd_\b__\bg_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\bp_\b-_\bw_\bh_\be_\bn_\b-_\br_\be_\ba_\bd_\by_\b _\bw_\bh_\be_\bn_\b _\ba_\bl_\br_\be_\ba_\bd_\by_\b _\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\be_\bf_\bf_\be_\bc_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bte\bes\bst\bt i\bis\bs f\bfl\bla\bak\bky\by,\b, s\bsi\bin\bnc\bce\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bil\bll\bl b\bbe\bec\bco\bom\bme\be r\bre\bea\bad\bdy\by b\bbe\bef\bfo\bor\bre\be a\bas\bsk\bki\bin\bng\bg f\bfo\bor\br t\bth\bhe\be f\bfl\bla\bag\bgs\bs,\b, a\ban\bnd\bd b\bby\by t\bth\bhe\ben\bn s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by w\bwi\bil\bll\bl h\bha\bav\bve\be b\bbe\bee\ben\bn c\bcl\ble\bea\bar\bre\bed\bd t\bte\bes\bst\bt_\b_a\bad\bdd\bd_\b_a\ban\bnd\bd_\b_g\bge\bet\bt_\b_f\bfl\bla\bag\bgs\bs |\n+|(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; s\bse\bet\btt\bti\bin\bng\bg s\bst\bto\bop\bp-\b-w\bwh\bhe\ben\bn-\b-r\bre\bea\bad\bdy\by w\bwh\bhe\ben\bn a\bal\blr\bre\bea\bad\bdy\by s\bst\bto\bop\bpp\bpe\bed\bd h\bha\bas\bs n\bno\bo e\bef\bff\bfe\bec\bct\bt.\b. *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bl\bl_\ba\ba_\bg\bg_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b0\b0_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b9_\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bn_\bg_\be_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bt_\be_\bs_\bt_\b _\bs_\be_\bt_\bu_\bp_\b._\b _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b._\b _\bt_\be_\bs_\bt_\b__\bs_\be_\bt_\b__\ba_\bf_\bt_\be_\br_\b__\ba_\bd_\bd_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:2\b20\b09\b9 *\b**\b**\b* |\n+|test_set_after_add(torrent_flags::super_seeding); |\n+|} |\n+|#endif |\n+|#endif |\n+| |\n+|TORRENT_TEST(flag_sequential_download) |\n+|{ |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n+|} |\n+| |\n+|// the stop when ready flag will be cleared when the torrent is ready to start |\n+|// downloading. |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|TORRENT_TEST(flag_stop_when_ready) |\n+|{ |\n+|\t// stop-when-ready |\n+|test_unset_after_add(torrent_flags::stop_when_ready); |\n+|} |\n+|#endif |\n+| |\n+|TORRENT_TEST(flag_disable_dht) |\n+|{ |\n+|\ttest_add_and_get_flags(torrent_flags::disable_dht); |\n+|\ttest_set_after_add(torrent_flags::disable_dht); |\n+|\ttest_unset_after_add(torrent_flags::disable_dht); |\n+|} |\n+| |\n+| |\n+|TORRENT_TEST(flag_disable_lsd) |\n+|{ |\n+|\ttest_add_and_get_flags(torrent_flags::disable_lsd); |\n+|\ttest_set_after_add(torrent_flags::disable_lsd); |\n+|\ttest_unset_after_add(torrent_flags::disable_lsd); |\n+|} |\n+| |\n+|TORRENT_TEST(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__\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@@ -5285,165 +5223,126 @@\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_\bn_\bs_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b7_\b3_\b _\b|_\bt_\bh_\be_\bs_\be_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b _\bt_\be_\bs_\bt_\bs_\b _\bb_\be_\bl_\bo_\bn_\bg_\b _\bi_\bn_\b _\bt_\bh_\be_\bi_\br_\b _\bo_\bw_\bn_\b _\bt_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\bes\bse\be s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk t\bte\bes\bst\bts\bs b\bbe\bel\blo\bon\bng\bg i\bin\bn t\bth\bhe\bei\bir\br o\bow\bwn\bn t\bte\bes\bst\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\ban\bns\bsf\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b17\b73\b3 *\b**\b**\b* |\n-|// to the time it will take to complete the test |\n-|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n-|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n-|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n-|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n-| |\n-|\t// make sure we announce to both http and udp trackers |\n-|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n-|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_lsd, false); |\n-|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n-|\tpack.set_bool(settings_pack::enable_upnp, false); |\n-|\tpack.set_bool(settings_pack::enable_dht, false); |\n-| |\n-|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n-|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n-| |\n-|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n-| |\n-|pack.set_int(settings_pack::unchoke_slots_limit, 0); |\n-|ses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, -1); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, 8); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8); |\n-| |\n-|\tses2.apply_settings(pack); |\n-| |\n-|\ttorrent_handle tor1; |\n-|\ttorrent_handle tor2; |\n-| |\n-|\tcreate_directory(\"tmp1_transfer\", ec); |\n-|\tstd::ofstream file(\"tmp1_transfer/temporary\"); |\n-|\tstd::shared_ptr<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-|_\b\t_\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\bl_\bi_\bs_\bt_\be_\bn_\b(_\bs_\be_\bs_\b2_\b,_\b _\b\"_\bs_\be_\bs_\b2_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where we have > 120 samples (and have the base delay actually be updated) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be h\bha\bav\bve\be >\b> 1\b12\b20\b0 s\bsa\bam\bmp\bpl\ble\bes\bs (\b(a\ban\bnd\bd h\bha\bav\bve\be t\bth\bhe\be b\bba\bas\bse\be d\bde\bel\bla\bay\by a\bac\bct\btu\bua\bal\bll\bly\by b\bbe\be u\bup\bpd\bda\bat\bte\bed\bd)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bi\bi_\bm\bm_\be\be_\bs\bs_\bt\bt_\ba\ba_\bm\bm_\bp\bp_\b_\b__\bh\bh_\bi\bi_\bs\bs_\bt\bt_\bo\bo_\br\br_\by\by_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b5\b5_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where a sample is lower than the history entry but not lower than the base |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be a\ba s\bsa\bam\bmp\bpl\ble\be i\bis\bs l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be h\bhi\bis\bst\bto\bor\bry\by e\ben\bnt\btr\bry\by b\bbu\but\bt n\bno\bot\bt l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be b\bba\bas\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bti\bim\bme\bes\bst\bta\bam\bmp\bp_\b_h\bhi\bis\bst\bto\bor\bry\by.\b.c\bcp\bpp\bp:\b:5\b55\b5 *\b**\b**\b* |\n-|#include \"libtorrent/aux_/timestamp_history.hpp\" |\n+|_\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(timestamp_history) |\n-|{ |\n-|\tusing namespace lt; |\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-|\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+|\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-|\t// test that wrapping of the timestamp is properly handled |\n-|\th.add_sample(0xfffffff3, false); |\n-|\tTEST_EQUAL(h.base(), 0xfffffff3); |\n | |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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+|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-|using namespace lt; |\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-|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+|\t// fill in the peer-id |\n+|\tstd::generate(handshake + 48, handshake + 68, &rand); |\n | |\n-|\tTEST_EQUAL(ec, error_code()); |\n-|\tTEST_EQUAL(resp.peers.size(), 2); |\n-|\tif (resp.peers.size() == 2) |\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\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+|\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-|\t\tTEST_EQUAL(e1.hostname, \"another_host\"); |\n-|\t\tTEST_EQUAL(e1.port, 1001); |\n-|\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\")); |\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 | |\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+|\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 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__\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@@ -5472,232 +5371,14 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_c\bcl\blo\bos\bse\bed\bd *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |connect candidates recalculation when incrementing failcount |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs r\bre\bec\bca\bal\blc\bcu\bul\bla\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bti\bin\bng\bg f\bfa\bai\bil\blc\bco\bou\bun\bnt\bt *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\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<tcp::endpoint> g_got_peers; |\n-| |\n-|void get_peers_cb(std::vector<tcp::endpoint> const& peers) |\n-|{ |\n-|\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end()); |\n-|} |\n-| |\n-|std::vector<dht::item> g_got_items; |\n-|dht::item g_put_item; |\n-|int g_put_count; |\n-| |\n-|void get_mutable_item_cb(dht::item const& i, bool a) |\n-|{ |\n-|\tif (!a) return; |\n-|\tif (!i.empty()) |\n-|\t\tg_got_items.push_back(i); |\n-|} |\n-| |\n-|void put_mutable_item_data_cb(dht::item& i) |\n-|{ |\n-|\tif (!i.empty()) |\n-|_\b\t_\b\t_\bg_\b__\bg_\bo_\bt_\b__\bi_\bt_\be_\bm_\bs_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b2_\b2_\b3_\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bn_\b'_\bt_\b _\bw_\bo_\br_\bk_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bc_\bo_\bn_\bd_\b _\bn_\bo_\bd_\be_\b _\bi_\bs_\bn_\b'_\bt_\b _\bp_\bi_\bn_\bg_\be_\bd_\b _\bs_\bo_\b _\bi_\bt_\b _\bw_\bo_\bn_\bt_\b _\bb_\be_\b _\ba_\bd_\bd_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b _\bt_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bon\bn'\b't\bt w\bwo\bor\brk\bk b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be s\bse\bec\bco\bon\bnd\bd n\bno\bod\bde\be i\bis\bsn\bn'\b't\bt p\bpi\bin\bng\bge\bed\bd s\bso\bo i\bit\bt w\bwo\bon\bnt\bt b\bbe\be a\bad\bdd\bde\bed\bd t\bto\bo t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:3\b32\b22\b23\b3 *\b**\b**\b* |\n-|bool ret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n-| |\n-|\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-|\t// and no replacement nodes |\n-|\tTEST_EQUAL(std::get<1>(node.size()), 0); |\n-| |\n-|\t// now, disable read_only, try again. |\n-|\tg_sent_packets.clear(); |\n-|\tsett.set_bool(settings_pack::dht_read_only, false); |\n-| |\n-|\tsend_dht_request(node, \"get\", source, &response); |\n-|\t// sender should be added to replacement bucket |\n-|\tTEST_EQUAL(std::get<1>(node.size()), 1); |\n-| |\n-|\tg_sent_packets.clear(); |\n-|#if 0 |\n-|target = generate_next(); |\n-|node.get_item(target, get_immutable_item_cb); |\n-| |\n-|\t// since we have 2 nodes, we should have two packets. |\n-|\tTEST_EQUAL(g_sent_packets.size(), 2); |\n-| |\n-|\t// both of them shouldn't have a 'ro' key. |\n-|\tnode_from_entry(g_sent_packets.front().second, request); |\n-|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n-| |\n-|\tTEST_CHECK(ret); |\n-|\tTEST_CHECK(!parsed[3]); |\n-| |\n-|\tnode_from_entry(g_sent_packets.back().second, request); |\n-|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n-| |\n-|\tTEST_CHECK(ret); |\n-|\tTEST_CHECK(!parsed[3]); |\n-|#endif |\n-|} |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|// these tests rely on logging being enabled |\n-| |\n-|TORRENT_TEST(invalid_error_msg) |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b8_\b1_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bo_\bb_\bf_\bu_\bs_\bc_\ba_\bt_\be_\bd_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt o\bob\bbf\bfu\bus\bsc\bca\bat\bte\bed\bd_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b40\b08\b81\b1 *\b**\b**\b* |\n-|TEST_CHECK(sm.has_quota()); |\n-|\t}); |\n-|} |\n-| |\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-| |\n-|\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) { |\n-|\t\tTEST_CHECK(sm.has_quota()); |\n-|\t\tfor (int i = 0; i < 10; ++i) |\n-|\t\t{ |\n-|\t\t\tstd::this_thread::sleep_for(milliseconds(500)); |\n-|\t\t\tTEST_CHECK(sm.has_quota()); |\n-|\t\t} |\n-|\t}); |\n-|} |\n-| |\n-| |\n-| |\n-|#else |\n-|TORRENT_TEST(dht) |\n-|{ |\n-|\t// dummy dht test |\n-|\tTEST_CHECK(true); |\n-|} |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test sending invalid requests (out of bound piece index, offsets and sizes) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bf_\ba_\bs_\bt_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b3_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bse\ben\bnd\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd r\bre\beq\bqu\bue\bes\bst\bts\bs (\b(o\bou\but\bt o\bof\bf b\bbo\bou\bun\bnd\bd p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx,\b, o\bof\bff\bfs\bse\bet\bts\bs a\ban\bnd\bd s\bsi\biz\bze\bes\bs)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\ba\ba_\bs\bs_\bt\bt_\b_\b__\be\be_\bx\bx_\bt\bt_\be\be_\bn\bn_\bs\bs_\bi\bi_\bo\bo_\bn\bn_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test files with different piece size (negative test) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\br_\be_\bs_\bo_\bl_\bv_\be_\b__\bl_\bi_\bn_\bk_\bs_\b._\bc_\bp_\bp_\b:_\b9_\b5_\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt f\bfi\bil\ble\bes\bs w\bwi\bit\bth\bh d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt p\bpi\bie\bec\bce\be s\bsi\biz\bze\be (\b(n\bne\beg\bga\bat\bti\biv\bve\be t\bte\bes\bst\bt)\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_r\bre\bes\bso\bol\blv\bve\be_\b_l\bli\bin\bnk\bks\bs.\b.c\bcp\bpp\bp:\b:9\b95\b5 *\b**\b**\b* |\n-|{ \"test2\", \"test1_pad_files\", 0}, |\n-|\t{ \"test3\", \"test1_pad_files\", 0}, |\n-|\t{ \"test2\", \"test1_single\", 0}, |\n-| |\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-|_\b}_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |it 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 |\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_\b8_\b _\b _\b _\b _\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 |\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 t\bte\bes\bst\bt r\bre\bes\bso\bol\blv\bvi\bin\bng\bg o\bof\bf m\bmo\bor\bre\be t\bth\bha\ban\bn j\bju\bus\bst\bt 2\b2 f\bfi\bil\ble\bes\bs a\bas\bs w\bwe\bel\bll\bl.\b. l\bli\bik\bke\be 3\b3 s\bsi\bin\bng\bgl\ble\be f\bfi\bil\ble\be t\bto\bor\brr\bre\ben\bnt\bts\bs m\bme\ber\brg\bge\bed\bd i\bin\bnt\bto\bo o\bon\bne\be,\b, r\bre\bes\bso\bol\blv\bvi\bin\bng\bg a\bal\bll\bl 3\b3 f\bfi\bil\ble\bes\bs.\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\b98\b8 *\b**\b**\b* |\n-|{ \"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-|_\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__\br_\be_\bs_\bu_\bm_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bw_\bh_\ba_\bt_\b _\bh_\ba_\bp_\bp_\be_\bn_\bs_\b _\bw_\bh_\be_\bn_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\ba_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bf_\bi_\bl_\be_\b _\bw_\bi_\bt_\bh_\b _\bb_\bo_\bt_\bh_\b _\bp_\bi_\be_\bc_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b _\ba_\bn_\bd_\b _\bf_\bi_\bl_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b _\b(_\bf_\bi_\bl_\be_\b _\bp_\br_\bi_\bo_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\ba_\bk_\be_\b _\bp_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be_\b)_\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt w\bwh\bha\bat\bt h\bha\bap\bpp\bpe\ben\bns\bs w\bwh\bhe\ben\bn l\blo\boa\bad\bdi\bin\bng\bg a\ba r\bre\bes\bsu\bum\bme\be f\bfi\bil\ble\be w\bwi\bit\bth\bh b\bbo\bot\bth\bh p\bpi\bie\bec\bce\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs a\ban\bnd\bd f\bfi\bil\ble\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs (\b(f\bfi\bil\ble\be p\bpr\bri\bio\bo s\bsh\bho\bou\bul\bld\bd t\bta\bak\bke\be p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be)\b) *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_r\bre\bes\bsu\bum\bme\be.\b.c\bcp\bpp\bp:\b:5\b58\b82\b2 *\b**\b**\b* |\n |{ |\n |\t\t\tTEST_EQUAL(pieces[i], true); |\n |\t\t} |\n |\t} |\n@@ -5904,393 +5585,920 @@\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 |_\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+|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+| |\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+|_\b}_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |it 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 |\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_\b8_\b _\b _\b _\b _\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 |\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 t\bte\bes\bst\bt r\bre\bes\bso\bol\blv\bvi\bin\bng\bg o\bof\bf m\bmo\bor\bre\be t\bth\bha\ban\bn j\bju\bus\bst\bt 2\b2 f\bfi\bil\ble\bes\bs a\bas\bs w\bwe\bel\bll\bl.\b. l\bli\bik\bke\be 3\b3 s\bsi\bin\bng\bgl\ble\be f\bfi\bil\ble\be t\bto\bor\brr\bre\ben\bnt\bts\bs m\bme\ber\brg\bge\bed\bd i\bin\bnt\bto\bo o\bon\bne\be,\b, r\bre\bes\bso\bol\blv\bvi\bin\bng\bg a\bal\bll\bl 3\b3 f\bfi\bil\ble\bes\bs.\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\b98\b8 *\b**\b**\b* |\n+|{ \"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-|\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+|\tstd::string path = combine_path(parent_path(current_working_directory()) |\n+|\t\t, \"mutable_test_torrents\"); |\n | |\n-|TORRENT_TEST(flag_apply_ip_filter) |\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+|_\b\t_\b\t_\b\t_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bf_\bs_\b _\b=_\b _\bt_\bi_\b1_\b-_\b>_\bf_\bi_\bl_\be_\bs_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bs_\bc_\br_\ba_\bp_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsc\bcr\bra\bap\bpe\be r\bre\beq\bqu\bue\bes\bst\bts\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bp_\be_\be_\br_\bs_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be p\bpe\bee\ber\brs\bs6\b6 *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b-_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be t\btr\bra\bac\bck\bke\ber\br-\b-i\bid\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b-_\br_\be_\ba_\bs_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be f\bfa\bai\bil\blu\bur\bre\be-\b-r\bre\bea\bas\bso\bon\bn *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b4 |test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b _\bp_\be_\be_\br_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\bi_\be_\bs_\b _\bu_\bn_\be_\bv_\be_\bn_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bb_\by_\bt_\be_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\bs_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\bs_\b6_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\bl f\bfa\bai\bil\blu\bur\bre\be p\bpa\bat\bth\bhs\bs,\b, i\bin\bnc\bcl\blu\bud\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bdi\bin\bng\bg n\bno\bot\bt a\ba d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by n\bno\bo f\bfi\bil\ble\bes\bs e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be n\bno\bo i\bin\bnf\bfo\bo-\b-h\bha\bas\bsh\bh e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be m\bma\bal\blf\bfo\bor\brm\bme\bed\bd p\bpe\bee\ber\brs\bs i\bin\bn p\bpe\bee\ber\br l\bli\bis\bst\bt|\n+|o\bof\bf d\bdi\bic\bct\bti\bio\bon\bna\bar\bri\bie\bes\bs u\bun\bne\bev\bve\ben\bn n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bby\byt\bte\bes\bs i\bin\bn p\bpe\bee\ber\brs\bs a\ban\bnd\bd p\bpe\bee\ber\brs\bs6\b6 s\bst\btr\bri\bin\bng\bg r\bre\bes\bsp\bpo\bon\bns\bse\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:6\b64\b4 *\b**\b**\b* |\n+|#include \"test_utils.hpp\" |\n+|#include \"udp_tracker.hpp\" |\n+|#include \"settings.hpp\" |\n+|#include \"test_utils.hpp\" |\n+|#include \"libtorrent/alert.hpp\" |\n+|#include \"libtorrent/peer_info.hpp\" // for peer_list_entry |\n+|#include \"libtorrent/alert_types.hpp\" |\n+|#include \"libtorrent/session.hpp\" |\n+|#include \"libtorrent/session_params.hpp\" |\n+|#include \"libtorrent/error_code.hpp\" |\n+|#include \"libtorrent/tracker_manager.hpp\" |\n+|#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response |\n+|#include \"libtorrent/torrent_info.hpp\" |\n+|#include \"libtorrent/announce_entry.hpp\" |\n+|#include \"libtorrent/torrent.hpp\" |\n+|#include \"libtorrent/aux_/path.hpp\" |\n+|#include \"libtorrent/socket_io.hpp\" |\n+| |\n+|using namespace lt; |\n+| |\n+| |\n+|TORRENT_TEST(parse_hostname_peers) |\n |{ |\n-|\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+|\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(flag_paused) |\n+|TORRENT_TEST(parse_peers4) |\n |{ |\n-|\t// paused |\n-|\ttest_add_and_get_flags(torrent_flags::paused); |\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+|_\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<int>(mapping) |\n+|\t\t\t\t<< \", port: \" << port << \", IP: \" << ip |\n+|\t\t\t\t<< \", proto: \" << static_cast<int>(protocol) |\n+|\t\t\t\t<< \", error: \\\"\" << err.message() << \"\\\"\\n\"; |\n+|\t\t} |\n+|\t#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tbool should_log_portmap(portmap_transport) const override |\n+|\t\t{ |\n+|\t\t\treturn true; |\n+|\t\t} |\n+| |\n+|\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-|TORRENT_TEST(flag_auto_managed) |\n+|ip_interface pick_upnp_interface() |\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+|\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+|_\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__\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-|// 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+|int sum_distance_exp(int s, node_entry const& e, node_id const& ref) |\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+|\treturn s + distance_exp(e.id, ref); |\n |} |\n-|#endif |\n-|#endif |\n | |\n-|TORRENT_TEST(flag_sequential_download) |\n+|std::vector<tcp::endpoint> g_got_peers; |\n+| |\n+|void get_peers_cb(std::vector<tcp::endpoint> const& peers) |\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+|\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end()); |\n |} |\n-|#endif |\n-|#endif |\n | |\n-|TORRENT_TEST(flag_sequential_download) |\n+|std::vector<dht::item> g_got_items; |\n+|dht::item g_put_item; |\n+|int g_put_count; |\n+| |\n+|void get_mutable_item_cb(dht::item const& i, bool a) |\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+|\tif (!a) return; |\n+|\tif (!i.empty()) |\n+|\t\tg_got_items.push_back(i); |\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+|void put_mutable_item_data_cb(dht::item& i) |\n |{ |\n-|\t// stop-when-ready |\n-|test_unset_after_add(torrent_flags::stop_when_ready); |\n-|} |\n+|\tif (!i.empty()) |\n+|_\b\t_\b\t_\bg_\b__\bg_\bo_\bt_\b__\bi_\bt_\be_\bm_\bs_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b2_\b2_\b3_\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bn_\b'_\bt_\b _\bw_\bo_\br_\bk_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bc_\bo_\bn_\bd_\b _\bn_\bo_\bd_\be_\b _\bi_\bs_\bn_\b'_\bt_\b _\bp_\bi_\bn_\bg_\be_\bd_\b _\bs_\bo_\b _\bi_\bt_\b _\bw_\bo_\bn_\bt_\b _\bb_\be_\b _\ba_\bd_\bd_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b _\bt_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bon\bn'\b't\bt w\bwo\bor\brk\bk b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be s\bse\bec\bco\bon\bnd\bd n\bno\bod\bde\be i\bis\bsn\bn'\b't\bt p\bpi\bin\bng\bge\bed\bd s\bso\bo i\bit\bt w\bwo\bon\bnt\bt b\bbe\be a\bad\bdd\bde\bed\bd t\bto\bo t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:3\b32\b22\b23\b3 *\b**\b**\b* |\n+|bool ret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+| |\n+|\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+|\t// and no replacement nodes |\n+|\tTEST_EQUAL(std::get<1>(node.size()), 0); |\n+| |\n+|\t// now, disable read_only, try again. |\n+|\tg_sent_packets.clear(); |\n+|\tsett.set_bool(settings_pack::dht_read_only, false); |\n+| |\n+|\tsend_dht_request(node, \"get\", source, &response); |\n+|\t// sender should be added to replacement bucket |\n+|\tTEST_EQUAL(std::get<1>(node.size()), 1); |\n+| |\n+|\tg_sent_packets.clear(); |\n+|#if 0 |\n+|target = generate_next(); |\n+|node.get_item(target, get_immutable_item_cb); |\n+| |\n+|\t// since we have 2 nodes, we should have two packets. |\n+|\tTEST_EQUAL(g_sent_packets.size(), 2); |\n+| |\n+|\t// both of them shouldn't have a 'ro' key. |\n+|\tnode_from_entry(g_sent_packets.front().second, request); |\n+|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+| |\n+|\tTEST_CHECK(ret); |\n+|\tTEST_CHECK(!parsed[3]); |\n+| |\n+|\tnode_from_entry(g_sent_packets.back().second, request); |\n+|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+| |\n+|\tTEST_CHECK(ret); |\n+|\tTEST_CHECK(!parsed[3]); |\n |#endif |\n+|} |\n | |\n-|TORRENT_TEST(flag_disable_dht) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|// these tests rely on logging being enabled |\n+| |\n+|TORRENT_TEST(invalid_error_msg) |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b8_\b1_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bo_\bb_\bf_\bu_\bs_\bc_\ba_\bt_\be_\bd_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt o\bob\bbf\bfu\bus\bsc\bca\bat\bte\bed\bd_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b40\b08\b81\b1 *\b**\b**\b* |\n+|TEST_CHECK(sm.has_quota()); |\n+|\t}); |\n+|} |\n+| |\n+|TORRENT_TEST(rate_limit_accrue_limit) |\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+|\taux::session_settings sett; |\n+|\tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits<int>::max()); |\n+| |\n+|\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) { |\n+|\t\tTEST_CHECK(sm.has_quota()); |\n+|\t\tfor (int i = 0; i < 10; ++i) |\n+|\t\t{ |\n+|\t\t\tstd::this_thread::sleep_for(milliseconds(500)); |\n+|\t\t\tTEST_CHECK(sm.has_quota()); |\n+|\t\t} |\n+|\t}); |\n |} |\n | |\n | |\n-|TORRENT_TEST(flag_disable_lsd) |\n+| |\n+|#else |\n+|TORRENT_TEST(dht) |\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+|\t// dummy dht test |\n+|\tTEST_CHECK(true); |\n |} |\n | |\n-|TORRENT_TEST(flag_disable_pex) |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test file attributes |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt f\bfi\bil\ble\be a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test symlinks |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsy\bym\bml\bli\bin\bnk\bks\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where we have > 120 samples (and have the base delay actually be updated) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be h\bha\bav\bve\be >\b> 1\b12\b20\b0 s\bsa\bam\bmp\bpl\ble\bes\bs (\b(a\ban\bnd\bd h\bha\bav\bve\be t\bth\bhe\be b\bba\bas\bse\be d\bde\bel\bla\bay\by a\bac\bct\btu\bua\bal\bll\bly\by b\bbe\be u\bup\bpd\bda\bat\bte\bed\bd)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bi\bi_\bm\bm_\be\be_\bs\bs_\bt\bt_\ba\ba_\bm\bm_\bp\bp_\b_\b__\bh\bh_\bi\bi_\bs\bs_\bt\bt_\bo\bo_\br\br_\by\by_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b5\b5_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where a sample is lower than the history entry but not lower than the base |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be a\ba s\bsa\bam\bmp\bpl\ble\be i\bis\bs l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be h\bhi\bis\bst\bto\bor\bry\by e\ben\bnt\btr\bry\by b\bbu\but\bt n\bno\bot\bt l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be b\bba\bas\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bti\bim\bme\bes\bst\bta\bam\bmp\bp_\b_h\bhi\bis\bst\bto\bor\bry\by.\b.c\bcp\bpp\bp:\b:5\b55\b5 *\b**\b**\b* |\n+|#include \"libtorrent/aux_/timestamp_history.hpp\" |\n+| |\n+|TORRENT_TEST(timestamp_history) |\n |{ |\n-|\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+|\tusing namespace lt; |\n+| |\n+|\taux::timestamp_history h; |\n+|\tTEST_EQUAL(h.add_sample(0x32, false), 0); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x33, false), 0x1); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x3433, false), 0x3401); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x30, false), 0); |\n+|\tTEST_EQUAL(h.base(), 0x30); |\n+| |\n+|\t// test that wrapping of the timestamp is properly handled |\n+|\th.add_sample(0xfffffff3, false); |\n+|\tTEST_EQUAL(h.base(), 0xfffffff3); |\n+| |\n |_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\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+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bn_\bs_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b7_\b3_\b _\b|_\bt_\bh_\be_\bs_\be_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b _\bt_\be_\bs_\bt_\bs_\b _\bb_\be_\bl_\bo_\bn_\bg_\b _\bi_\bn_\b _\bt_\bh_\be_\bi_\br_\b _\bo_\bw_\bn_\b _\bt_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\bes\bse\be s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk t\bte\bes\bst\bts\bs b\bbe\bel\blo\bon\bng\bg i\bin\bn t\bth\bhe\bei\bir\br o\bow\bwn\bn t\bte\bes\bst\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\ban\bns\bsf\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b17\b73\b3 *\b**\b**\b* |\n+|// to the time it will take to complete the test |\n+|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n+|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n+|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n+|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n | |\n-|\t\twhile (new_size < size) |\n-|\t\t\tnew_size <<= 1; |\n+|\t// make sure we announce to both http and udp trackers |\n+|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n+|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_lsd, false); |\n+|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n+|\tpack.set_bool(settings_pack::enable_upnp, false); |\n+|\tpack.set_bool(settings_pack::enable_dht, false); |\n | |\n-|\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]); |\n+|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n+|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n | |\n-|\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i) |\n-|\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]); |\n+|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n | |\n-|\t\tm_storage = std::move(new_storage); |\n-|\t\tm_capacity = new_size; |\n-|\t} |\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-|\tpacket_ptr packet_buffer::remove(index_type idx) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-|if (idx >= m_first + m_capacity) |\n-|return packet_ptr(); |\n+|\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-|\t\tif (compare_less_wrap(idx, m_first, 0xffff)) |\n-|\t\t\treturn packet_ptr(); |\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-|\t\tstd::size_t const mask = m_capacity - 1; |\n-|\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]); |\n-|\t\tm_storage[idx & mask].reset(); |\n+|\tses2.apply_settings(pack); |\n | |\n-|\t\tif (old_value) |\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+|_\b\t_\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\bl_\bi_\bs_\bt_\be_\bn_\b(_\bs_\be_\bs_\b2_\b,_\b _\b\"_\bs_\be_\bs_\b2_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\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<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--m_size; |\n-|\t\t\tif (m_size == 0) m_last = m_first; |\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 (idx == m_first && m_size != 0) |\n+|\t\tif (!ec && move_partfile) |\n |\t\t{ |\n-|\t\t\t++m_first; |\n-|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first) |\n-|\t\t\t\tif (m_storage[m_first & mask]) break; |\n-|\t\t\tm_first &= 0xffff; |\n+|\t\t\terror_code e; |\n+|\t\t\tmove_partfile(new_save_path, e); |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b8 |it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bo_\bg_\bi_\bc_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd s\bse\bee\bem\bm r\bre\bea\bas\bso\bon\bna\bab\bbl\ble\be t\bto\bo,\b, i\bin\bns\bst\bte\bea\bad\bd,\b, s\bse\bet\bt t\bth\bhe\be h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\bes\bs b\bbi\bit\bts\bs f\bfo\bor\br t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs r\bre\bep\bpr\bre\bes\bse\ben\bnt\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfi\bil\ble\bes\bs,\b, a\ban\bnd\bd r\bre\bes\bsu\bum\bme\be w\bwi\bit\bth\bh t\bth\bhe\be n\bno\bor\brm\bma\bal\bl l\blo\bog\bgi\bic\bc *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:5\b53\b38\b8 *\b**\b**\b* |\n+|continue; |\n+| |\n+|\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs |\n+|\t\t\t\t\t, save_path, ec); |\n+|\t\t\t\tif (size < 0) return false; |\n+| |\n+|\t\t\t\tif (size < fs.file_size(file_index)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tec.ec = errors::mismatching_file_size; |\n+|\t\t\t\t\tec.file(file_index); |\n+|\t\t\t\t\tec.operation = operation_t::check_resume; |\n+|\t\t\t\t\treturn false; |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t\treturn true; |\n |\t\t} |\n | |\n-|\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0) |\n-|\t\t{ |\n-|\t\t\t--m_last; |\n-|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last) |\n-|\t\t\t\tif (m_storage[m_last & mask]) break; |\n-|\t\t\t++m_last; |\n-|_\b\t_\b\t_\b\t_\bm_\b__\bl_\ba_\bs_\bt_\b _\b&_\b=_\b _\b0_\bx_\bf_\bf_\bf_\bf_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b9_\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b4_\b,_\b _\bu_\bs_\be_\b _\bu_\bn_\bi_\bq_\bu_\be_\b__\bp_\bt_\br_\b _\ba_\bn_\bd_\b _\bm_\bo_\bv_\be_\b _\bi_\bt_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b14\b4,\b, u\bus\bse\be u\bun\bni\biq\bqu\bue\be_\b_p\bpt\btr\br a\ban\bnd\bd m\bmo\bov\bve\be i\bit\bt i\bin\bnt\bto\bo t\bth\bhe\be l\bla\bam\bmb\bbd\bda\ba *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:4\b49\b99\b9 *\b**\b**\b* |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\t\tif (params.save_path.empty()) |\n-|\t\t\taux::throw_ex<system_error>(error_code(errors::invalid_save_path)); |\n-|#else |\n-|\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty()); |\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-|#if TORRENT_ABI_VERSION < 3 |\n-|\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti) |\n-|\t\t\tparams.info_hashes.v1 = params.info_hash; |\n-|#endif |\n+|\t\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// the internal torrent object keeps and mutates state in the |\n-|\t\t// torrent_info object. We can't let that leak back to the client |\n-|\t\tif (params.ti) |\n-|\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti); |\n+|\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1); |\n+|\t\t\tTORRENT_ASSERT(!f.empty()); |\n | |\n-|\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw |\n-|\t\t// pointer for now. async_call uses a lambda expression to post the call |\n-|\t\t// to the main thread |\n-|auto* p = new add_torrent_params(std::move(params)); |\n-|auto guard = aux::scope_end([p]{ delete p; }); |\n-|\t\tp->save_path = complete(p->save_path); |\n+|\t\t\tfile_index_t const file_index = f[0].file_index; |\n | |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\thandle_backwards_compatible_resume_data(*p); |\n-|#endif |\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\tasync_call(&session_impl::async_add_torrent, p); |\n-|\t\tguard.disarm(); |\n-|\t} |\n+|\t\t\tif (fs.pad_file_at(file_index)) continue; |\n | |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t// if the torrent already exists, this will throw duplicate_torrent |\n-|\ttorrent_handle session_handle::add_torrent( |\n-|\t\ttorrent_info const& ti |\n-|\t\t, std::string const& save_path |\n-|\t\t, entry const& resume_data |\n-|\t\t, storage_mode_t storage_mode |\n-|\t\t, bool const add_paused) |\n-|\t{ |\n-|\t\tadd_torrent_params p; |\n-|\t\tp.ti = std::make_shared<torrent_info>(ti); |\n-|\t\tp.save_path = save_path; |\n-|\t\tif (resume_data.type() != entry::undefined_t) |\n-|\t\t{ |\n-|\t\t\tbencode(std::back_inserter(p.resume_data), resume_data); |\n+|\t\t\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/_\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-|\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_\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+|\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+|// openssl |\n+|\t\t\tint r = RAND_bytes(reinterpret_cast<unsigned char*>(buffer.data()) |\n+|\t\t\t\t, int(buffer.size())); |\n+|\t\t\tif (r != 1) aux::throw_ex<system_error>(errors::no_entropy); |\n+|#elif TORRENT_USE_GETRANDOM |\n+|\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast<std::size_t>(buffer.size()), 0); |\n+|\t\t\tif (r == ssize_t(buffer.size())) return; |\n+|\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex<system_error>(error_code(errno, generic_category())); |\n+|\t\t\tstatic dev_random dev; |\n+|\t\t\tdev.read(buffer); |\n+|#elif TORRENT_USE_DEV_RANDOM |\n+|\t\t\tstatic dev_random dev; |\n+|\t\t\tdev.read(buffer); |\n |#else |\n-|\t\t\tret = file_pointer(::fopen(fn.c_str(), \"wb+\")); |\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\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+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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-|\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+|\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-|m_free_slots.push_back(i->second); |\n-|\t\tm_piece_map.erase(i); |\n-|\t\tm_dirty_metadata = true; |\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-|\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec) |\n+|\tstd::string tracker_error_alert::message() const |\n |\t{ |\n-|\t\tflush_metadata_impl(ec); |\n-|\t\tif (ec) return; |\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-|\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+|\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-|\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+|\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-|\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_\b4_\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b42\b24\b4 *\b**\b**\b* |\n-|} |\n-|\t\t\t\tauto bytes_read = std::fread(buf.get(), 1, std::size_t(block_to_copy), file.file()); |\n-|\t\t\t\tif (int(bytes_read) != block_to_copy) |\n-|\t\t\t\t\tec.assign(errno, generic_category()); |\n+|\tchar const* tracker_warning_alert::warning_message() const |\n+|\t{ |\n+|\t\treturn m_alloc.get().ptr(m_msg_idx); |\n+|\t} |\n | |\n-|\t\t\t\tif (ec) return; |\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-|\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+|\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-|\tvoid posix_part_file::flush_metadata(error_code& ec) |\n+|\tstd::string tracker_warning_alert::message() const |\n |\t{ |\n-|\t\tflush_metadata_impl(ec); |\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-|void posix_part_file::flush_metadata_impl(error_code& ec) |\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\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+|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t} |\n | |\n-|\t\tauto f = open_file(open_mode::read_write, ec); |\n-|\t\tif (ec) return; |\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-|\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size)); |\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-|\t\tusing namespace libtorrent::aux; |\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-|\t\tchar* ptr = header.data(); |\n-|\t\twrite_uint32(m_max_pieces, ptr); |\n-|\t\twrite_uint32(m_piece_size, ptr); |\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-|\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+|\tchar const* scrape_failed_alert::error_message() const |\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\tif (m_msg_idx == aux::allocation_slot()) return \"\"; |\n+|\t\telse return m_alloc.get().ptr(m_msg_idx); |\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+|\tstd::string scrape_failed_alert::message() const |\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+|#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-|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+|\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-|\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+|\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-|void socks5::on_connect_timeout(error_code const& e) |\n-|{ |\n-|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\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-|\tif (e == boost::asio::error::operation_aborted) return; |\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-|\tif (m_abort) return; |\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-|\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+|\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-|\terror_code ignore; |\n-|\tm_socks5_sock.close(ignore); |\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-|\t++m_failures; |\n-|\tretry_connection(); |\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-|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+|\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/_\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 <arpa/inet.h> |\n |#include <cstring> |\n |#include <cstdlib> |\n |#include <unistd.h> |\n@@ -6472,880 +6680,1708 @@\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/_\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+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b51\b1 *\b**\b**\b* |\n+|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n+|\t\t\t\twe_have(i); |\n+|\t\t\t} |\n+|\t\t} |\n | |\n-|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\tset_state(torrent_status::checking_resume_data); |\n | |\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-|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n-|#include \"libtorrent/assert.hpp\" |\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-|#if defined TORRENT_BUILD_SIMULATOR |\n-|#elif TORRENT_USE_NETLINK |\n-|#include \"libtorrent/netlink.hpp\" |\n-|#include \"libtorrent/socket.hpp\" |\n-|#include <array> |\n-|#include <unordered_map> |\n-|#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY |\n-|#include <SystemConfiguration/SystemConfiguration.h> |\n-|#elif defined TORRENT_WINDOWS |\n-|#include \"libtorrent/aux_/throw.hpp\" |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include <iphlpapi.h> |\n-|#ifdef TORRENT_WINRT |\n-|#include <netioapi.h> |\n-|#endif |\n-|#include <mutex> |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-|#endif |\n+|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|if (!t->is_seed()) continue; |\n | |\n-|#include \"libtorrent/aux_/netlink_utils.hpp\" |\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-|namespace libtorrent { namespace aux { |\n+|\t\t\t\tfor (auto const& t : ts) |\n+|\t\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b96\b64\b4 *\b**\b**\b* |\n+|{ |\n+|\t\t\tresolve_links res(m_torrent_file); |\n | |\n-|namespace { |\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-|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n-|\t!defined TORRENT_BUILD_SIMULATOR |\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-|// common utilities for Mac and iOS |\n-|template <typename T> void CFRefRetain(T h) { CFRetain(h); } |\n-|_\bt_\be_\bm_\bp_\bl_\ba_\bt_\be_\b _\b<_\bt_\by_\bp_\be_\bn_\ba_\bm_\be_\b _\bT_\b>_\b _\bv_\bo_\bi_\bd_\b _\bC_\bF_\bR_\be_\bf_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bT_\b _\bh_\b)_\b _\b{_\b _\bC_\bF_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bh_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |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<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\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\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+|\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\tif (m_parser.status_code() == 503) |\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\tif (!m_parser.finished()) return; |\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-|\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str()); |\n-|\t\t\t\tif (retry_time <= 0) retry_time = 60; |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time); |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n+|\t\tm_outstanding_check_files = true; |\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+|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n+|\t\t{ |\n+|\t\t\tm_ses.disk_thread().async_check_files( |\n+|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n+|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b2_\b8 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b72\b28\b8 *\b**\b**\b* |\n+|// not ready for peers. Except, if we don't have metadata, |\n+|\t\t// we need peers to download from |\n+|\t\tif (!m_files_checked && valid_metadata()) return; |\n+| |\n+|\t\tif (!m_announce_to_lsd) return; |\n | |\n+|\t\t// private torrents are never announced on LSD |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return; |\n | |\n-|\t\t\t// we only received the header, no data |\n-|\t\t\tif (recv_buffer.empty()) break; |\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\t\tif (recv_buffer.size() < front_request.length) break; |\n+|\t\tif (is_paused()) return; |\n | |\n-|\t\t\t// if the response is chunked, we need to receive the last |\n-|\t\t\t// terminating chunk and the tail headers before we can proceed |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\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+|\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// 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\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\tsession_log(\"start session\"); |\n+|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n+|#endif |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\tif (!should_announce_dht()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b88\b85\b5 *\b**\b**\b* |\n+|catch (...) { handle_exception(); } |\n |#endif |\n | |\n-|#if TORRENT_USE_SSL |\n-|\t\terror_code ec; |\n-|\t\tm_ssl_ctx.set_default_verify_paths(ec); |\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 (ec) session_log(\"SSL set_default verify_paths failed: %s\", ec.message().c_str()); |\n-|\t\tec.clear(); |\n+|\t\tif (e && should_log()) |\n+|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n |#endif |\n-|#if defined TORRENT_WINDOWS && defined TORRENT_USE_OPENSSL && !defined TORRENT_WINRT |\n-|X509_STORE* store = X509_STORE_new(); |\n-|if (store) |\n+| |\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-|\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\"); |\n-|\t\t\t// this is best effort |\n-|\t\t\tif (system_store) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n |\t\t\t{ |\n-|\t\t\t\tCERT_CONTEXT const* ctx = nullptr; |\n-|\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded); |\n-|\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded); |\n-|\t\t\t\t\t// this is best effort |\n-|\t\t\t\t\tif (!x509) continue; |\n-|\t\t\t\t\tX509_STORE_add_cert(store, x509); |\n-|\t\t\t\t\tX509_free(x509); |\n-|\t\t\t\t} |\n-|\t\t\t\tCertFreeCertificateContext(ctx); |\n-|\t\t\t\tCertCloseStore(system_store, 0); |\n+|\t\t\t\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\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle(); |\n-|\t\tSSL_CTX_set_cert_store(ssl_ctx, store); |\n-|#endif |\n-|#ifdef __APPLE__ |\n-|\t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec); |\n+|\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\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str()); |\n-|\t\tec.clear(); |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b8_\b4_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)_\b _\bt_\bh_\be_\bs_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\bs_\b _\bu_\bp_\b _\bf_\br_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bes\bse\ber\brv\bve\be(\b()\b) t\bth\bhe\bes\bse\be v\bve\bec\bct\bto\bor\brs\bs u\bup\bp f\bfr\bro\bon\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b14\b48\b84\b4 *\b**\b**\b* |\n-|bandwidth_channel* ch = &p->channel[peer_connection::download_channel]; |\n-|\t\t\tif (use_quota_overhead(ch, amount_down)) |\n-|\t\t\t\tret |= 1 << peer_connection::download_channel; |\n-|\t\t\tch = &p->channel[peer_connection::upload_channel]; |\n-|\t\t\tif (use_quota_overhead(ch, amount_up)) |\n-|\t\t\t\tret |= 1 << peer_connection::upload_channel; |\n+|\t\t\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\treturn ret; |\n-|\t} |\n+|\t\tupdate_want_peers(); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b8_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b58\b81\b1 *\b**\b**\b* |\n+|{ |\n+|\t\t\tstd::set<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// session_impl is responsible for deleting 'pack' |\n-|\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-|\t\tapply_settings_pack_impl(*pack); |\n-|\t} |\n+|\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-|\tsettings_pack session_impl::get_settings() const |\n-|\t{ |\n-|\t\tsettings_pack ret; |\n-|for (int i = settings_pack::string_type_base; |\n-|i < settings_pack::max_string_setting_internal; ++i) |\n+|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n |\t\t{ |\n-|\t\t\tret.set_str(i, m_settings.get_str(i)); |\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<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\tfor (int i = settings_pack::int_type_base; |\n-|\t\t\ti < settings_pack::max_int_setting_internal; ++i) |\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\tret.set_int(i, m_settings.get_int(i)); |\n+|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b52\b25\b5 *\b**\b**\b* |\n+||| peerinfo->confirmed_supports_utp)) |\n+|\t\t\t{ |\n+|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// don't make a TCP connection if it's disabled |\n+|\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp)) |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \" |\n+|\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str() |\n+|\t\t\t\t\t\t, peerinfo->supports_utp); |\n+|\t\t\t\t} |\n+|#endif |\n+|\t\t\t\treturn false; |\n+|\t\t\t} |\n |\t\t} |\n-|\t\tfor (int i = settings_pack::bool_type_base; |\n-|\t\t\ti < settings_pack::max_bool_setting_internal; ++i) |\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\tret.set_bool(i, m_settings.get_bool(i)); |\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\treturn ret; |\n-|\t} |\n+|\t\telse |\n+|#endif |\n+|\t\t{ |\n+|\t\t\tvoid* userdata = nullptr; |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\t\tif (is_ssl_torrent()) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b11\b18\b8 *\b**\b**\b* |\n+|// finished torrents may not change their queue positions, as it's set to |\n+|\t\t// -1 |\n+|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n | |\n-|namespace { |\n-|\ttemplate <typename Pack> |\n-|\tint get_setting_impl(Pack const& p, int name, int*) |\n-|\t{ return p.get_int(name); } |\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-|\ttemplate <typename Pack> |\n-|\tbool get_setting_impl(Pack const& p, int name, bool*) |\n-|\t{ return p.get_bool(name); } |\n+|\t\tTORRENT_ASSERT(p >= no_pos); |\n | |\n-|\ttemplate <typename Pack> |\n-|\tstd::string get_setting_impl(Pack const& p, int name, std::string*) |\n-|_\b\t_\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bp_\b._\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\bn_\ba_\bm_\be_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b8 |could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bd_\be_\bn_\bt_\bi_\bc_\ba_\bl_\b,_\b _\bm_\ba_\by_\bb_\be_\b _\bt_\bh_\be_\b _\bl_\ba_\bt_\bt_\be_\br_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bco\bou\bul\bld\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn b\bbe\be m\bme\ber\brg\bge\bed\bd w\bwi\bit\bth\bh e\bex\bxp\bpa\ban\bnd\bd_\b_u\bun\bns\bsp\bpe\bec\bci\bif\bfi\bie\bed\bd_\b_a\bad\bdd\bdr\bre\bes\bss\bse\bes\bs?\b? r\bri\big\bgh\bht\bt n\bno\bow\bw b\bbo\bot\bth\bh l\bli\bis\bst\bte\ben\bn_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt_\b_t\bt a\ban\bnd\bd l\bli\bis\bst\bte\ben\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be_\b_t\bt a\bar\bre\be a\bal\blm\bmo\bos\bst\bt i\bid\bde\ben\bnt\bti\bic\bca\bal\bl,\b, m\bma\bay\byb\bbe\be t\bth\bhe\be l\bla\bat\btt\bte\ber\br c\bco\bou\bul\bld\bd b\bbe\be |\n-|r\bre\bem\bmo\bov\bve\bed\bd t\bto\boo\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b19\b99\b98\b8 *\b**\b**\b* |\n-|session_log(\"FATAL SESSION ERROR (%s : %d) [%s]\" |\n-|\t\t\t, ec.category().name(), ec.value(), ec.message().c_str()); |\n+|\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<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-|\t\tthis->abort(); |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n |\t} |\n | |\n-|\tvoid session_impl::on_ip_change(error_code const& ec) |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n |\t{ |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b13\b35\b5 *\b**\b**\b* |\n+|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (limit <= 0) limit = (1 << 24) - 1; |\n+|\t\tif (int(m_max_uploads) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit); |\n |#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (!ec) |\n-|\t\t\tsession_log(\"received ip change from internal ip_notifier\"); |\n-|\t\telse |\n-|\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str()); |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n |#endif |\n-|\t\tif (ec || m_abort || !m_ip_notifier) return; |\n-|\t\tm_ip_notifier->async_wait([this] (error_code const& e) |\n-|\t\t\t{ wrap(&session_impl::on_ip_change, e); }); |\n-|\t\treopen_network_sockets({}); |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n |\t} |\n | |\n-|void interface_to_endpoints(listen_interface_t const& iface |\n-|, listen_socket_flags_t flags |\n-|\t\t, span<ip_interface const> const ifs |\n-|\t\t, std::vector<listen_endpoint_t>& eps) |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n |\t{ |\n-|\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{}; |\n-|\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext; |\n+|\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<std::uint32_t>(limit); |\n+|\t\tupdate_want_peers(); |\n | |\n-|\t\t// First, check to see if it's an IP address |\n-|\t\terror_code err; |\n-|\t\taddress const adr = make_address(iface.device.c_str(), err); |\n-|\t\tif (!err) |\n+|#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\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags); |\n+|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n+|\t\t\t\t, errors::too_many_connections); |\n |\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tflags |= listen_socket_t::was_expanded; |\n | |\n-|\t\t\t// this is the case where device names a network device. We need to |\n-|\t\t\t// enumerate all IPs associated with this device |\n-|\t\t\tfor (auto const& ipface : ifs) |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n+| |\n+|\tvoid torrent::set_upload_limit(int const limit) |\n+|\t{ |\n+|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid torrent::set_download_limit(int const limit) |\n+|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b6_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b06\b61\b1 *\b**\b**\b* |\n+|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n+|\t\t\t\t\t, m_average_piece_time); |\n+|#endif |\n+|\t\t\t} |\n+| |\n+|\t\t\t// pick all blocks for this piece. the peers list is kept up to date |\n+|\t\t\t// and sorted. when we issue a request to a peer, its download queue |\n+|\t\t\t// time will increase and it may need to be bumped in the peers list, |\n+|\t\t\t// since it's ordered by download queue time |\n+|\t\t\tpick_time_critical_block(peers, ignore_peers |\n+|\t\t\t\t, peers_with_requests |\n+|\t\t\t\t, pi, &i, m_picker.get() |\n+|\t\t\t\t, blocks_in_piece, timed_out); |\n+| |\n+|\t\t\t// put back the peers we ignored into the peer list for the next piece |\n+|\t\t\tif (!ignore_peers.empty()) |\n |\t\t\t{ |\n-|\t\t\t\t// we're looking for a specific interface, and its address |\n-|\t\t\t\t// (which must be of the same family as the address we're |\n-|\t\t\t\t// connecting to) |\n-|\t\t\t\tif (iface.device != ipface.name) continue; |\n+|\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\tbool const local = iface.local |\n-|\t\t\t\t\t|| ipface.interface_address.is_loopback() |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b|_\b|_\b _\bi_\bs_\b__\bl_\bi_\bn_\bk_\b__\bl_\bo_\bc_\ba_\bl_\b(_\bi_\bp_\bf_\ba_\bc_\be_\b._\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to|\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0_\b6 |disable a tracker, we set the version number that it was disabled at. This change would affect the ABI in 1.2, so should be done in |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b._\b0_\b _\bo_\br_\b _\bl_\ba_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bbe\bet\btt\bte\ber\br t\bto\bo d\bdo\bo t\bth\bhi\bis\bs b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba l\bli\bis\bst\bte\ben\bn-\b-s\bso\boc\bck\bke\bet\bt \"\b\"v\bve\ber\brs\bsi\bio\bon\bn\"\b\" n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt g\bge\bet\bts\bs b\bbu\bum\bmp\bpe\bed\bd.\b. A\bAn\bnd\bd i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bse\bet\btt\bti\bin\bng\bg a\ba b\bbo\boo\bol\bl t\bto\bo d\bdi\bis\bsa\bab\bbl\ble\be a\ba t\btr\bra\bac\bck\bke\ber\br,\b, w\bwe\be s\bse\bet\bt t\bth\bhe\be |\n-|v\bve\ber\brs\bsi\bio\bon\bn n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt i\bit\bt w\bwa\bas\bs d\bdi\bis\bsa\bab\bbl\ble\bed\bd a\bat\bt.\b. T\bTh\bhi\bis\bs c\bch\bha\ban\bng\bge\be w\bwo\bou\bul\bld\bd a\baf\bff\bfe\bec\bct\bt t\bth\bhe\be A\bAB\bBI\bI i\bin\bn 1\b1.\b.2\b2,\b, s\bso\bo s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be i\bin\bn 2\b2.\b.0\b0 o\bor\br l\bla\bat\bte\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b23\b30\b06\b6 *\b**\b**\b* |\n-|{ |\n-|\t\t\tfor (auto const& s : m_listen_sockets) |\n-|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n+|std::sort(peers.begin(), peers.end() |\n+|, [] (peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); }); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// if this peer's download time exceeds 2 seconds, we're done. |\n+|\t\t\t// We don't want to build unreasonably long request queues |\n+|\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000)) |\n+|\t\t\t\tbreak; |\n |\t\t} |\n-|\t\telse |\n+| |\n+|\t\t// commit all the time critical requests |\n+|\t\tfor (auto p : peers_with_requests) |\n |\t\t{ |\n-|\t\t\t// new sockets need to map ports even if the caller did not request |\n-|\t\t\t// re-mapping |\n-|\t\t\tfor (auto const& s : new_sockets) |\n-|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n+|\t\t\tp->send_block_requests(); |\n |\t\t} |\n+|\t} |\n+|#endif // TORRENT_DISABLE_STREAMING |\n | |\n-|\t\tupdate_lsd(); |\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+|_\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/_\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-|#if TORRENT_USE_I2P |\n-|\t\topen_new_incoming_i2p_connection(); |\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+|if (sizeof(void*) == 8) |\n+|\t\t\treturn mmap_disk_io_constructor(ios, sett, cnt); |\n+|\t\telse |\n+|\t\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|#else |\n+|\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n |#endif |\n+|\t} |\n | |\n-|\t\t// trackers that were not reachable, may have become reachable now. |\n-|\t\t// so clear the \"disabled\" flags to let them be tried one more time |\n-|for (auto& t : m_torrents) |\n-|t->enable_all_trackers(); |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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<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-|\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options) |\n+|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n |\t{ |\n-|\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports)); |\n+|\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length())); |\n |\t} |\n | |\n-|\tnamespace { |\n-|\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType> |\n-|\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep |\n-|\t\t\t, port_mapping_t& map_handle, std::string const& device) |\n-|\t\t{ |\n-|\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle); |\n-|\t\t\tmap_handle = port_mapping_t{-1}; |\n+|\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-|\t\t\taddress const addr = ep.address(); |\n-|\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them |\n-|\t\t\t// based on the scope of the local address |\n-|\t\t\tif (addr.is_v6() && is_local(addr)) |\n-|\t\t\t\treturn; |\n+|\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-|\t\t\t// only update this mapping if we actually have a socket listening |\n-|\t\t\tif (ep != EndpointType()) |\n-|\t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device); |\n-|\t\t} |\n+|#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-|\tvoid session_impl::remap_ports(remap_port_mask_t const mask |\n-|_\b\t_\b\t_\b,_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\b&_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b6_\b6_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b86\b66\b6 *\b**\b**\b* |\n-|// handshaking |\n-|\t\t\t\treturn socket_type(ssl_stream<tcp::socket>(tcp::socket(std::move(s)), m_peer_ssl_ctx)); |\n-|\t\t\t} |\n-|\t\t\telse |\n+|\tint file_storage::file_name_len(file_index_t const index) const |\n+|\t{ |\n+|\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned) |\n+|\t\t\treturn -1; |\n+|\t\treturn m_files[index].name_len; |\n+|\t} |\n |#endif |\n+| |\n+|\tstd::vector<file_slice> file_storage::map_block(piece_index_t const piece |\n+|\t\t, std::int64_t const offset, std::int64_t size) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0}); |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b__\bP_\bR_\bE_\bC_\bO_\bN_\bD_\b(_\bp_\bi_\be_\bc_\be_\b _\b<_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b4_\b2_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\bi_\bf_\b _\bm_\b__\bp_\ba_\bt_\bh_\bs_\b _\bw_\ba_\bs_\b _\bs_\bo_\br_\bt_\be_\bd_\b _\bf_\bi_\br_\bs_\bt_\b,_\b _\bs_\bu_\bc_\bh_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bl_\bo_\bw_\be_\br_\b _\bp_\ba_\bt_\bh_\b _\bi_\bn_\bd_\be_\bx_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bm_\be_\ba_\bn_\bt_\b _\bs_\bo_\br_\bt_\be_\bd_\b-_\bb_\be_\bf_\bo_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt i\bif\bf m\bm_\b_p\bpa\bat\bth\bhs\bs w\bwa\bas\bs s\bso\bor\brt\bte\bed\bd f\bfi\bir\brs\bst\bt,\b, s\bsu\buc\bch\bh t\bth\bha\bat\bt a\ba l\blo\bow\bwe\ber\br p\bpa\bat\bth\bh i\bin\bnd\bde\bex\bx a\bal\blw\bwa\bay\bys\bs m\bme\bea\ban\bnt\bt s\bso\bor\brt\bte\bed\bd-\b-b\bbe\bef\bfo\bor\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b12\b24\b42\b2 *\b**\b**\b* |\n+|} |\n+| |\n+|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\n+| |\n+|\t\t// use this vector to track the new ordering of files |\n+|\t\t// this allows the use of STL algorithms despite them |\n+|\t\t// not supporting a custom swap functor |\n+|\t\taux::vector<file_index_t, file_index_t> new_order(end_file()); |\n+|\t\tfor (auto i : file_range()) |\n+|\t\t\tnew_order[i] = i; |\n+| |\n+|\t\t// remove any existing pad files |\n+|\t\t{ |\n+|\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end() |\n+|\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; }); |\n+|\t\t\tnew_order.erase(pad_begin, new_order.end()); |\n+|\t\t} |\n+| |\n+| |\n+|// 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\treturn socket_type(tcp::socket(std::move(s))); |\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}(); |\n+|\t\t\treturn lf.filename() < rf.filename(); |\n+|\t\t}); |\n | |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c)); |\n-|#endif |\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-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tif (ssl == transport::ssl) |\n+|\t\t// reserve enough space for the worst case after padding |\n+|\t\tnew_files.reserve(new_order.size() * 2 - 1); |\n+|\t\tif (!m_file_hashes.empty()) |\n+|\t\t\tnew_file_hashes.reserve(new_order.size() * 2 - 1); |\n+|\t\tif (!m_mtime.empty()) |\n+|\t\t\tnew_mtime.reserve(new_order.size() * 2 - 1); |\n+| |\n+|\t\t// re-compute offsets and insert pad files as necessary |\n+|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bi_\bn_\bt_\b6_\b4_\b__\bt_\b _\bo_\bf_\bf_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b4_\b5_\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7 t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b13\b34\b45\b5 *\b**\b**\b* |\n+|add_pad_file(i); |\n+|\t\t} |\n+| |\n+|\t\tm_files = std::move(new_files); |\n+|\t\tm_file_hashes = std::move(new_file_hashes); |\n+|\t\tm_mtime = std::move(new_mtime); |\n+| |\n+|\t\tm_total_size = off; |\n+|\t} |\n+| |\n+|\tvoid file_storage::sanitize_symlinks() |\n+|\t{ |\n+|\t\t// symlinks are unusual, this function is optimized assuming there are no |\n+|\t\t// symbolic links in the torrent. If we find one symbolic link, we'll |\n+|\t\t// build the hash table of files it's allowed to refer to, but don't pay |\n+|\t\t// that price up-front. |\n+|\t\tstd::unordered_map<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+|std::unordered_set<std::string> dir_map; |\n+|bool 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\tTORRENT_ASSERT(is_ssl(c)); |\n+|\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n | |\n-|\t\t\t// save the socket so we can cancel the handshake |\n-|auto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first; |\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\tauto sock = iter->get(); |\n-|\t\t\t// for SSL connections, incoming_connection() is called |\n-|\t\t\t// after the handshake is done |\n-|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake( |\n-|\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n-|\t\t} |\n-|\t\telse |\n-|#endif |\n+|\t\t\taux::file_entry const& fe = m_files[i]; |\n+|\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size())); |\n+| |\n+|\t\t\t// symlink targets are only allowed to point to files or directories in |\n+|\t\t\t// this torrent. |\n+|\t\t\t{ |\n+|\t\t\t\tstd::string target = m_symlinks[fe.symlink_index]; |\n+| |\n+|\t\t\t\tif (is_complete(target)) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |introduce a web-seed default class which has a low download priority |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be_\b._\bc_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnt\btr\bro\bod\bdu\buc\bce\be a\ba w\bwe\beb\bb-\b-s\bse\bee\bed\bd d\bde\bef\bfa\bau\bul\blt\bt c\bcl\bla\bas\bss\bs w\bwh\bhi\bic\bch\bh h\bha\bas\bs a\ba l\blo\bow\bw d\bdo\bow\bwn\bnl\blo\boa\bad\bd p\bpr\bri\bio\bor\bri\bit\bty\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_b\bba\bas\bse\be.\b.c\bcp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n+|: peer_connection(pack) |\n+|\t\t, m_first_request(true) |\n+|\t\t, m_ssl(false) |\n+|\t\t, m_external_auth(web.auth) |\n+|\t\t, m_extra_headers(web.extra_headers) |\n+|\t\t, m_parser(http_parser::dont_parse_chunks) |\n+|\t\t, m_body_start(0) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo); |\n+|\t\t// when going through a proxy, we don't necessarily have an endpoint here, |\n+|\t\t// since the proxy might be resolving the hostname, not us |\n+|\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp); |\n+| |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tTORRENT_ASSERT(is_outgoing()); |\n+| |\n+|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n+| |\n+|\t\t// we only want left-over bandwidth |\n+| |\n+|std::string protocol; |\n+|\t\terror_code ec; |\n+|\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path) |\n+|\t\t\t= parse_url_components(web.url, ec); |\n+|\t\tTORRENT_ASSERT(!ec); |\n+| |\n+|\t\tif (m_port == -1 && protocol == \"http\") |\n+|\t\t\tm_port = 80; |\n+| |\n+|#if TORRENT_USE_SSL |\n+|\t\tif (protocol == \"https\") |\n |\t\t{ |\n-|\t\t\tincoming_connection(std::move(c)); |\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-|#ifdef TORRENT_SSL_PEERS |\n+|\tint web_connection_base::timeout() const |\n+|\t{ |\n+|\t\t// since this is a web seed, change the timeout |\n+|\t\t// according to the settings. |\n+|\t\treturn m_settings.get_int(settings_pack::urlseed_timeout); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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-|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\n+|\tbool supports_arm_neon() noexcept |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_ssl(s)); |\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-|_\b\t_\b\t_\b/_\b/_\b _\bs_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b9_\b1_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b89\b91\b1 *\b**\b**\b* |\n-|// after the handshake is done |\n-|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\t\tboost::get<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+|\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\t{ |\n-|\t\t\tincoming_connection(std::move(c)); |\n-|\t\t} |\n |\t} |\n | |\n-|#ifdef TORRENT_SSL_PEERS |\n+|} // anonymous namespace |\n | |\n-|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\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+|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<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(is_ssl(s)); |\n+|\t\tTORRENT_ASSERT(r.length <= default_block_size); |\n+|\t\tTORRENT_UNUSED(r); |\n | |\n-|\t\t// save the socket so we can cancel the handshake |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n+|\t\treturn false; |\n+|\t} |\n | |\n-|auto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first; |\n-|auto sock = iter->get(); |\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+|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n+|} |\n | |\n-|\t\t// for SSL connections, incoming_connection() is called |\n-|\t\t// after the handshake is done |\n-|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake( |\n-|\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n+|\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-|\t// to test SSL connections, one can use this openssl command template: |\n-|\t// |\n-|\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem |\n-|\t// -CAfile <torrent-cert>.pem -debug -connect 127.0.0.1:4433 -tls1 |\n-|\t// -servername <hex-encoded-info-hash> |\n+|\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 session_impl::ssl_handshake(error_code const& ec, socket_type* sock) |\n+|\tvoid async_release_files(storage_index_t, std::function<void()> handler) override |\n |\t{ |\n-|\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n+|\t} |\n | |\n-|\t\tauto iter = m_incoming_sockets.find(sock); |\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-|\t\t// this happens if the SSL connection is aborted because we're shutting |\n-|\t\t// down |\n-|\t\tif (iter == m_incoming_sockets.end()) return; |\n+|\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/_\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<socks5_alert>()) |\n+|\t\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::sock_option, ec); |\n+|\t\tec.clear(); |\n+|\t} |\n+|#endif |\n+|#endif |\n | |\n-|\t\tsocket_type s(std::move(**iter)); |\n-|\t\tTORRENT_ASSERT(is_ssl(s)); |\n-|\t\tm_incoming_sockets.erase(iter); |\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-|_\b\t_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b5_\b9_\b0_\b _\b _\b|_\bh_\ba_\bv_\be_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\bs_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\bl_\bo_\bo_\bp_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\be_\bm_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt f\bfo\bor\br t\bth\bhe\bes\bse\be c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo l\blo\boo\bop\bp t\bth\bhr\bro\bou\bug\bgh\bh a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b35\b59\b90\b0 *\b**\b**\b* |\n-|// -------------------------------------------------------------- |\n-|\t\tif (!m_paused) m_auto_manage_time_scaler--; |\n-|\t\tif (m_auto_manage_time_scaler < 0) |\n-|\t\t{ |\n-|\t\t\tm_auto_manage_time_scaler = settings().get_int(settings_pack::auto_manage_interval); |\n-|\t\t\trecalculate_auto_managed_torrents(); |\n-|\t\t} |\n | |\n-|\t\t// -------------------------------------------------------------- |\n-|\t\t// check for incoming connections that might have timed out |\n-|\t\t// -------------------------------------------------------------- |\n+|ADD_OUTSTANDING_ASYNC(\"socks5::on_connected\"); |\n+|\tm_socks5_sock.async_connect(m_proxy_addr |\n+|\t\t, std::bind(&socks5::on_connected, self(), _1)); |\n | |\n-|\t\tfor (auto i = m_connections.begin(); i != m_connections.end();) |\n-|\t\t{ |\n-|\t\t\tpeer_connection* p = (*i).get(); |\n-|\t\t\t++i; |\n-|\t\t\t// ignore connections that already have a torrent, since they |\n-|\t\t\t// are ticked through the torrents' second_tick |\n-|\t\t\tif (!p->associated_torrent().expired()) continue; |\n+|\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-|int timeout = m_settings.get_int(settings_pack::handshake_timeout); |\n-|#if TORRENT_USE_I2P |\n-|\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1; |\n-|#endif |\n-|\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout)) |\n-|\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent); |\n-|\t\t} |\n+|void socks5::on_connect_timeout(error_code const& e) |\n+|{ |\n+|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\n | |\n-|\t\t// -------------------------------------------------------------- |\n-|\t\t// second_tick every torrent (that wants it) |\n-|\t\t// -------------------------------------------------------------- |\n+|\tif (e == boost::asio::error::operation_aborted) return; |\n | |\n-|#if TORRENT_DEBUG_STREAMING > 0 |\n-|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n-|#endif |\n+|\tif (m_abort) return; |\n | |\n-|\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick]; |\n-|\t\tfor (int i = 0; i < int(want_tick.size()); ++i) |\n-|\t\t{ |\n-|\t\t\ttorrent& t = *want_tick[i]; |\n-|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n-|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n+|\tif (m_alerts.should_post<socks5_alert>()) |\n+|\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::connect, errors::timed_out); |\n | |\n-|\t\t\tt.second_tick(tick_interval_ms); |\n+|\terror_code ignore; |\n+|\tm_socks5_sock.close(ignore); |\n | |\n-|\t\t\t// if the call to second_tick caused the torrent |\n-|\t\t\t// to no longer want to be ticked (i.e. it was |\n-|\t\t\t// removed from the list) we need to back up the counter |\n-|\t\t\t// to not miss the torrent after it |\n-|\t\t\tif (!t.want_tick()) --i; |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b2_\b3_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bp_\bp_\bl_\by_\b _\bt_\bo_\b _\ba_\bl_\bl_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bc_\bh_\ba_\bn_\bn_\be_\bl_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd a\bap\bpp\bpl\bly\by t\bto\bo a\bal\bll\bl b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh c\bch\bha\ban\bnn\bne\bel\bls\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b36\b62\b23\b3 *\b**\b**\b* |\n-|#if TORRENT_DEBUG_STREAMING > 0 |\n-|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n+|\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/_\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-|\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick]; |\n-|\t\tfor (int i = 0; i < int(want_tick.size()); ++i) |\n-|\t\t{ |\n-|\t\t\ttorrent& t = *want_tick[i]; |\n-|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n-|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n+|\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-|\t\t\tt.second_tick(tick_interval_ms); |\n | |\n-|\t\t\t// if the call to second_tick caused the torrent |\n-|\t\t\t// to no longer want to be ticked (i.e. it was |\n-|\t\t\t// removed from the list) we need to back up the counter |\n-|\t\t\t// to not miss the torrent after it |\n-|\t\t\tif (!t.want_tick()) --i; |\n-|\t\t} |\n+|m_free_slots.push_back(i->second); |\n+|\t\tm_piece_map.erase(i); |\n+|\t\tm_dirty_metadata = true; |\n+|\t} |\n | |\n-|if (m_settings.get_bool(settings_pack::rate_limit_ip_overhead)) |\n-|{ |\n-|\t\t\tint const up_limit = upload_rate_limit(m_global_class); |\n-|\t\t\tint const down_limit = download_rate_limit(m_global_class); |\n+|\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\t\tif (down_limit > 0 |\n-|\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit |\n-|\t\t\t\t&& m_alerts.should_post<performance_alert>()) |\n+|\t\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\tm_alerts.emplace_alert<performance_alert>(torrent_handle() |\n-|\t\t\t\t\t, performance_alert::download_limit_too_low); |\n+|\t\t\t\tstorage_error se; |\n+|\t\t\t\taux::copy_file(old_path, new_path, se); |\n+|\t\t\t\tec = se.ec; |\n+|\t\t\t\tif (ec) return; |\n+|\t\t\t\tremove(old_path, ec); |\n |\t\t\t} |\n+|\t\t} |\n+|\t\tm_path = path; |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b4_\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b42\b24\b4 *\b**\b**\b* |\n+|} |\n+|\t\t\t\tauto bytes_read = std::fread(buf.get(), 1, std::size_t(block_to_copy), file.file()); |\n+|\t\t\t\tif (int(bytes_read) != block_to_copy) |\n+|\t\t\t\t\tec.assign(errno, generic_category()); |\n | |\n-|\t\t\tif (up_limit > 0 |\n-|\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit |\n-|\t\t\t\t&& m_alerts.should_post<performance_alert>()) |\n-|\t\t\t{ |\n-|\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle() |\n-|\t\t\t\t\t, performance_alert::upload_limit_too_low); |\n+|\t\t\t\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-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate); |\n-|#endif |\n+|\tvoid posix_part_file::flush_metadata(error_code& ec) |\n+|\t{ |\n+|\t\tflush_metadata_impl(ec); |\n+|\t} |\n | |\n-|\t\tm_stat.second_tick(tick_interval_ms); |\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\t// -------------------------------------------------------------- |\n-|\t\t// scrape paused torrents that are auto managed |\n-|_\b\t_\b\t_\b/_\b/_\b _\b(_\bu_\bn_\bl_\be_\bs_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b1_\b4 |use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\ba_\bt_\b _\bm_\ba_\bx_\b _\b-_\b _\b1_\b,_\b _\bs_\bi_\bn_\bc_\be_\b _\bw_\be_\b _\bm_\ba_\by_\b _\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bb_\be_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be a\ba l\blo\bow\bwe\ber\br l\bli\bim\bmi\bit\bt t\bth\bha\ban\bn m\bm_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs.\b.c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be t\bth\bhe\be t\bto\bo 1\b10\b0%\b% o\bor\br s\bso\bo o\bof\bf c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsl\blo\bot\bts\bs f\bfo\bor\br i\bin\bnc\bco\bom\bmi\bin\bng\bg c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\bap\bp t\bth\bhi\bis\bs a\bat\bt m\bma\bax\bx -\b- 1\b1,\b, s\bsi\bin\bnc\bce\be w\bwe\be m\bma\bay\by a\bad\bdd\bd o\bon\bne\be |\n-|b\bbe\bel\blo\bow\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b43\b31\b14\b4 *\b**\b**\b* |\n-|// boost, which are done immediately on a tracker response. These |\n-|\t\t// connections needs to be deducted from the regular connection attempt |\n-|\t\t// quota for this tick |\n-|\t\tif (m_boost_connections > 0) |\n+|\t\tif (m_piece_map.empty()) |\n |\t\t{ |\n-|\t\t\tif (m_boost_connections > max_connections) |\n-|\t\t\t{ |\n-|\t\t\t\tm_boost_connections -= max_connections; |\n-|\t\t\t\tmax_connections = 0; |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tmax_connections -= m_boost_connections; |\n-|\t\t\t\tm_boost_connections = 0; |\n-|\t\t\t} |\n+|\t\t\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\t// zero connections speeds are allowed, we just won't make any connections |\n-|\t\tif (max_connections <= 0) return; |\n+|\t\tauto f = open_file(open_mode::read_write, ec); |\n+|\t\tif (ec) return; |\n | |\n-|int const limit = std::min(m_settings.get_int(settings_pack::connections_limit) |\n-|- num_connections(), std::numeric_limits<int>::max() - 1); |\n+|\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size)); |\n | |\n-|\t\t// this logic is here to smooth out the number of new connection |\n-|\t\t// attempts over time, to prevent connecting a large number of |\n-|\t\t// sockets, wait 10 seconds, and then try again |\n-|\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2) |\n-|\t\t\tmax_connections = (limit + 1) / 2; |\n+|\t\tusing namespace libtorrent::aux; |\n | |\n-|\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download]; |\n-|\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished]; |\n+|\t\tchar* ptr = header.data(); |\n+|\t\twrite_uint32(m_max_pieces, ptr); |\n+|\t\twrite_uint32(m_piece_size, ptr); |\n | |\n-|\t\t// if no torrent want any peers, just return |\n-|\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return; |\n+|\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/_\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<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-|\t\t// if we don't have any connection attempt quota, return |\n-|\t\tif (max_connections <= 0) return; |\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 | |\n-|\t\tint steps_since_last_connect = 0; |\n-|\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size()); |\n-|\t\tfor (;;) |\n-|\t\t{ |\n-|\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size())) |\n-|\t\t\t\tm_next_downloading_connect_torrent = 0; |\n+|\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 | |\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+|void torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const |\n+|{ |\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-|\t\t\ttorrent* t = nullptr; |\n-|\t\t\t// there are prioritized torrents. Pick one of those |\n-|_\b\t_\b\t_\b\t_\bw_\bh_\bi_\bl_\be_\b _\b(_\b!_\bm_\b__\bp_\br_\bi_\bo_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b._\be_\bm_\bp_\bt_\by_\b(_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b5_\b9_\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\bh_\ba_\bp_\bp_\be_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bx_\bt_\b _\bt_\bi_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\ba m\bme\bes\bss\bsa\bag\bge\be t\bto\bo h\bha\bav\bve\be t\bth\bhi\bis\bs h\bha\bap\bpp\bpe\ben\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bns\bst\bte\bea\bad\bd o\bof\bf w\bwa\bai\bit\bti\bin\bng\bg f\bfo\bor\br t\bth\bhe\be n\bne\bex\bxt\bt t\bti\bic\bck\bk *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b44\b45\b59\b9 *\b**\b**\b* |\n-|continue; |\n+|\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+|\t} |\n+| |\n+|#if TORRENT_ABI_VERSION == 1 |\n+| |\n+|// ============ start deprecation =============== |\n+| |\n+|\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const |\n+|\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+|\tstd::vector<int> 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/ |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<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\tif (!p->is_peer_interested() |\n-|\t\t\t\t|| p->is_disconnecting() |\n-|\t\t\t\t|| p->is_connecting()) |\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\t// this peer is not unchokable. So, if it's unchoked |\n-|\t\t\t\t// already, make sure to choke it. |\n-|\t\t\t\tif (p->is_choked()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tp->reset_choke_counters(); |\n-|\t\t\t\t\tcontinue; |\n-|\t\t\t\t} |\n-|\t\t\t\tif (pi && pi->optimistically_unchoked) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1); |\n-|\t\t\t\t\tpi->optimistically_unchoked = false; |\n-|\t\t\t\t\t// force a new optimistic unchoke |\n-|\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0; |\n-|} |\n-|t->choke_peer(*p); |\n-|\t\t\t\tp->reset_choke_counters(); |\n-|\t\t\t\tcontinue; |\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-|\t\t\tpeers.push_back(p.get()); |\n+| |\n+|\t\t\t// we only received the header, no data |\n+|\t\t\tif (recv_buffer.empty()) break; |\n+| |\n+|\t\t\tif (recv_buffer.size() < front_request.length) break; |\n+| |\n+|\t\t\t// if the response is chunked, we need to receive the last |\n+|\t\t\t// terminating chunk and the tail headers before we can proceed |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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<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\tint const allowed_upload_slots = unchoke_sort(peers |\n-|\t\t\t, unchoke_interval, m_settings); |\n+|\t\tstd::shared_ptr<mmap_storage> storage = j->storage; |\n | |\n-|\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker) |\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+|status_t ret = status_t::no_error; |\n+|try |\n |\t\t{ |\n-|\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit); |\n-|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots); |\n+|\t\t\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\telse |\n+|\t\tcatch (boost::system::system_error const& err) |\n |\t\t{ |\n-|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots |\n-|\t\t\t\t, allowed_upload_slots); |\n+|\t\t\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-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log()) |\n+|\t\tcatch (std::bad_alloc const&) |\n |\t\t{ |\n-|\t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \" |\n-|\t\t\t\t\"eligible-peers: %d\" |\n-|\t\t\t\t\" allowed-slots: %d ]\" |\n-|\t\t\t\t, int(m_connections.size()) |\n-|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bi_\bn_\bt_\b(_\bp_\be_\be_\br_\bs_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b8_\b6 |they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\ba_\br_\br_\ba_\by_\b _\bo_\bf_\b _\bn_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\br_\ba_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\ba_\b _\bv_\be_\bc_\bt_\bo_\br_\b,_\b _\bt_\bo_\b _\bf_\bu_\br_\bt_\bh_\be_\br_\b _\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bm_\be_\bm_\bo_\br_\by_\b _\bl_\bo_\bc_\ba_\bl_\bi_\bt_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt m\bmi\big\bgh\bht\bt b\bbe\be a\ba n\bni\bic\bce\be f\bfe\bea\bat\btu\bur\bre\be h\bhe\ber\bre\be t\bto\bo l\bli\bim\bmi\bit\bt t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bto\bor\brr\bre\ben\bnt\bts\bs t\bto\bo s\bse\ben\bnd\bd i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be u\bup\bpd\bda\bat\bte\be.\b. B\bBy\by j\bju\bus\bst\bt p\bpo\bos\bst\bti\bin\bng\bg t\bth\bhe\be f\bfi\bir\brs\bst\bt n\bn t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, t\bth\bhe\bey\by w\bwo\bou\bul\bld\bd n\bni\bic\bce\bel\bly\by b\bbe\be r\bro\bou\bun\bnd\bd-\b-r\bro\bob\bbi\bin\bne\bed\bd |\n-|b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt l\bli\bis\bst\bts\bs a\bar\bre\be a\bal\blw\bwa\bay\bys\bs p\bpu\bus\bsh\bhe\bed\bd b\bba\bac\bck\bk.\b. P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be s\bst\bta\bat\btu\bus\bs_\b_u\bup\bpd\bda\bat\bte\be_\b_a\bal\ble\ber\brt\bt c\bco\bou\bul\bld\bd e\bev\bve\ben\bn h\bha\bav\bve\be a\ba f\bfi\bix\bxe\bed\bd a\bar\brr\bra\bay\by o\bof\bf n\bn e\ben\bnt\btr\bri\bie\bes\bs r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn a\ba v\bve\bec\bct\bto\bor\br,\b, t\bto\bo f\bfu\bur\brt\bth\bhe\ber\br i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by |\n-|l\blo\boc\bca\bal\bli\bit\bty\by.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b47\b78\b86\b6 *\b**\b**\b* |\n-|t->status(&st, flags); |\n+|\t\t\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 session_impl::post_torrent_updates(status_flags_t const flags) |\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\tINVARIANT_CHECK; |\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\tTORRENT_ASSERT(is_single_thread()); |\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-|\t\tstd::vector<torrent*>& state_updates |\n-|\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates]; |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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-|#if TORRENT_USE_ASSERTS |\n-|\t\tm_posting_torrent_updates = true; |\n-|#endif |\n+|\t\tadd_fence_job(j); |\n+|\t} |\n | |\n-|\t\tstd::vector<torrent_status> status; |\n-|\t\tstatus.reserve(state_updates.size()); |\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-|for (auto& t : state_updates) |\n-|{ |\n-|\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list()); |\n-|\t\t\tstatus.emplace_back(); |\n-|\t\t\t// querying accurate download counters may require |\n-|\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another |\n-|\t\t\t// one will lead to calling state_updated(), which screws with |\n-|\t\t\t// this list while we're working on it, and break things |\n-|\t\t\tt->status(&status.back(), flags); |\n-|\t\t\tt->clear_in_state_update(); |\n-|\t\t} |\n-|\t\tstate_updates.clear(); |\n+|\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-|#if TORRENT_USE_ASSERTS |\n-|\t\tm_posting_torrent_updates = false; |\n-|#endif |\n | |\n-|\t\tm_alerts.emplace_alert<state_update_alert>(std::move(status)); |\n-|\t} |\n+|add_fence_job(j); |\n+|} |\n | |\n-|\tvoid session_impl::post_session_stats() |\n+|\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j) |\n |\t{ |\n-|\t\tif (!m_posted_stats_header) |\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\tm_posted_stats_header = true; |\n-|\t\t\tm_alerts.emplace_alert<session_stats_header_alert>(); |\n+|\t\t\tbool const v2_block = i < blocks_in_piece2; |\n+| |\n+|_\b\t_\b\t_\b\t_\bD_\bL_\bO_\bG_\b(_\b\"_\bd_\bo_\b__\bh_\ba_\bs_\bh_\b:_\b _\br_\be_\ba_\bd_\bi_\bn_\bg_\b _\b(_\bp_\bi_\be_\bc_\be_\b:_\b _\b%_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b:_\b _\b%_\bd_\b)_\b\\_\bn_\b\"_\b,_\b _\bi_\bn_\bt_\b(_\bj_\b-_\b>_\bp_\bi_\be_\bc_\be_\b)_\b,_\b _\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bch\bho\bok\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b58\b8 *\b**\b**\b* |\n+|// first reset the number of unchoke slots, because we'll calculate |\n+|\t\t\t// it purely based on the current state of our peers. |\n+|\t\t\tupload_slots = 0; |\n+| |\n+|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n+| |\n+|\t\t\tstd::sort(peers.begin(), peers.end() |\n+|\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t{ return upload_rate_compare(lhs, rhs); }); |\n+| |\n+|\t\t\tfor (auto const* p : peers) |\n+|\t\t\t{ |\n+|\t\t\t\tint const rate = int(p->uploaded_in_last_round() |\n+|\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval)); |\n+| |\n+|\t\t\t\t// always have at least 1 unchoke slot |\n+|\t\t\t\tif (rate < rate_threshold) break; |\n+| |\n+|\t\t\t\t++upload_slots; |\n+| |\n+|rate_threshold += 2048; |\n+|} |\n+|\t\t\t++upload_slots; |\n |\t\t} |\n-|\t\tm_disk_thread->update_stats_counters(m_stats_counters); |\n | |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bd_\bh_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b1_\b6_\b1_\b _\b _\b|_\bf_\ba_\bc_\bt_\bo_\br_\b _\bo_\bu_\bt_\b _\bt_\bh_\bi_\bs_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn f\bfo\bor\br u\bun\bni\bit\bt t\bte\bes\bst\bti\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b51\b16\b61\b1 *\b**\b**\b* |\n-|if (m_settings.get_int(settings_pack::outgoing_port) > 0) |\n+|\t\t// sorts the peers that are eligible for unchoke by download rate and |\n+|\t\t// secondary by total upload. The reason for this is, if all torrents are |\n+|\t\t// being seeded, the download rate will be 0, and the peers we have sent |\n+|\t\t// the least to should be unchoked |\n+| |\n+|\t\t// we use partial sort here, because we only care about the top |\n+|\t\t// upload_slots peers. |\n+| |\n+|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n+| |\n+|\t\tif (sett.get_int(settings_pack::seed_choking_algorithm) |\n+|\t\t\t== settings_pack::round_robin) |\n |\t\t{ |\n-|#ifdef TORRENT_WINDOWS |\n-|\t\t\ts.set_option(exclusive_address_use(true), ec); |\n-|#else |\n-|\t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec); |\n-|#endif |\n-|\t\t\t// ignore errors because the underlying socket may not |\n-|\t\t\t// be opened yet. This happens when we're routing through |\n-|\t\t\t// a proxy. In that case, we don't yet know the address of |\n-|\t\t\t// the proxy server, and more importantly, we don't know |\n-|\t\t\t// the address family of its address. This means we can't |\n-|\t\t\t// open the socket yet. The socks abstraction layer defers |\n-|\t\t\t// opening it. |\n-|\t\t\tec.clear(); |\n-|\t\t\tbind_ep.port(std::uint16_t(next_port())); |\n+|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\n+| |\n+|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n+|\t\t\t\t+ slots, peers.end() |\n+|\t\t\t\t, [pieces](peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t{ return unchoke_compare_rr(lhs, rhs, pieces); }); |\n |\t\t} |\n+|\t\telse if (sett.get_int(settings_pack::seed_choking_algorithm) |\n+|\t\t\t== settings_pack::fastest_upload) |\n+|\t\t{ |\n+|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n+|\t\t\t\t+ slots, peers.end() |\n+|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\b[_\b]_\b(_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\bl_\bh_\bs_\b,_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\br_\bh_\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\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\tif (is_utp(s)) |\n+|\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified); |\n+| |\n+|\t\tload_verified_bits(verified); |\n+| |\n+|\t\toptimize_storage(); |\n+|\t\toptimize_storage_piece_layer(); |\n+|\t} |\n+| |\n+|\tvoid merkle_tree::clear() |\n+|\t{ |\n+|\t\tm_tree.clear(); |\n+|\t\tm_tree.shrink_to_fit(); |\n+|\t\tm_block_verified.clear(); |\n+|\t\tm_mode = mode_t::empty_tree; |\n+|\t} |\n+| |\n+|namespace { |\n+| |\n+|struct identity |\n+|{ |\n+|\t\tbool operator()(bool b) const { return b; } |\n+|\t}; |\n+|} |\n+| |\n+|\tvoid merkle_tree::load_sparse_tree(span<sha256_hash const> t |\n+|\t\t, std::vector<bool> const& mask |\n+|\t\t, std::vector<bool> const& verified) |\n+|\t{ |\n+|\t\tINVARIANT_CHECK; |\n+|\t\tTORRENT_ASSERT(mask.size() == size()); |\n+|\t\tif (size() != mask.size()) return; |\n+| |\n+|\t\tint const first_block = block_layer_start(); |\n+|\t\tint const end_block = first_block + m_num_blocks; |\n+| |\n+|\t\tTORRENT_ASSERT(first_block < int(mask.size())); |\n+|\t\tTORRENT_ASSERT(end_block <= int(mask.size())); |\n+| |\n+|\t\t// if the mask covers all blocks, go straight to block_layer |\n+|\t\t// mode, and validate |\n+|\t\tif (std::all_of(mask.begin() + first_block, mask.begin() + end_block, identity())) |\n |\t\t{ |\n+|\t\t\t// the index in t that points to first_block |\n+|\t\t\tauto const block_index = std::count_if(mask.begin(), mask.begin() + first_block, identity()); |\n | |\n-|utp_socket_impl* impl = nullptr; |\n-|\t\t\ttransport ssl = transport::plaintext; |\n-|#if TORRENT_USE_SSL |\n-|\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr) |\n+|\t\t\t// discrepancy |\n+|\t\t\tif (t.size() < block_index + m_num_blocks) |\n+|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bu_\bs_\bi_\bn_\bg_\b _\bm_\b__\bt_\br_\be_\be_\b _\ba_\bs_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bf_\bi_\bl_\bl_\b _\bt_\bh_\bi_\bs_\b _\bt_\br_\be_\be_\b _\bi_\bn_\bt_\bo_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bca\ban\bn b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by u\bus\bsi\bin\bng\bg m\bm_\b_t\btr\bre\bee\be a\bas\bs s\bst\bto\bor\bra\bag\bge\be t\bto\bo f\bfi\bil\bll\bl t\bth\bhi\bis\bs t\btr\bre\bee\be i\bin\bnt\bto\bo,\b, a\ban\bnd\bd t\bth\bhe\ben\bn c\bcl\ble\bea\bar\br i\bit\bt i\bif\bf t\bth\bhe\be h\bha\bas\bsh\bhe\bes\bs f\bfa\bai\bil\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:3\b31\b19\b9 *\b**\b**\b* |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\t// as we set the hashes of interior nodes, we may be able to validate |\n+|\t\t// block hashes that we had since earlier. Any blocks that can be |\n+|\t\t// validated, and failed, are added to this list |\n+|\t\tadd_hashes_result_t ret; |\n+| |\n+|\t\t// we already have all hashes |\n+|\t\tif (m_mode == mode_t::block_layer) |\n+|\t\t{ |\n+|\t\t\t// since we're already on the block layer mode, we have the whole |\n+|\t\t\t// tree, and we've already reported any pieces as passing that may |\n+|\t\t\t// have existed in the tree when we completed it. At this point no |\n+|\t\t\t// more pieces should be reported as passed |\n+|\t\t\treturn ret; |\n+|\t\t} |\n+| |\n+|\t\tallocate_full(); |\n+| |\n+|int const leaf_count = merkle_num_leafs(int(hashes.size())); |\n+|aux::vector<sha256_hash> tree(merkle_num_nodes(leaf_count)); |\n+|\t\tstd::copy(hashes.begin(), hashes.end(), tree.end() - leaf_count); |\n+| |\n+|\t\t// the end of a file is a special case, we may need to pad the leaf layer |\n+|\t\tif (leaf_count > hashes.size()) |\n+|\t\t{ |\n+|\t\t\tint const leaf_layer_size = num_leafs(); |\n+|\t\t\t// assuming uncle_hashes lead all the way to the root, they tell us |\n+|\t\t\t// how many layers down we are |\n+|\t\t\tint const insert_layer_size = leaf_count << uncle_hashes.size(); |\n+|\t\t\tif (leaf_layer_size != insert_layer_size) |\n |\t\t\t{ |\n-|\t\t\t\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl(); |\n-|\t\t\t\tssl = transport::ssl; |\n+|\t\t\t\tsha256_hash const pad_hash = merkle_pad(leaf_layer_size, insert_layer_size); |\n+|\t\t\t\tfor (int i = int(hashes.size()); i < leaf_count; ++i) |\n+|\t\t\t\t\ttree[tree.end_index() - leaf_count + i] = pad_hash; |\n |\t\t\t} |\n-|\t\t\telse |\n-|#endif |\n-|\t\t\t\timpl = boost::get<utp_stream>(s).get_impl(); |\n+|\t\t} |\n | |\n-|\t\t\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways; |\n-|\t\t\tstd::shared_ptr<listen_socket_t> match; |\n-|\t\t\tfor (auto& ls : m_listen_sockets) |\n+|\t\tmerkle_fill_tree(tree, leaf_count); |\n+| |\n+|\t\tint const base_num_layers = merkle_num_layers(leaf_count); |\n+| |\n+|\t\t// this is the index of the node where we'll insert the root of the |\n+|\t\t// subtree (tree). It's also the hash the uncle_hashes are here to prove |\n+|\t\t// is valid. |\n+|\t\tint const insert_root_idx = dest_start_idx >> base_num_layers; |\n+| |\n+|\t\t// start with validating the proofs, and inserting them as we go. |\n+|\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes)) |\n+|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b{_\b}_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b7_\b _\b _\b _\b _\b|_\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bo_\bu_\bt_\bs_\bi_\bd_\be_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\br_\ba_\bn_\bg_\be_\b _\bm_\ba_\by_\b _\ba_\bl_\bs_\bo_\b _\bf_\ba_\bi_\bl_\b,_\b _\bi_\bf_\b _\bo_\bn_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bu_\bn_\bc_\bl_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bi_\bs_\b _\ba_\bt_\b _\bt_\bh_\be_\b _\bl_\ba_\by_\be_\br_\b _\br_\bi_\bg_\bh_\bt_\b _\ba_\bb_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\ba p\bpi\bie\bec\bce\be o\bou\but\bts\bsi\bid\bde\be o\bof\bf t\bth\bhi\bis\bs r\bra\ban\bng\bge\be m\bma\bay\by a\bal\bls\bso\bo f\bfa\bai\bil\bl,\b, i\bif\bf o\bon\bne\be o\bof\bf t\bth\bhe\be u\bun\bnc\bcl\ble\be h\bha\bas\bsh\bhe\bes\bs i\bis\bs a\bat\bt t\bth\bhe\be l\bla\bay\bye\ber\br r\bri\big\bgh\bht\bt a\bab\bbo\bov\bve\be t\bth\bhe\be b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:3\b36\b67\b7 *\b**\b**\b* |\n+|int const insert_root_idx = dest_start_idx >> base_num_layers; |\n+| |\n+|\t\t// start with validating the proofs, and inserting them as we go. |\n+|\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes)) |\n+|\t\t\treturn {}; |\n+| |\n+|\t\t// first fill in the subtree of known hashes from the base layer |\n+|\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks); |\n+|\t\tauto const first_leaf = merkle_first_leaf(num_leafs); |\n+| |\n+|\t\t// this is the start of the leaf layer of \"tree\". We'll use this |\n+|\t\t// variable to step upwards towards the root |\n+|\t\tint source_cursor = int(tree.size()) - leaf_count; |\n+|\t\t// the running index in the loop |\n+|\t\tint dest_cursor = dest_start_idx; |\n+| |\n+|\t\t// the number of tree levels in a piece hash. 0 means the block layer is |\n+|\t\t// the same as the piece layer |\n+|\t\tint const base = piece_levels(); |\n+| |\n+|for (int layer_size = leaf_count; layer_size != 0; layer_size /= 2) |\n+|{ |\n+|\t\t\tfor (int i = 0; i < layer_size; ++i) |\n |\t\t\t{ |\n-|\t\t\t\t// this is almost, but not quite, like can_route() |\n-|\t\t\t\tif (!(ls->flags & listen_socket_t::proxy) |\n-|\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4()) |\n+|\t\t\t\tint const dst_idx = dest_cursor + i; |\n+|\t\t\t\tint const src_idx = source_cursor + i; |\n+|\t\t\t\tif (has_node(dst_idx)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx]) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until |\n+|\t\t\t\t\t\t// they can be verified. This assert ensures we're at the |\n+|\t\t\t\t\t\t// leaf layer of the file tree |\n+|\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf); |\n+| |\n+|\t\t\t\t\t\tint const pos = dst_idx - first_leaf; |\n+|\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset; |\n+|\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1); |\n+| |\n+|\t\t\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks); |\n+|\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece) |\n+|\t\t\t\t\t\t\tret.failed.back().second.push_back(block); |\n+|\t\t\t\t\t\telse |\n+|\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector<int>{block}); |\n+| |\n+|\t\t\t\t\t\t// now that this hash has been reported as failing, we |\n+|\t\t\t\t\t\t// can clear it. This will prevent it from being |\n+|\t\t\t\t\t\t// reported as failing again. |\n+|\t\t\t\t\t\tm_tree[dst_idx].clear(); |\n+|\t\t\t\t\t} |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\be_\bl_\bs_\be_\b _\bi_\bf_\b _\b(_\bd_\bs_\bt_\b__\bi_\bd_\bx_\b _\b>_\b=_\b _\bf_\bi_\br_\bs_\bt_\b__\bl_\be_\ba_\bf_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b7 |instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\be_\bv_\be_\bl_\b _\bb_\be_\bl_\bo_\bw_\b _\bt_\bh_\be_\b _\br_\bo_\bo_\bt_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\bs_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf o\bov\bve\ber\brw\bwr\bri\bit\bti\bin\bng\bg t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd c\bco\bom\bmp\bpa\bar\bri\bin\bng\bg i\bit\bt a\bag\bga\bai\bin\bns\bst\bt h\bha\bas\bsh\bhe\bes\bs[\b[]\b],\b, w\bwr\bri\bit\bte\be a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs t\bth\bha\bat\bt *\b*v\bva\bal\bli\bid\bda\bat\bte\bes\bs*\b* a\ba t\btr\bre\bee\be b\bby\by j\bju\bus\bst\bt f\bfi\bil\bll\bli\bin\bng\bg i\bit\bt u\bup\bp t\bto\bo t\bth\bhe\be l\ble\bev\bve\bel\bl b\bbe\bel\blo\bow\bw t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd t\bth\bhe\ben\bn |\n+|v\bva\bal\bli\bid\bda\bat\bte\bes\bs i\bit\bt.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:4\b44\b47\b7 *\b**\b**\b* |\n+|&& dest_start_idx < first_piece_idx + num_pieces()) |\n+|\t\t{ |\n+|\t\t\tint const blocks_in_piece = 1 << base; |\n+| |\n+|\t\t\t// it may now be possible to verify the hashes of previously received blocks |\n+|\t\t\t// try to verify as many child nodes of the received hashes as possible |\n+|\t\t\tfor (int i = 0; i < int(hashes.size()); ++i) |\n+|\t\t\t{ |\n+|\t\t\t\tint const piece = dest_start_idx + i; |\n+|\t\t\t\tif (piece - first_piece_idx >= num_pieces()) |\n+|\t\t\t\t\tbreak; |\n+|\t\t\t\t// the first block in this piece |\n+|\t\t\t\tint const block_idx = merkle_get_first_child(piece, base); |\n+| |\n+|\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks); |\n+|\t\t\t\tif (std::any_of(m_tree.begin() + block_idx |\n+|\t\t\t\t\t, m_tree.begin() + block_end_idx |\n+|\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); })) |\n |\t\t\t\t\tcontinue; |\n-|\t\t\t\tif (ls->ssl != ssl) continue; |\n-|\t\t\t\tif (!(ls->flags & listen_socket_t::local_network)) |\n-|\t\t\t\t\twith_gateways.push_back(ls); |\n | |\n-|\t\t\t\tif (ls->flags & listen_socket_t::proxy |\n-|\t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask)) |\n+|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n+|if (m_tree[piece] != hashes[i]) |\n |\t\t\t\t{ |\n-|\t\t\t\t\t// is this better than the previous match? |\n-|\t\t\t\t\tmatch = ls; |\n-|_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b8_\b0_\b _\b _\b|_\br_\be_\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bef\bfa\bac\bct\bto\bor\br,\b, m\bmo\bov\bve\be t\bth\bhe\be s\bst\bto\bor\bra\bag\bge\be t\bto\bo d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b58\b88\b80\b0 *\b**\b**\b* |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tsession_log(\"not starting DHT, outstanding router lookups: %d\" |\n-|\t\t\t\t, m_outstanding_router_lookups); |\n-|#endif |\n-|\t\t\treturn; |\n-|\t\t} |\n+|\t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx); |\n+|\t\t\t\t\t// write back the correct hash |\n+|\t\t\t\t\tm_tree[piece] = hashes[i]; |\n+|\t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece()); |\n | |\n-|\t\tif (m_abort) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tsession_log(\"not starting DHT, aborting\"); |\n-|#endif |\n-|\t\t\treturn; |\n+|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n+|\t\t\t\t\t// block hashes, and we can't know which block failed |\n+|\t\t\t\t\t// this will cause the block hashes to be requested |\n+|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n+|\t\t\t\t\t\t, std::vector<int>()); |\n+|\t\t\t\t} |\n+|\t\t\t\telse |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset); |\n+|\t\t\t\t\t// record that these block hashes are correct! |\n+|\t\t\t\t\tint const leafs_start = block_idx - block_layer_start(); |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bl_\be_\ba_\bf_\bs_\b__\be_\bn_\bd_\b _\b=_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bi_\bn_\b(_\bm_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b,_\b _\bl_\be_\ba_\bf_\bs_\b__\bs_\bt_\ba_\br_\bt_\b _\b+_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:4\b47\b71\b1 *\b**\b**\b* |\n+|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n+|\t\t\t\tif (m_tree[piece] != hashes[i]) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx); |\n+|\t\t\t\t\t// write back the correct hash |\n+|\t\t\t\t\tm_tree[piece] = hashes[i]; |\n+|\t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece()); |\n+| |\n+|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n+|\t\t\t\t\t// block hashes, and we can't know which block failed |\n+|\t\t\t\t\t// this will cause the block hashes to be requested |\n+|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n+|\t\t\t\t\t\t, std::vector<int>()); |\n+|\t\t\t\t} |\n+|\t\t\t\telse |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset); |\n+|\t\t\t\t\t// record that these block hashes are correct! |\n+|\t\t\t\t\tint const leafs_start = block_idx - block_layer_start(); |\n+|\t\t\t\t\tint const leafs_end = std::min(m_num_blocks, leafs_start + blocks_in_piece); |\n+|for (int k = leafs_start; k < leafs_end; ++k) |\n+|m_block_verified.set_bit(k); |\n+|\t\t\t\t} |\n+|\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0); |\n+|\t\t\t} |\n |\t\t} |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\" |\n-|\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups); |\n+|\t\toptimize_storage(); |\n+| |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tstd::tuple<merkle_tree::set_block_result, int, int> merkle_tree::set_block(int const block_index |\n+|\t\t, sha256_hash const& h) |\n+|\t{ |\n+|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n+|\t\tINVARIANT_CHECK; |\n |#endif |\n+|\t\tTORRENT_ASSERT(block_index < m_num_blocks); |\n | |\n-|m_dht_storage = m_dht_storage_constructor(m_settings); |\n-|m_dht = std::make_shared<dht::dht_tracker>( |\n-|\t\t\tstatic_cast<dht::dht_observer*>(this) |\n-|\t\t\t, m_io_context |\n-|\t\t\t, [this](aux::listen_socket_handle const& sock |\n-|\t\t\t\t, udp::endpoint const& ep |\n-|\t\t\t\t, span<char const> p |\n-|\t\t\t\t, error_code& ec |\n-|\t\t\t\t, udp_send_flags_t const flags) |\n-|\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); } |\n-|\t\t\t, m_settings |\n-|\t\t\t, m_stats_counters |\n-|\t\t\t, *m_dht_storage |\n-|\t\t\t, std::move(m_dht_state)); |\n+|\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks); |\n+|\t\tauto const first_leaf = merkle_first_leaf(num_leafs); |\n+|\t\tauto const block_tree_index = first_leaf + block_index; |\n | |\n-|\t\tfor (auto& s : m_listen_sockets) |\n+|\t\tif (blocks_verified(block_index, 1)) |\n |\t\t{ |\n-|\t\t\tif (s->ssl != transport::ssl |\n-|\t\t\t\t&& !(s->flags & listen_socket_t::local_network)) |\n-|\t\t\t{ |\n-|\t\t\t\tm_dht->new_socket(s); |\n-|\t\t\t} |\n+|\t\t\t// if this blocks's hash is already known, check the passed-in hash against it |\n+|\t\t\tif (compare_node(block_tree_index, h)) |\n+|\t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1); |\n+|\t\t\telse |\n+|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\bd_\b:_\b:_\bm_\ba_\bk_\be_\b__\bt_\bu_\bp_\bl_\be_\b(_\bs_\be_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\be_\bs_\bu_\bl_\bt_\b:_\b:_\bb_\bl_\bo_\bc_\bk_\b__\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b,_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bd_\be_\bx_\b,_\b _\b1_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b1_\b4_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bd_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\b _\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bru\buc\bct\btu\bur\bre\bed\bd b\bbi\bin\bnd\bdi\bin\bng\bg i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b51\b14\b4 *\b**\b**\b* |\n+|auto const first_leaf = merkle_first_leaf(num_leafs); |\n+|\t\tauto const block_tree_index = first_leaf + block_index; |\n+| |\n+|\t\tif (blocks_verified(block_index, 1)) |\n+|\t\t{ |\n+|\t\t\t// if this blocks's hash is already known, check the passed-in hash against it |\n+|\t\t\tif (compare_node(block_tree_index, h)) |\n+|\t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1); |\n+|\t\t\telse |\n+|\t\t\t\treturn std::make_tuple(set_block_result::block_hash_failed, block_index, 1); |\n |\t\t} |\n | |\n-|\t\tfor (auto const& n : m_dht_router_nodes) |\n+|\t\tallocate_full(); |\n+| |\n+|\t\tm_tree[block_tree_index] = h; |\n+| |\n+|\t\t// to avoid wasting a lot of time hashing nodes only to discover they |\n+|\t\t// cannot be verified, check first to see if the root of the largest |\n+|\t\t// computable subtree is known |\n+| |\n+|int leafs_start; |\n+|int leafs_size; |\n+|\t\tint root_index; |\n+|\t\tstd::tie(leafs_start, leafs_size, root_index) = |\n+|\t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\n+| |\n+|\t\t// if the root node is unknown the hashes cannot be verified yet |\n+|\t\tif (m_tree[root_index].is_all_zeros()) |\n+|\t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size); |\n+| |\n+|\t\t// save the root hash because merkle_fill_tree will overwrite it |\n+|\t\tsha256_hash const root = m_tree[root_index]; |\n+|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n+| |\n+|\t\tif (root != m_tree[root_index]) |\n |\t\t{ |\n-|\t\t\tm_dht->add_router_node(n); |\n+|\t\t\t// hash failure, clear all the internal nodes |\n+|\t\t\t// the whole piece failed the hash check. Clear all block hashes |\n+|\t\t\t// in this piece and report a hash failure |\n+|\t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n+|\t\t\tm_tree[root_index] = root; |\n+|\t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size); |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b53\b39\b9 *\b**\b**\b* |\n+|merkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\n+| |\n+|\t\t// if the root node is unknown the hashes cannot be verified yet |\n+|\t\tif (m_tree[root_index].is_all_zeros()) |\n+|\t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size); |\n+| |\n+|\t\t// save the root hash because merkle_fill_tree will overwrite it |\n+|\t\tsha256_hash const root = m_tree[root_index]; |\n+|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n+| |\n+|\t\tif (root != m_tree[root_index]) |\n+|\t\t{ |\n+|\t\t\t// hash failure, clear all the internal nodes |\n+|\t\t\t// the whole piece failed the hash check. Clear all block hashes |\n+|\t\t\t// in this piece and report a hash failure |\n+|\t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n+|\t\t\tm_tree[root_index] = root; |\n+|\t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size); |\n |\t\t} |\n | |\n-|\t\tfor (auto const& n : m_dht_nodes) |\n-|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b7_\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bf_\bl_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bts\bs t\bth\bha\bat\bt n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bar\bre\be s\bst\bti\bil\bll\bl i\bin\bn f\bfl\bli\big\bgh\bht\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b62\b26\b67\b7 *\b**\b**\b* |\n-|if (!m_dht) return; |\n-|\t\tm_dht->direct_request(ep, e, std::bind(&on_direct_response, std::ref(m_alerts), userdata, _1)); |\n+|int const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size); |\n+|for (int i = leafs_start; i < leafs_end; ++i) |\n+|\t\t\tm_block_verified.set_bit(i); |\n+| |\n+|\t\t// attempting to optimize storage is quite costly, only do it if we have |\n+|\t\t// a reason to believe it might have an effect |\n+|\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros()) |\n+|\t\t\toptimize_storage(); |\n+| |\n+|\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size); |\n |\t} |\n | |\n-|#endif |\n+|\tstd::size_t merkle_tree::size() const |\n+|\t{ |\n+|\t\treturn static_cast<std::size_t>(merkle_num_nodes(merkle_num_leafs(m_num_blocks))); |\n+|\t} |\n | |\n-|\tbool session_impl::is_listening() const |\n+|\tint merkle_tree::num_pieces() const |\n |\t{ |\n-|\t\treturn !m_listen_sockets.empty(); |\n+|\t\tint const ps = blocks_per_piece(); |\n+|\t\tTORRENT_ASSERT(ps > 0); |\n+|\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log; |\n |\t} |\n | |\n-|\tsession_impl::~session_impl() |\n+|\tint merkle_tree::block_layer_start() const |\n |\t{ |\n-|\t\t// since we're destructing the session, no more alerts will make it out to |\n-|\t\t// the user. So stop posting them now |\n-|\t\tm_alerts.set_alert_mask({}); |\n-|\t\tm_alerts.set_notify_function({}); |\n+|\t\tint const num_leafs = merkle_num_leafs(m_num_blocks); |\n+|\t\tTORRENT_ASSERT(num_leafs > 0); |\n+|\t\treturn merkle_first_leaf(num_leafs); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b _\bb_\by_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\be_\bi_\bt_\bh_\be_\br_\b _\bs_\bt_\ba_\bt_\bi_\bc_\b__\ba_\bs_\bs_\be_\br_\bt_\b(_\bs_\bt_\bd_\b:_\b:_\bi_\bs_\b__\bn_\bo_\bt_\bh_\br_\bo_\bw_\b__\bm_\bo_\bv_\be_\b__\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b:_\b:_\bv_\ba_\bl_\bu_\be_\b _\b,_\b _\b\"_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpr\bre\be C\bC+\b++\b+1\b17\b7,\b, G\bGC\bCC\bC a\ban\bnd\bd m\bms\bsv\bvc\bc d\bdo\boe\bes\bs n\bno\bot\bt m\bma\bak\bke\be s\bst\btd\bd:\b::\b:s\bst\btr\bri\bin\bng\bg n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be,\b, w\bwh\bhi\bic\bch\bh m\bme\bea\ban\bns\bs n\bno\bo t\bty\byp\bpe\be c\bco\bon\bnt\bta\bai\bin\bni\bin\bng\bg a\ba s\bst\btr\bri\bin\bng\bg w\bwi\bil\bll\bl b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be b\bby\by d\bde\bef\bfa\bau\bul\blt\bt e\bei\bit\bth\bhe\ber\br |\n+|s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_m\bmo\bov\bve\be_\b_a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:7\b78\b8 *\b**\b**\b* |\n+|DECL_FLAG(sequential_download); |\n+|\t\t\tDECL_FLAG(pinned); |\n+|\t\t\tDECL_FLAG(stop_when_ready); |\n+|\t\t\tDECL_FLAG(override_trackers); |\n+|\t\t\tDECL_FLAG(override_web_seeds); |\n+|\t\t\tDECL_FLAG(need_save_resume); |\n+|\t\t\tDECL_FLAG(override_resume_data); |\n+|\t\t\tDECL_FLAG(merge_resume_trackers); |\n+|\t\t\tDECL_FLAG(use_resume_save_path); |\n+|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n+|\t\t\tDECL_FLAG(default_flags); |\n+|#undef DECL_FLAG |\n+|#endif // TORRENT_ABI_VERSION |\n | |\n-|\t\t// this is not allowed to be the network thread! |\n-|//\t\tTORRENT_ASSERT(is_not_thread()); |\n+|\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n | |\n-|// this can happen if we end the io_context run loop with an exception |\n-|\t\tm_connections.clear(); |\n-|\t\tfor (auto& t : m_torrents) |\n-|\t\t{ |\n-|\t\t\tt->panic(); |\n-|\t\t\tt->abort(); |\n-|\t\t} |\n-|\t\tm_torrents.clear(); |\n+|\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n | |\n-|\t\t// this has probably been called already, but in case of sudden |\n-|\t\t// termination through an exception, it may not have been done |\n-|\t\tabort_stage2(); |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs w\bwa\bas\bs n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b*|\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:8\b84\b4 *\b**\b**\b* |\n+|DECL_FLAG(pinned); |\n+|\t\t\tDECL_FLAG(stop_when_ready); |\n+|\t\t\tDECL_FLAG(override_trackers); |\n+|\t\t\tDECL_FLAG(override_web_seeds); |\n+|\t\t\tDECL_FLAG(need_save_resume); |\n+|\t\t\tDECL_FLAG(override_resume_data); |\n+|\t\t\tDECL_FLAG(merge_resume_trackers); |\n+|\t\t\tDECL_FLAG(use_resume_save_path); |\n+|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n+|\t\t\tDECL_FLAG(default_flags); |\n+|#undef DECL_FLAG |\n+|#endif // TORRENT_ABI_VERSION |\n | |\n-|#if defined TORRENT_ASIO_DEBUGGING |\n-|\t\tFILE* f = fopen(\"wakeups.log\", \"w+\"); |\n-|\t\tif (f != nullptr) |\n-|\t\t{ |\n-|\t\t\ttime_point m = min_time(); |\n-|\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp; |\n-|\t\t\ttime_point prev = m; |\n-|\t\t\tstd::uint64_t prev_csw = 0; |\n-|\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches; |\n-|\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\"); |\n-|\t\t\tfor (wakeup_t const& w : _wakeups) |\n-|\t\t\t{ |\n-|\t\t\t\tbool const idle_wakeup = w.context_switches > prev_csw; |\n-|\t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\" |\n-|\t\t\t\t\t, total_microseconds(w.timestamp - m) |\n-|\t\t\t\t\t, total_microseconds(w.timestamp - prev) |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bw_\b._\bc_\bo_\bn_\bt_\be_\bx_\bt_\b__\bs_\bw_\bi_\bt_\bc_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+|\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+| |\n+| |\n+|namespace aux { |\n+| |\n+|\t// returns whether this add_torrent_params object has \"resume-data\", i.e. |\n+|\t// information about which pieces we have. |\n+|\tbool contains_resume_data(add_torrent_params const& atp) |\n+|\t{ |\n+|\t\treturn !atp.have_pieces.empty() |\n+|\t\t\t|| (atp.flags & torrent_flags::seed_mode); |\n+|\t} |\n+|} |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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@@ -7448,122 +8484,175 @@\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_\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+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |this should be the global download rate |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be t\bth\bhe\be g\bgl\blo\bob\bba\bal\bl d\bdo\bow\bwn\bnl\blo\boa\bad\bd r\bra\bat\bte\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b11\b10\b05\b5 *\b**\b**\b* |\n+|\t\tint rate = 0; |\n | |\n-|\t// 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// 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// 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-|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<packet_buffer::index_type>(i)); |\n-|\t\tif (!p) continue; |\n-|\t\tif (!p->need_resend) continue; |\n-|\t\tif (!resend_packet(p)) |\n+|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n+|} |\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+|\t\t// avoid division by zero |\n+|\t\tif (rate < 50) rate = 50; |\n | |\n-|\t// MTU DISCOVERY |\n+|\t\t// average of current rate and peak |\n+|//\t\trate = (rate + m_download_rate_peak) / 2; |\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/_\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<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\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n+|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n |\t} |\n-|#endif |\n | |\n-|\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const |\n+|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n |\t{ |\n-|\t\tasync_call(&torrent::set_file_priority, index, priority); |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tm_statistics.add_stat(downloaded, uploaded); |\n |\t} |\n | |\n-|\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const |\n+|\tsha1_hash peer_connection::associated_info_hash() const |\n |\t{ |\n-|\t\treturn sync_call_ret<download_priority_t>(dont_download, &torrent::file_priority, index); |\n-|\t} |\n-| |\n-|void torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const |\n-|{ |\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\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+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bt_\bh_\be_\br_\bw_\bi_\bs_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b _\bi_\bs_\bn_\b'_\bt_\b _\br_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |sort the allowed fast set in priority order |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bso\bor\brt\bt t\bth\bhe\be a\bal\bll\blo\bow\bwe\bed\bd f\bfa\bas\bst\bt s\bse\bet\bt i\bin\bn p\bpr\bri\bio\bor\bri\bit\bty\by o\bor\brd\bde\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b35\b53\b36\b6 *\b**\b**\b* |\n+|\t\t// if the peer has the piece and we want |\n+|\t\t// to download it, request it |\n+|\t\tif (index < m_have_piece.end_index() |\n+|\t\t\t&& m_have_piece[index] |\n+|\t\t\t&& !t->have_piece(index) |\n+|\t\t\t&& t->valid_metadata() |\n+|\t\t\t&& t->has_picker() |\n+|\t\t\t&& t->picker().piece_priority(index) > dont_download) |\n+|\t\t{ |\n+|\t\t\tt->peer_is_interesting(*this); |\n+|\t\t} |\n |\t} |\n | |\n-|\tstd::vector<download_priority_t> torrent_handle::get_file_priorities() const |\n+|\tstd::vector<piece_index_t> const& peer_connection::allowed_fast() |\n |\t{ |\n-|\t\taux::vector<download_priority_t, file_index_t> ret; |\n-|\t\tauto retp = &ret; |\n-|\t\tsync_call(&torrent::file_priorities, retp); |\n-|\t\treturn TORRENT_RVO(ret); |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tstd::shared_ptr<torrent> t = m_torrent.lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n | |\n-|// ============ start deprecation =============== |\n+|return m_allowed_fast; |\n+|} |\n | |\n-|\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const |\n+|\tbool peer_connection::can_request_time_critical() 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\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-|\tstd::vector<int> torrent_handle::file_priorities() const |\n+|\tbool peer_connection::make_time_critical(piece_block const& block) |\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+|\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+|_\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/_\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b _\b _\b|_\bs_\bi_\bm_\bu_\bl_\ba_\bt_\bo_\br_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsi\bim\bmu\bul\bla\bat\bto\bor\br s\bsu\bup\bpp\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bip\bp_\b_n\bno\bot\bti\bif\bfi\bie\ber\br.\b.c\bcp\bpp\bp:\b:4\b41\b1 *\b**\b**\b* |\n+| from this software without specific prior written permission. |\n+| |\n+|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n+| |\n+|*/ |\n+| |\n+|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n+| |\n+|#if defined TORRENT_BUILD_SIMULATOR |\n+|#elif TORRENT_USE_NETLINK |\n+|#include \"libtorrent/netlink.hpp\" |\n+|#include \"libtorrent/socket.hpp\" |\n+|#include <array> |\n+|#include <unordered_map> |\n+|#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY |\n+|#include <SystemConfiguration/SystemConfiguration.h> |\n+|#elif defined TORRENT_WINDOWS |\n+|#include \"libtorrent/aux_/throw.hpp\" |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include <iphlpapi.h> |\n+|#ifdef TORRENT_WINRT |\n+|#include <netioapi.h> |\n+|#endif |\n+|#include <mutex> |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|#endif |\n+| |\n+|#include \"libtorrent/aux_/netlink_utils.hpp\" |\n+| |\n+|namespace libtorrent { namespace aux { |\n+| |\n+|namespace { |\n+| |\n+|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n+|\t!defined TORRENT_BUILD_SIMULATOR |\n+| |\n+|// common utilities for Mac and iOS |\n+|template <typename T> void CFRefRetain(T h) { CFRetain(h); } |\n+|_\bt_\be_\bm_\bp_\bl_\ba_\bt_\be_\b _\b<_\bt_\by_\bp_\be_\bn_\ba_\bm_\be_\b _\bT_\b>_\b _\bv_\bo_\bi_\bd_\b _\bC_\bF_\bR_\be_\bf_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bT_\b _\bh_\b)_\b _\b{_\b _\bC_\bF_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bh_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\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@@ -7664,122 +8753,185 @@\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/ |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<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+|_\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-|std::list<address> 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+|\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\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\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\tclose(); |\n-|\t\treturn true; |\n-|\t} |\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-|\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+|\t// first see if we need to resend any packets |\n | |\n-|\t\tif (transaction != m_transaction_id) |\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<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\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent); |\n-|\t\t\treturn false; |\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\tif (action == action_t::error) |\n+|\t\t// don't fast-resend this packet |\n+|\t\tif (m_fast_resend_seq_nr == i) |\n+|\t\t\tm_fast_resend_seq_nr = (m_fast_resend_seq_nr + 1) & ACK_MASK; |\n+|\t} |\n+| |\n+|\t// MTU DISCOVERY |\n+| |\n+|\t// under these conditions, the next packet we send should be an MTU probe. |\n+|\t// MTU probes get to use the mid-point packet size, whereas other packets |\n+|\t// use a conservative packet size of the largest known to work. The reason |\n+|\t// for the cwnd condition is to make sure the probe is surrounded by non- |\n+|\t// probes, to be able to distinguish a loss of the probe vs. just loss in |\n+|_\b\t_\b/_\b/_\b _\bg_\be_\bn_\be_\br_\ba_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:|this should not be heap allocated, sockets should be movable |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be h\bhe\bea\bap\bp a\bal\bll\blo\boc\bca\bat\bte\bed\bd,\b, s\bso\boc\bck\bke\bet\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bmo\bov\bva\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b04\b4 *\b**\b**\b* |\n+|//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str()); |\n+| |\n+|\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp)) |\n+|\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\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\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<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 (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/_\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+|\t\tif (ph->get_type() == ST_RESET) return false; |\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+|\t\t// #error send reset |\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+|\t\treturn false; |\n+|\t} |\n | |\n-|\t\t\t\t\tif (token.empty()) continue; |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b:_\b:_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bb_\be_\b__\bw_\br_\bi_\bt_\ba_\bb_\bl_\be_\b(_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bi_\bm_\bp_\bl_\b*_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |move stats_counter_t out of counters |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br_\b_t\bt o\bou\but\bt o\bof\bf c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |should bittorrent keep-alive messages have a counter too? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt k\bke\bee\bep\bp-\b-a\bal\bli\biv\bve\be m\bme\bes\bss\bsa\bag\bge\bes\bs h\bha\bav\bve\be a\ba c\bco\bou\bun\bnt\bte\ber\br t\bto\boo\bo?\b? *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |It would be nice if this could be an internal type. default_disk_constructor depends on it now |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be a\ban\bn i\bin\bnt\bte\ber\brn\bna\bal\bl t\bty\byp\bpe\be.\b. d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br d\bde\bep\bpe\ben\bnd\bds\bs o\bon\bn i\bit\bt n\bno\bow\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.c\bcp\bpp\bp:\b:4\b42\b2 *\b**\b**\b* |\n+|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\t\t\t\t\tint idx1, idx2; |\n-|constexpr int max_index = 10000; // can't risk out of memory |\n+|*/ |\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+|#include \"libtorrent/performance_counters.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n+|#include <cstring> // for memset |\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+|namespace libtorrent { |\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+|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-|\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+|\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+|_\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/_\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@@ -7825,773 +8977,312 @@\n |\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0); |\n | |\n |\t\tfor (int i = req.index; i < req.index + req.count; i += 512) |\n |\t\t{ |\n |\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time(); |\n |\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests; |\n |_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b2_\b _\b _\b _\b|_\bh_\bo_\bw_\b _\bd_\bo_\b _\bw_\be_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bc_\bh_\ba_\bn_\bg_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* h\bho\bow\bw d\bdo\bo w\bwe\be d\bde\bea\bal\bl w\bwi\bit\bth\bh o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs c\bch\bha\ban\bng\bgi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b92\b2 *\b**\b**\b* |\n-|// connections. If it fails, we'll |\n-|\t\t// retry with encryption |\n-|\t\t, pe_support(false) |\n-|#endif |\n-|\t\t, is_v6_addr(false) |\n-|#if TORRENT_USE_I2P |\n-|\t\t, is_i2p_addr(false) |\n-|#endif |\n-|\t\t, on_parole(false) |\n-|\t\t, banned(false) |\n-|\t\t, supports_utp(true) // assume peers support utp |\n-|\t\t, confirmed_supports_utp(false) |\n-|\t\t, supports_holepunch(false) |\n-|\t\t, web_seed(false) |\n-|\t\t, protocol_v2(false) |\n-|\t{} |\n-| |\n-|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|if (peer_rank == 0) |\n-|peer_rank = peer_priority( |\n-|\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port)) |\n-|\t\t\t\t, tcp::endpoint(this->address(), this->port)); |\n-|\t\treturn peer_rank; |\n-|\t} |\n+|_\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 <algorithm> |\n+|#include <random> |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\tstd::string torrent_peer::to_string() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|#if TORRENT_USE_I2P |\n-|\t\tif (is_i2p_addr) return dest().to_string(); |\n-|#endif // TORRENT_USE_I2P |\n-|\t\treturn address().to_string(); |\n-|\t} |\n-|#endif |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\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-|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+|#include <boost/multiprecision/integer.hpp> |\n+|#include <boost/multiprecision/cpp_int.hpp> |\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+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n | |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t\treturn false; |\n-|\t} |\n+|#include \"libtorrent/random.hpp\" |\n+|#include \"libtorrent/aux_/alloca.hpp\" |\n+|#include \"libtorrent/pe_crypto.hpp\" |\n+|#include \"libtorrent/hasher.hpp\" |\n | |\n-|\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-|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n-|} |\n+|namespace libtorrent { |\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+|\tnamespace mp = boost::multiprecision; |\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+|\tnamespace { |\n+|key_t const dh_prime |\n+|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n |\t} |\n | |\n-|\tvoid async_release_files(storage_index_t, std::function<void()> handler) override |\n+|\tstd::array<char, 96> export_key(key_t const& k) |\n |\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n-|\t} |\n+|\t\tstd::array<char, 96> ret; |\n+|\t\tauto* begin = reinterpret_cast<std::uint8_t*>(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-|\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+|namespace libtorrent { |\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/_\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+|\tnamespace mp = boost::multiprecision; |\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+|\tnamespace { |\n+|\t\tkey_t const dh_prime |\n+|\t\t\t |\n+|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n |\t} |\n | |\n-|\tchar const* tracker_error_alert::failure_reason() const |\n+|\tstd::array<char, 96> export_key(key_t const& k) |\n |\t{ |\n-|\t\treturn m_alloc.get().ptr(m_msg_idx); |\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-|\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+|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} |\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+|\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-|\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+|\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-|\tchar const* tracker_warning_alert::warning_message() const |\n+|\t// Set the prime P and the generator, generate local public key |\n+|\tdh_key_exchange::dh_key_exchange() |\n |\t{ |\n-|\t\treturn m_alloc.get().ptr(m_msg_idx); |\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-|\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+|\t\t// create local key (random) |\n+|\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end()); |\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\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/_\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-|\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+|\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-|\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+|add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg) |\n |{ |\n-|\t\tTORRENT_ASSERT(!u.empty()); |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared<torrent_info>(filename, cfg); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|\tstd::string scrape_reply_alert::message() const |\n+|\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg) |\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\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-|#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+|\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-|#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+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:_\b8_\b8_\b7_\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bc_\bo_\bn_\bs_\bi_\bd_\be_\br_\be_\bd_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be c\bco\bon\bns\bsi\bid\bde\ber\bre\bed\bd a\ba f\bfa\bai\bil\blu\bur\bre\be,\b, a\ban\bnd\bd t\bth\bhe\be .\b.t\bto\bor\brr\bre\ben\bnt\bt f\bfi\bil\ble\be r\bre\bej\bje\bec\bct\bte\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:8\b88\b87\b7 *\b**\b**\b* |\n+|std::string ext = extension(filename); |\n+|\t\t\tint cnt = 0; |\n+|\t\t\tfor (;;) |\n+|\t\t\t{ |\n+|\t\t\t\t++cnt; |\n+|\t\t\t\tchar new_ext[50]; |\n+|\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str()); |\n+|\t\t\t\tfilename = base + new_ext; |\n | |\n-|\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+|\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-|\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\t\tcopy_on_write(); |\n+|\t\t\tm_files.rename_file(i, filename); |\n+|\t\t} |\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+|\tvoid torrent_info::remap_files(file_storage const& f) |\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+|\t\tINVARIANT_CHECK; |\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+|\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-|\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\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-|\tstd::string tracker_reply_alert::message() const |\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-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n+|\t\tstd::vector<char> tmp; |\n+|\t\tstd::back_insert_iterator<std::vector<char>> 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__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b9_\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b4_\b,_\b _\bu_\bs_\be_\b _\bu_\bn_\bi_\bq_\bu_\be_\b__\bp_\bt_\br_\b _\ba_\bn_\bd_\b _\bm_\bo_\bv_\be_\b _\bi_\bt_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b14\b4,\b, u\bus\bse\be u\bun\bni\biq\bqu\bue\be_\b_p\bpt\btr\br a\ban\bnd\bd m\bmo\bov\bve\be i\bit\bt i\bin\bnt\bto\bo t\bth\bhe\be l\bla\bam\bmb\bbd\bda\ba *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:4\b49\b99\b9 *\b**\b**\b* |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\t\tif (params.save_path.empty()) |\n+|\t\t\taux::throw_ex<system_error>(error_code(errors::invalid_save_path)); |\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+|\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty()); |\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+|#if TORRENT_ABI_VERSION < 3 |\n+|\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti) |\n+|\t\t\tparams.info_hashes.v1 = params.info_hash; |\n |#endif |\n-|\t} |\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+|\t\t// the internal torrent object keeps and mutates state in the |\n+|\t\t// torrent_info object. We can't let that leak back to the client |\n+|\t\tif (params.ti) |\n+|\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti); |\n | |\n-|\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+|\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw |\n+|\t\t// pointer for now. async_call uses a lambda expression to post the call |\n+|\t\t// to the main thread |\n+|auto* p = new add_torrent_params(std::move(params)); |\n+|auto guard = aux::scope_end([p]{ delete p; }); |\n+|\t\tp->save_path = complete(p->save_path); |\n+| |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\thandle_backwards_compatible_resume_data(*p); |\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\tasync_call(&session_impl::async_add_torrent, p); |\n+|\t\tguard.disarm(); |\n |\t} |\n | |\n-|\tstd::string hash_failed_alert::message() const |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t// if the torrent already exists, this will throw duplicate_torrent |\n+|\ttorrent_handle session_handle::add_torrent( |\n+|\t\ttorrent_info const& ti |\n+|\t\t, std::string const& save_path |\n+|\t\t, entry const& resume_data |\n+|\t\t, storage_mode_t storage_mode |\n+|\t\t, bool const add_paused) |\n |\t{ |\n-|#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/_\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<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-|// 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-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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<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\tadd_torrent_params p; |\n+|\t\tp.ti = std::make_shared<torrent_info>(ti); |\n+|\t\tp.save_path = save_path; |\n+|\t\tif (resume_data.type() != entry::undefined_t) |\n |\t\t{ |\n-|\t\t\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\tbencode(std::back_inserter(p.resume_data), resume_data); |\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\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/ |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\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<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-|_\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_\b1_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be t\bth\bhe\be g\bgl\blo\bob\bba\bal\bl d\bdo\bow\bwn\bnl\blo\boa\bad\bd r\bra\bat\bte\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b11\b10\b05\b5 *\b**\b**\b* |\n-|\t\tint rate = 0; |\n-| |\n-|\t\t// if we haven't received any data recently, the current download rate |\n-|\t\t// is not representative |\n-|\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0) |\n-|\t\t{ |\n-|\t\t\trate = m_download_rate_peak; |\n-|\t\t} |\n-|\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5) |\n-|\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000) |\n-|\t\t{ |\n-|\t\t\t// if we're have only been unchoked for a short period of time, |\n-|\t\t\t// we don't know what rate we can get from this peer. Instead of assuming |\n-|\t\t\t// the lowest possible rate, assume the average. |\n-| |\n-|\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]); |\n-|\t\t\t// avoid division by 0 |\n-|\t\t\tif (peers_with_requests == 0) peers_with_requests = 1; |\n-| |\n-|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n-|} |\n |\t\telse |\n |\t\t{ |\n-|\t\t\t// current download rate in bytes per seconds |\n-|\t\t\trate = m_statistics.transfer_rate(stat::download_payload); |\n-|\t\t} |\n-| |\n-|\t\t// avoid division by zero |\n-|\t\tif (rate < 50) rate = 50; |\n-| |\n-|\t\t// average of current rate and peak |\n-|//\t\trate = (rate + m_download_rate_peak) / 2; |\n-| |\n-|\t\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n-|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n-|\t} |\n-| |\n-|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tm_statistics.add_stat(downloaded, uploaded); |\n-|\t} |\n-| |\n-|\tsha1_hash peer_connection::associated_info_hash() const |\n-|\t{ |\n-|\t\tstd::shared_ptr<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-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bt_\bh_\be_\br_\bw_\bi_\bs_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b _\bi_\bs_\bn_\b'_\bt_\b _\br_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |sort the allowed fast set in priority order |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bso\bor\brt\bt t\bth\bhe\be a\bal\bll\blo\bow\bwe\bed\bd f\bfa\bas\bst\bt s\bse\bet\bt i\bin\bn p\bpr\bri\bio\bor\bri\bit\bty\by o\bor\brd\bde\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b35\b53\b36\b6 *\b**\b**\b* |\n-|\t\t// if the peer has the piece and we want |\n-|\t\t// to download it, request it |\n-|\t\tif (index < m_have_piece.end_index() |\n-|\t\t\t&& m_have_piece[index] |\n-|\t\t\t&& !t->have_piece(index) |\n-|\t\t\t&& t->valid_metadata() |\n-|\t\t\t&& t->has_picker() |\n-|\t\t\t&& t->picker().piece_priority(index) > dont_download) |\n-|\t\t{ |\n-|\t\t\tt->peer_is_interesting(*this); |\n+|\t\t\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-|\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-|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<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-|_\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/ |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 <cstring> // for memset |\n+|std::list<address> 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-|namespace libtorrent { |\n+|\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\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\tclose(); |\n+|\t\treturn true; |\n |\t} |\n | |\n-|\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT |\n+|\tbool udp_tracker_connection::on_scrape_response(span<char const> buf) |\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+|\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-|\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+|\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+|_\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@@ -8852,14 +9543,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+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b2_\b _\b _\b _\b|_\bh_\bo_\bw_\b _\bd_\bo_\b _\bw_\be_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bc_\bh_\ba_\bn_\bg_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* h\bho\bow\bw d\bdo\bo w\bwe\be d\bde\bea\bal\bl w\bwi\bit\bth\bh o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs c\bch\bha\ban\bng\bgi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b92\b2 *\b**\b**\b* |\n+|// connections. If it fails, we'll |\n+|\t\t// retry with encryption |\n+|\t\t, pe_support(false) |\n+|#endif |\n+|\t\t, is_v6_addr(false) |\n+|#if TORRENT_USE_I2P |\n+|\t\t, is_i2p_addr(false) |\n+|#endif |\n+|\t\t, on_parole(false) |\n+|\t\t, banned(false) |\n+|\t\t, supports_utp(true) // assume peers support utp |\n+|\t\t, confirmed_supports_utp(false) |\n+|\t\t, supports_holepunch(false) |\n+|\t\t, web_seed(false) |\n+|\t\t, protocol_v2(false) |\n+|\t{} |\n+| |\n+|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|if (peer_rank == 0) |\n+|peer_rank = peer_priority( |\n+|\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port)) |\n+|\t\t\t\t, tcp::endpoint(this->address(), this->port)); |\n+|\t\treturn peer_rank; |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\tstd::string torrent_peer::to_string() const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|#if TORRENT_USE_I2P |\n+|\t\tif (is_i2p_addr) return dest().to_string(); |\n+|#endif // TORRENT_USE_I2P |\n+|\t\treturn address().to_string(); |\n+|\t} |\n+|#endif |\n+| |\n+|\tstd::int64_t torrent_peer::total_download() const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|\t\tif (connection != nullptr) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n+|\t\t\treturn connection->statistics().total_payload_download(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\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/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b8_\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bca\ban\bn b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:6\b61\b18\b8 *\b**\b**\b* |\n |std::string& attr = e[\"attr\"].string(); |\n |\t\tif (flags & file_storage::flag_pad_file) attr += 'p'; |\n |\t\tif (flags & file_storage::flag_hidden) attr += 'h'; |\n |\t\tif (flags & file_storage::flag_executable) attr += 'x'; |\n@@ -8906,1624 +9651,879 @@\n | |\n |\t\tif (!m_nodes.empty()) |\n |\t\t{ |\n |\t\t\tentry& nodes = dict[\"nodes\"]; |\n |\t\t\tentry::list_type& nodes_list = nodes.list(); |\n |\t\t\tfor (auto const& n : m_nodes) |\n |_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b51\b1 *\b**\b**\b* |\n-|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n-|\t\t\t\twe_have(i); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tset_state(torrent_status::checking_resume_data); |\n-| |\n-|\t\taux::vector<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-|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<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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b96\b64\b4 *\b**\b**\b* |\n-|{ |\n-|\t\t\tresolve_links res(m_torrent_file); |\n-| |\n-|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::shared_ptr<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+|_\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\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-|if (!t->is_seed()) continue; |\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\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n+|\t\t\t\t// make sure all file priorities are set to 0, except the ones |\n+|\t\t\t\t// we specify in the file_priorities |\n+|\t\t\t\tp.flags |= torrent_flags::default_dont_download; |\n | |\n-|\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\tdo |\n |\t\t\t\t{ |\n-|\t\t\t\t\tif (!i.ti) continue; |\n-|\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path |\n-|\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx)); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t} |\n-|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n-|\t\tm_outstanding_check_files = true; |\n-|#endif |\n-| |\n-|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n-|\t\t{ |\n-|\t\t\tm_ses.disk_thread().async_check_files( |\n-|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n-|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n-|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b2_\b8 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b72\b28\b8 *\b**\b**\b* |\n-|// not ready for peers. Except, if we don't have metadata, |\n-|\t\t// we need peers to download from |\n-|\t\tif (!m_files_checked && valid_metadata()) return; |\n-| |\n-|\t\tif (!m_announce_to_lsd) return; |\n+|\t\t\t\t\tstring_view token; |\n+|\t\t\t\t\tstd::tie(token, value) = split_string(value, ','); |\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+|\t\t\t\t\tif (token.empty()) continue; |\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+|\t\t\t\t\tint idx1, idx2; |\n+|constexpr int max_index = 10000; // can't risk out of memory |\n | |\n-|\t\tif (is_paused()) return; |\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\tif (!m_ses.has_lsd()) return; |\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-|#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+|\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// 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\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/_\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-|#ifndef TORRENT_DISABLE_DHT |\n-| |\n-|\tvoid torrent::dht_announce() |\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-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (!m_ses.dht()) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n-|#endif |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\tif (!should_announce_dht()) |\n-|\t\t{ |\n |#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b88\b85\b5 *\b**\b**\b* |\n-|catch (...) { handle_exception(); } |\n+|\t\tsession_log(\"start session\"); |\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+|#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 (e && should_log()) |\n-|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n+|\t\tif (ec) session_log(\"SSL set_default verify_paths failed: %s\", ec.message().c_str()); |\n+|\t\tec.clear(); |\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+|#if defined TORRENT_WINDOWS && defined TORRENT_USE_OPENSSL && !defined TORRENT_WINRT |\n+|X509_STORE* store = X509_STORE_new(); |\n+|if (store) |\n |\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n+|\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\"); |\n+|\t\t\t// this is best effort |\n+|\t\t\tif (system_store) |\n |\t\t\t{ |\n-|\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str()); |\n+|\t\t\t\tCERT_CONTEXT const* ctx = nullptr; |\n+|\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded); |\n+|\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded); |\n+|\t\t\t\t\t// this is best effort |\n+|\t\t\t\t\tif (!x509) continue; |\n+|\t\t\t\t\tX509_STORE_add_cert(store, x509); |\n+|\t\t\t\t\tX509_free(x509); |\n+|\t\t\t\t} |\n+|\t\t\t\tCertFreeCertificateContext(ctx); |\n+|\t\t\t\tCertCloseStore(system_store, 0); |\n |\t\t\t} |\n-|#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+|\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle(); |\n+|\t\tSSL_CTX_set_cert_store(ssl_ctx, store); |\n |#endif |\n+|#ifdef __APPLE__ |\n+|\t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str()); |\n+|\t\tec.clear(); |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b8_\b4_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)_\b _\bt_\bh_\be_\bs_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\bs_\b _\bu_\bp_\b _\bf_\br_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bes\bse\ber\brv\bve\be(\b()\b) t\bth\bhe\bes\bse\be v\bve\bec\bct\bto\bor\brs\bs u\bup\bp f\bfr\bro\bon\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b14\b48\b84\b4 *\b**\b**\b* |\n+|bandwidth_channel* ch = &p->channel[peer_connection::download_channel]; |\n+|\t\t\tif (use_quota_overhead(ch, amount_down)) |\n+|\t\t\t\tret |= 1 << peer_connection::download_channel; |\n+|\t\t\tch = &p->channel[peer_connection::upload_channel]; |\n+|\t\t\tif (use_quota_overhead(ch, amount_up)) |\n+|\t\t\t\tret |= 1 << peer_connection::upload_channel; |\n |\t\t} |\n-|\t\tupdate_want_peers(); |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b8_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b58\b81\b1 *\b**\b**\b* |\n-|{ |\n-|\t\t\tstd::set<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+|\t\treturn ret; |\n+|\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+|\t// session_impl is responsible for deleting 'pack' |\n+|\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack) |\n+|\t{ |\n+|\t\tINVARIANT_CHECK; |\n+|\t\tapply_settings_pack_impl(*pack); |\n+|\t} |\n | |\n-|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n+|\tsettings_pack session_impl::get_settings() const |\n+|\t{ |\n+|\t\tsettings_pack ret; |\n+|for (int i = settings_pack::string_type_base; |\n+|i < settings_pack::max_string_setting_internal; ++i) |\n |\t\t{ |\n-|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\tret.set_str(i, m_settings.get_str(i)); |\n+|\t\t} |\n+|\t\tfor (int i = settings_pack::int_type_base; |\n+|\t\t\ti < settings_pack::max_int_setting_internal; ++i) |\n |\t\t{ |\n-|\t\t\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+|\t\t\tret.set_int(i, m_settings.get_int(i)); |\n+|\t\t} |\n+|\t\tfor (int i = settings_pack::bool_type_base; |\n+|\t\t\ti < settings_pack::max_bool_setting_internal; ++i) |\n+|\t\t{ |\n+|\t\t\tret.set_bool(i, m_settings.get_bool(i)); |\n+|\t\t} |\n+|\t\treturn ret; |\n+|\t} |\n | |\n-|\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+|namespace { |\n+|\ttemplate <typename Pack> |\n+|\tint get_setting_impl(Pack const& p, int name, int*) |\n+|\t{ return p.get_int(name); } |\n | |\n-|\t\t\tpenalize_peers(peers, index, known_bad_peer); |\n-|\t\t} |\n+|\ttemplate <typename Pack> |\n+|\tbool get_setting_impl(Pack const& p, int name, bool*) |\n+|\t{ return p.get_bool(name); } |\n | |\n-|\t\t// If m_storage isn't set here, it means we're shutting down |\n-|\t\tif (m_storage) |\n-|\t\t{ |\n-|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b52\b25\b5 *\b**\b**\b* |\n-||| peerinfo->confirmed_supports_utp)) |\n-|\t\t\t{ |\n-|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n-|\t\t\t} |\n+|\ttemplate <typename Pack> |\n+|\tstd::string get_setting_impl(Pack const& p, int name, std::string*) |\n+|_\b\t_\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bp_\b._\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\bn_\ba_\bm_\be_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b8 |could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bd_\be_\bn_\bt_\bi_\bc_\ba_\bl_\b,_\b _\bm_\ba_\by_\bb_\be_\b _\bt_\bh_\be_\b _\bl_\ba_\bt_\bt_\be_\br_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bco\bou\bul\bld\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn b\bbe\be m\bme\ber\brg\bge\bed\bd w\bwi\bit\bth\bh e\bex\bxp\bpa\ban\bnd\bd_\b_u\bun\bns\bsp\bpe\bec\bci\bif\bfi\bie\bed\bd_\b_a\bad\bdd\bdr\bre\bes\bss\bse\bes\bs?\b? r\bri\big\bgh\bht\bt n\bno\bow\bw b\bbo\bot\bth\bh l\bli\bis\bst\bte\ben\bn_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt_\b_t\bt a\ban\bnd\bd l\bli\bis\bst\bte\ben\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be_\b_t\bt a\bar\bre\be a\bal\blm\bmo\bos\bst\bt i\bid\bde\ben\bnt\bti\bic\bca\bal\bl,\b, m\bma\bay\byb\bbe\be t\bth\bhe\be l\bla\bat\btt\bte\ber\br c\bco\bou\bul\bld\bd b\bbe\be |\n+|r\bre\bem\bmo\bov\bve\bed\bd t\bto\boo\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b19\b99\b98\b8 *\b**\b**\b* |\n+|session_log(\"FATAL SESSION ERROR (%s : %d) [%s]\" |\n+|\t\t\t, ec.category().name(), ec.value(), ec.message().c_str()); |\n+|#endif |\n+|\t\tthis->abort(); |\n+|\t} |\n | |\n-|\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+|\tvoid session_impl::on_ip_change(error_code const& ec) |\n+|\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+|\t\tif (!ec) |\n+|\t\t\tsession_log(\"received ip change from internal ip_notifier\"); |\n+|\t\telse |\n+|\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str()); |\n |#endif |\n-|\t\t\t\treturn false; |\n-|\t\t\t} |\n-|\t\t} |\n+|\t\tif (ec || m_abort || !m_ip_notifier) return; |\n+|\t\tm_ip_notifier->async_wait([this] (error_code const& e) |\n+|\t\t\t{ wrap(&session_impl::on_ip_change, e); }); |\n+|\t\treopen_network_sockets({}); |\n+|\t} |\n | |\n-|aux::socket_type s = [&] { |\n+|void interface_to_endpoints(listen_interface_t const& iface |\n+|, listen_socket_flags_t flags |\n+|\t\t, span<ip_interface const> const ifs |\n+|\t\t, std::vector<listen_endpoint_t>& eps) |\n+|\t{ |\n+|\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{}; |\n+|\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext; |\n | |\n-|#if TORRENT_USE_I2P |\n-|\t\tif (peerinfo->is_i2p_addr) |\n+|\t\t// First, check to see if it's an IP address |\n+|\t\terror_code err; |\n+|\t\taddress const adr = make_address(iface.device.c_str(), err); |\n+|\t\tif (!err) |\n |\t\t{ |\n-|\t\t\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\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags); |\n |\t\t} |\n |\t\telse |\n-|#endif |\n |\t\t{ |\n-|\t\t\tvoid* userdata = nullptr; |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\t\tif (is_ssl_torrent()) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b11\b18\b8 *\b**\b**\b* |\n-|// finished torrents may not change their queue positions, as it's set to |\n-|\t\t// -1 |\n-|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n-| |\n-|\t\tTORRENT_ASSERT((p == no_pos) == is_finished() |\n-|\t\t\t|| (!m_auto_managed && p == no_pos) |\n-|\t\t\t|| (m_abort && p == no_pos) |\n-|\t\t\t|| (!m_added && p == no_pos)); |\n-|\t\tif (p == m_sequence_number) return; |\n+|\t\t\tflags |= listen_socket_t::was_expanded; |\n | |\n-|\t\tTORRENT_ASSERT(p >= no_pos); |\n+|\t\t\t// this is the case where device names a network device. We need to |\n+|\t\t\t// enumerate all IPs associated with this device |\n+|\t\t\tfor (auto const& ipface : ifs) |\n+|\t\t\t{ |\n+|\t\t\t\t// we're looking for a specific interface, and its address |\n+|\t\t\t\t// (which must be of the same family as the address we're |\n+|\t\t\t\t// connecting to) |\n+|\t\t\t\tif (iface.device != ipface.name) continue; |\n | |\n-|\t\tstate_updated(); |\n+|\t\t\t\tbool const local = iface.local |\n+|\t\t\t\t\t|| ipface.interface_address.is_loopback() |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b|_\b|_\b _\bi_\bs_\b__\bl_\bi_\bn_\bk_\b__\bl_\bo_\bc_\ba_\bl_\b(_\bi_\bp_\bf_\ba_\bc_\be_\b._\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to|\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0_\b6 |disable a tracker, we set the version number that it was disabled at. This change would affect the ABI in 1.2, so should be done in |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b._\b0_\b _\bo_\br_\b _\bl_\ba_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bbe\bet\btt\bte\ber\br t\bto\bo d\bdo\bo t\bth\bhi\bis\bs b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba l\bli\bis\bst\bte\ben\bn-\b-s\bso\boc\bck\bke\bet\bt \"\b\"v\bve\ber\brs\bsi\bio\bon\bn\"\b\" n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt g\bge\bet\bts\bs b\bbu\bum\bmp\bpe\bed\bd.\b. A\bAn\bnd\bd i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bse\bet\btt\bti\bin\bng\bg a\ba b\bbo\boo\bol\bl t\bto\bo d\bdi\bis\bsa\bab\bbl\ble\be a\ba t\btr\bra\bac\bck\bke\ber\br,\b, w\bwe\be s\bse\bet\bt t\bth\bhe\be |\n+|v\bve\ber\brs\bsi\bio\bon\bn n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt i\bit\bt w\bwa\bas\bs d\bdi\bis\bsa\bab\bbl\ble\bed\bd a\bat\bt.\b. T\bTh\bhi\bis\bs c\bch\bha\ban\bng\bge\be w\bwo\bou\bul\bld\bd a\baf\bff\bfe\bec\bct\bt t\bth\bhe\be A\bAB\bBI\bI i\bin\bn 1\b1.\b.2\b2,\b, s\bso\bo s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be i\bin\bn 2\b2.\b.0\b0 o\bor\br l\bla\bat\bte\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b23\b30\b06\b6 *\b**\b**\b* |\n+|{ |\n+|\t\t\tfor (auto const& s : m_listen_sockets) |\n+|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\t// new sockets need to map ports even if the caller did not request |\n+|\t\t\t// re-mapping |\n+|\t\t\tfor (auto const& s : new_sockets) |\n+|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n+|\t\t} |\n | |\n-|\t\tm_ses.set_queue_position(this, p); |\n-|\t} |\n+|\t\tupdate_lsd(); |\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<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+|#if TORRENT_USE_I2P |\n+|\t\topen_new_incoming_i2p_connection(); |\n |#endif |\n | |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t\t// trackers that were not reachable, may have become reachable now. |\n+|\t\t// so clear the \"disabled\" flags to let them be tried one more time |\n+|for (auto& t : m_torrents) |\n+|t->enable_all_trackers(); |\n |\t} |\n | |\n-|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n-|\t{ |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b13\b35\b5 *\b**\b**\b* |\n-|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n+|\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options) |\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\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports)); |\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<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+|\tnamespace { |\n+|\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType> |\n+|\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep |\n+|\t\t\t, port_mapping_t& map_handle, std::string const& device) |\n |\t\t{ |\n-|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n-|\t\t\t\t, errors::too_many_connections); |\n-|\t\t} |\n+|\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle); |\n+|\t\t\tmap_handle = port_mapping_t{-1}; |\n | |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n+|\t\t\taddress const addr = ep.address(); |\n+|\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them |\n+|\t\t\t// based on the scope of the local address |\n+|\t\t\tif (addr.is_v6() && is_local(addr)) |\n+|\t\t\t\treturn; |\n | |\n-|\tvoid torrent::set_upload_limit(int const limit) |\n-|\t{ |\n-|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n-|#endif |\n+|\t\t\t// only update this mapping if we actually have a socket listening |\n+|\t\t\tif (ep != EndpointType()) |\n+|\t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device); |\n+|\t\t} |\n |\t} |\n | |\n-|\tvoid torrent::set_download_limit(int const limit) |\n-|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b6_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b06\b61\b1 *\b**\b**\b* |\n-|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n-|\t\t\t\t\t, m_average_piece_time); |\n-|#endif |\n+|\tvoid session_impl::remap_ports(remap_port_mask_t const mask |\n+|_\b\t_\b\t_\b,_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\b&_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b6_\b6_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b86\b66\b6 *\b**\b**\b* |\n+|// handshaking |\n+|\t\t\t\treturn socket_type(ssl_stream<tcp::socket>(tcp::socket(std::move(s)), m_peer_ssl_ctx)); |\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\telse |\n+|#endif |\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\treturn socket_type(tcp::socket(std::move(s))); |\n |\t\t\t} |\n+|\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+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c)); |\n+|#endif |\n | |\n-|\t\t// commit all the time critical requests |\n-|\t\tfor (auto p : peers_with_requests) |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tif (ssl == transport::ssl) |\n |\t\t{ |\n-|\t\t\tp->send_block_requests(); |\n-|\t\t} |\n-|\t} |\n-|#endif // TORRENT_DISABLE_STREAMING |\n+|\t\t\tTORRENT_ASSERT(is_ssl(c)); |\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\t// save the socket so we can cancel the handshake |\n+|auto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first; |\n+| |\n+|\t\t\tauto sock = iter->get(); |\n+|\t\t\t// for SSL connections, incoming_connection() is called |\n+|\t\t\t// after the handshake is done |\n+|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake( |\n+|\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n |\t\t} |\n-|_\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/_\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+|\t\telse |\n |#endif |\n-|\t\t\tm_thread->join(); |\n+|\t\t{ |\n+|\t\t\tincoming_connection(std::move(c)); |\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+|#ifdef TORRENT_SSL_PEERS |\n+| |\n+|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\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\tTORRENT_ASSERT(is_ssl(s)); |\n+| |\n+|_\b\t_\b\t_\b/_\b/_\b _\bs_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b9_\b1_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b89\b91\b1 *\b**\b**\b* |\n+|// after the handshake is done |\n+|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\t\tboost::get<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-|\t\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-|#else |\n-|\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n |#endif |\n+|\t\t{ |\n+|\t\t\tincoming_connection(std::move(c)); |\n+|\t\t} |\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+|#ifdef TORRENT_SSL_PEERS |\n | |\n-|\tbool supports_arm_neon() noexcept |\n+|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\n |\t{ |\n-|#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV |\n-|#if defined __arm__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON); |\n-|\t\treturn (helper_getauxval(16) & (1 << 12)); |\n-|#elif defined __aarch64__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD); |\n-|\t\t//return (getauxval(16) & (1 << 1)); |\n-|return false; |\n-|#endif |\n-|#else |\n-|\t\treturn false; |\n-|#endif |\n-|\t} |\n+|\t\tTORRENT_ASSERT(is_ssl(s)); |\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+|\t\t// save the socket so we can cancel the handshake |\n | |\n-|} // anonymous namespace |\n+|auto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first; |\n+|auto sock = iter->get(); |\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/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bch\bho\bok\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b58\b8 *\b**\b**\b* |\n-|// first reset the number of unchoke slots, because we'll calculate |\n-|\t\t\t// it purely based on the current state of our peers. |\n-|\t\t\tupload_slots = 0; |\n+|\t\t// for SSL connections, incoming_connection() is called |\n+|\t\t// after the handshake is done |\n+|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake( |\n+|\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n+|\t} |\n | |\n-|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n+|\t// to test SSL connections, one can use this openssl command template: |\n+|\t// |\n+|\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem |\n+|\t// -CAfile <torrent-cert>.pem -debug -connect 127.0.0.1:4433 -tls1 |\n+|\t// -servername <hex-encoded-info-hash> |\n | |\n-|\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+|\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\"); |\n | |\n-|\t\t\tfor (auto const* p : peers) |\n-|\t\t\t{ |\n-|\t\t\t\tint const rate = int(p->uploaded_in_last_round() |\n-|\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval)); |\n+|\t\tauto iter = m_incoming_sockets.find(sock); |\n | |\n-|\t\t\t\t// always have at least 1 unchoke slot |\n-|\t\t\t\tif (rate < rate_threshold) break; |\n+|\t\t// this happens if the SSL connection is aborted because we're shutting |\n+|\t\t// down |\n+|\t\tif (iter == m_incoming_sockets.end()) return; |\n | |\n-|\t\t\t\t++upload_slots; |\n+|\t\tsocket_type s(std::move(**iter)); |\n+|\t\tTORRENT_ASSERT(is_ssl(s)); |\n+|\t\tm_incoming_sockets.erase(iter); |\n | |\n-|rate_threshold += 2048; |\n-|} |\n-|\t\t\t++upload_slots; |\n+|_\b\t_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b5_\b9_\b0_\b _\b _\b|_\bh_\ba_\bv_\be_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\bs_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\bl_\bo_\bo_\bp_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\be_\bm_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt f\bfo\bor\br t\bth\bhe\bes\bse\be c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo l\blo\boo\bop\bp t\bth\bhr\bro\bou\bug\bgh\bh a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b35\b59\b90\b0 *\b**\b**\b* |\n+|// -------------------------------------------------------------- |\n+|\t\tif (!m_paused) m_auto_manage_time_scaler--; |\n+|\t\tif (m_auto_manage_time_scaler < 0) |\n+|\t\t{ |\n+|\t\t\tm_auto_manage_time_scaler = settings().get_int(settings_pack::auto_manage_interval); |\n+|\t\t\trecalculate_auto_managed_torrents(); |\n |\t\t} |\n | |\n-|\t\t// sorts the peers that are eligible for unchoke by download rate and |\n-|\t\t// secondary by total upload. The reason for this is, if all torrents are |\n-|\t\t// being seeded, the download rate will be 0, and the peers we have sent |\n-|\t\t// the least to should be unchoked |\n-| |\n-|\t\t// we use partial sort here, because we only care about the top |\n-|\t\t// upload_slots peers. |\n-| |\n-|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n+|\t\t// -------------------------------------------------------------- |\n+|\t\t// check for incoming connections that might have timed out |\n+|\t\t// -------------------------------------------------------------- |\n | |\n-|\t\tif (sett.get_int(settings_pack::seed_choking_algorithm) |\n-|\t\t\t== settings_pack::round_robin) |\n+|\t\tfor (auto i = m_connections.begin(); i != m_connections.end();) |\n |\t\t{ |\n-|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\n+|\t\t\tpeer_connection* p = (*i).get(); |\n+|\t\t\t++i; |\n+|\t\t\t// ignore connections that already have a torrent, since they |\n+|\t\t\t// are ticked through the torrents' second_tick |\n+|\t\t\tif (!p->associated_torrent().expired()) continue; |\n | |\n-|\t\t\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+|int timeout = m_settings.get_int(settings_pack::handshake_timeout); |\n+|#if TORRENT_USE_I2P |\n+|\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1; |\n+|#endif |\n+|\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout)) |\n+|\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent); |\n |\t\t} |\n-|\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-|\t\tload_verified_bits(verified); |\n | |\n-|\t\toptimize_storage(); |\n-|\t\toptimize_storage_piece_layer(); |\n-|\t} |\n+|\t\t// -------------------------------------------------------------- |\n+|\t\t// second_tick every torrent (that wants it) |\n+|\t\t// -------------------------------------------------------------- |\n | |\n-|\tvoid merkle_tree::clear() |\n-|\t{ |\n-|\t\tm_tree.clear(); |\n-|\t\tm_tree.shrink_to_fit(); |\n-|\t\tm_block_verified.clear(); |\n-|\t\tm_mode = mode_t::empty_tree; |\n-|\t} |\n+|#if TORRENT_DEBUG_STREAMING > 0 |\n+|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n+|#endif |\n | |\n-|namespace { |\n+|\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick]; |\n+|\t\tfor (int i = 0; i < int(want_tick.size()); ++i) |\n+|\t\t{ |\n+|\t\t\ttorrent& t = *want_tick[i]; |\n+|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n+|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n | |\n-|struct identity |\n-|{ |\n-|\t\tbool operator()(bool b) const { return b; } |\n-|\t}; |\n-|} |\n+|\t\t\tt.second_tick(tick_interval_ms); |\n | |\n-|\tvoid merkle_tree::load_sparse_tree(span<sha256_hash const> t |\n-|\t\t, std::vector<bool> const& mask |\n-|\t\t, std::vector<bool> const& verified) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-|\t\tTORRENT_ASSERT(mask.size() == size()); |\n-|\t\tif (size() != mask.size()) return; |\n+|\t\t\t// if the call to second_tick caused the torrent |\n+|\t\t\t// to no longer want to be ticked (i.e. it was |\n+|\t\t\t// removed from the list) we need to back up the counter |\n+|\t\t\t// to not miss the torrent after it |\n+|\t\t\tif (!t.want_tick()) --i; |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b2_\b3_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bp_\bp_\bl_\by_\b _\bt_\bo_\b _\ba_\bl_\bl_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bc_\bh_\ba_\bn_\bn_\be_\bl_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd a\bap\bpp\bpl\bly\by t\bto\bo a\bal\bll\bl b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh c\bch\bha\ban\bnn\bne\bel\bls\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:3\b36\b62\b23\b3 *\b**\b**\b* |\n+|#if TORRENT_DEBUG_STREAMING > 0 |\n+|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n+|#endif |\n | |\n-|\t\tint const first_block = block_layer_start(); |\n-|\t\tint const end_block = first_block + m_num_blocks; |\n+|\t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick]; |\n+|\t\tfor (int i = 0; i < int(want_tick.size()); ++i) |\n+|\t\t{ |\n+|\t\t\ttorrent& t = *want_tick[i]; |\n+|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n+|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n | |\n-|\t\tTORRENT_ASSERT(first_block < int(mask.size())); |\n-|\t\tTORRENT_ASSERT(end_block <= int(mask.size())); |\n+|\t\t\tt.second_tick(tick_interval_ms); |\n | |\n-|\t\t// if the mask covers all blocks, go straight to block_layer |\n-|\t\t// mode, and validate |\n-|\t\tif (std::all_of(mask.begin() + first_block, mask.begin() + end_block, identity())) |\n-|\t\t{ |\n-|\t\t\t// the index in t that points to first_block |\n-|\t\t\tauto const block_index = std::count_if(mask.begin(), mask.begin() + first_block, identity()); |\n+|\t\t\t// if the call to second_tick caused the torrent |\n+|\t\t\t// to no longer want to be ticked (i.e. it was |\n+|\t\t\t// removed from the list) we need to back up the counter |\n+|\t\t\t// to not miss the torrent after it |\n+|\t\t\tif (!t.want_tick()) --i; |\n+|\t\t} |\n | |\n-|\t\t\t// discrepancy |\n-|\t\t\tif (t.size() < block_index + m_num_blocks) |\n-|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bu_\bs_\bi_\bn_\bg_\b _\bm_\b__\bt_\br_\be_\be_\b _\ba_\bs_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bf_\bi_\bl_\bl_\b _\bt_\bh_\bi_\bs_\b _\bt_\br_\be_\be_\b _\bi_\bn_\bt_\bo_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bca\ban\bn b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by u\bus\bsi\bin\bng\bg m\bm_\b_t\btr\bre\bee\be a\bas\bs s\bst\bto\bor\bra\bag\bge\be t\bto\bo f\bfi\bil\bll\bl t\bth\bhi\bis\bs t\btr\bre\bee\be i\bin\bnt\bto\bo,\b, a\ban\bnd\bd t\bth\bhe\ben\bn c\bcl\ble\bea\bar\br i\bit\bt i\bif\bf t\bth\bhe\be h\bha\bas\bsh\bhe\bes\bs f\bfa\bai\bil\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:3\b31\b19\b9 *\b**\b**\b* |\n+|if (m_settings.get_bool(settings_pack::rate_limit_ip_overhead)) |\n |{ |\n-|\t\tINVARIANT_CHECK; |\n+|\t\t\tint const up_limit = upload_rate_limit(m_global_class); |\n+|\t\t\tint const down_limit = download_rate_limit(m_global_class); |\n | |\n-|\t\t// 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+|\t\t\tif (down_limit > 0 |\n+|\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit |\n+|\t\t\t\t&& m_alerts.should_post<performance_alert>()) |\n+|\t\t\t{ |\n+|\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle() |\n+|\t\t\t\t\t, performance_alert::download_limit_too_low); |\n+|\t\t\t} |\n | |\n-|\t\t// we already have all hashes |\n-|\t\tif (m_mode == mode_t::block_layer) |\n-|\t\t{ |\n-|\t\t\t// since we're already on the block layer mode, we have the whole |\n-|\t\t\t// tree, and we've already reported any pieces as passing that may |\n-|\t\t\t// have existed in the tree when we completed it. At this point no |\n-|\t\t\t// more pieces should be reported as passed |\n-|\t\t\treturn ret; |\n+|\t\t\tif (up_limit > 0 |\n+|\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit |\n+|\t\t\t\t&& m_alerts.should_post<performance_alert>()) |\n+|\t\t\t{ |\n+|\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle() |\n+|\t\t\t\t\t, performance_alert::upload_limit_too_low); |\n+|\t\t\t} |\n |\t\t} |\n | |\n-|\t\tallocate_full(); |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate); |\n+|#endif |\n | |\n-|int const leaf_count = merkle_num_leafs(int(hashes.size())); |\n-|aux::vector<sha256_hash> tree(merkle_num_nodes(leaf_count)); |\n-|\t\tstd::copy(hashes.begin(), hashes.end(), tree.end() - leaf_count); |\n+|\t\tm_stat.second_tick(tick_interval_ms); |\n | |\n-|\t\t// the end of a file is a special case, we may need to pad the leaf layer |\n-|\t\tif (leaf_count > hashes.size()) |\n+|\t\t// -------------------------------------------------------------- |\n+|\t\t// scrape paused torrents that are auto managed |\n+|_\b\t_\b\t_\b/_\b/_\b _\b(_\bu_\bn_\bl_\be_\bs_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b1_\b4 |use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\ba_\bt_\b _\bm_\ba_\bx_\b _\b-_\b _\b1_\b,_\b _\bs_\bi_\bn_\bc_\be_\b _\bw_\be_\b _\bm_\ba_\by_\b _\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bb_\be_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be a\ba l\blo\bow\bwe\ber\br l\bli\bim\bmi\bit\bt t\bth\bha\ban\bn m\bm_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs.\b.c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be t\bth\bhe\be t\bto\bo 1\b10\b0%\b% o\bor\br s\bso\bo o\bof\bf c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsl\blo\bot\bts\bs f\bfo\bor\br i\bin\bnc\bco\bom\bmi\bin\bng\bg c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\bap\bp t\bth\bhi\bis\bs a\bat\bt m\bma\bax\bx -\b- 1\b1,\b, s\bsi\bin\bnc\bce\be w\bwe\be m\bma\bay\by a\bad\bdd\bd o\bon\bne\be |\n+|b\bbe\bel\blo\bow\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b43\b31\b14\b4 *\b**\b**\b* |\n+|// boost, which are done immediately on a tracker response. These |\n+|\t\t// connections needs to be deducted from the regular connection attempt |\n+|\t\t// quota for this tick |\n+|\t\tif (m_boost_connections > 0) |\n |\t\t{ |\n-|\t\t\tint const leaf_layer_size = num_leafs(); |\n-|\t\t\t// assuming uncle_hashes lead all the way to the root, they tell us |\n-|\t\t\t// how many layers down we are |\n-|\t\t\tint const insert_layer_size = leaf_count << uncle_hashes.size(); |\n-|\t\t\tif (leaf_layer_size != insert_layer_size) |\n+|\t\t\tif (m_boost_connections > max_connections) |\n |\t\t\t{ |\n-|\t\t\t\tsha256_hash const pad_hash = merkle_pad(leaf_layer_size, insert_layer_size); |\n-|\t\t\t\tfor (int i = int(hashes.size()); i < leaf_count; ++i) |\n-|\t\t\t\t\ttree[tree.end_index() - leaf_count + i] = pad_hash; |\n+|\t\t\t\tm_boost_connections -= max_connections; |\n+|\t\t\t\tmax_connections = 0; |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tmax_connections -= m_boost_connections; |\n+|\t\t\t\tm_boost_connections = 0; |\n |\t\t\t} |\n |\t\t} |\n | |\n-|\t\tmerkle_fill_tree(tree, leaf_count); |\n-| |\n-|\t\tint const base_num_layers = merkle_num_layers(leaf_count); |\n-| |\n-|\t\t// this is the index of the node where we'll insert the root of the |\n-|\t\t// subtree (tree). It's also the hash the uncle_hashes are here to prove |\n-|\t\t// is valid. |\n-|\t\tint const insert_root_idx = dest_start_idx >> base_num_layers; |\n-| |\n-|\t\t// start with validating the proofs, and inserting them as we go. |\n-|\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes)) |\n-|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b{_\b}_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b7_\b _\b _\b _\b _\b|_\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bo_\bu_\bt_\bs_\bi_\bd_\be_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\br_\ba_\bn_\bg_\be_\b _\bm_\ba_\by_\b _\ba_\bl_\bs_\bo_\b _\bf_\ba_\bi_\bl_\b,_\b _\bi_\bf_\b _\bo_\bn_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bu_\bn_\bc_\bl_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bi_\bs_\b _\ba_\bt_\b _\bt_\bh_\be_\b _\bl_\ba_\by_\be_\br_\b _\br_\bi_\bg_\bh_\bt_\b _\ba_\bb_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\ba p\bpi\bie\bec\bce\be o\bou\but\bts\bsi\bid\bde\be o\bof\bf t\bth\bhi\bis\bs r\bra\ban\bng\bge\be m\bma\bay\by a\bal\bls\bso\bo f\bfa\bai\bil\bl,\b, i\bif\bf o\bon\bne\be o\bof\bf t\bth\bhe\be u\bun\bnc\bcl\ble\be h\bha\bas\bsh\bhe\bes\bs i\bis\bs a\bat\bt t\bth\bhe\be l\bla\bay\bye\ber\br r\bri\big\bgh\bht\bt a\bab\bbo\bov\bve\be t\bth\bhe\be b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:3\b36\b67\b7 *\b**\b**\b* |\n-|int const insert_root_idx = dest_start_idx >> base_num_layers; |\n-| |\n-|\t\t// start with validating the proofs, and inserting them as we go. |\n-|\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes)) |\n-|\t\t\treturn {}; |\n-| |\n-|\t\t// first fill in the subtree of known hashes from the base layer |\n-|\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks); |\n-|\t\tauto const first_leaf = merkle_first_leaf(num_leafs); |\n+|\t\t// zero connections speeds are allowed, we just won't make any connections |\n+|\t\tif (max_connections <= 0) return; |\n | |\n-|\t\t// this is the start of the leaf layer of \"tree\". We'll use this |\n-|\t\t// variable to step upwards towards the root |\n-|\t\tint source_cursor = int(tree.size()) - leaf_count; |\n-|\t\t// the running index in the loop |\n-|\t\tint dest_cursor = dest_start_idx; |\n+|int const limit = std::min(m_settings.get_int(settings_pack::connections_limit) |\n+|- num_connections(), std::numeric_limits<int>::max() - 1); |\n | |\n-|\t\t// the number of tree levels in a piece hash. 0 means the block layer is |\n-|\t\t// the same as the piece layer |\n-|\t\tint const base = piece_levels(); |\n+|\t\t// this logic is here to smooth out the number of new connection |\n+|\t\t// attempts over time, to prevent connecting a large number of |\n+|\t\t// sockets, wait 10 seconds, and then try again |\n+|\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2) |\n+|\t\t\tmax_connections = (limit + 1) / 2; |\n | |\n-|for (int layer_size = leaf_count; layer_size != 0; layer_size /= 2) |\n-|{ |\n-|\t\t\tfor (int i = 0; i < layer_size; ++i) |\n-|\t\t\t{ |\n-|\t\t\t\tint const dst_idx = dest_cursor + i; |\n-|\t\t\t\tint const src_idx = source_cursor + i; |\n-|\t\t\t\tif (has_node(dst_idx)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx]) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until |\n-|\t\t\t\t\t\t// they can be verified. This assert ensures we're at the |\n-|\t\t\t\t\t\t// leaf layer of the file tree |\n-|\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf); |\n+|\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download]; |\n+|\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished]; |\n | |\n-|\t\t\t\t\t\tint const pos = dst_idx - first_leaf; |\n-|\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset; |\n-|\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1); |\n+|\t\t// if no torrent want any peers, just return |\n+|\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return; |\n | |\n-|\t\t\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks); |\n-|\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece) |\n-|\t\t\t\t\t\t\tret.failed.back().second.push_back(block); |\n-|\t\t\t\t\t\telse |\n-|\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector<int>{block}); |\n+|\t\t// if we don't have any connection attempt quota, return |\n+|\t\tif (max_connections <= 0) return; |\n | |\n-|\t\t\t\t\t\t// now that this hash has been reported as failing, we |\n-|\t\t\t\t\t\t// can clear it. This will prevent it from being |\n-|\t\t\t\t\t\t// reported as failing again. |\n-|\t\t\t\t\t\tm_tree[dst_idx].clear(); |\n-|\t\t\t\t\t} |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\be_\bl_\bs_\be_\b _\bi_\bf_\b _\b(_\bd_\bs_\bt_\b__\bi_\bd_\bx_\b _\b>_\b=_\b _\bf_\bi_\br_\bs_\bt_\b__\bl_\be_\ba_\bf_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b7 |instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\be_\bv_\be_\bl_\b _\bb_\be_\bl_\bo_\bw_\b _\bt_\bh_\be_\b _\br_\bo_\bo_\bt_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\bs_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf o\bov\bve\ber\brw\bwr\bri\bit\bti\bin\bng\bg t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd c\bco\bom\bmp\bpa\bar\bri\bin\bng\bg i\bit\bt a\bag\bga\bai\bin\bns\bst\bt h\bha\bas\bsh\bhe\bes\bs[\b[]\b],\b, w\bwr\bri\bit\bte\be a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs t\bth\bha\bat\bt *\b*v\bva\bal\bli\bid\bda\bat\bte\bes\bs*\b* a\ba t\btr\bre\bee\be b\bby\by j\bju\bus\bst\bt f\bfi\bil\bll\bli\bin\bng\bg i\bit\bt u\bup\bp t\bto\bo t\bth\bhe\be l\ble\bev\bve\bel\bl b\bbe\bel\blo\bow\bw t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd t\bth\bhe\ben\bn |\n-|v\bva\bal\bli\bid\bda\bat\bte\bes\bs i\bit\bt.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:4\b44\b47\b7 *\b**\b**\b* |\n-|&& dest_start_idx < first_piece_idx + num_pieces()) |\n+|\t\tint steps_since_last_connect = 0; |\n+|\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size()); |\n+|\t\tfor (;;) |\n |\t\t{ |\n-|\t\t\tint const blocks_in_piece = 1 << base; |\n-| |\n-|\t\t\t// it may now be possible to verify the hashes of previously received blocks |\n-|\t\t\t// try to verify as many child nodes of the received hashes as possible |\n-|\t\t\tfor (int i = 0; i < int(hashes.size()); ++i) |\n-|\t\t\t{ |\n-|\t\t\t\tint const piece = dest_start_idx + i; |\n-|\t\t\t\tif (piece - first_piece_idx >= num_pieces()) |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t// the first block in this piece |\n-|\t\t\t\tint const block_idx = merkle_get_first_child(piece, base); |\n+|\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size())) |\n+|\t\t\t\tm_next_downloading_connect_torrent = 0; |\n | |\n-|\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks); |\n-|\t\t\t\tif (std::any_of(m_tree.begin() + block_idx |\n-|\t\t\t\t\t, m_tree.begin() + block_end_idx |\n-|\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); })) |\n-|\t\t\t\t\tcontinue; |\n+|\t\t\tif (m_next_finished_connect_torrent >= int(want_peers_finished.size())) |\n+|\t\t\t\tm_next_finished_connect_torrent = 0; |\n | |\n-|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n-|if (m_tree[piece] != hashes[i]) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx); |\n-|\t\t\t\t\t// write back the correct hash |\n-|\t\t\t\t\tm_tree[piece] = hashes[i]; |\n-|\t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece()); |\n+|\t\t\ttorrent* t = nullptr; |\n+|\t\t\t// there are prioritized torrents. Pick one of those |\n+|_\b\t_\b\t_\b\t_\bw_\bh_\bi_\bl_\be_\b _\b(_\b!_\bm_\b__\bp_\br_\bi_\bo_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b._\be_\bm_\bp_\bt_\by_\b(_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b5_\b9_\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\bh_\ba_\bp_\bp_\be_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bx_\bt_\b _\bt_\bi_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\ba m\bme\bes\bss\bsa\bag\bge\be t\bto\bo h\bha\bav\bve\be t\bth\bhi\bis\bs h\bha\bap\bpp\bpe\ben\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bns\bst\bte\bea\bad\bd o\bof\bf w\bwa\bai\bit\bti\bin\bng\bg f\bfo\bor\br t\bth\bhe\be n\bne\bex\bxt\bt t\bti\bic\bck\bk *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b44\b45\b59\b9 *\b**\b**\b* |\n+|continue; |\n+|\t\t\t} |\n | |\n-|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n-|\t\t\t\t\t// block hashes, and we can't know which block failed |\n-|\t\t\t\t\t// this will cause the block hashes to be requested |\n-|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n-|\t\t\t\t\t\t, std::vector<int>()); |\n-|\t\t\t\t} |\n-|\t\t\t\telse |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset); |\n-|\t\t\t\t\t// record that these block hashes are correct! |\n-|\t\t\t\t\tint const leafs_start = block_idx - block_layer_start(); |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bl_\be_\ba_\bf_\bs_\b__\be_\bn_\bd_\b _\b=_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bi_\bn_\b(_\bm_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b,_\b _\bl_\be_\ba_\bf_\bs_\b__\bs_\bt_\ba_\br_\bt_\b _\b+_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:4\b47\b71\b1 *\b**\b**\b* |\n-|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n-|\t\t\t\tif (m_tree[piece] != hashes[i]) |\n+|\t\t\tif (!p->is_peer_interested() |\n+|\t\t\t\t|| p->is_disconnecting() |\n+|\t\t\t\t|| p->is_connecting()) |\n+|\t\t\t{ |\n+|\t\t\t\t// this peer is not unchokable. So, if it's unchoked |\n+|\t\t\t\t// already, make sure to choke it. |\n+|\t\t\t\tif (p->is_choked()) |\n |\t\t\t\t{ |\n-|\t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx); |\n-|\t\t\t\t\t// write back the correct hash |\n-|\t\t\t\t\tm_tree[piece] = hashes[i]; |\n-|\t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece()); |\n-| |\n-|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n-|\t\t\t\t\t// block hashes, and we can't know which block failed |\n-|\t\t\t\t\t// this will cause the block hashes to be requested |\n-|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n-|\t\t\t\t\t\t, std::vector<int>()); |\n+|\t\t\t\t\tp->reset_choke_counters(); |\n+|\t\t\t\t\tcontinue; |\n |\t\t\t\t} |\n-|\t\t\t\telse |\n+|\t\t\t\tif (pi && pi->optimistically_unchoked) |\n |\t\t\t\t{ |\n-|\t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset); |\n-|\t\t\t\t\t// record that these block hashes are correct! |\n-|\t\t\t\t\tint const leafs_start = block_idx - block_layer_start(); |\n-|\t\t\t\t\tint const leafs_end = std::min(m_num_blocks, leafs_start + blocks_in_piece); |\n-|for (int k = leafs_start; k < leafs_end; ++k) |\n-|m_block_verified.set_bit(k); |\n-|\t\t\t\t} |\n-|\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0); |\n+|\t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1); |\n+|\t\t\t\t\tpi->optimistically_unchoked = false; |\n+|\t\t\t\t\t// force a new optimistic unchoke |\n+|\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0; |\n+|} |\n+|t->choke_peer(*p); |\n+|\t\t\t\tp->reset_choke_counters(); |\n+|\t\t\t\tcontinue; |\n |\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\toptimize_storage(); |\n-| |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tstd::tuple<merkle_tree::set_block_result, int, int> merkle_tree::set_block(int const block_index |\n-|\t\t, sha256_hash const& h) |\n-|\t{ |\n-|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n-|\t\tINVARIANT_CHECK; |\n-|#endif |\n-|\t\tTORRENT_ASSERT(block_index < m_num_blocks); |\n | |\n-|\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks); |\n-|\t\tauto const first_leaf = merkle_first_leaf(num_leafs); |\n-|\t\tauto const block_tree_index = first_leaf + block_index; |\n+|\t\t\tpeers.push_back(p.get()); |\n+|\t\t} |\n | |\n-|\t\tif (blocks_verified(block_index, 1)) |\n-|\t\t{ |\n-|\t\t\t// if this blocks's hash is already known, check the passed-in hash against it |\n-|\t\t\tif (compare_node(block_tree_index, h)) |\n-|\t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1); |\n-|\t\t\telse |\n-|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\bd_\b:_\b:_\bm_\ba_\bk_\be_\b__\bt_\bu_\bp_\bl_\be_\b(_\bs_\be_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\be_\bs_\bu_\bl_\bt_\b:_\b:_\bb_\bl_\bo_\bc_\bk_\b__\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b,_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bd_\be_\bx_\b,_\b _\b1_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b1_\b4_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bd_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\b _\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bru\buc\bct\btu\bur\bre\bed\bd b\bbi\bin\bnd\bdi\bin\bng\bg i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b51\b14\b4 *\b**\b**\b* |\n-|auto const first_leaf = merkle_first_leaf(num_leafs); |\n-|\t\tauto const block_tree_index = first_leaf + block_index; |\n+|\t\tint const allowed_upload_slots = unchoke_sort(peers |\n+|\t\t\t, unchoke_interval, m_settings); |\n | |\n-|\t\tif (blocks_verified(block_index, 1)) |\n+|\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker) |\n |\t\t{ |\n-|\t\t\t// if this blocks's hash is already known, check the passed-in hash against it |\n-|\t\t\tif (compare_node(block_tree_index, h)) |\n-|\t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1); |\n-|\t\t\telse |\n-|\t\t\t\treturn std::make_tuple(set_block_result::block_hash_failed, block_index, 1); |\n+|\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit); |\n+|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots); |\n |\t\t} |\n-| |\n-|\t\tallocate_full(); |\n-| |\n-|\t\tm_tree[block_tree_index] = h; |\n-| |\n-|\t\t// to avoid wasting a lot of time hashing nodes only to discover they |\n-|\t\t// cannot be verified, check first to see if the root of the largest |\n-|\t\t// computable subtree is known |\n-| |\n-|int leafs_start; |\n-|int leafs_size; |\n-|\t\tint root_index; |\n-|\t\tstd::tie(leafs_start, leafs_size, root_index) = |\n-|\t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\n-| |\n-|\t\t// if the root node is unknown the hashes cannot be verified yet |\n-|\t\tif (m_tree[root_index].is_all_zeros()) |\n-|\t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size); |\n-| |\n-|\t\t// save the root hash because merkle_fill_tree will overwrite it |\n-|\t\tsha256_hash const root = m_tree[root_index]; |\n-|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n-| |\n-|\t\tif (root != m_tree[root_index]) |\n+|\t\telse |\n |\t\t{ |\n-|\t\t\t// hash failure, clear all the internal nodes |\n-|\t\t\t// the whole piece failed the hash check. Clear all block hashes |\n-|\t\t\t// in this piece and report a hash failure |\n-|\t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n-|\t\t\tm_tree[root_index] = root; |\n-|\t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size); |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b53\b39\b9 *\b**\b**\b* |\n-|merkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\n-| |\n-|\t\t// if the root node is unknown the hashes cannot be verified yet |\n-|\t\tif (m_tree[root_index].is_all_zeros()) |\n-|\t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size); |\n-| |\n-|\t\t// save the root hash because merkle_fill_tree will overwrite it |\n-|\t\tsha256_hash const root = m_tree[root_index]; |\n-|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n+|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots |\n+|\t\t\t\t, allowed_upload_slots); |\n+|\t\t} |\n | |\n-|\t\tif (root != m_tree[root_index]) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log()) |\n |\t\t{ |\n-|\t\t\t// hash failure, clear all the internal nodes |\n-|\t\t\t// the whole piece failed the hash check. Clear all block hashes |\n-|\t\t\t// in this piece and report a hash failure |\n-|\t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n-|\t\t\tm_tree[root_index] = root; |\n-|\t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size); |\n+|\t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \" |\n+|\t\t\t\t\"eligible-peers: %d\" |\n+|\t\t\t\t\" allowed-slots: %d ]\" |\n+|\t\t\t\t, int(m_connections.size()) |\n+|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bi_\bn_\bt_\b(_\bp_\be_\be_\br_\bs_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b8_\b6 |they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\ba_\br_\br_\ba_\by_\b _\bo_\bf_\b _\bn_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\br_\ba_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\ba_\b _\bv_\be_\bc_\bt_\bo_\br_\b,_\b _\bt_\bo_\b _\bf_\bu_\br_\bt_\bh_\be_\br_\b _\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bm_\be_\bm_\bo_\br_\by_\b _\bl_\bo_\bc_\ba_\bl_\bi_\bt_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt m\bmi\big\bgh\bht\bt b\bbe\be a\ba n\bni\bic\bce\be f\bfe\bea\bat\btu\bur\bre\be h\bhe\ber\bre\be t\bto\bo l\bli\bim\bmi\bit\bt t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bto\bor\brr\bre\ben\bnt\bts\bs t\bto\bo s\bse\ben\bnd\bd i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be u\bup\bpd\bda\bat\bte\be.\b. B\bBy\by j\bju\bus\bst\bt p\bpo\bos\bst\bti\bin\bng\bg t\bth\bhe\be f\bfi\bir\brs\bst\bt n\bn t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, t\bth\bhe\bey\by w\bwo\bou\bul\bld\bd n\bni\bic\bce\bel\bly\by b\bbe\be r\bro\bou\bun\bnd\bd-\b-r\bro\bob\bbi\bin\bne\bed\bd |\n+|b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt l\bli\bis\bst\bts\bs a\bar\bre\be a\bal\blw\bwa\bay\bys\bs p\bpu\bus\bsh\bhe\bed\bd b\bba\bac\bck\bk.\b. P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be s\bst\bta\bat\btu\bus\bs_\b_u\bup\bpd\bda\bat\bte\be_\b_a\bal\ble\ber\brt\bt c\bco\bou\bul\bld\bd e\bev\bve\ben\bn h\bha\bav\bve\be a\ba f\bfi\bix\bxe\bed\bd a\bar\brr\bra\bay\by o\bof\bf n\bn e\ben\bnt\btr\bri\bie\bes\bs r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn a\ba v\bve\bec\bct\bto\bor\br,\b, t\bto\bo f\bfu\bur\brt\bth\bhe\ber\br i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by |\n+|l\blo\boc\bca\bal\bli\bit\bty\by.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:4\b47\b78\b86\b6 *\b**\b**\b* |\n+|t->status(&st, flags); |\n |\t\t} |\n-| |\n-|int const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size); |\n-|for (int i = leafs_start; i < leafs_end; ++i) |\n-|\t\t\tm_block_verified.set_bit(i); |\n-| |\n-|\t\t// attempting to optimize storage is quite costly, only do it if we have |\n-|\t\t// a reason to believe it might have an effect |\n-|\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros()) |\n-|\t\t\toptimize_storage(); |\n-| |\n-|\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size); |\n-|\t} |\n-| |\n-|\tstd::size_t merkle_tree::size() const |\n-|\t{ |\n-|\t\treturn static_cast<std::size_t>(merkle_num_nodes(merkle_num_leafs(m_num_blocks))); |\n-|\t} |\n-| |\n-|\tint merkle_tree::num_pieces() const |\n-|\t{ |\n-|\t\tint const ps = blocks_per_piece(); |\n-|\t\tTORRENT_ASSERT(ps > 0); |\n-|\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log; |\n-|\t} |\n-| |\n-|\tint merkle_tree::block_layer_start() const |\n-|\t{ |\n-|\t\tint const num_leafs = merkle_num_leafs(m_num_blocks); |\n-|\t\tTORRENT_ASSERT(num_leafs > 0); |\n-|\t\treturn merkle_first_leaf(num_leafs); |\n-|_\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 <algorithm> |\n-|#include <random> |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-| |\n-|#include <boost/multiprecision/integer.hpp> |\n-|#include <boost/multiprecision/cpp_int.hpp> |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-| |\n-|#include \"libtorrent/random.hpp\" |\n-|#include \"libtorrent/aux_/alloca.hpp\" |\n-|#include \"libtorrent/pe_crypto.hpp\" |\n-|#include \"libtorrent/hasher.hpp\" |\n-| |\n-|namespace libtorrent { |\n-| |\n-|\tnamespace mp = boost::multiprecision; |\n-| |\n-|\tnamespace { |\n-|key_t const dh_prime |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n |\t} |\n | |\n-|\tstd::array<char, 96> export_key(key_t const& k) |\n+|\tvoid session_impl::post_torrent_updates(status_flags_t const flags) |\n |\t{ |\n-|\t\tstd::array<char, 96> ret; |\n-|\t\tauto* begin = reinterpret_cast<std::uint8_t*>(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+|\t\tINVARIANT_CHECK; |\n | |\n-|\tnamespace { |\n-|\t\tkey_t const dh_prime |\n-|\t\t\t |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n-|\t} |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n | |\n-|\tstd::array<char, 96> export_key(key_t const& k) |\n-|\t{ |\n-|\t\tstd::array<char, 96> ret; |\n-|\t\tauto* begin = reinterpret_cast<std::uint8_t*>(ret.data()); |\n-|\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8); |\n+|\t\tstd::vector<torrent*>& state_updates |\n+|\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates]; |\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<std::size_t>(len)); |\n-|#if defined __GNUC__ && __GNUC__ == 12 |\n-|#pragma GCC diagnostic pop |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tm_posting_torrent_updates = true; |\n |#endif |\n-|\t\t\tstd::memset(begin, 0, aux::numeric_cast<std::size_t>(96 - len)); |\n-|\t\t} |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state); |\n-|\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state); |\n-| |\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-|_\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/_\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<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+|\t\tstd::vector<torrent_status> status; |\n+|\t\tstatus.reserve(state_updates.size()); |\n | |\n-|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const |\n-|\t{ |\n-|for (file_index_t const i : file_range()) |\n+|for (auto& t : state_updates) |\n |{ |\n-|\t\t\tif (root(i) == root_hash) return i; |\n+|\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list()); |\n+|\t\t\tstatus.emplace_back(); |\n+|\t\t\t// querying accurate download counters may require |\n+|\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another |\n+|\t\t\t// one will lead to calling state_updated(), which screws with |\n+|\t\t\t// this list while we're working on it, and break things |\n+|\t\t\tt->status(&status.back(), flags); |\n+|\t\t\tt->clear_in_state_update(); |\n |\t\t} |\n-|\t\treturn file_index_t{-1}; |\n-|\t} |\n-| |\n-|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n-|\t{ |\n-|\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())}; |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tchar const* file_storage::file_name_ptr(file_index_t const index) const |\n-|\t{ |\n-|\t\treturn m_files[index].name; |\n-|\t} |\n+|\t\tstate_updates.clear(); |\n | |\n-|\tint file_storage::file_name_len(file_index_t const index) const |\n-|\t{ |\n-|\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned) |\n-|\t\t\treturn -1; |\n-|\t\treturn m_files[index].name_len; |\n-|\t} |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tm_posting_torrent_updates = false; |\n |#endif |\n | |\n-|\tstd::vector<file_slice> file_storage::map_block(piece_index_t const piece |\n-|\t\t, std::int64_t const offset, std::int64_t size) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0}); |\n-|_\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\tm_alerts.emplace_alert<state_update_alert>(std::move(status)); |\n+|\t} |\n | |\n-|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\tvoid session_impl::post_session_stats() |\n |\t{ |\n-|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\n-| |\n-|\t\t// use this vector to track the new ordering of files |\n-|\t\t// this allows the use of STL algorithms despite them |\n-|\t\t// not supporting a custom swap functor |\n-|\t\taux::vector<file_index_t, file_index_t> new_order(end_file()); |\n-|\t\tfor (auto i : file_range()) |\n-|\t\t\tnew_order[i] = i; |\n-| |\n-|\t\t// remove any existing pad files |\n+|\t\tif (!m_posted_stats_header) |\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\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-| |\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+|#ifndef TORRENT_DISABLE_DHT |\n+|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bd_\bh_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b1_\b6_\b1_\b _\b _\b|_\bf_\ba_\bc_\bt_\bo_\br_\b _\bo_\bu_\bt_\b _\bt_\bh_\bi_\bs_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn f\bfo\bor\br u\bun\bni\bit\bt t\bte\bes\bst\bti\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b51\b16\b61\b1 *\b**\b**\b* |\n+|if (m_settings.get_int(settings_pack::outgoing_port) > 0) |\n |\t\t{ |\n-|\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-|_\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+|#ifdef TORRENT_WINDOWS |\n+|\t\t\ts.set_option(exclusive_address_use(true), ec); |\n+|#else |\n+|\t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec); |\n+|#endif |\n+|\t\t\t// ignore errors because the underlying socket may not |\n+|\t\t\t// be opened yet. This happens when we're routing through |\n+|\t\t\t// a proxy. In that case, we don't yet know the address of |\n+|\t\t\t// the proxy server, and more importantly, we don't know |\n+|\t\t\t// the address family of its address. This means we can't |\n+|\t\t\t// open the socket yet. The socks abstraction layer defers |\n+|\t\t\t// opening it. |\n+|\t\t\tec.clear(); |\n+|\t\t\tbind_ep.port(std::uint16_t(next_port())); |\n |\t\t} |\n | |\n-|\t\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-|std::unordered_set<std::string> dir_map; |\n-|bool 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\tif (is_utp(s)) |\n |\t\t{ |\n-|\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n | |\n-|\t\t\tif (!file_map_initialized) |\n+|utp_socket_impl* impl = nullptr; |\n+|\t\t\ttransport ssl = transport::plaintext; |\n+|#if TORRENT_USE_SSL |\n+|\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr) |\n |\t\t\t{ |\n-|\t\t\t\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\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl(); |\n+|\t\t\t\tssl = transport::ssl; |\n |\t\t\t} |\n+|\t\t\telse |\n+|#endif |\n+|\t\t\t\timpl = boost::get<utp_stream>(s).get_impl(); |\n | |\n-|\t\t\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\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways; |\n+|\t\t\tstd::shared_ptr<listen_socket_t> match; |\n+|\t\t\tfor (auto& ls : m_listen_sockets) |\n |\t\t\t{ |\n-|\t\t\t\tstd::string target = m_symlinks[fe.symlink_index]; |\n-| |\n-|\t\t\t\tif (is_complete(target)) |\n-|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\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+|\t\t\t\t// this is almost, but not quite, like can_route() |\n+|\t\t\t\tif (!(ls->flags & listen_socket_t::proxy) |\n+|\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4()) |\n+|\t\t\t\t\tcontinue; |\n+|\t\t\t\tif (ls->ssl != ssl) continue; |\n+|\t\t\t\tif (!(ls->flags & listen_socket_t::local_network)) |\n+|\t\t\t\t\twith_gateways.push_back(ls); |\n | |\n-|\t\t\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+|\t\t\t\tif (ls->flags & listen_socket_t::proxy |\n+|\t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// is this better than the previous match? |\n+|\t\t\t\t\tmatch = ls; |\n+|_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b8_\b0_\b _\b _\b|_\br_\be_\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bef\bfa\bac\bct\bto\bor\br,\b, m\bmo\bov\bve\be t\bth\bhe\be s\bst\bto\bor\bra\bag\bge\be t\bto\bo d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b58\b88\b80\b0 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tsession_log(\"not starting DHT, outstanding router lookups: %d\" |\n+|\t\t\t\t, m_outstanding_router_lookups); |\n |#endif |\n-|\t\t\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\treturn; |\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/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b8_\b _\b _\b _\b|_\bi_\bn_\b _\bt_\bh_\be_\b _\bf_\bu_\bt_\bu_\br_\be_\b,_\b _\bp_\br_\bo_\bp_\ba_\bg_\ba_\bt_\be_\b _\be_\bx_\bc_\be_\bp_\bt_\bi_\bo_\bn_\bs_\b _\bb_\ba_\bc_\bk_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bl_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bn t\bth\bhe\be f\bfu\but\btu\bur\bre\be,\b, p\bpr\bro\bop\bpa\bag\bga\bat\bte\be e\bex\bxc\bce\bep\bpt\bti\bio\bon\bns\bs b\bba\bac\bck\bk t\bto\bo t\bth\bhe\be h\bha\ban\bnd\bdl\ble\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo.\b.c\bcp\bpp\bp:\b:5\b57\b78\b8 *\b**\b**\b* |\n-|#if DEBUG_DISK_THREAD |\n+|\t\tif (m_abort) |\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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tsession_log(\"not starting DHT, aborting\"); |\n |#endif |\n+|\t\t\treturn; |\n+|\t\t} |\n | |\n-|\t\tstd::shared_ptr<mmap_storage> storage = j->storage; |\n-| |\n-|\t\tTORRENT_ASSERT(static_cast<int>(j->action) < int(job_functions.size())); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\" |\n+|\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups); |\n+|#endif |\n | |\n-|\t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1); |\n+|m_dht_storage = m_dht_storage_constructor(m_settings); |\n+|m_dht = std::make_shared<dht::dht_tracker>( |\n+|\t\t\tstatic_cast<dht::dht_observer*>(this) |\n+|\t\t\t, m_io_context |\n+|\t\t\t, [this](aux::listen_socket_handle const& sock |\n+|\t\t\t\t, udp::endpoint const& ep |\n+|\t\t\t\t, span<char const> p |\n+|\t\t\t\t, error_code& ec |\n+|\t\t\t\t, udp_send_flags_t const flags) |\n+|\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); } |\n+|\t\t\t, m_settings |\n+|\t\t\t, m_stats_counters |\n+|\t\t\t, *m_dht_storage |\n+|\t\t\t, std::move(m_dht_state)); |\n | |\n-|\t\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<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\tfor (auto& s : m_listen_sockets) |\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\tif (s->ssl != transport::ssl |\n+|\t\t\t\t&& !(s->flags & listen_socket_t::local_network)) |\n+|\t\t\t{ |\n+|\t\t\t\tm_dht->new_socket(s); |\n+|\t\t\t} |\n |\t\t} |\n-|\t\tcatch (std::exception const&) |\n+| |\n+|\t\tfor (auto const& n : m_dht_router_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\tm_dht->add_router_node(n); |\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<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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\tfor (auto const& n : m_dht_nodes) |\n+|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b7_\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bf_\bl_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bts\bs t\bth\bha\bat\bt n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bar\bre\be s\bst\bti\bil\bll\bl i\bin\bn f\bfl\bli\big\bgh\bht\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b62\b26\b67\b7 *\b**\b**\b* |\n+|if (!m_dht) return; |\n+|\t\tm_dht->direct_request(ep, e, std::bind(&on_direct_response, std::ref(m_alerts), userdata, _1)); |\n |\t} |\n | |\n-|\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-|add_fence_job(j); |\n-|} |\n+|#endif |\n | |\n-|\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j) |\n+|\tbool session_impl::is_listening() const |\n |\t{ |\n-|\t\t// we're not using a cache. This is the simple path |\n-|\t\t// just read straight from the file |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-| |\n-|\t\tbool const v1 = bool(j->flags & disk_interface::v1_hash); |\n-|\t\tbool const v2 = !j->d.h.block_hashes.empty(); |\n-| |\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+|\t\treturn !m_listen_sockets.empty(); |\n+|\t} |\n | |\n-|_\b\t_\b\t_\b\t_\bD_\bL_\bO_\bG_\b(_\b\"_\bd_\bo_\b__\bh_\ba_\bs_\bh_\b:_\b _\br_\be_\ba_\bd_\bi_\bn_\bg_\b _\b(_\bp_\bi_\be_\bc_\be_\b:_\b _\b%_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b:_\b _\b%_\bd_\b)_\b\\_\bn_\b\"_\b,_\b _\bi_\bn_\bt_\b(_\bj_\b-_\b>_\bp_\bi_\be_\bc_\be_\b)_\b,_\b _\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |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+|\tsession_impl::~session_impl() |\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+|\t\t// since we're destructing the session, no more alerts will make it out to |\n+|\t\t// the user. So stop posting them now |\n+|\t\tm_alerts.set_alert_mask({}); |\n+|\t\tm_alerts.set_notify_function({}); |\n | |\n-|\t\tif (m_port == -1 && protocol == \"http\") |\n-|\t\t\tm_port = 80; |\n+|\t\t// this is not allowed to be the network thread! |\n+|//\t\tTORRENT_ASSERT(is_not_thread()); |\n | |\n-|#if TORRENT_USE_SSL |\n-|\t\tif (protocol == \"https\") |\n+|// this can happen if we end the io_context run loop with an exception |\n+|\t\tm_connections.clear(); |\n+|\t\tfor (auto& t : m_torrents) |\n |\t\t{ |\n-|\t\t\tm_ssl = true; |\n-|\t\t\tif (m_port == -1) m_port = 443; |\n+|\t\t\tt->panic(); |\n+|\t\t\tt->abort(); |\n |\t\t} |\n-|#endif |\n-| |\n-|\t\tif (!m_basic_auth.empty()) |\n-|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n+|\t\tm_torrents.clear(); |\n | |\n-|\t\tm_server_string = m_host; |\n-|\t\taux::verify_encoding(m_server_string); |\n-|\t} |\n+|\t\t// this has probably been called already, but in case of sudden |\n+|\t\t// termination through an exception, it may not have been done |\n+|\t\tabort_stage2(); |\n | |\n-|\tint web_connection_base::timeout() const |\n-|\t{ |\n-|\t\t// since this is a web seed, change the timeout |\n-|\t\t// according to the settings. |\n-|\t\treturn m_settings.get_int(settings_pack::urlseed_timeout); |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:_\b8_\b8_\b7_\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bc_\bo_\bn_\bs_\bi_\bd_\be_\br_\be_\bd_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be c\bco\bon\bns\bsi\bid\bde\ber\bre\bed\bd a\ba f\bfa\bai\bil\blu\bur\bre\be,\b, a\ban\bnd\bd t\bth\bhe\be .\b.t\bto\bor\brr\bre\ben\bnt\bt f\bfi\bil\ble\be r\bre\bej\bje\bec\bct\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:8\b88\b87\b7 *\b**\b**\b* |\n-|std::string ext = extension(filename); |\n-|\t\t\tint cnt = 0; |\n-|\t\t\tfor (;;) |\n+|#if defined TORRENT_ASIO_DEBUGGING |\n+|\t\tFILE* f = fopen(\"wakeups.log\", \"w+\"); |\n+|\t\tif (f != nullptr) |\n+|\t\t{ |\n+|\t\t\ttime_point m = min_time(); |\n+|\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp; |\n+|\t\t\ttime_point prev = m; |\n+|\t\t\tstd::uint64_t prev_csw = 0; |\n+|\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches; |\n+|\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\"); |\n+|\t\t\tfor (wakeup_t const& w : _wakeups) |\n |\t\t\t{ |\n-|\t\t\t\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\t\t\tbool const idle_wakeup = w.context_switches > prev_csw; |\n+|\t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\" |\n+|\t\t\t\t\t, total_microseconds(w.timestamp - m) |\n+|\t\t\t\t\t, total_microseconds(w.timestamp - prev) |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bw_\b._\bc_\bo_\bn_\bt_\be_\bx_\bt_\b__\bs_\bw_\bi_\bt_\bc_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b7_\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bo_\bm_\bp_\ba_\br_\be_\b__\bl_\be_\bs_\bs_\b__\bw_\br_\ba_\bp_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bm_\bp_\ba_\br_\bi_\bs_\bo_\bn_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be c\bco\bom\bmp\bpa\bar\bre\be_\b_l\ble\bes\bss\bs_\b_w\bwr\bra\bap\bp f\bfo\bor\br t\bth\bhi\bis\bs c\bco\bom\bmp\bpa\bar\bri\bis\bso\bon\bn a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bac\bck\bke\bet\bt_\b_b\bbu\buf\bff\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b15\b57\b7 *\b**\b**\b* |\n+|{ |\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\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-|_\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/_\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+|\t\twhile (new_size < size) |\n+|\t\t\tnew_size <<= 1; |\n | |\n-|\tadd_torrent_params load_torrent_file(std::string const& filename) |\n-|\t{ return load_torrent_file(filename, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_buffer(span<char const> buffer) |\n-|\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file) |\n-|\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); } |\n+|\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]); |\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<torrent_info>(filename, cfg); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n+|\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i) |\n+|\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]); |\n | |\n-|\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\tm_storage = std::move(new_storage); |\n+|\t\tm_capacity = new_size; |\n |\t} |\n | |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n+|\tpacket_ptr packet_buffer::remove(index_type idx) |\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-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b _\bb_\by_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\be_\bi_\bt_\bh_\be_\br_\b _\bs_\bt_\ba_\bt_\bi_\bc_\b__\ba_\bs_\bs_\be_\br_\bt_\b(_\bs_\bt_\bd_\b:_\b:_\bi_\bs_\b__\bn_\bo_\bt_\bh_\br_\bo_\bw_\b__\bm_\bo_\bv_\be_\b__\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b:_\b:_\bv_\ba_\bl_\bu_\be_\b _\b,_\b _\b\"_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpr\bre\be C\bC+\b++\b+1\b17\b7,\b, G\bGC\bCC\bC a\ban\bnd\bd m\bms\bsv\bvc\bc d\bdo\boe\bes\bs n\bno\bot\bt m\bma\bak\bke\be s\bst\btd\bd:\b::\b:s\bst\btr\bri\bin\bng\bg n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be,\b, w\bwh\bhi\bic\bch\bh m\bme\bea\ban\bns\bs n\bno\bo t\bty\byp\bpe\be c\bco\bon\bnt\bta\bai\bin\bni\bin\bng\bg a\ba s\bst\btr\bri\bin\bng\bg w\bwi\bil\bll\bl b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be b\bby\by d\bde\bef\bfa\bau\bul\blt\bt e\bei\bit\bth\bhe\ber\br |\n-|s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_m\bmo\bov\bve\be_\b_a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:7\b78\b8 *\b**\b**\b* |\n-|DECL_FLAG(sequential_download); |\n-|\t\t\tDECL_FLAG(pinned); |\n-|\t\t\tDECL_FLAG(stop_when_ready); |\n-|\t\t\tDECL_FLAG(override_trackers); |\n-|\t\t\tDECL_FLAG(override_web_seeds); |\n-|\t\t\tDECL_FLAG(need_save_resume); |\n-|\t\t\tDECL_FLAG(override_resume_data); |\n-|\t\t\tDECL_FLAG(merge_resume_trackers); |\n-|\t\t\tDECL_FLAG(use_resume_save_path); |\n-|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n-|\t\t\tDECL_FLAG(default_flags); |\n-|#undef DECL_FLAG |\n-|#endif // TORRENT_ABI_VERSION |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible<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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs w\bwa\bas\bs n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b*|\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:8\b84\b4 *\b**\b**\b* |\n-|DECL_FLAG(pinned); |\n-|\t\t\tDECL_FLAG(stop_when_ready); |\n-|\t\t\tDECL_FLAG(override_trackers); |\n-|\t\t\tDECL_FLAG(override_web_seeds); |\n-|\t\t\tDECL_FLAG(need_save_resume); |\n-|\t\t\tDECL_FLAG(override_resume_data); |\n-|\t\t\tDECL_FLAG(merge_resume_trackers); |\n-|\t\t\tDECL_FLAG(use_resume_save_path); |\n-|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n-|\t\t\tDECL_FLAG(default_flags); |\n-|#undef DECL_FLAG |\n-|#endif // TORRENT_ABI_VERSION |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible<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+|\t\tINVARIANT_CHECK; |\n+|if (idx >= m_first + m_capacity) |\n+|return packet_ptr(); |\n | |\n+|\t\tif (compare_less_wrap(idx, m_first, 0xffff)) |\n+|\t\t\treturn packet_ptr(); |\n | |\n+|\t\tstd::size_t const mask = m_capacity - 1; |\n+|\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]); |\n+|\t\tm_storage[idx & mask].reset(); |\n | |\n-|namespace aux { |\n+|\t\tif (old_value) |\n+|\t\t{ |\n+|\t\t\t--m_size; |\n+|\t\t\tif (m_size == 0) m_last = m_first; |\n+|\t\t} |\n | |\n-|\t// returns whether this add_torrent_params object has \"resume-data\", i.e. |\n-|\t// information about which pieces we have. |\n-|\tbool contains_resume_data(add_torrent_params const& atp) |\n-|\t{ |\n-|\t\treturn !atp.have_pieces.empty() |\n-|\t\t\t|| (atp.flags & torrent_flags::seed_mode); |\n-|\t} |\n-|} |\n+|\t\tif (idx == m_first && m_size != 0) |\n+|\t\t{ |\n+|\t\t\t++m_first; |\n+|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first) |\n+|\t\t\t\tif (m_storage[m_first & mask]) break; |\n+|\t\t\tm_first &= 0xffff; |\n+|\t\t} |\n | |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 (((idx + 1) & 0xffff) == m_last && m_size != 0) |\n+|\t\t{ |\n+|\t\t\t--m_last; |\n+|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last) |\n+|\t\t\t\tif (m_storage[m_last & mask]) break; |\n+|\t\t\t++m_last; |\n+|_\b\t_\b\t_\b\t_\bm_\b__\bl_\ba_\bs_\bt_\b _\b&_\b=_\b _\b0_\bx_\bf_\bf_\bf_\bf_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bn_\bo_\bd_\be_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b7_\b7_\b _\b|_\bk_\be_\be_\bp_\b _\bt_\bh_\be_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b _\bv_\ba_\bl_\bu_\be_\b _\bt_\bo_\b _\bp_\ba_\bs_\bs_\b _\ba_\bs_\b _\ba_\b _\bl_\bi_\bm_\bi_\bt_\b _\bt_\bo_\b _\bw_\br_\bi_\bt_\be_\b__\bn_\bo_\bd_\be_\bs_\b__\be_\bn_\bt_\br_\bi_\be_\bs_\b _\bw_\bh_\be_\bn_\b _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* k\bke\bee\bep\bp t\bth\bhe\be r\bre\bet\btu\bur\brn\bne\bed\bd v\bva\bal\blu\bue\be t\bto\bo p\bpa\bas\bss\bs a\bas\bs a\ba l\bli\bim\bmi\bit\bt t\bto\bo w\bwr\bri\bit\bte\be_\b_n\bno\bod\bde\bes\bs_\b_e\ben\bnt\btr\bri\bie\bes\bs w\bwh\bhe\ben\bn i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/n\bno\bod\bde\be.\b.c\bcp\bpp\bp:\b:1\b11\b17\b77\b7 *\b**\b**\b* |\n |} |\n |\t} |\n |\telse if (query == \"sample_infohashes\") |\n |\t{ |\n@@ -10618,14 +10618,161 @@\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 |_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bj_\bo_\br_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bb_\br_\be_\ba_\bk_\b _\bt_\bh_\be_\b _\bA_\bB_\bI_\b _\ba_\bn_\bd_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\br_\be_\bp_\bo_\br_\bt_\bi_\bn_\bg_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\be_\bm_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* T\bTh\bhi\bis\bs i\bis\bs t\bte\bem\bmp\bpo\bor\bra\bar\bry\by.\b. F\bFo\bor\br n\bno\bow\bw,\b, o\bon\bnl\bly\by r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be l\bla\bar\brg\bge\bes\bst\bt r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be (\b(o\bof\bf p\bpo\bot\bte\ben\bnt\bti\bia\bal\bll\bly\by m\bmu\bul\blt\bti\bip\bpl\ble\be o\bon\bne\bes\bs,\b, f\bfo\bor\br m\bmu\bul\blt\bti\bi-\b-h\bho\bom\bme\bed\bd s\bsy\bys\bst\bte\bem\bms\bs)\b) i\bin\bn n\bne\bex\bxt\bt m\bma\baj\bjo\bor\br v\bve\ber\brs\bsi\bio\bon\bn,\b, b\bbr\bre\bea\bak\bk t\bth\bhe\be A\bAB\bBI\bI a\ban\bnd\bd |\n+|s\bsu\bup\bpp\bpo\bor\brt\bt r\bre\bep\bpo\bor\brt\bti\bin\bng\bg a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm i\bin\bn t\bth\bhe\be d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:2\b28\b89\b9 *\b**\b**\b* |\n+|, m_bucket_size(bucket_size) |\n+|{ |\n+|\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+|\tm_buckets.reserve(30); |\n+|} |\n+| |\n+|int routing_table::bucket_limit(int bucket) const |\n+|{ |\n+|\tif (!m_settings.get_bool(settings_pack::dht_extended_routing_table)) return m_bucket_size; |\n+| |\n+|\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+|if (s.size() > m_buckets.size()) return; |\n+|s.clear(); |\n+|\tfor (auto const& i : m_buckets) |\n+|\t{ |\n+|\t\tdht_routing_bucket b; |\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+|_\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+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |arvidn note when it's across IPv4 and IPv6, adding (dht_global_nodes) would make sense. in the future though, where we may have one |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bD_\bH_\bT_\b _\bn_\bo_\bd_\be_\b _\bp_\be_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b(_\bw_\bh_\bi_\bc_\bh_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bf_\ba_\bm_\bi_\bl_\by_\b)_\b,_\b _\bt_\bh_\be_\bn_\b _\bi_\bt_\b _\bb_\be_\bc_\bo_\bm_\be_\bs_\b _\ba_\b _\bb_\bi_\bt_\b _\bt_\br_\bi_\bc_\bk_\bi_\be_\br_\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\bar\brv\bvi\bid\bdn\bn n\bno\bot\bte\be w\bwh\bhe\ben\bn i\bit\bt'\b's\bs a\bac\bcr\bro\bos\bss\bs I\bIP\bPv\bv4\b4 a\ban\bnd\bd I\bIP\bPv\bv6\b6,\b, a\bad\bdd\bdi\bin\bng\bg (\b(d\bdh\bht\bt_\b_g\bgl\blo\bob\bba\bal\bl_\b_n\bno\bod\bde\bes\bs)\b) w\bwo\bou\bul\bld\bd m\bma\bak\bke\be s\bse\ben\bns\bse\be.\b. i\bin\bn t\bth\bhe\be f\bfu\but\btu\bur\bre\be t\bth\bho\bou\bug\bgh\bh,\b, w\bwh\bhe\ber\bre\be w\bwe\be m\bma\bay\by h\bha\bav\bve\be o\bon\bne\be D\bDH\bHT\bT n\bno\bod\bde\be p\bpe\ber\br e\bex\bxt\bte\ber\brn\bna\bal\bl i\bin\bnt\bte\ber\brf\bfa\bac\bce\be |\n+|(\b(w\bwh\bhi\bic\bch\bh m\bma\bay\by b\bbe\be m\bmu\bul\blt\bti\bip\bpl\ble\be o\bof\bf t\bth\bhe\be s\bsa\bam\bme\be a\bad\bdd\bdr\bre\bes\bss\bs f\bfa\bam\bmi\bil\bly\by)\b),\b, t\bth\bhe\ben\bn i\bit\bt b\bbe\bec\bco\bom\bme\bes\bs a\ba b\bbi\bit\bt t\btr\bri\bic\bck\bki\bie\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:3\b31\b14\b4 *\b**\b**\b* |\n+|if (s.size() > m_buckets.size()) return; |\n+|\ts.clear(); |\n+|\tfor (auto const& i : m_buckets) |\n+|\t{ |\n+|\t\tdht_routing_bucket b; |\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+|void routing_table::status(session_status& s) const |\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+|s.dht_global_nodes += num_global_nodes(); |\n+| |\n+|\tfor (auto const& i : m_buckets) |\n+|\t{ |\n+|\t\tdht_routing_bucket b; |\n+|\t\tb.num_nodes = int(i.live_nodes.size()); |\n+|\t\tb.num_replacements = int(i.replacements.size()); |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\tb.last_active = 0; |\n+|#endif |\n+|\t\ts.dht_routing_table.push_back(b); |\n+|\t} |\n+|} |\n+|#endif |\n+| |\n+|std::tuple<int, int, int> routing_table::size() const |\n+|{ |\n+|\tint nodes = 0; |\n+|\tint replacements = 0; |\n+|\tint confirmed = 0; |\n+|\tfor (auto const& i : m_buckets) |\n+|\t{ |\n+|\t\tnodes += int(i.live_nodes.size()); |\n+|\t\tconfirmed += static_cast<int>(std::count_if(i.live_nodes.begin(), i.live_nodes.end() |\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+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |this need to take bucket \"prefix\" into account. It should be unified with add_node_impl() |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b1_\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+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs n\bne\bee\bed\bd t\bto\bo t\bta\bak\bke\be b\bbu\buc\bck\bke\bet\bt \"\b\"p\bpr\bre\bef\bfi\bix\bx\"\b\" i\bin\bnt\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd b\bbe\be u\bun\bni\bif\bfi\bie\bed\bd w\bwi\bit\bth\bh a\bad\bdd\bd_\b_n\bno\bod\bde\be_\b_i\bim\bmp\bpl\bl(\b()\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/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:5\b51\b18\b8 *\b**\b**\b* |\n+|{ |\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+|\t\t\treturn std::make_tuple(&*j, i, &i->replacements); |\n+|\t\t} |\n+|\t\tfor (auto j = i->live_nodes.begin(); j != i->live_nodes.end(); ++j) |\n+|\t\t{ |\n+|\t\t\tif (j->addr() != ep.address()) continue; |\n+|\t\t\tif (j->port() != ep.port()) continue; |\n+|\t\t\treturn std::make_tuple(&*j, i, &i->live_nodes); |\n+|\t\t} |\n+|\t} |\n+|\treturn std::tuple<node_entry*, routing_table::table_t::iterator, bucket_t*> |\n+|\t{nullptr, m_buckets.end(), nullptr}; |\n+|} |\n+| |\n+|void routing_table::fill_from_replacements(table_t::iterator bucket) |\n+|{ |\n+|\tbucket_t& b = bucket->live_nodes; |\n+|\tbucket_t& rb = bucket->replacements; |\n+|\tint const bucket_size = bucket_limit(int(std::distance(m_buckets.begin(), bucket))); |\n+| |\n+|\tif (int(b.size()) >= bucket_size) return; |\n+| |\n+|\t// sort by RTT first, to find the node with the lowest |\n+|\t// RTT that is pinged |\n+|\tstd::sort(rb.begin(), rb.end()); |\n+| |\n+|\twhile (int(b.size()) < bucket_size && !rb.empty()) |\n+|\t{ |\n+|\t\tauto j = std::find_if(rb.begin(), rb.end(), std::bind(&node_entry::pinged, _1)); |\n+|\t\tif (j == rb.end()) break; |\n+|\t\tb.push_back(*j); |\n+|\t\trb.erase(j); |\n+|\t} |\n+|} |\n+| |\n+|void routing_table::prune_empty_bucket() |\n+|{ |\n+|\tif (m_buckets.back().live_nodes.empty() |\n+|\t\t&& m_buckets.back().replacements.empty()) |\n+|\t{ |\n+|\t\tm_buckets.erase(m_buckets.end() - 1); |\n+|\t} |\n+|} |\n+| |\n+|_\bv_\bo_\bi_\bd_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b:_\b:_\br_\be_\bm_\bo_\bv_\be_\b__\bn_\bo_\bd_\be_\b(_\bn_\bo_\bd_\be_\b__\be_\bn_\bt_\br_\by_\b*_\b _\bn_\b,_\b _\bb_\bu_\bc_\bk_\be_\bt_\b__\bt_\b*_\b _\bb_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bp_\bu_\bt_\b__\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b: |what if o is not an instance of put_data_observer? This need to be redesigned for better type safety. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt i\bif\bf o\bo i\bis\bs n\bno\bot\bt a\ban\bn i\bin\bns\bst\bta\ban\bnc\bce\be o\bof\bf p\bpu\but\bt_\b_d\bda\bat\bta\ba_\b_o\bob\bbs\bse\ber\brv\bve\ber\br?\b? T\bTh\bhi\bis\bs n\bne\bee\bed\bd t\bto\bo b\bbe\be r\bre\bed\bde\bes\bsi\big\bgn\bne\bed\bd f\bfo\bor\br b\bbe\bet\btt\bte\ber\br t\bty\byp\bpe\be s\bsa\baf\bfe\bet\bty\by.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/p\bpu\but\bt_\b_d\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:9\b92\b2 *\b**\b**\b* |\n |} |\n |} |\n | |\n@@ -10722,68 +10869,14 @@\n | |\n |\taddress_v4::bytes_type b4{}; |\n |\taddress_v6::bytes_type b6{}; |\n |\tif (ip_.is_v6()) |\n |\t{ |\n |\t\tb6 = ip_.to_v6().to_bytes(); |\n |_\b\t_\b\t_\bi_\bp_\b _\b=_\b _\bb_\b6_\b._\bd_\ba_\bt_\ba_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |pick the closest node rather than the first |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpi\bic\bck\bk t\bth\bhe\be c\bcl\blo\bos\bse\bes\bst\bt n\bno\bod\bde\be r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b17\b7 *\b**\b**\b* |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\" |\n-|\t\t\t, int(m_nodes.size())); |\n-|#endif |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::update_storage_node_ids() |\n-|\t{ |\n-|\t\tstd::vector<sha1_hash> ids; |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tids.push_back(n.second.dht.nid()); |\n-|\t\tm_storage.update_node_ids(ids); |\n-|\t} |\n-| |\n-|\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name) |\n-|\t{ |\n-|\t\tTORRENT_UNUSED(id); |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t{ |\n-|if (n.second.dht.protocol_family_name() == family_name) |\n-|return &n.second.dht; |\n-|\t\t} |\n-| |\n-|\t\treturn nullptr; |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::get_peers(sha1_hash const& ih |\n-|\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port |\n-|\t\t, announce_flags_t const flags |\n-|\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tn.second.dht.announce(ih, listen_port, flags, f); |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target |\n-|\t\t, std::function<void(node_id |\n-|\t\t\t, time_duration |\n-|\t\t\t, int, std::vector<sha1_hash> |\n-|\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t{ |\n-|_\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@@ -10830,161 +10923,68 @@\n |\tm_pk = pk; |\n |\tm_seq = seq; |\n |\tm_mutable = true; |\n |\tm_value = std::move(v); |\n |} |\n | |\n |_\bv_\bo_\bi_\bd_\b _\bi_\bt_\be_\bm_\b:_\b:_\ba_\bs_\bs_\bi_\bg_\bn_\b(_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bv_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bj_\bo_\br_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bb_\br_\be_\ba_\bk_\b _\bt_\bh_\be_\b _\bA_\bB_\bI_\b _\ba_\bn_\bd_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\br_\be_\bp_\bo_\br_\bt_\bi_\bn_\bg_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\be_\bm_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* T\bTh\bhi\bis\bs i\bis\bs t\bte\bem\bmp\bpo\bor\bra\bar\bry\by.\b. F\bFo\bor\br n\bno\bow\bw,\b, o\bon\bnl\bly\by r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be l\bla\bar\brg\bge\bes\bst\bt r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be (\b(o\bof\bf p\bpo\bot\bte\ben\bnt\bti\bia\bal\bll\bly\by m\bmu\bul\blt\bti\bip\bpl\ble\be o\bon\bne\bes\bs,\b, f\bfo\bor\br m\bmu\bul\blt\bti\bi-\b-h\bho\bom\bme\bed\bd s\bsy\bys\bst\bte\bem\bms\bs)\b) i\bin\bn n\bne\bex\bxt\bt m\bma\baj\bjo\bor\br v\bve\ber\brs\bsi\bio\bon\bn,\b, b\bbr\bre\bea\bak\bk t\bth\bhe\be A\bAB\bBI\bI a\ban\bnd\bd |\n-|s\bsu\bup\bpp\bpo\bor\brt\bt r\bre\bep\bpo\bor\brt\bti\bin\bng\bg a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm i\bin\bn t\bth\bhe\be d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:2\b28\b89\b9 *\b**\b**\b* |\n-|, m_bucket_size(bucket_size) |\n-|{ |\n-|\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-|\tm_buckets.reserve(30); |\n-|} |\n-| |\n-|int routing_table::bucket_limit(int bucket) const |\n-|{ |\n-|\tif (!m_settings.get_bool(settings_pack::dht_extended_routing_table)) return m_bucket_size; |\n-| |\n-|\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-|if (s.size() > m_buckets.size()) return; |\n-|s.clear(); |\n-|\tfor (auto const& i : m_buckets) |\n-|\t{ |\n-|\t\tdht_routing_bucket b; |\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-|_\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-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |arvidn note when it's across IPv4 and IPv6, adding (dht_global_nodes) would make sense. in the future though, where we may have one |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bD_\bH_\bT_\b _\bn_\bo_\bd_\be_\b _\bp_\be_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b(_\bw_\bh_\bi_\bc_\bh_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bf_\ba_\bm_\bi_\bl_\by_\b)_\b,_\b _\bt_\bh_\be_\bn_\b _\bi_\bt_\b _\bb_\be_\bc_\bo_\bm_\be_\bs_\b _\ba_\b _\bb_\bi_\bt_\b _\bt_\br_\bi_\bc_\bk_\bi_\be_\br_\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\bar\brv\bvi\bid\bdn\bn n\bno\bot\bte\be w\bwh\bhe\ben\bn i\bit\bt'\b's\bs a\bac\bcr\bro\bos\bss\bs I\bIP\bPv\bv4\b4 a\ban\bnd\bd I\bIP\bPv\bv6\b6,\b, a\bad\bdd\bdi\bin\bng\bg (\b(d\bdh\bht\bt_\b_g\bgl\blo\bob\bba\bal\bl_\b_n\bno\bod\bde\bes\bs)\b) w\bwo\bou\bul\bld\bd m\bma\bak\bke\be s\bse\ben\bns\bse\be.\b. i\bin\bn t\bth\bhe\be f\bfu\but\btu\bur\bre\be t\bth\bho\bou\bug\bgh\bh,\b, w\bwh\bhe\ber\bre\be w\bwe\be m\bma\bay\by h\bha\bav\bve\be o\bon\bne\be D\bDH\bHT\bT n\bno\bod\bde\be p\bpe\ber\br e\bex\bxt\bte\ber\brn\bna\bal\bl i\bin\bnt\bte\ber\brf\bfa\bac\bce\be |\n-|(\b(w\bwh\bhi\bic\bch\bh m\bma\bay\by b\bbe\be m\bmu\bul\blt\bti\bip\bpl\ble\be o\bof\bf t\bth\bhe\be s\bsa\bam\bme\be a\bad\bdd\bdr\bre\bes\bss\bs f\bfa\bam\bmi\bil\bly\by)\b),\b, t\bth\bhe\ben\bn i\bit\bt b\bbe\bec\bco\bom\bme\bes\bs a\ba b\bbi\bit\bt t\btr\bri\bic\bck\bki\bie\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:3\b31\b14\b4 *\b**\b**\b* |\n-|if (s.size() > m_buckets.size()) return; |\n-|\ts.clear(); |\n-|\tfor (auto const& i : m_buckets) |\n-|\t{ |\n-|\t\tdht_routing_bucket b; |\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-|void routing_table::status(session_status& s) const |\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-|s.dht_global_nodes += num_global_nodes(); |\n-| |\n-|\tfor (auto const& i : m_buckets) |\n-|\t{ |\n-|\t\tdht_routing_bucket b; |\n-|\t\tb.num_nodes = int(i.live_nodes.size()); |\n-|\t\tb.num_replacements = int(i.replacements.size()); |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\tb.last_active = 0; |\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\ts.dht_routing_table.push_back(b); |\n |\t} |\n-|} |\n-|#endif |\n | |\n-|std::tuple<int, int, int> routing_table::size() const |\n-|{ |\n-|\tint nodes = 0; |\n-|\tint replacements = 0; |\n-|\tint confirmed = 0; |\n-|\tfor (auto const& i : m_buckets) |\n+|\tvoid dht_tracker::update_storage_node_ids() |\n |\t{ |\n-|\t\tnodes += int(i.live_nodes.size()); |\n-|\t\tconfirmed += static_cast<int>(std::count_if(i.live_nodes.begin(), i.live_nodes.end() |\n-|\t\t\t, [](node_entry const& k) { return k.confirmed(); } )); |\n-| |\n-|\t\treplacements += int(i.replacements.size()); |\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-|\treturn std::make_tuple(nodes, replacements, confirmed); |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |this need to take bucket \"prefix\" into account. It should be unified with add_node_impl() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b1_\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-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs n\bne\bee\bed\bd t\bto\bo t\bta\bak\bke\be b\bbu\buc\bck\bke\bet\bt \"\b\"p\bpr\bre\bef\bfi\bix\bx\"\b\" i\bin\bnt\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd b\bbe\be u\bun\bni\bif\bfi\bie\bed\bd w\bwi\bit\bth\bh a\bad\bdd\bd_\b_n\bno\bod\bde\be_\b_i\bim\bmp\bpl\bl(\b()\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/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:5\b51\b18\b8 *\b**\b**\b* |\n-|{ |\n-|\tfor (auto i = m_buckets.begin() , end(m_buckets.end()); i != end; ++i) |\n+| |\n+|\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name) |\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-|\t\t\treturn std::make_tuple(&*j, i, &i->replacements); |\n-|\t\t} |\n-|\t\tfor (auto j = i->live_nodes.begin(); j != i->live_nodes.end(); ++j) |\n+|\t\tTORRENT_UNUSED(id); |\n+|\t\tfor (auto& n : m_nodes) |\n |\t\t{ |\n-|\t\t\tif (j->addr() != ep.address()) continue; |\n-|\t\t\tif (j->port() != ep.port()) continue; |\n-|\t\t\treturn std::make_tuple(&*j, i, &i->live_nodes); |\n+|if (n.second.dht.protocol_family_name() == family_name) |\n+|return &n.second.dht; |\n |\t\t} |\n-|\t} |\n-|\treturn std::tuple<node_entry*, routing_table::table_t::iterator, bucket_t*> |\n-|\t{nullptr, m_buckets.end(), nullptr}; |\n-|} |\n-| |\n-|void routing_table::fill_from_replacements(table_t::iterator bucket) |\n-|{ |\n-|\tbucket_t& b = bucket->live_nodes; |\n-|\tbucket_t& rb = bucket->replacements; |\n-|\tint const bucket_size = bucket_limit(int(std::distance(m_buckets.begin(), bucket))); |\n-| |\n-|\tif (int(b.size()) >= bucket_size) return; |\n | |\n-|\t// sort by RTT first, to find the node with the lowest |\n-|\t// RTT that is pinged |\n-|\tstd::sort(rb.begin(), rb.end()); |\n+|\t\treturn nullptr; |\n+|\t} |\n | |\n-|\twhile (int(b.size()) < bucket_size && !rb.empty()) |\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\tauto j = std::find_if(rb.begin(), rb.end(), std::bind(&node_entry::pinged, _1)); |\n-|\t\tif (j == rb.end()) break; |\n-|\t\tb.push_back(*j); |\n-|\t\trb.erase(j); |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n |\t} |\n-|} |\n | |\n-|void routing_table::prune_empty_bucket() |\n-|{ |\n-|\tif (m_buckets.back().live_nodes.empty() |\n-|\t\t&& m_buckets.back().replacements.empty()) |\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\tm_buckets.erase(m_buckets.end() - 1); |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.announce(ih, listen_port, flags, f); |\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+|\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target |\n+|\t\t, std::function<void(node_id |\n+|\t\t\t, time_duration |\n+|\t\t\t, int, std::vector<sha1_hash> |\n+|\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f) |\n+|\t{ |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t{ |\n+|_\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/_\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@@ -11031,152 +11031,121 @@\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/ |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+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |should this be allocated lazily? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs b\bbe\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd l\bla\baz\bzi\bil\bly\by?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b82\b23\b3 *\b**\b**\b* |\n+|// download list it may live in now |\n+|\t\tstd::vector<downloading_piece>::iterator update_piece_state( |\n+|\t\t\tstd::vector<downloading_piece>::iterator dp); |\n | |\n-|#include \"libtorrent/config.hpp\" |\n+|\tprivate: |\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+|#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-|#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+|\t\t// the following vectors are mutable because they sometimes may |\n+|\t\t// be updated lazily, triggered by const functions |\n | |\n-|#if TORRENT_ABI_VERSION == 1 |\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<piece_pos, piece_index_t> m_piece_map; |\n | |\n-|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\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// 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+|\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-|_\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/ |move to aux |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bto\bo a\bau\bux\bx *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be.\b.h\bhp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n-|namespace libtorrent { |\n+|\t\t// the number of bytes of pad file set in this piece picker |\n+|\t\tstd::int64_t m_num_pad_bytes = 0; |\n | |\n-|// A type describing kinds of sockets involved in various operations or events. |\n-|enum class socket_type_t : std::uint8_t { |\n-|\ttcp, |\n-|\tsocks5, |\n-|\thttp, |\n-|\tutp, |\n-|\ti2p, |\n-|\ttcp_ssl, |\n-|\tsocks5_ssl, |\n-|\thttp_ssl, |\n-|\tutp_ssl, |\n+|\t\t// the number of pad blocks that we already have |\n+|\t\tstd::int64_t m_have_pad_bytes = 0; |\n | |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tudp TORRENT_DEPRECATED_ENUM = utp, |\n-|#endif |\n-|}; |\n+|\t\t// the number of pad blocks part of filtered pieces we don't have |\n+|\t\tstd::int64_t m_filtered_pad_bytes = 0; |\n | |\n-|// return a short human readable name for types of socket |\n-|char const* socket_type_name(socket_type_t); |\n+|\t\t// the number of pad blocks we have that are also filtered |\n+|\t\tstd::int64_t m_have_filtered_pad_bytes = 0; |\n | |\n-|} |\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#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |include the number of peers received from this tracker, at last announce |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b76\b6 *\b**\b**\b* |\n-|\tstruct TORRENT_EXPORT announce_infohash |\n-|\t{ |\n-|\t\t// internal |\n-|\t\tTORRENT_UNEXPORT announce_infohash(); |\n+|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bv_\be_\bc_\bt_\bo_\br_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\bs_\b _\ba_\bl_\bl_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\bi_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bp_\bi_\bc_\bk_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be more intuitive to account \"wanted\" pieces instead of filtered |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b9_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be i\bin\bnt\btu\bui\bit\bti\biv\bve\be t\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt \"\b\"w\bwa\ban\bnt\bte\bed\bd\"\b\" p\bpi\bie\bec\bce\bes\bs i\bin\bns\bst\bte\bea\bad\bd o\bof\bf f\bfi\bil\blt\bte\ber\bre\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b89\b95\b5 *\b**\b**\b* |\n+|\t\t// this holds the information of the blocks in partially downloaded |\n+|\t\t// pieces. the downloading_piece::info index point into this vector for |\n+|\t\t// its storage |\n+|\t\taux::vector<block_info> m_block_info; |\n | |\n-|\t\t// if this tracker has returned an error or warning message |\n-|\t\t// that message is stored here |\n-|\t\tstd::string message; |\n+|\t\t// 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\t// if this tracker failed the last time it was contacted |\n-|\t\t// this error code specifies what error occurred |\n-|\t\terror_code last_error; |\n+|\t\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 time of next tracker announce |\n-|\t\ttime_point32 next_announce = (time_point32::min)(); |\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// no announces before this time |\n-|\t\ttime_point32 min_announce = (time_point32::min)(); |\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-|// 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// 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// if this tracker has returned scrape data, these fields are filled in |\n-|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n-|\t\t// the number of current downloaders. ``complete`` counts the number of |\n-|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n-|\t\t// cumulative number of completed downloads. |\n-|\t\tint scrape_incomplete = -1; |\n-|\t\tint scrape_complete = -1; |\n-|\t\tint scrape_downloaded = -1; |\n+|\t\t// the number of pieces we have (i.e. passed hash check). |\n+|\t\t// This includes pieces that we have filtered but still have |\n+|\t\tint m_num_have = 0; |\n | |\n-|\t\t// 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// 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\t// true while we're waiting for a response from the tracker. |\n-|\t\tbool updating : 1; |\n+|\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 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+|\t}; |\n+|} |\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+|_\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/ |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@@ -11442,14 +11411,108 @@\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/ |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<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+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |include the number of peers received from this tracker, at last announce |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b76\b6 *\b**\b**\b* |\n+|\tstruct TORRENT_EXPORT announce_infohash |\n+|\t{ |\n+|\t\t// internal |\n+|\t\tTORRENT_UNEXPORT announce_infohash(); |\n+| |\n+|\t\t// if this tracker has returned an error or warning message |\n+|\t\t// that message is stored here |\n+|\t\tstd::string message; |\n+| |\n+|\t\t// if this tracker failed the last time it was contacted |\n+|\t\t// this error code specifies what error occurred |\n+|\t\terror_code last_error; |\n+| |\n+|\t\t// the time of next tracker announce |\n+|\t\ttime_point32 next_announce = (time_point32::min)(); |\n+| |\n+|\t\t// no announces before this time |\n+|\t\ttime_point32 min_announce = (time_point32::min)(); |\n+| |\n+| |\n+|// these are either -1 or the scrape information this tracker last |\n+|\t\t// responded with. *incomplete* is the current number of downloaders in |\n+|\t\t// the swarm, *complete* is the current number of seeds in the swarm and |\n+|\t\t// *downloaded* is the cumulative number of completed downloads of this |\n+|\t\t// torrent, since the beginning of time (from this tracker's point of |\n+|\t\t// view). |\n+| |\n+|\t\t// if this tracker has returned scrape data, these fields are filled in |\n+|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n+|\t\t// the number of current downloaders. ``complete`` counts the number of |\n+|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n+|\t\t// cumulative number of completed downloads. |\n+|\t\tint scrape_incomplete = -1; |\n+|\t\tint scrape_complete = -1; |\n+|\t\tint scrape_downloaded = -1; |\n+| |\n+|\t\t// the number of times in a row we have failed to announce to this |\n+|\t\t// tracker. |\n+|\t\tstd::uint8_t fails : 7; |\n+| |\n+|\t\t// true while we're waiting for a response from the tracker. |\n+|\t\tbool updating : 1; |\n+| |\n+|\t\t// set to true when we get a valid response from an announce |\n+|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n+|\t\t// announces. |\n+|\t\tbool start_sent : 1; |\n+| |\n+|\t\t// set to true when we send a event=completed. |\n+|_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | |_\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@@ -11497,121 +11560,208 @@\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_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs b\bbe\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd l\bla\baz\bzi\bil\bly\by?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b82\b23\b3 *\b**\b**\b* |\n-|// download list it may live in now |\n-|\t\tstd::vector<downloading_piece>::iterator update_piece_state( |\n-|\t\t\tstd::vector<downloading_piece>::iterator dp); |\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<aux::merkle_tree, file_index_t>& trees); |\n+| |\n+|\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces); |\n+| |\n+|\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes); |\n+|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+|\t\t// do we know the piece layer hash for a piece |\n+|\t\tbool have_hash(piece_index_t index) const; |\n+|\t\t// do we know all the block hashes for a file? |\n+|\t\tbool have_all(file_index_t file) const; |\n+|\t\tbool have_all() const; |\n+|\t\tbool piece_verified(piece_index_t piece) const; |\n+| |\n+|\t\tint piece_layer() const { return m_piece_layer; } |\n | |\n |\tprivate: |\n+|\t\t// returns the number of proof layers needed to verify the node's hash |\n+|\t\tint layers_to_verify(node_index idx) const; |\n+|\t\tint file_num_layers(file_index_t idx) const; |\n | |\n-|#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+|\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/ |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 <boost/optional.hpp> |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\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+|#include \"libtorrent/peer_id.hpp\" |\n+|#include \"libtorrent/fingerprint.hpp\" |\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<piece_pos, piece_index_t> m_piece_map; |\n+|namespace libtorrent { |\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+|namespace aux { |\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+|\tTORRENT_EXTRA_EXPORT |\n+|\tstd::string identify_client_impl(const peer_id& p); |\n | |\n-|\t\t// the number of bytes of pad file set in this piece picker |\n-|\t\tstd::int64_t m_num_pad_bytes = 0; |\n+|} |\n | |\n-|\t\t// the number of pad blocks that we already have |\n-|\t\tstd::int64_t m_have_pad_bytes = 0; |\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// the number of pad blocks part of filtered pieces we don't have |\n-|\t\tstd::int64_t m_filtered_pad_bytes = 0; |\n+|\t// 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// the number of pad blocks we have that are also filtered |\n-|\t\tstd::int64_t m_have_filtered_pad_bytes = 0; |\n+|#if TORRENT_ABI_VERSION == 1 |\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+|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\n | |\n-|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bv_\be_\bc_\bt_\bo_\br_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\bs_\b _\ba_\bl_\bl_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\bi_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bp_\bi_\bc_\bk_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be more intuitive to account \"wanted\" pieces instead of filtered |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b9_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be i\bin\bnt\btu\bui\bit\bti\biv\bve\be t\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt \"\b\"w\bwa\ban\bnt\bte\bed\bd\"\b\" p\bpi\bie\bec\bce\bes\bs i\bin\bns\bst\bte\bea\bad\bd o\bof\bf f\bfi\bil\blt\bte\ber\bre\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b89\b95\b5 *\b**\b**\b* |\n-|\t\t// this holds the information of the blocks in partially downloaded |\n-|\t\t// pieces. the downloading_piece::info index point into this vector for |\n-|\t\t// its storage |\n-|\t\taux::vector<block_info> m_block_info; |\n+|\t// Returns an optional fingerprint if any can be identified from the peer |\n+|\t// id. This can be used to automate the identification of clients. It will |\n+|\t// not be able to identify peers with non- standard encodings. Only Azureus |\n+|\t// style, Shadow's style and Mainline style. |\n+|\tTORRENT_DEPRECATED_EXPORT |\n+|\tboost::optional<fingerprint> |\n+|\t\tclient_fingerprint(peer_id const& p); |\n | |\n-|\t\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+|_\b#_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b _\b\"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\bs_\b__\bp_\bo_\bp_\b._\bh_\bp_\bp_\b\"_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |support using the windows API for UPnP operations as well |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwi\bin\bnd\bdo\bow\bws\bs A\bAP\bPI\bI f\bfo\bor\br U\bUP\bPn\bnP\bP o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/u\bup\bpn\bnp\bp.\b.h\bhp\bpp\bp:\b:1\b16\b62\b2 *\b**\b**\b* |\n+|{ |\n+|\tbool in_error_code = false; |\n+|\tbool exit = false; |\n+|\tint error_code = -1; |\n+|}; |\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+|struct ip_address_parse_state: error_code_parse_state |\n+|{ |\n+|\tbool in_ip_address = false; |\n+|\tstd::string ip_address; |\n+|}; |\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+|TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state); |\n | |\n-|\t\t// the number of pieces we have that also are filtered |\n-|\t\tint m_num_have_filtered = 0; |\n+|TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string |\n+|\t, error_code_parse_state& state); |\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+|TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string |\n+|\t, ip_address_parse_state& state); |\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+|struct TORRENT_EXTRA_EXPORT upnp final |\n+|: std::enable_shared_from_this<upnp> |\n+|\t, single_threaded |\n+|{ |\n+|\tupnp(io_context& ios |\n+|\t\t, aux::session_settings const& settings |\n+|\t\t, aux::portmap_callback& cb |\n+|\t\t, address_v4 listen_address |\n+|\t\t, address_v4 netmask |\n+|\t\t, std::string listen_device |\n+|\t\t, aux::listen_socket_handle ls); |\n+|\t~upnp(); |\n | |\n-|\t\t// the number of pieces we have (i.e. passed hash check). |\n-|\t\t// This includes pieces that we have filtered but still have |\n-|\t\tint m_num_have = 0; |\n+|\tvoid start(); |\n | |\n-|\t\t// if this is set to true, it means update_pieces() |\n-|\t\t// has to be called before accessing m_pieces. |\n-|\t\tmutable bool m_dirty = false; |\n-|\tpublic: |\n+|\t// Attempts to add a port mapping for the specified protocol. Valid protocols are |\n+|\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and |\n+|\t// ``natpmp::udp`` for the NAT-PMP class. |\n+|\t// |\n+|\t// ``external_port`` is the port on the external address that will be mapped. This |\n+|\t// is a hint, you are not guaranteed that this port will be available, and it may |\n+|\t// end up being something else. In the portmap_alert_ notification, the actual |\n+|\t// external port is reported. |\n+|\t// |\n+|\t// ``local_port`` is the port in the local machine that the mapping should forward |\n+|\t// to. |\n+|\t// |\n+|\t// The return value is an index that identifies this port mapping. This is used |\n+|\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and |\n+|\t// portmap_alert_ respectively. If The mapping fails immediately, the return value |\n+|_\b\t_\b/_\b/_\b _\bi_\bs_\b _\b-_\b1_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b._\b _\bT_\bh_\be_\br_\be_\b _\bw_\bi_\bl_\bl_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bn_\by_\b _\be_\br_\br_\bo_\br_\b _\ba_\bl_\be_\br_\bt_\b _\bn_\bo_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move to aux |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bto\bo a\bau\bux\bx *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be.\b.h\bhp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n+|namespace libtorrent { |\n | |\n-|\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 1 }; |\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-|\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+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a string_view |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b5_\b3_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bi2\b2p\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:5\b53\b33\b3 *\b**\b**\b* |\n |\t\tchar tmp[20]; |\n |\t\taux::random_bytes(tmp); |\n |\t\tm_session_id.resize(sizeof(tmp)*2); |\n@@ -11658,14 +11808,69 @@\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/ |it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec); |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b2_\b2_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bem\bme\bem\bmb\bbe\ber\br t\bth\bhe\be b\bbi\bin\bnd\bd p\bpo\bor\brt\bt a\ban\bnd\bd b\bbi\bin\bnd\bd o\bon\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bhe\ber\bre\be t\bth\bhe\be p\bpr\bro\box\bxy\by i\bis\bs m\bm_\b_s\bso\boc\bck\bk.\b.b\bbi\bin\bnd\bd(\b(e\ben\bnd\bdp\bpo\boi\bin\bnt\bt,\b, e\bec\bc)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:2\b22\b27\b7 *\b**\b**\b* |\n+|TORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_sock.cancel(); |\n+|\t} |\n+| |\n+|\tvoid cancel(error_code& ec) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_sock.cancel(ec); |\n+|\t} |\n+| |\n+|\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\t// the reason why we ignore binds here is because we don't |\n+|\t\t// (necessarily) yet know what address family the proxy |\n+|\t\t// will resolve to, and binding to the wrong one would |\n+|\t\t// break our connection attempt later. The caller here |\n+|\t\t// doesn't necessarily know that we're proxying, so this |\n+|\t\t// bind address is based on the final endpoint, not the |\n+|\t\t// proxy. |\n+|} |\n+| |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid open(protocol_type const&) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|//\t\tm_sock.open(p); |\n+|\t} |\n+|#endif |\n+| |\n+|\tvoid open(protocol_type const&, error_code&) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\t// we need to ignore this for the same reason as stated |\n+|\t\t// for ignoring bind() |\n+|//\t\tm_sock.open(p, ec); |\n+|\t} |\n+| |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_remote_endpoint = endpoint_type(); |\n+|\t\tm_sock.close(); |\n+|\t\tm_resolver.cancel(); |\n+|\t} |\n+|#endif |\n+| |\n+|\tvoid close(error_code& ec) |\n+|\t{ |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bm_\b__\bm_\ba_\bg_\bi_\bc_\b _\b=_\b=_\b _\b0_\bx_\b1_\b3_\b3_\b7_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |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@@ -11713,124 +11918,69 @@\n |{ |\n |\twhile (pos < v.size()) |\n |\t{ |\n |\t\tif (std::strchr(c, v[pos]) != nullptr) return pos; |\n |\t\t++pos; |\n |\t} |\n |_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b:_\b:_\bn_\bp_\bo_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |support batched adding of block hashes for reduced overhead? |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\ba_\bs_\bh_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt b\bba\bat\btc\bch\bhe\bed\bd a\bad\bdd\bdi\bin\bng\bg o\bof\bf b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs f\bfo\bor\br r\bre\bed\bdu\buc\bce\bed\bd o\bov\bve\ber\brh\bhe\bea\bad\bd?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/h\bha\bas\bsh\bh_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:1\b15\b55\b5 *\b**\b**\b* |\n-|// the number of hashes in the range |\n-|\t\tint count = 0; |\n-|\t\tint proof_layers = 0; |\n-|\t}; |\n-| |\n-|\t// validates the hash_request, to ensure its invariant as well as matching |\n-|\t// the torrent's file_storage and the number of hashes accompanying the |\n-|\t// request |\n-|\tTORRENT_EXTRA_EXPORT |\n-|\tbool validate_hash_request(hash_request const& hr, file_storage const& fs); |\n-| |\n-|\tclass TORRENT_EXTRA_EXPORT hash_picker |\n-|\t{ |\n-|\tpublic: |\n-|\t\thash_picker(file_storage const& files |\n-|\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees); |\n-| |\n-|\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces); |\n-| |\n-|\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes); |\n-|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-|\t\t// do we know the piece layer hash for a piece |\n-|\t\tbool have_hash(piece_index_t index) const; |\n-|\t\t// do we know all the block hashes for a file? |\n-|\t\tbool have_all(file_index_t file) const; |\n-|\t\tbool have_all() const; |\n-|\t\tbool piece_verified(piece_index_t piece) const; |\n-| |\n-|\t\tint piece_layer() const { return m_piece_layer; } |\n-| |\n-|\tprivate: |\n-|\t\t// returns the number of proof layers needed to verify the node's hash |\n-|\t\tint layers_to_verify(node_index idx) const; |\n-|\t\tint file_num_layers(file_index_t idx) const; |\n-| |\n-|\t\tstruct piece_hash_request |\n-|\t\t{ |\n-|\t\t\ttime_point last_request = min_time(); |\n-|\t\t\tint num_requests = 0; |\n-|\t\t\tbool have = false; |\n-|\t\t}; |\n-| |\n-|\t\tstruct priority_block_request |\n-|\t\t{ |\n-|\t\t\tpriority_block_request(file_index_t const f, int const b) |\n-|\t\t\t\t: file(f), block(b) {} |\n-|\t\t\tfile_index_t file; |\n-|_\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/ |it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec); |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b2_\b2_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bem\bme\bem\bmb\bbe\ber\br t\bth\bhe\be b\bbi\bin\bnd\bd p\bpo\bor\brt\bt a\ban\bnd\bd b\bbi\bin\bnd\bd o\bon\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bhe\ber\bre\be t\bth\bhe\be p\bpr\bro\box\bxy\by i\bis\bs m\bm_\b_s\bso\boc\bck\bk.\b.b\bbi\bin\bnd\bd(\b(e\ben\bnd\bdp\bpo\boi\bin\bnt\bt,\b, e\bec\bc)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:2\b22\b27\b7 *\b**\b**\b* |\n-|TORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_sock.cancel(); |\n+|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-|\tvoid cancel(error_code& ec) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_sock.cancel(ec); |\n-|\t} |\n+|private: |\n | |\n-|\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */) |\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\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\t// the reason why we ignore binds here is because we don't |\n-|\t\t// (necessarily) yet know what address family the proxy |\n-|\t\t// will resolve to, and binding to the wrong one would |\n-|\t\t// break our connection attempt later. The caller here |\n-|\t\t// doesn't necessarily know that we're proxying, so this |\n-|\t\t// bind address is based on the final endpoint, not the |\n-|\t\t// proxy. |\n-|} |\n+|\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n | |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid open(protocol_type const&) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|//\t\tm_sock.open(p); |\n-|\t} |\n-|#endif |\n+|\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-|\tvoid open(protocol_type const&, error_code&) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\t// we need to ignore this for the same reason as stated |\n-|\t\t// for ignoring bind() |\n-|//\t\tm_sock.open(p, ec); |\n+|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-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid close() |\n+|\ttemplate <typename Handler> |\n+|\tvoid connected(error_code const& e, Handler h) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_remote_endpoint = endpoint_type(); |\n-|\t\tm_sock.close(); |\n-|\t\tm_resolver.cancel(); |\n-|\t} |\n-|#endif |\n+|\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n | |\n-|\tvoid close(error_code& ec) |\n-|\t{ |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bm_\b__\bm_\ba_\bg_\bi_\bc_\b _\b=_\b=_\b _\b0_\bx_\b1_\b3_\b3_\b7_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\tusing namespace libtorrent::aux; |\n+|\t\tif (m_version == 5) |\n+|\t\t{ |\n+|\t\t\t// send SOCKS5 authentication methods |\n+|\t\t\tm_buffer.resize(m_user.empty()?3:4); |\n+|\t\t\tchar* p = &m_buffer[0]; |\n+|\t\t\twrite_uint8(5, p); // SOCKS VERSION 5 |\n+|\t\t\tif (m_user.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth) |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(2, p); // 2 authentication methods |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t\twrite_uint8(2, p); // username/password |\n+|\t\t\t} |\n+|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b:_\b:_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b1_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b2_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bw_\ba_\by_\bs_\b _\bo_\bu_\bt_\bl_\bi_\bv_\be_\b _\bt_\bh_\be_\bi_\br_\b _\bp_\be_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br (\b(t\bto\bo s\bsa\bav\bve\be s\bsi\biz\bze\be i\bin\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt c\bca\bac\bch\bhe\be l\bli\bin\bne\be)\b) a\ban\bnd\bd m\bma\bak\bke\be t\bth\bhe\be c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br t\bta\bak\bke\be a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br.\b. t\bto\bor\brr\bre\ben\bnt\bt o\bob\bbj\bje\bec\bct\bts\bs s\bsh\bho\bou\bul\bld\bd a\bal\blw\bwa\bay\bys\bs o\bou\but\btl\bli\biv\bve\be t\bth\bhe\bei\bir\br p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:2\b21\b18\b8 *\b**\b**\b* |\n |, m_snubbed(false) |\n |\t\t\t, m_interesting(false) |\n |\t\t\t, m_choked(true) |\n@@ -11932,164 +12082,14 @@\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/ |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 <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-|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 <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-|_\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/ |support using the windows API for UPnP operations as well |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwi\bin\bnd\bdo\bow\bws\bs A\bAP\bPI\bI f\bfo\bor\br U\bUP\bPn\bnP\bP o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/u\bup\bpn\bnp\bp.\b.h\bhp\bpp\bp:\b:1\b16\b62\b2 *\b**\b**\b* |\n-|{ |\n-|\tbool in_error_code = false; |\n-|\tbool exit = false; |\n-|\tint error_code = -1; |\n-|}; |\n-| |\n-|struct ip_address_parse_state: error_code_parse_state |\n-|{ |\n-|\tbool in_ip_address = false; |\n-|\tstd::string ip_address; |\n-|}; |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state); |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string |\n-|\t, error_code_parse_state& state); |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string |\n-|\t, ip_address_parse_state& state); |\n-| |\n-|struct TORRENT_EXTRA_EXPORT upnp final |\n-|: std::enable_shared_from_this<upnp> |\n-|\t, single_threaded |\n-|{ |\n-|\tupnp(io_context& ios |\n-|\t\t, aux::session_settings const& settings |\n-|\t\t, aux::portmap_callback& cb |\n-|\t\t, address_v4 listen_address |\n-|\t\t, address_v4 netmask |\n-|\t\t, std::string listen_device |\n-|\t\t, aux::listen_socket_handle ls); |\n-|\t~upnp(); |\n-| |\n-|\tvoid start(); |\n-| |\n-|\t// Attempts to add a port mapping for the specified protocol. Valid protocols are |\n-|\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and |\n-|\t// ``natpmp::udp`` for the NAT-PMP class. |\n-|\t// |\n-|\t// ``external_port`` is the port on the external address that will be mapped. This |\n-|\t// is a hint, you are not guaranteed that this port will be available, and it may |\n-|\t// end up being something else. In the portmap_alert_ notification, the actual |\n-|\t// external port is reported. |\n-|\t// |\n-|\t// ``local_port`` is the port in the local machine that the mapping should forward |\n-|\t// to. |\n-|\t// |\n-|\t// The return value is an index that identifies this port mapping. This is used |\n-|\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and |\n-|\t// portmap_alert_ respectively. If The mapping fails immediately, the return value |\n-|_\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/ |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<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-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move 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,328 +12177,58 @@\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 |_\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/ |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<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-|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<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-|_\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/ |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-| |\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-|\t\taux::array<listen_port_mapping, 2, portmap_transport> tcp_port_mapping; |\n-|\t\taux::array<listen_port_mapping, 2, portmap_transport> udp_port_mapping; |\n-| |\n-|\t\t// indicates whether this is an SSL listen socket or not |\n-|\t\ttransport ssl = transport::plaintext; |\n-| |\n-|\t\tlisten_socket_flags_t flags = accept_incoming; |\n-| |\n-|\t\t// the actual sockets (TCP listen socket and UDP socket) |\n-|\t\t// An entry does not necessarily have a UDP or TCP socket. One of these |\n-|\t\t// pointers may be nullptr! |\n-|\t\t// These must be shared_ptr to avoid a dangling reference if an |\n-|\t\t// incoming packet is in the event queue when the socket is erased |\n-|std::shared_ptr<tcp::acceptor> sock; |\n-|std::shared_ptr<aux::session_udp_socket> udp_sock; |\n-| |\n-|\t\t// since udp packets are expected to be dispatched frequently, this saves |\n-|\t\t// time on handler allocation every time we read again. |\n-|\t\taux::handler_storage<aux::udp_handler_max_size, aux::udp_handler> udp_handler_storage; |\n-| |\n-|\t\tstd::shared_ptr<natpmp> natpmp_mapper; |\n-|\t\tstd::shared_ptr<upnp> upnp_mapper; |\n-| |\n-|\t\tstd::shared_ptr<struct lsd> lsd; |\n-| |\n-|\t\t// set to true when we receive an incoming connection from this listen |\n-|\t\t// socket |\n-|\t\tbool incoming_connection = false; |\n-|\t}; |\n-| |\n-|\t\tstruct TORRENT_EXTRA_EXPORT listen_endpoint_t |\n-|\t\t{ |\n-|\t\t\tlisten_endpoint_t(address const& adr, int p, std::string dev, transport s |\n-|\t\t\t\t, listen_socket_flags_t f, address const& nmask = address{}) |\n-|\t\t\t\t: addr(adr), netmask(nmask), port(p), device(std::move(dev)), ssl(s), flags(f) {} |\n-| |\n-|\t\t\tbool operator==(listen_endpoint_t const& o) const |\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-|_\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b06\b68\b8 *\b**\b**\b* |\n-|#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+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |figure out which version of clang this is supported in |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b._\bh_\bp_\bp_\b:_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfi\big\bgu\bur\bre\be o\bou\but\bt w\bwh\bhi\bic\bch\bh v\bve\ber\brs\bsi\bio\bon\bn o\bof\bf c\bcl\bla\ban\bng\bg t\bth\bhi\bis\bs i\bis\bs s\bsu\bup\bpp\bpo\bor\brt\bte\bed\bd i\bin\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd.\b.h\bhp\bpp\bp:\b:4\b47\b7 *\b**\b**\b* |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\t\t\t// round-robin index into m_outgoing_interfaces |\n-|\t\t\tmutable std::uint8_t m_interface_index = 0; |\n+|*/ |\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+|#ifndef TORRENT_DEPRECATED_HPP_INCLUDED |\n+|#define TORRENT_DEPRECATED_HPP_INCLUDED |\n | |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\t\tdht::dht_state m_dht_state; |\n+|#if !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED [[deprecated]] |\n+|#else |\n+|# define TORRENT_DEPRECATED |\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-|\t\t\t// unchoke_interval and the unchoke set is |\n-|\t\t\t// recomputed. |\n-|int m_unchoke_time_scaler = 0; |\n+|#if defined __clang__ |\n | |\n-|\t\t\t// this is used to decide when to recalculate which |\n-|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bo_\b _\bk_\be_\be_\bp_\b _\bq_\bu_\be_\bu_\be_\bd_\b _\ba_\bn_\bd_\b _\bw_\bh_\bi_\bc_\bh_\b _\bt_\bo_\b _\ba_\bc_\bt_\bi_\bv_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\b7_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b07\b73\b3 *\b**\b**\b* |\n-|\t\t\t// round-robin index into m_outgoing_interfaces |\n-|\t\t\tmutable std::uint8_t m_interface_index = 0; |\n+|// ====== CLANG ======== |\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+|# if !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n+|# endif |\n | |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\t\tdht::dht_state m_dht_state; |\n-|#endif |\n+|#elif defined __GNUC__ |\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-|\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+|// ======== GCC ======== |\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-|int m_auto_manage_time_scaler = 0; |\n+|// deprecation markup is only enabled when libtorrent |\n+|// headers are included by clients, not while building |\n+|// libtorrent itself |\n+|# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n+|# endif |\n | |\n-|\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-|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b _\bu_\bn_\bc_\bh_\bo_\bk_\be_\b _\bi_\bs_\b _\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\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 |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b08\b80\b0 *\b**\b**\b* |\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-|\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-|\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-|int m_optimistic_unchoke_time_scaler = 0; |\n-| |\n-|\t\t\t// works like unchoke_time_scaler. Each time |\n-|\t\t\t// it reaches 0, and all the connections are |\n-|\t\t\t// used, the worst connection will be disconnected |\n-|\t\t\t// from the torrent with the most peers |\n-|\t\t\tint m_disconnect_time_scaler = 90; |\n-| |\n-|\t\t\t// when this scaler reaches zero, it will |\n-|\t\t\t// scrape one of the auto managed, paused, |\n-|\t\t\t// torrents. |\n-|\t\t\tint m_auto_scrape_time_scaler = 180; |\n-| |\n-|\t\t\t// statistics gathered from all torrents. |\n-|\t\t\tstat m_stat; |\n-| |\n-|\t\t\t// implements session_interface |\n-|\t\t\tvoid sent_bytes(int bytes_payload, int bytes_protocol) override; |\n-|\t\t\tvoid received_bytes(int bytes_payload, int bytes_protocol) override; |\n-|\t\t\tvoid trancieve_ip_packet(int bytes, bool ipv6) override; |\n-|\t\t\tvoid sent_syn(bool ipv6) override; |\n-|\t\t\tvoid received_synack(bool ipv6) override; |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\t\tint m_peak_up_rate = 0; |\n+|#ifndef TORRENT_DEPRECATED_ENUM |\n+|#define TORRENT_DEPRECATED_ENUM |\n |#endif |\n | |\n-|\t\t\tvoid on_tick(error_code const& e); |\n-| |\n-|\t\t\tvoid try_connect_more_peers(); |\n-|_\b\t_\b\t_\b\t_\bv_\bo_\bi_\bd_\b _\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\bs_\bt_\bd_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bt_\bo_\br_\br_\be_\bn_\bt_\b*_\b>_\b&_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |include the number of peers received from this tracker, at last announce |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b74\b4 *\b**\b**\b* |\n-|namespace aux { |\n-| |\n-|\tstruct TORRENT_EXTRA_EXPORT announce_infohash |\n-|\t{ |\n-|\t\tannounce_infohash(); |\n-| |\n-|\t\t// if this tracker has returned an error or warning message |\n-|\t\t// that message is stored here |\n-|\t\tstd::string message; |\n-| |\n-|\t\t// if this tracker failed the last time it was contacted |\n-|\t\t// this error code specifies what error occurred |\n-|\t\terror_code last_error; |\n-| |\n-|\t\t// the time of next tracker announce |\n-|\t\ttime_point32 next_announce = (time_point32::min)(); |\n-| |\n-|\t\t// no announces before this time |\n-|\t\ttime_point32 min_announce = (time_point32::min)(); |\n-| |\n-| |\n-|// these are either -1 or the scrape information this tracker last |\n-|\t\t// responded with. *incomplete* is the current number of downloaders in |\n-|\t\t// the swarm, *complete* is the current number of seeds in the swarm and |\n-|\t\t// *downloaded* is the cumulative number of completed downloads of this |\n-|\t\t// torrent, since the beginning of time (from this tracker's point of |\n-|\t\t// view). |\n-| |\n-|\t\t// if this tracker has returned scrape data, these fields are filled in |\n-|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n-|\t\t// the number of current downloaders. ``complete`` counts the number of |\n-|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n-|\t\t// cumulative number of completed downloads. |\n-|\t\tint scrape_incomplete = -1; |\n-|\t\tint scrape_complete = -1; |\n-|\t\tint scrape_downloaded = -1; |\n-| |\n-|\t\t// the number of times in a row we have failed to announce to this |\n-|\t\t// tracker. |\n-|\t\tstd::uint8_t fails : 7; |\n-| |\n-|\t\t// true while we're waiting for a response from the tracker. |\n-|\t\tbool updating : 1; |\n-| |\n-|\t\t// set to true when we get a valid response from an announce |\n-|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n-|\t\t// announces. |\n-|\t\tbool start_sent : 1; |\n-| |\n-|\t\t// set to true when we send a event=completed. |\n-|_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |ensure the alignment is good here |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bo_\bl_\b._\bh_\bp_\bp_\b:_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* e\ben\bns\bsu\bur\bre\be t\bth\bhe\be a\bal\bli\big\bgn\bnm\bme\ben\bnt\bt i\bis\bs g\bgo\boo\bod\bd h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/p\bpo\boo\bol\bl.\b.h\bhp\bpp\bp:\b:4\b49\b9 *\b**\b**\b* |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#ifndef TORRENT_POOL_HPP |\n-|#define TORRENT_POOL_HPP |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include <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-|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<allocator_new_delete>; |\n-| |\n-|template <typename T> |\n-|using object_pool = boost::object_pool<T, allocator_new_delete>; |\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@@ -12600,57 +12330,106 @@\n | |\n |\t\t// we don't have any hashes in this tree. m_tree should be empty |\n |\t\t// an empty tree still always have the root hash (available as root()) |\n |\t\tempty_tree, |\n | |\n |\t\t// in this mode, m_tree represents the full tree, including padding. |\n |_\b\t_\b\t_\bf_\bu_\bl_\bl_\b__\bt_\br_\be_\be_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |figure out which version of clang this is supported in |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b._\bh_\bp_\bp_\b:_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfi\big\bgu\bur\bre\be o\bou\but\bt w\bwh\bhi\bic\bch\bh v\bve\ber\brs\bsi\bio\bon\bn o\bof\bf c\bcl\bla\ban\bng\bg t\bth\bhi\bis\bs i\bis\bs s\bsu\bup\bpp\bpo\bor\brt\bte\bed\bd i\bin\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd.\b.h\bhp\bpp\bp:\b:4\b47\b7 *\b**\b**\b* |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |include the number of peers received from this tracker, at last announce |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b74\b4 *\b**\b**\b* |\n+|namespace aux { |\n | |\n-|*/ |\n+|\tstruct TORRENT_EXTRA_EXPORT announce_infohash |\n+|\t{ |\n+|\t\tannounce_infohash(); |\n | |\n-|#ifndef TORRENT_DEPRECATED_HPP_INCLUDED |\n-|#define TORRENT_DEPRECATED_HPP_INCLUDED |\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-|#if !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED [[deprecated]] |\n-|#else |\n-|# define TORRENT_DEPRECATED |\n-|#endif |\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-|#if defined __clang__ |\n+|\t\t// the time of next tracker announce |\n+|\t\ttime_point32 next_announce = (time_point32::min)(); |\n | |\n-|// ====== CLANG ======== |\n+|\t\t// no announces before this time |\n+|\t\ttime_point32 min_announce = (time_point32::min)(); |\n | |\n-|# if !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n-|# endif |\n | |\n-|#elif defined __GNUC__ |\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-|// ======== GCC ======== |\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-|// deprecation markup is only enabled when libtorrent |\n-|// headers are included by clients, not while building |\n-|// libtorrent itself |\n-|# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n-|# endif |\n+|\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-|#endif |\n+|\t\t// true while we're waiting for a response from the tracker. |\n+|\t\tbool updating : 1; |\n | |\n-|#ifndef TORRENT_DEPRECATED_ENUM |\n-|#define TORRENT_DEPRECATED_ENUM |\n-|#endif |\n+|\t\t// set to true when we get a valid response from an announce |\n+|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n+|\t\t// announces. |\n+|\t\tbool start_sent : 1; |\n+| |\n+|\t\t// set to true when we send a event=completed. |\n+|_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |ensure the alignment is good here |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bo_\bl_\b._\bh_\bp_\bp_\b:_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* e\ben\bns\bsu\bur\bre\be t\bth\bhe\be a\bal\bli\big\bgn\bnm\bme\ben\bnt\bt i\bis\bs g\bgo\boo\bod\bd h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/p\bpo\boo\bol\bl.\b.h\bhp\bpp\bp:\b:4\b49\b9 *\b**\b**\b* |\n+|POSSIBILITY OF SUCH DAMAGE. |\n+| |\n+|*/ |\n+| |\n+|#ifndef TORRENT_POOL_HPP |\n+|#define TORRENT_POOL_HPP |\n+| |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include <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+|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<allocator_new_delete>; |\n+| |\n+|template <typename T> |\n+|using object_pool = boost::object_pool<T, allocator_new_delete>; |\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/ |in C++17, Handler and Storage could just use \"auto\" |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bn_\bg_\b__\bh_\ba_\bn_\bd_\bl_\be_\br_\b._\bh_\bp_\bp_\b:_\b3_\b1_\b6_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7,\b, H\bHa\ban\bnd\bdl\ble\ber\br a\ban\bnd\bd S\bSt\bto\bor\bra\bag\bge\be c\bco\bou\bul\bld\bd j\bju\bus\bst\bt u\bus\bse\be \"\b\"a\bau\but\bto\bo\"\b\" *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\bal\bll\blo\boc\bca\bat\bti\bin\bng\bg_\b_h\bha\ban\bnd\bdl\ble\ber\br.\b.h\bhp\bpp\bp:\b:3\b31\b16\b6 *\b**\b**\b* |\n |\tprivate: |\n@@ -12754,7 +12533,228 @@\n |\t// it's important that these match the enums in performance_counters for |\n |\t// num_utp_idle etc. |\n |\tenum class state_t { |\n |\t\t// not yet connected |\n |\t\tnone, |\n |\t\t// sent a syn packet, not received any acks |\n |_\b\t_\b\t_\bs_\by_\bn_\b__\bs_\be_\bn_\bt_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |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+| |\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+|\t\taux::array<listen_port_mapping, 2, portmap_transport> tcp_port_mapping; |\n+|\t\taux::array<listen_port_mapping, 2, portmap_transport> udp_port_mapping; |\n+| |\n+|\t\t// indicates whether this is an SSL listen socket or not |\n+|\t\ttransport ssl = transport::plaintext; |\n+| |\n+|\t\tlisten_socket_flags_t flags = accept_incoming; |\n+| |\n+|\t\t// the actual sockets (TCP listen socket and UDP socket) |\n+|\t\t// An entry does not necessarily have a UDP or TCP socket. One of these |\n+|\t\t// pointers may be nullptr! |\n+|\t\t// These must be shared_ptr to avoid a dangling reference if an |\n+|\t\t// incoming packet is in the event queue when the socket is erased |\n+|std::shared_ptr<tcp::acceptor> sock; |\n+|std::shared_ptr<aux::session_udp_socket> udp_sock; |\n+| |\n+|\t\t// since udp packets are expected to be dispatched frequently, this saves |\n+|\t\t// time on handler allocation every time we read again. |\n+|\t\taux::handler_storage<aux::udp_handler_max_size, aux::udp_handler> udp_handler_storage; |\n+| |\n+|\t\tstd::shared_ptr<natpmp> natpmp_mapper; |\n+|\t\tstd::shared_ptr<upnp> upnp_mapper; |\n+| |\n+|\t\tstd::shared_ptr<struct lsd> lsd; |\n+| |\n+|\t\t// set to true when we receive an incoming connection from this listen |\n+|\t\t// socket |\n+|\t\tbool incoming_connection = false; |\n+|\t}; |\n+| |\n+|\t\tstruct TORRENT_EXTRA_EXPORT listen_endpoint_t |\n+|\t\t{ |\n+|\t\t\tlisten_endpoint_t(address const& adr, int p, std::string dev, transport s |\n+|\t\t\t\t, listen_socket_flags_t f, address const& nmask = address{}) |\n+|\t\t\t\t: addr(adr), netmask(nmask), port(p), device(std::move(dev)), ssl(s), flags(f) {} |\n+| |\n+|\t\t\tbool operator==(listen_endpoint_t const& o) const |\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+|_\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b06\b68\b8 *\b**\b**\b* |\n+|#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+|\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+|\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+|\t\t\t// unchoke_interval and the unchoke set is |\n+|\t\t\t// recomputed. |\n+|int m_unchoke_time_scaler = 0; |\n+| |\n+|\t\t\t// this is used to decide when to recalculate which |\n+|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bo_\b _\bk_\be_\be_\bp_\b _\bq_\bu_\be_\bu_\be_\bd_\b _\ba_\bn_\bd_\b _\bw_\bh_\bi_\bc_\bh_\b _\bt_\bo_\b _\ba_\bc_\bt_\bi_\bv_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\b7_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b07\b73\b3 *\b**\b**\b* |\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+|\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+|\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+|int 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+|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b _\bu_\bn_\bc_\bh_\bo_\bk_\be_\b _\bi_\bs_\b _\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/ |replace this by a proper asio timer |\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:_\b1_\b0_\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 |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by a\ba p\bpr\bro\bop\bpe\ber\br a\bas\bsi\bio\bo t\bti\bim\bme\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:1\b10\b08\b80\b0 *\b**\b**\b* |\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+|\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+|\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+|int m_optimistic_unchoke_time_scaler = 0; |\n+| |\n+|\t\t\t// works like unchoke_time_scaler. Each time |\n+|\t\t\t// it reaches 0, and all the connections are |\n+|\t\t\t// used, the worst connection will be disconnected |\n+|\t\t\t// from the torrent with the most peers |\n+|\t\t\tint m_disconnect_time_scaler = 90; |\n+| |\n+|\t\t\t// when this scaler reaches zero, it will |\n+|\t\t\t// scrape one of the auto managed, paused, |\n+|\t\t\t// torrents. |\n+|\t\t\tint m_auto_scrape_time_scaler = 180; |\n+| |\n+|\t\t\t// statistics gathered from all torrents. |\n+|\t\t\tstat m_stat; |\n+| |\n+|\t\t\t// implements session_interface |\n+|\t\t\tvoid sent_bytes(int bytes_payload, int bytes_protocol) override; |\n+|\t\t\tvoid received_bytes(int bytes_payload, int bytes_protocol) override; |\n+|\t\t\tvoid trancieve_ip_packet(int bytes, bool ipv6) override; |\n+|\t\t\tvoid sent_syn(bool ipv6) override; |\n+|\t\t\tvoid received_synack(bool ipv6) override; |\n+| |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\t\tint m_peak_up_rate = 0; |\n+|#endif |\n+| |\n+|\t\t\tvoid on_tick(error_code const& e); |\n+| |\n+|\t\t\tvoid try_connect_more_peers(); |\n+|_\b\t_\b\t_\b\t_\bv_\bo_\bi_\bd_\b _\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\bs_\bt_\bd_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bt_\bo_\br_\br_\be_\bn_\bt_\b*_\b>_\b&_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |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<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+|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<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+|_\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"}]}]}]}]}]}