diff --git a/ChangeLog b/ChangeLog index 6d0e9b8e3..e96d5323a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ + * deprecated alert::progress_notification alert category, split into + finer grained categories * update plugin interface functions for improved type-safety * implemented support magnet URI extension, select specific file indices for download, BEP53 diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index b9939a34b..1492cf4b9 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -275,7 +275,9 @@ void bind_alert() s.attr("tracker_notification") = alert::tracker_notification; s.attr("debug_notification") = alert::debug_notification; s.attr("status_notification") = alert::status_notification; +#ifndef TORRENT_NO_DEPRECATE s.attr("progress_notification") = alert::progress_notification; +#endif s.attr("ip_block_notification") = alert::ip_block_notification; s.attr("performance_warning") = alert::performance_warning; s.attr("dht_notification") = alert::dht_notification; @@ -288,6 +290,10 @@ void bind_alert() s.attr("dht_operation_notification") = alert::dht_operation_notification; s.attr("port_mapping_log_notification") = alert::port_mapping_log_notification; s.attr("picker_log_notification") = alert::picker_log_notification; + s.attr("file_progress_notification") = alert::file_progress_notification; + s.attr("piece_progress_notification") = alert::piece_progress_notification; + s.attr("upload_notification") = alert::upload_notification; + s.attr("block_progress_notification") = alert::block_progress_notification; s.attr("all_categories") = alert::all_categories; } diff --git a/docs/hunspell/libtorrent.dic b/docs/hunspell/libtorrent.dic index a07174774..667901d0a 100644 --- a/docs/hunspell/libtorrent.dic +++ b/docs/hunspell/libtorrent.dic @@ -216,3 +216,4 @@ pe lt tex natpmp +cancelled diff --git a/docs/upgrade_to_1.2.rst b/docs/upgrade_to_1.2.rst index 843e90daa..1c3c69bac 100644 --- a/docs/upgrade_to_1.2.rst +++ b/docs/upgrade_to_1.2.rst @@ -73,6 +73,17 @@ This means they are no longer heap allocated nor held by a smart pointer. The ``clone()`` member on alerts was deprecated in 1.1 and removed in 1.2. To pass alerts across threads, instead pull out the relevant information from the alerts and pass that across. +progress alert category +======================= + +The ``alert::progress_notification`` category has been deprecated. +Alerts posted in this category are now also posted in one of these new categories: + +* ``alert::block_progress_notification`` +* ``alert::piece_progress_notification`` +* ``alert::file_progress_notification`` +* ``alert::upload_notification`` + boost replaced by std ===================== diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 5a969e961..dd0166c85 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1086,16 +1086,21 @@ example alert_masks: settings.set_int(settings_pack::choking_algorithm, settings_pack::rate_based_choker); settings.set_str(settings_pack::user_agent, "client_test/" LIBTORRENT_VERSION); - settings.set_int(settings_pack::alert_mask, alert::all_categories - & ~(alert::dht_notification - | alert::progress_notification - | alert::stats_notification - | alert::session_log_notification - | alert::torrent_log_notification - | alert::peer_log_notification - | alert::dht_log_notification - | alert::picker_log_notification - )); + settings.set_int(settings_pack::alert_mask + , alert::error_notification + | alert::peer_notification + | alert::port_mapping_notification + | alert::storage_notification + | alert::tracker_notification + | alert::debug_notification + | alert::status_notification + | alert::ip_block_notification + | alert::performance_warning + | alert::dht_notification + | alert::incoming_request_notification + | alert::dht_operation_notification + | alert::port_mapping_log_notification + | alert::file_progress_notification); lt::time_duration refresh_delay = lt::milliseconds(500); bool rate_limit_locals = false; diff --git a/include/libtorrent/alert.hpp b/include/libtorrent/alert.hpp index 4dbb496ab..a32d549d3 100644 --- a/include/libtorrent/alert.hpp +++ b/include/libtorrent/alert.hpp @@ -70,12 +70,20 @@ namespace libtorrent { // hidden using alert_category_t = flags::bitfield_flag; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + // The ``alert`` class is the base class that specific messages are derived from. // alert types are not copyable, and cannot be constructed by the client. The // pointers returned by libtorrent are short lived (the details are described // under session_handle::pop_alerts()) class TORRENT_EXPORT alert { +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif public: alert(alert const& rhs) = delete; @@ -84,7 +92,7 @@ namespace libtorrent { #ifndef TORRENT_NO_DEPRECATE // only here for backwards compatibility - enum TORRENT_DEPRECATED severity_t { debug, info, warning, critical, fatal, none }; + enum TORRENT_DEPRECATED_ENUM severity_t { debug, info, warning, critical, fatal, none }; #endif // Enables alerts that report an error. This includes: @@ -120,9 +128,11 @@ namespace libtorrent { // Enables alerts for when a torrent or the session changes state. static constexpr alert_category_t status_notification = 6_bit; +#ifndef TORRENT_NO_DEPRECATE // Alerts for when blocks are requested and completed. Also when // pieces are completed. - static constexpr alert_category_t progress_notification = 7_bit; + static constexpr alert_category_t TORRENT_DEPRECATED_MEMBER progress_notification = 7_bit; +#endif // Alerts when a peer is blocked by the ip blocker or port blocker. static constexpr alert_category_t ip_block_notification = 8_bit; @@ -181,6 +191,20 @@ namespace libtorrent { // enables verbose logging from the piece picker. static constexpr alert_category_t picker_log_notification = 20_bit; + // alerts when files complete downloading + static constexpr alert_category_t file_progress_notification = 21_bit; + + // alerts when pieces complete downloading or fail hash check + static constexpr alert_category_t piece_progress_notification = 22_bit; + + // alerts when we upload blocks to other peers + static constexpr alert_category_t upload_notification = 23_bit; + + // alerts on individual blocks being requested, downloading, finished, + // rejected, time-out and cancelled. This is likely to post alerts at a + // high rate. + static constexpr alert_category_t block_progress_notification = 24_bit; + // The full bitmask, representing all available categories. // // since the enum is signed, make sure this isn't diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 6bdd702c0..b37049062 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -59,6 +59,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/aux_/disable_warnings_pop.hpp" +#ifndef TORRENT_NO_DEPRECATE +#define PROGRESS_NOTIFICATION | alert::progress_notification +#else +#define PROGRESS_NOTIFICATION +#endif + + namespace libtorrent { #ifndef TORRENT_NO_DEPRECATE @@ -254,7 +261,17 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(file_completed_alert, 6) - static constexpr alert_category_t static_category = alert::progress_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::file_progress_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; // refers to the index of the file that completed. @@ -809,7 +826,17 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(piece_finished_alert, 27) - static constexpr alert_category_t static_category = alert::progress_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::piece_progress_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; // the index of the piece that finished @@ -826,8 +853,18 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(request_dropped_alert, 28) - static constexpr alert_category_t static_category = alert::progress_notification - | alert::peer_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::block_progress_notification + | alert::peer_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; int const block_index; @@ -844,8 +881,18 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(block_timeout_alert, 29) - static constexpr alert_category_t static_category = alert::progress_notification - | alert::peer_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::block_progress_notification + | alert::peer_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; int const block_index; @@ -862,7 +909,17 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(block_finished_alert, 30) - static constexpr alert_category_t static_category = alert::progress_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::block_progress_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; int const block_index; @@ -879,7 +936,17 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(block_downloading_alert, 31) - static constexpr alert_category_t static_category = alert::progress_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::block_progress_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; int const block_index; @@ -2710,7 +2777,7 @@ namespace libtorrent { // This alert is posted when a block intended to be sent to a peer is placed in the // send buffer. Note that if the connection is closed before the send buffer is sent, // the alert may be posted without the bytes having been sent to the peer. - // It belongs to the ``progress_notification`` category. + // It belongs to the ``upload_notification`` category. struct TORRENT_EXPORT block_uploaded_alert final : peer_alert { // internal @@ -2720,7 +2787,17 @@ namespace libtorrent { TORRENT_DEFINE_ALERT(block_uploaded_alert, 94) - static constexpr alert_category_t static_category = alert::progress_notification; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static constexpr alert_category_t static_category = + alert::upload_notification + PROGRESS_NOTIFICATION + ; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif std::string message() const override; int const block_index; @@ -2730,6 +2807,7 @@ namespace libtorrent { #undef TORRENT_DEFINE_ALERT_IMPL #undef TORRENT_DEFINE_ALERT #undef TORRENT_DEFINE_ALERT_PRIO +#undef PROGRESS_NOTIFICATION constexpr int num_alert_types = 95; // this constant represents "max_alert_index" + 1 } diff --git a/simulation/test_http_connection.cpp b/simulation/test_http_connection.cpp index 9e69f1bfd..04e02e312 100644 --- a/simulation/test_http_connection.cpp +++ b/simulation/test_http_connection.cpp @@ -370,7 +370,7 @@ void run_test(lt::aux::proxy_settings ps, std::string url, int expect_size, int }); http.register_handler("/redirect" - , [&data_buffer,&counters](std::string method, std::string req + , [&counters](std::string method, std::string req , std::map&) { ++counters[redirect_req]; @@ -381,7 +381,7 @@ void run_test(lt::aux::proxy_settings ps, std::string url, int expect_size, int }); http.register_handler("/relative/redirect" - , [&data_buffer,&counters](std::string method, std::string req + , [&counters](std::string method, std::string req , std::map&) { ++counters[rel_redirect_req]; @@ -392,7 +392,7 @@ void run_test(lt::aux::proxy_settings ps, std::string url, int expect_size, int }); http.register_handler("/infinite/redirect" - , [&data_buffer,&counters](std::string method, std::string req + , [&counters](std::string method, std::string req , std::map&) { ++counters[inf_redirect_req]; diff --git a/simulation/test_swarm.cpp b/simulation/test_swarm.cpp index 73cc77389..49a084133 100644 --- a/simulation/test_swarm.cpp +++ b/simulation/test_swarm.cpp @@ -512,7 +512,7 @@ TORRENT_TEST(torrent_completed_alert) // add session , [](lt::settings_pack& pack) { - pack.set_int(lt::settings_pack::alert_mask, alert::progress_notification); + pack.set_int(lt::settings_pack::alert_mask, alert::file_progress_notification); } // add torrent , [](lt::add_torrent_params&) {} @@ -550,7 +550,7 @@ TORRENT_TEST(block_uploaded_alert) , [](lt::settings_pack& pack) { pack.set_int(lt::settings_pack::alert_mask, - alert::progress_notification | alert::status_notification); + alert::upload_notification | alert::status_notification); } // add torrent , [](lt::add_torrent_params&) {} diff --git a/simulation/test_tracker.cpp b/simulation/test_tracker.cpp index 9825136cd..1b8288fa8 100644 --- a/simulation/test_tracker.cpp +++ b/simulation/test_tracker.cpp @@ -74,7 +74,6 @@ void test_interval(int interval) sim::default_config network_cfg; sim::simulation sim{network_cfg}; - lt::time_point start = lt::clock_type::now(); bool ran_to_completion = false; sim::asio::io_service web_server(sim, address_v4::from_string("2.2.2.2")); @@ -85,7 +84,7 @@ void test_interval(int interval) std::vector announces; http.register_handler("/announce" - , [&announces,interval,start,&ran_to_completion](std::string /* method */ + , [&announces,interval,&ran_to_completion](std::string /* method */ , std::string /* req */ , std::map&) { diff --git a/src/alert.cpp b/src/alert.cpp index b07033f89..415cbb35b 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -62,7 +62,9 @@ namespace libtorrent { constexpr alert_category_t alert::tracker_notification; constexpr alert_category_t alert::debug_notification; constexpr alert_category_t alert::status_notification; +#ifndef TORRENT_NO_DEPRECATE constexpr alert_category_t alert::progress_notification; +#endif constexpr alert_category_t alert::ip_block_notification; constexpr alert_category_t alert::performance_warning; constexpr alert_category_t alert::dht_notification; @@ -75,6 +77,11 @@ namespace libtorrent { constexpr alert_category_t alert::dht_operation_notification; constexpr alert_category_t alert::port_mapping_log_notification; constexpr alert_category_t alert::picker_log_notification; + constexpr alert_category_t alert::file_progress_notification; + constexpr alert_category_t alert::piece_progress_notification; + constexpr alert_category_t alert::upload_notification; + constexpr alert_category_t alert::block_progress_notification; + constexpr alert_category_t alert::all_categories; #ifndef TORRENT_NO_DEPRECATE constexpr alert_category_t alert::rss_notification; diff --git a/test/settings.cpp b/test/settings.cpp index 4567e49b0..35bf7f1a3 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -39,8 +39,11 @@ using namespace lt; lt::settings_pack settings() { auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + & ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification | alert::picker_log_notification); diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index eef8a5fe6..44ab84a2c 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -770,9 +770,16 @@ setup_transfer(lt::session* ses1, lt::session* ses2, lt::session* ses3 ses2->set_peer_class_filter(f); if (ses3) ses3->set_peer_class_filter(f); + auto const mask = alert::all_categories + & ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif + | alert::stats_notification); + settings_pack pack; - pack.set_int(settings_pack::alert_mask - , ~(alert::progress_notification | alert::stats_notification)); + pack.set_int(settings_pack::alert_mask, mask); if (ses3) pack.set_bool(settings_pack::allow_multiple_connections_per_ip, true); pack.set_int(settings_pack::mixed_mode_algorithm, settings_pack::prefer_tcp); pack.set_int(settings_pack::max_failcount, 1); diff --git a/test/swarm_suite.cpp b/test/swarm_suite.cpp index 7ee626d17..8b5a73415 100644 --- a/test/swarm_suite.cpp +++ b/test/swarm_suite.cpp @@ -75,9 +75,11 @@ void test_swarm(test_flags_t const flags) session_proxy p2; session_proxy p3; - auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + auto const mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification); settings_pack pack; diff --git a/test/test_alert_types.cpp b/test/test_alert_types.cpp index 1421dddc1..40f75daa9 100644 --- a/test/test_alert_types.cpp +++ b/test/test_alert_types.cpp @@ -65,9 +65,16 @@ TORRENT_TEST(alerts_types) #else ++count_alert_types; #endif + +#ifndef TORRENT_NO_DEPRECATE +#define PROGRESS_NOTIFICATION alert::progress_notification | +#else +#define PROGRESS_NOTIFICATION +#endif + TEST_ALERT_TYPE(torrent_removed_alert, 4, 1, alert::status_notification); TEST_ALERT_TYPE(read_piece_alert, 5, 1, alert::storage_notification); - TEST_ALERT_TYPE(file_completed_alert, 6, 0, alert::progress_notification); + TEST_ALERT_TYPE(file_completed_alert, 6, 0, PROGRESS_NOTIFICATION alert::file_progress_notification); TEST_ALERT_TYPE(file_renamed_alert, 7, 1, alert::storage_notification); TEST_ALERT_TYPE(file_rename_failed_alert, 8, 1, alert::storage_notification); TEST_ALERT_TYPE(performance_alert, 9, 0, alert::performance_warning); @@ -88,11 +95,11 @@ TORRENT_TEST(alerts_types) TEST_ALERT_TYPE(peer_disconnected_alert, 24, 0, alert::debug_notification); TEST_ALERT_TYPE(invalid_request_alert, 25, 0, alert::peer_notification); TEST_ALERT_TYPE(torrent_finished_alert, 26, 0, alert::status_notification); - TEST_ALERT_TYPE(piece_finished_alert, 27, 0, alert::progress_notification); - TEST_ALERT_TYPE(request_dropped_alert, 28, 0, alert::progress_notification | alert::peer_notification); - TEST_ALERT_TYPE(block_timeout_alert, 29, 0, alert::progress_notification | alert::peer_notification); - TEST_ALERT_TYPE(block_finished_alert, 30, 0, alert::progress_notification); - TEST_ALERT_TYPE(block_downloading_alert, 31, 0, alert::progress_notification); + TEST_ALERT_TYPE(piece_finished_alert, 27, 0, PROGRESS_NOTIFICATION alert::piece_progress_notification); + TEST_ALERT_TYPE(request_dropped_alert, 28, 0, PROGRESS_NOTIFICATION alert::block_progress_notification | alert::peer_notification); + TEST_ALERT_TYPE(block_timeout_alert, 29, 0, PROGRESS_NOTIFICATION alert::block_progress_notification | alert::peer_notification); + TEST_ALERT_TYPE(block_finished_alert, 30, 0, PROGRESS_NOTIFICATION alert::block_progress_notification); + TEST_ALERT_TYPE(block_downloading_alert, 31, 0, PROGRESS_NOTIFICATION alert::block_progress_notification); TEST_ALERT_TYPE(unwanted_block_alert, 32, 0, alert::peer_notification); TEST_ALERT_TYPE(storage_moved_alert, 33, 1, alert::storage_notification); TEST_ALERT_TYPE(storage_moved_failed_alert, 34, 1, alert::storage_notification); @@ -163,7 +170,7 @@ TORRENT_TEST(alerts_types) TEST_ALERT_TYPE(dht_live_nodes_alert, 91, 0, alert::dht_notification); TEST_ALERT_TYPE(session_stats_header_alert, 92, 0, alert::stats_notification); TEST_ALERT_TYPE(dht_sample_infohashes_alert, 93, 0, alert::dht_operation_notification); - TEST_ALERT_TYPE(block_uploaded_alert, 94, 0, alert::progress_notification); + TEST_ALERT_TYPE(block_uploaded_alert, 94, 0, PROGRESS_NOTIFICATION alert::upload_notification); #undef TEST_ALERT_TYPE @@ -324,3 +331,6 @@ TORRENT_TEST(dht_sample_infohashes_alert) std::sort(nodes.begin(), nodes.end()); TEST_CHECK(nv == nodes); } + +#undef PROGRESS_NOTIFICATION + diff --git a/test/test_pex.cpp b/test/test_pex.cpp index 65bac455a..bb39b9c16 100644 --- a/test/test_pex.cpp +++ b/test/test_pex.cpp @@ -59,9 +59,11 @@ void test_pex() session_proxy p2; session_proxy p3; - auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + auto const mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification); // this is to avoid everything finish from a single peer diff --git a/test/test_privacy.cpp b/test/test_privacy.cpp index bf785f548..a6326b5ac 100644 --- a/test/test_privacy.cpp +++ b/test/test_privacy.cpp @@ -101,9 +101,12 @@ session_proxy test_proxy(settings_pack::proxy_type_t proxy_type, int flags) int const prev_udp_announces = num_udp_announces(); - auto const alert_mask = alert::all_categories - & ~alert::progress_notification - & ~alert::stats_notification; + auto const alert_mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif + | alert::stats_notification); settings_pack sett = settings(); sett.set_int(settings_pack::stop_tracker_timeout, 2); diff --git a/test/test_read_piece.cpp b/test/test_read_piece.cpp index 2c4dc1ef7..d19291ed4 100644 --- a/test/test_read_piece.cpp +++ b/test/test_read_piece.cpp @@ -91,9 +91,11 @@ void test_read_piece(int flags) std::printf("generated torrent: %s tmp1_read_piece/test_torrent\n" , aux::to_hex(ti->info_hash()).c_str()); - auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + auto const mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification); settings_pack sett; diff --git a/test/test_ssl.cpp b/test/test_ssl.cpp index a591c5b3c..28d30a968 100644 --- a/test/test_ssl.cpp +++ b/test/test_ssl.cpp @@ -263,14 +263,14 @@ void test_ssl(int test_idx, bool use_utp) << std::endl; } + if (st2.is_finished) break; + if (peer_disconnects >= 2) { std::printf("too many disconnects (%d), breaking\n", peer_disconnects); break; } - if (st2.is_finished) break; - if (st2.state != torrent_status::downloading) { static char const* state_str[] = diff --git a/test/test_utp.cpp b/test/test_utp.cpp index d9cf8d13f..75b524142 100644 --- a/test/test_utp.cpp +++ b/test/test_utp.cpp @@ -62,9 +62,11 @@ void test_transfer() session_proxy p1; session_proxy p2; - auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + auto const mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification); settings_pack pack; diff --git a/test/test_web_seed_redirect.cpp b/test/test_web_seed_redirect.cpp index 4f0ac2e26..b13d5d993 100644 --- a/test/test_web_seed_redirect.cpp +++ b/test/test_web_seed_redirect.cpp @@ -88,9 +88,16 @@ TORRENT_TEST(web_seed_redirect) auto torrent_file = std::make_shared(buf, ec, from_span); { + auto const mask = ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif + | alert::stats_notification); + settings_pack p = settings(); p.set_int(settings_pack::max_queued_disk_bytes, 256 * 1024); - p.set_int(settings_pack::alert_mask, ~(alert::progress_notification | alert::stats_notification)); + p.set_int(settings_pack::alert_mask, mask); lt::session ses(p); // disable keep-alive because otherwise the test will choke on seeing diff --git a/test/web_seed_suite.cpp b/test/web_seed_suite.cpp index 0e5637c9a..79f834b75 100644 --- a/test/web_seed_suite.cpp +++ b/test/web_seed_suite.cpp @@ -392,8 +392,11 @@ int EXPORT run_http_suite(int proxy, char const* protocol, bool test_url_seed { auto const mask = alert::all_categories - & ~(alert::progress_notification - | alert::performance_warning + & ~( + alert::performance_warning +#ifndef TORRENT_NO_DEPRECATE + | alert::progress_notification +#endif | alert::stats_notification); settings_pack pack;