fix typo in #if tests for TORRENT_DISABLE_ENCRYPTION
This commit is contained in:
parent
6f4f394f29
commit
92f1937b97
|
@ -444,7 +444,7 @@ namespace aux {
|
|||
, std::vector<address> const& addresses, int port);
|
||||
#endif
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
torrent const* find_encrypted_torrent(
|
||||
sha1_hash const& info_hash, sha1_hash const& xor_mask) override;
|
||||
|
||||
|
@ -876,7 +876,7 @@ namespace aux {
|
|||
// ordered by their queue position
|
||||
aux::vector<torrent*, queue_position_t> m_download_queue;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// this maps obfuscated hashes to torrents. It's only
|
||||
// used when encryption is enabled
|
||||
torrent_map m_obfuscated_torrents;
|
||||
|
|
|
@ -294,7 +294,7 @@ namespace aux {
|
|||
virtual boost::asio::ssl::context* ssl_ctx() = 0 ;
|
||||
#endif
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
virtual torrent const* find_encrypted_torrent(
|
||||
sha1_hash const& info_hash, sha1_hash const& xor_mask) = 0;
|
||||
virtual void add_obfuscated_hash(sha1_hash const& obfuscated
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace libtorrent {
|
|||
|
||||
~bt_peer_connection() override;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
bool supports_encryption() const
|
||||
{ return m_encrypted; }
|
||||
bool rc4_encrypted() const
|
||||
|
@ -171,7 +171,7 @@ namespace libtorrent {
|
|||
, std::size_t bytes_transferred) override;
|
||||
void on_receive_impl(std::size_t bytes_transferred);
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// next_barrier, buffers-to-prepend
|
||||
std::tuple<int, span<span<char const>>>
|
||||
hit_send_barrier(span<span<char>> iovec) override;
|
||||
|
@ -295,7 +295,7 @@ namespace libtorrent {
|
|||
// will be invalid.
|
||||
piece_block_progress downloading_piece_progress() const override;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
|
||||
// if (is_local()), we are 'a' otherwise 'b'
|
||||
//
|
||||
|
@ -324,7 +324,7 @@ namespace libtorrent {
|
|||
template <typename Holder>
|
||||
void append_const_send_buffer(Holder holder, int size)
|
||||
{
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
if (!m_enc_handler.is_send_plaintext())
|
||||
{
|
||||
// if we're encrypting this buffer, we need to make a copy
|
||||
|
@ -343,7 +343,7 @@ namespace libtorrent {
|
|||
|
||||
enum class state_t : std::uint8_t
|
||||
{
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
read_pe_dhkey,
|
||||
read_pe_syncvc,
|
||||
read_pe_synchash,
|
||||
|
@ -386,7 +386,7 @@ namespace libtorrent {
|
|||
// only done once per connection
|
||||
bool m_sent_allowed_fast:1;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// this is set to true after the encryption method has been
|
||||
// successfully negotiated (either plaintext or rc4), to signal
|
||||
// automatic encryption/decryption.
|
||||
|
@ -436,7 +436,7 @@ namespace libtorrent {
|
|||
|
||||
std::vector<range> m_payloads;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// initialized during write_pe1_2_dhkey, and destroyed on
|
||||
// creation of m_enc_handler. Cannot reinitialize once
|
||||
// initialized.
|
||||
|
|
|
@ -88,7 +88,7 @@ struct TORRENT_EXTRA_EXPORT receive_buffer
|
|||
// This is the "current" packet.
|
||||
span<char const> get() const;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// returns the buffer from the current packet start position to the last
|
||||
// received byte (possibly part of another packet)
|
||||
span<char> mutable_buffer();
|
||||
|
@ -159,7 +159,7 @@ private:
|
|||
buffer m_recv_buffer;
|
||||
};
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// Wraps a receive_buffer to provide the ability to inject
|
||||
// possibly authenticated crypto beneath the bittorrent protocol.
|
||||
// When authenticated crypto is in use the wrapped receive_buffer
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace libtorrent {
|
|||
peer_source_flags_t peer_source() const
|
||||
{ return peer_source_flags_t(source); }
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// Hints encryption support of torrent_peer. Only effective
|
||||
// for and when the outgoing encryption policy
|
||||
// allows both encrypted and non encrypted
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace libtorrent {
|
|||
, (tracker_req().event != tracker_request::none) ? event_string[tracker_req().event - 1] : ""
|
||||
, tracker_req().num_want);
|
||||
url += str;
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
if (settings.get_int(settings_pack::in_enc_policy) != settings_pack::pe_disabled
|
||||
&& settings.get_bool(settings_pack::announce_crypto_support))
|
||||
url += "&supportcrypto=1";
|
||||
|
|
|
@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
*/
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
|
||||
#include <cstdint>
|
||||
#include <algorithm>
|
||||
|
@ -411,4 +411,4 @@ std::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state)
|
|||
|
||||
} // namespace libtorrent
|
||||
|
||||
#endif // TORRENT_DISABLE_ENCRYPION
|
||||
#endif // TORRENT_DISABLE_ENCRYPTION
|
||||
|
|
|
@ -4275,7 +4275,7 @@ namespace libtorrent {
|
|||
if (m_outgoing) m_counters.inc_stats_counter(counters::error_outgoing_peers);
|
||||
else m_counters.inc_stats_counter(counters::error_incoming_peers);
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
if (type() == connection_type::bittorrent && op != operation_t::connect)
|
||||
{
|
||||
auto* bt = static_cast<bt_peer_connection*>(this);
|
||||
|
|
|
@ -315,7 +315,7 @@ bool bt_peer_connection_handle::support_extensions() const
|
|||
|
||||
bool bt_peer_connection_handle::supports_encryption() const
|
||||
{
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
std::shared_ptr<bt_peer_connection> pc = native_handle();
|
||||
TORRENT_ASSERT(pc);
|
||||
return pc->supports_encryption();
|
||||
|
@ -326,7 +326,7 @@ bool bt_peer_connection_handle::supports_encryption() const
|
|||
|
||||
void bt_peer_connection_handle::switch_send_crypto(std::shared_ptr<crypto_plugin> crypto)
|
||||
{
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
std::shared_ptr<bt_peer_connection> pc = native_handle();
|
||||
TORRENT_ASSERT(pc);
|
||||
pc->switch_send_crypto(std::move(crypto));
|
||||
|
@ -337,7 +337,7 @@ void bt_peer_connection_handle::switch_send_crypto(std::shared_ptr<crypto_plugin
|
|||
|
||||
void bt_peer_connection_handle::switch_recv_crypto(std::shared_ptr<crypto_plugin> crypto)
|
||||
{
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
std::shared_ptr<bt_peer_connection> pc = native_handle();
|
||||
TORRENT_ASSERT(pc);
|
||||
pc->switch_recv_crypto(std::move(crypto));
|
||||
|
|
|
@ -922,7 +922,7 @@ namespace libtorrent {
|
|||
|
||||
if (m_round_robin >= iter - m_peers.begin()) ++m_round_robin;
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
if (flags & pex_encryption) p->pe_support = true;
|
||||
#endif
|
||||
if (flags & pex_seed)
|
||||
|
|
|
@ -150,7 +150,7 @@ span<char const> receive_buffer::get() const
|
|||
return aux::typed_span<char const>(m_recv_buffer).subspan(m_recv_start, m_recv_pos);
|
||||
}
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
span<char> receive_buffer::mutable_buffer()
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
@ -230,7 +230,7 @@ void receive_buffer::reset(int const packet_size)
|
|||
m_packet_size = packet_size;
|
||||
}
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
bool crypto_receive_buffer::packet_finished() const
|
||||
{
|
||||
if (m_recv_pos == INT_MAX)
|
||||
|
|
|
@ -4460,7 +4460,7 @@ namespace aux {
|
|||
trigger_auto_manage();
|
||||
}
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
torrent const* session_impl::find_encrypted_torrent(sha1_hash const& info_hash
|
||||
, sha1_hash const& xor_mask)
|
||||
{
|
||||
|
@ -4803,7 +4803,7 @@ namespace aux {
|
|||
|
||||
m_torrents.insert(std::make_pair(params.info_hash, torrent_ptr));
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
static char const req2[4] = {'r', 'e', 'q', '2'};
|
||||
hasher h(req2);
|
||||
h.update(params.info_hash);
|
||||
|
@ -5191,7 +5191,7 @@ namespace aux {
|
|||
m_torrents.erase(i);
|
||||
tptr->removed();
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
static char const req2[4] = {'r', 'e', 'q', '2'};
|
||||
hasher h(req2);
|
||||
h.update(tptr->info_hash());
|
||||
|
@ -6092,13 +6092,13 @@ namespace aux {
|
|||
|
||||
#endif
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
void session_impl::add_obfuscated_hash(sha1_hash const& obfuscated
|
||||
, std::weak_ptr<torrent> const& t)
|
||||
{
|
||||
m_obfuscated_torrents.insert(std::make_pair(obfuscated, t.lock()));
|
||||
}
|
||||
#endif // TORRENT_DISABLE_ENCRYPION
|
||||
#endif // TORRENT_DISABLE_ENCRYPTION
|
||||
|
||||
bool session_impl::is_listening() const
|
||||
{
|
||||
|
|
|
@ -490,7 +490,7 @@ bool is_downloading_state(int const st)
|
|||
aux::random_shuffle(ws.begin(), ws.end());
|
||||
for (auto& w : ws) m_web_seeds.push_back(std::move(w));
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
static char const req2[4] = {'r', 'e', 'q', '2'};
|
||||
hasher h(req2);
|
||||
h.update(m_torrent_file->info_hash());
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace libtorrent {
|
|||
, fast_reconnects(0)
|
||||
, trust_points(0)
|
||||
, source(static_cast<std::uint8_t>(src))
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
// assume no support in order to
|
||||
// prefer opening non-encrypted
|
||||
// connections. If it fails, we'll
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace libtorrent { namespace {
|
|||
// used as a rendezvous point in case direct
|
||||
// connections to the peer fail
|
||||
pex_flags_t flags = p->is_seed() ? pex_seed : pex_flags_t{};
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
flags |= p->supports_encryption() ? pex_encryption : pex_flags_t{};
|
||||
#endif
|
||||
flags |= is_utp(*p->get_socket()) ? pex_utp : pex_flags_t{};
|
||||
|
@ -552,7 +552,7 @@ namespace libtorrent { namespace {
|
|||
// used as a rendezvous point in case direct
|
||||
// connections to the peer fail
|
||||
int flags = p->is_seed() ? 2 : 0;
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
flags |= p->supports_encryption() ? 1 : 0;
|
||||
#endif
|
||||
flags |= is_utp(*p->get_socket()) ? 4 : 0;
|
||||
|
|
|
@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "setup_transfer.hpp"
|
||||
#include "test.hpp"
|
||||
|
||||
#if !defined TORRENT_DISABLE_ENCRYPION
|
||||
#if !defined TORRENT_DISABLE_ENCRYPTION
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
Loading…
Reference in New Issue