diff --git a/docs/building.html b/docs/building.html index 8f926773b..3b44f38d6 100644 --- a/docs/building.html +++ b/docs/building.html @@ -360,6 +360,8 @@ API is used.
  • off - internal invariant checks are disabled. The resulting executable will run faster than a regular debug build.
  • +
  • full - turns on extra expensive invariant +checks.
  • @@ -520,8 +522,8 @@ invariant checks and asserts built into it. If you want to disable such checks defines you can use to control the build.

    --++ @@ -648,6 +650,11 @@ very well. This option can be used to still build in debug mode, with asserts enabled, but make the resulting executable faster. + + +
    macro
    TORRENT_EXPENSIVE_INVARIANT_CHECKSThis will enable extra expensive invariant +checks. Useful for finding particular bugs +or for running before releases.

    If you experience that libtorrent uses unreasonable amounts of cpu, it will diff --git a/docs/manual.html b/docs/manual.html index 95c0e9a57..c08a031c4 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -2524,6 +2524,7 @@ struct peer_info seed = 0x400, optimistic_unchoke = 0x800, snubbed = 0x1000, + upload_only = 0x2000, rc4_encrypted = 0x100000, plaintext_encrypted = 0x200000 }; @@ -2678,6 +2679,12 @@ the request timeout from when the request was sent. We're currently picking one block at a time from this peer. +upload_only +This peer has either explicitly (with an extension) +or implicitly (by becoming a seed) told us that it +will not downloading anything more, regardless of +which pieces we have. +

    source is a combination of flags describing from which sources this peer diff --git a/docs/manual.rst b/docs/manual.rst index cc07ab4f6..d5ae6fe86 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2502,6 +2502,7 @@ It contains the following fields:: seed = 0x400, optimistic_unchoke = 0x800, snubbed = 0x1000, + upload_only = 0x2000, rc4_encrypted = 0x100000, plaintext_encrypted = 0x200000 }; @@ -2639,6 +2640,11 @@ any combination of the enums above. The following table describes each flag: | | We're currently picking one block at a time from this | | | peer. | +-------------------------+-------------------------------------------------------+ +| ``upload_only`` | This peer has either explicitly (with an extension) | +| | or implicitly (by becoming a seed) told us that it | +| | will not downloading anything more, regardless of | +| | which pieces we have. | ++-------------------------+-------------------------------------------------------+ __ extension_protocol.html diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 5be698dab..c51597472 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -381,6 +381,7 @@ void print_peer_info(std::ostream& out, std::vector const (i->write_state == peer_info::bw_global)?'w': (i->write_state == peer_info::bw_network)?'W':'.') << ((i->flags & peer_info::snubbed)?'S':'.') + << ((i->flags & peer_info::upload_only)?'U':'D') #ifndef TORRENT_DISABLE_ENCRYPTION << ((i->flags & peer_info::rc4_encrypted)?'E': (i->flags & peer_info::plaintext_encrypted)?'e':'.') diff --git a/include/libtorrent/peer_info.hpp b/include/libtorrent/peer_info.hpp index 83aa217cf..c85069bff 100644 --- a/include/libtorrent/peer_info.hpp +++ b/include/libtorrent/peer_info.hpp @@ -57,7 +57,8 @@ namespace libtorrent on_parole = 0x200, seed = 0x400, optimistic_unchoke = 0x800, - snubbed = 0x1000 + snubbed = 0x1000, + upload_only = 0x2000 #ifndef TORRENT_DISABLE_ENCRYPTION , rc4_encrypted = 0x100000, plaintext_encrypted = 0x200000 diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index d151d957e..95dd990b5 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2497,6 +2497,7 @@ namespace libtorrent p.flags |= is_seed() ? peer_info::seed : 0; p.flags |= m_snubbed ? peer_info::snubbed : 0; + p.flags |= m_upload_only ? peer_info::upload_only : 0; if (peer_info_struct()) { policy::peer* pi = peer_info_struct();