fix build with no extensions support
This commit is contained in:
parent
87dfdd4790
commit
0c16163e71
|
@ -170,13 +170,12 @@ namespace libtorrent
|
||||||
virtual void get_specific_peer_info(peer_info& p) const;
|
virtual void get_specific_peer_info(peer_info& p) const;
|
||||||
virtual bool in_handshake() const;
|
virtual bool in_handshake() const;
|
||||||
|
|
||||||
bool supports_holepunch() const { return m_holepunch_id != 0; }
|
|
||||||
void write_holepunch_msg(int type, tcp::endpoint const& ep, int error);
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
bool support_extensions() const { return m_supports_extensions; }
|
bool supports_holepunch() const { return m_holepunch_id != 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool support_extensions() const { return m_supports_extensions; }
|
||||||
|
|
||||||
// the message handlers are called
|
// the message handlers are called
|
||||||
// each time a recv() returns some new
|
// each time a recv() returns some new
|
||||||
// data, the last time it will be called
|
// data, the last time it will be called
|
||||||
|
@ -205,7 +204,9 @@ namespace libtorrent
|
||||||
void on_have_none(int received);
|
void on_have_none(int received);
|
||||||
void on_reject_request(int received);
|
void on_reject_request(int received);
|
||||||
void on_allowed_fast(int received);
|
void on_allowed_fast(int received);
|
||||||
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||||
void on_holepunch();
|
void on_holepunch();
|
||||||
|
#endif
|
||||||
|
|
||||||
void on_extended(int received);
|
void on_extended(int received);
|
||||||
|
|
||||||
|
@ -229,6 +230,7 @@ namespace libtorrent
|
||||||
void write_extensions();
|
void write_extensions();
|
||||||
void write_upload_only();
|
void write_upload_only();
|
||||||
void write_share_mode();
|
void write_share_mode();
|
||||||
|
void write_holepunch_msg(int type, tcp::endpoint const& ep, int error);
|
||||||
#endif
|
#endif
|
||||||
void write_metadata(std::pair<int, int> req);
|
void write_metadata(std::pair<int, int> req);
|
||||||
void write_metadata_request(std::pair<int, int> req);
|
void write_metadata_request(std::pair<int, int> req);
|
||||||
|
@ -397,11 +399,11 @@ private:
|
||||||
int m_share_mode_id;
|
int m_share_mode_id;
|
||||||
|
|
||||||
char m_reserved_bits[8];
|
char m_reserved_bits[8];
|
||||||
|
#endif
|
||||||
// this is set to true if the handshake from
|
// this is set to true if the handshake from
|
||||||
// the peer indicated that it supports the
|
// the peer indicated that it supports the
|
||||||
// extension protocol
|
// extension protocol
|
||||||
bool m_supports_extensions:1;
|
bool m_supports_extensions:1;
|
||||||
#endif
|
|
||||||
bool m_supports_dht_port:1;
|
bool m_supports_dht_port:1;
|
||||||
bool m_supports_fast:1;
|
bool m_supports_fast:1;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ namespace libtorrent
|
||||||
namespace aux
|
namespace aux
|
||||||
{
|
{
|
||||||
struct session_impl;
|
struct session_impl;
|
||||||
struct checker_impl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct torrent_plugin;
|
struct torrent_plugin;
|
||||||
|
|
|
@ -1439,6 +1439,7 @@ namespace libtorrent
|
||||||
// -------- RENDEZVOUS ---------
|
// -------- RENDEZVOUS ---------
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
void bt_peer_connection::on_holepunch()
|
void bt_peer_connection::on_holepunch()
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
@ -1622,6 +1623,7 @@ namespace libtorrent
|
||||||
|
|
||||||
send_buffer(buf, ptr - buf);
|
send_buffer(buf, ptr - buf);
|
||||||
}
|
}
|
||||||
|
#endif // TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
// --------- EXTENDED ----------
|
// --------- EXTENDED ----------
|
||||||
|
@ -1749,7 +1751,6 @@ namespace libtorrent
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (is_disconnecting()) return;
|
if (is_disconnecting()) return;
|
||||||
#endif
|
|
||||||
|
|
||||||
// upload_only
|
// upload_only
|
||||||
if (lazy_entry const* m = root.dict_find_dict("m"))
|
if (lazy_entry const* m = root.dict_find_dict("m"))
|
||||||
|
@ -1757,6 +1758,7 @@ namespace libtorrent
|
||||||
m_upload_only_id = m->dict_find_int_value("upload_only", 0);
|
m_upload_only_id = m->dict_find_int_value("upload_only", 0);
|
||||||
m_holepunch_id = m->dict_find_int_value("ut_holepunch", 0);
|
m_holepunch_id = m->dict_find_int_value("ut_holepunch", 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// there is supposed to be a remote listen port
|
// there is supposed to be a remote listen port
|
||||||
int listen_port = root.dict_find_int_value("p");
|
int listen_port = root.dict_find_int_value("p");
|
||||||
|
@ -3013,7 +3015,7 @@ namespace libtorrent
|
||||||
, (recv_buffer[5] & 0x10) ? "extension " : "");
|
, (recv_buffer[5] & 0x10) ? "extension " : "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
std::memcpy(m_reserved_bits, recv_buffer.begin, 8);
|
std::memcpy(m_reserved_bits, recv_buffer.begin, 8);
|
||||||
if ((recv_buffer[5] & 0x10))
|
if ((recv_buffer[5] & 0x10))
|
||||||
m_supports_extensions = true;
|
m_supports_extensions = true;
|
||||||
|
|
|
@ -49,7 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/entry.hpp"
|
#include "libtorrent/entry.hpp"
|
||||||
#include "libtorrent/peer_request.hpp"
|
#include "libtorrent/peer_request.hpp"
|
||||||
|
|
||||||
#if TORRENT_USE_IOSTREAM
|
#if TORRENT_USE_IOSTREAM && !defined TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "libtorrent/file.hpp"
|
#include "libtorrent/file.hpp"
|
||||||
|
|
|
@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/pch.hpp"
|
#include "libtorrent/pch.hpp"
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -348,4 +350,5 @@ namespace libtorrent
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/pch.hpp"
|
#include "libtorrent/pch.hpp"
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -589,4 +591,5 @@ namespace libtorrent
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -3274,6 +3274,7 @@ namespace libtorrent
|
||||||
if (m_holepunch_mode)
|
if (m_holepunch_mode)
|
||||||
fast_reconnect(true);
|
fast_reconnect(true);
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
if ((!m_socket->get<utp_stream>() || !m_ses.m_settings.enable_outgoing_tcp)
|
if ((!m_socket->get<utp_stream>() || !m_ses.m_settings.enable_outgoing_tcp)
|
||||||
&& m_peer_info
|
&& m_peer_info
|
||||||
&& m_peer_info->supports_holepunch
|
&& m_peer_info->supports_holepunch
|
||||||
|
@ -3285,6 +3286,7 @@ namespace libtorrent
|
||||||
if (p)
|
if (p)
|
||||||
p->write_holepunch_msg(bt_peer_connection::hp_rendezvous, remote(), 0);
|
p->write_holepunch_msg(bt_peer_connection::hp_rendezvous, remote(), 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
disconnect(e, 1);
|
disconnect(e, 1);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/pch.hpp"
|
#include "libtorrent/pch.hpp"
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -313,4 +315,5 @@ namespace libtorrent
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -315,8 +315,10 @@ namespace libtorrent
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
// defined in ut_pex.cpp
|
// defined in ut_pex.cpp
|
||||||
bool was_introduced_by(peer_plugin const*, tcp::endpoint const&);
|
bool was_introduced_by(peer_plugin const*, tcp::endpoint const&);
|
||||||
|
#endif
|
||||||
|
|
||||||
torrent::torrent(
|
torrent::torrent(
|
||||||
session_impl& ses
|
session_impl& ses
|
||||||
|
|
|
@ -328,6 +328,7 @@ namespace libtorrent
|
||||||
TORRENT_ASYNC_CALL2(rename_file, index, new_name);
|
TORRENT_ASYNC_CALL2(rename_file, index, new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
void torrent_handle::add_extension(
|
void torrent_handle::add_extension(
|
||||||
boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext
|
boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext
|
||||||
, void* userdata)
|
, void* userdata)
|
||||||
|
@ -335,6 +336,7 @@ namespace libtorrent
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
TORRENT_ASYNC_CALL2(add_extension, ext, userdata);
|
TORRENT_ASYNC_CALL2(add_extension, ext, userdata);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool torrent_handle::set_metadata(char const* metadata, int size) const
|
bool torrent_handle::set_metadata(char const* metadata, int size) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/pch.hpp"
|
#include "libtorrent/pch.hpp"
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -538,4 +540,5 @@ namespace libtorrent
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/pch.hpp"
|
#include "libtorrent/pch.hpp"
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push, 1)
|
#pragma warning(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -582,4 +584,5 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue