deprecated anonymous_mode_alert

This commit is contained in:
arvidn 2018-07-07 13:09:21 +02:00 committed by Arvid Norberg
parent b750b6cc2c
commit 3c2b076eb0
5 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,4 @@
* deprecate anonymous_mode_alert
* deprecated force_proxy setting (when set, the proxy is always used)
* add support for Port Control Protocol (PCP)
* deliver notification of alerts being dropped via alerts_dropped_alert

View File

@ -215,7 +215,6 @@ namespace boost
POLY(performance_alert)
POLY(stats_alert)
POLY(cache_flushed_alert)
POLY(anonymous_mode_alert)
POLY(incoming_connection_alert)
POLY(torrent_need_cert_alert)
POLY(add_torrent_alert)
@ -229,6 +228,7 @@ namespace boost
POLY(dht_get_peers_reply_alert)
#if TORRENT_ABI_VERSION == 1
POLY(anonymous_mode_alert)
POLY(torrent_added_alert)
POLY(torrent_update_alert)
#endif
@ -847,6 +847,7 @@ void bind_alert()
"cache_flushed_alert", no_init)
;
#if TORRENT_ABI_VERSION == 1
class_<anonymous_mode_alert, bases<torrent_alert>, noncopyable>(
"anonymous_mode_alert", no_init)
.def_readonly("kind", &anonymous_mode_alert::kind)
@ -856,6 +857,7 @@ void bind_alert()
enum_<anonymous_mode_alert::kind_t>("kind")
.value("tracker_no_anonymous", anonymous_mode_alert::tracker_not_anonymous)
;
#endif // TORRENT_ABI_VERSION
class_<incoming_connection_alert, bases<alert>, noncopyable>(
"incoming_connection_alert", no_init)

View File

@ -1813,11 +1813,12 @@ TORRENT_VERSION_NAMESPACE_2
static constexpr alert_category_t static_category = alert::storage_notification;
};
#if TORRENT_ABI_VERSION == 1
// This alert is posted when a bittorrent feature is blocked because of the
// anonymous mode. For instance, if the tracker proxy is not set up, no
// trackers will be used, because trackers can only be used through proxies
// when in anonymous mode.
struct TORRENT_EXPORT anonymous_mode_alert final : torrent_alert
struct TORRENT_DEPRECATED_EXPORT anonymous_mode_alert final : torrent_alert
{
// internal
anonymous_mode_alert(aux::stack_allocator& alloc, torrent_handle const& h
@ -1840,6 +1841,7 @@ TORRENT_VERSION_NAMESPACE_2
int kind;
std::string str;
};
#endif // TORRENT_ABI_VERSION
// This alert is generated when we receive a local service discovery message
// from a peer for a torrent we're currently participating in.

View File

@ -1297,6 +1297,7 @@ namespace {
, torrent_handle const& h)
: torrent_alert(alloc, h) {}
#if TORRENT_ABI_VERSION == 1
anonymous_mode_alert::anonymous_mode_alert(aux::stack_allocator& alloc
, torrent_handle const& h, int k, string_view s)
: torrent_alert(alloc, h)
@ -1315,6 +1316,7 @@ namespace {
, msgs[kind], str.c_str());
return msg;
}
#endif // TORRENT_ABI_VERSION
lsd_peer_alert::lsd_peer_alert(aux::stack_allocator& alloc, torrent_handle const& h
, tcp::endpoint const& i)
@ -2673,7 +2675,6 @@ namespace {
constexpr alert_category_t dht_get_peers_alert::static_category;
constexpr alert_category_t stats_alert::static_category;
constexpr alert_category_t cache_flushed_alert::static_category;
constexpr alert_category_t anonymous_mode_alert::static_category;
constexpr alert_category_t lsd_peer_alert::static_category;
constexpr alert_category_t trackerid_alert::static_category;
constexpr alert_category_t dht_bootstrap_alert::static_category;
@ -2707,6 +2708,7 @@ namespace {
constexpr alert_category_t block_uploaded_alert::static_category;
constexpr alert_category_t alerts_dropped_alert::static_category;
#if TORRENT_ABI_VERSION == 1
constexpr alert_category_t anonymous_mode_alert::static_category;
constexpr alert_category_t mmap_cache_alert::static_category;
constexpr alert_category_t torrent_added_alert::static_category;
constexpr alert_category_t torrent_update_alert::static_category;

View File

@ -128,7 +128,11 @@ TORRENT_TEST(alerts_types)
TEST_ALERT_TYPE(dht_get_peers_alert, 56, 0, alert::dht_notification);
TEST_ALERT_TYPE(stats_alert, 57, 0, alert::stats_notification);
TEST_ALERT_TYPE(cache_flushed_alert, 58, 0, alert::storage_notification);
#if TORRENT_ABI_VERSION == 1
TEST_ALERT_TYPE(anonymous_mode_alert, 59, 0, alert::error_notification);
#else
count_alert_types++;
#endif
TEST_ALERT_TYPE(lsd_peer_alert, 60, 0, alert::peer_notification);
TEST_ALERT_TYPE(trackerid_alert, 61, 0, alert::status_notification);
TEST_ALERT_TYPE(dht_bootstrap_alert, 62, 0, alert::dht_notification);