diff --git a/ChangeLog b/ChangeLog index 6a014d80d..2e10a7739 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * renamed debug_notification to connect_notification * when updating listen sockets, only post alerts for new ones * deprecate anonymous_mode_alert * deprecated force_proxy setting (when set, the proxy is always used) diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 77fdb1b95..9b7e77be0 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -280,9 +280,10 @@ void bind_alert() s.attr("port_mapping_notification") = alert::port_mapping_notification; s.attr("storage_notification") = alert::storage_notification; s.attr("tracker_notification") = alert::tracker_notification; - s.attr("debug_notification") = alert::debug_notification; + s.attr("connect_notification") = alert::connect_notification; s.attr("status_notification") = alert::status_notification; #if TORRENT_ABI_VERSION == 1 + s.attr("debug_notification") = alert::debug_notification; s.attr("progress_notification") = alert::progress_notification; #endif s.attr("ip_block_notification") = alert::ip_block_notification; diff --git a/examples/client_test.cpp b/examples/client_test.cpp index b436f53fe..f78ac6a3b 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1095,7 +1095,7 @@ example alert_masks: | alert::port_mapping_notification | alert::storage_notification | alert::tracker_notification - | alert::debug_notification + | alert::connect_notification | alert::status_notification | alert::ip_block_notification | alert::performance_warning diff --git a/include/libtorrent/alert.hpp b/include/libtorrent/alert.hpp index a36f83c24..209ca0964 100644 --- a/include/libtorrent/alert.hpp +++ b/include/libtorrent/alert.hpp @@ -123,7 +123,10 @@ namespace libtorrent { static constexpr alert_category_t tracker_notification = 4_bit; // Low level alerts for when peers are connected and disconnected. - static constexpr alert_category_t debug_notification = 5_bit; + static constexpr alert_category_t connect_notification = 5_bit; +#if TORRENT_ABI_VERSION == 1 + static constexpr alert_category_t TORRENT_DEPRECATED_MEMBER debug_notification = connect_notification; +#endif // Enables alerts for when a torrent or the session changes state. static constexpr alert_category_t status_notification = 6_bit; diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 7cba1e0b8..1c52d9471 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -757,7 +757,7 @@ TORRENT_VERSION_NAMESPACE_2 TORRENT_DEFINE_ALERT(peer_connect_alert, 23) - static constexpr alert_category_t static_category = alert::debug_notification; + static constexpr alert_category_t static_category = alert::connect_notification; std::string message() const override; int const socket_type; @@ -775,7 +775,7 @@ TORRENT_VERSION_NAMESPACE_2 TORRENT_DEFINE_ALERT(peer_disconnected_alert, 24) - static constexpr alert_category_t static_category = alert::debug_notification; + static constexpr alert_category_t static_category = alert::connect_notification; std::string message() const override; // the kind of socket this peer was connected over diff --git a/src/alert.cpp b/src/alert.cpp index e9f1d604d..3934339ef 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -60,9 +60,10 @@ namespace libtorrent { constexpr alert_category_t alert::port_mapping_notification; constexpr alert_category_t alert::storage_notification; constexpr alert_category_t alert::tracker_notification; - constexpr alert_category_t alert::debug_notification; + constexpr alert_category_t alert::connect_notification; constexpr alert_category_t alert::status_notification; #if TORRENT_ABI_VERSION == 1 + constexpr alert_category_t alert::debug_notification; constexpr alert_category_t alert::progress_notification; #endif constexpr alert_category_t alert::ip_block_notification; diff --git a/test/settings.cpp b/test/settings.cpp index 6cc300010..9082c456d 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -44,7 +44,7 @@ lt::settings_pack settings() | alert::port_mapping_notification | alert::storage_notification | alert::tracker_notification - | alert::debug_notification + | alert::connect_notification | alert::status_notification | alert::ip_block_notification | alert::dht_notification diff --git a/test/test_alert_types.cpp b/test/test_alert_types.cpp index 9d2c2db4a..169edf3d5 100644 --- a/test/test_alert_types.cpp +++ b/test/test_alert_types.cpp @@ -51,6 +51,7 @@ TORRENT_TEST(alerts_types) TEST_EQUAL(torrent_alert::alert_type, 0); TEST_EQUAL(peer_alert::alert_type, 1); TEST_EQUAL(tracker_alert::alert_type, 2); + TEST_EQUAL(alert::debug_notification, alert::connect_notification); #endif #define TEST_ALERT_TYPE(name, seq, prio, cat) \ @@ -92,8 +93,8 @@ TORRENT_TEST(alerts_types) TEST_ALERT_TYPE(peer_unsnubbed_alert, 20, 0, alert::peer_notification); TEST_ALERT_TYPE(peer_snubbed_alert, 21, 0, alert::peer_notification); TEST_ALERT_TYPE(peer_error_alert, 22, 0, alert::peer_notification); - TEST_ALERT_TYPE(peer_connect_alert, 23, 0, alert::debug_notification); - TEST_ALERT_TYPE(peer_disconnected_alert, 24, 0, alert::debug_notification); + TEST_ALERT_TYPE(peer_connect_alert, 23, 0, alert::connect_notification); + TEST_ALERT_TYPE(peer_disconnected_alert, 24, 0, alert::connect_notification); TEST_ALERT_TYPE(invalid_request_alert, 25, 0, alert::peer_notification); TEST_ALERT_TYPE(torrent_finished_alert, 26, 1, alert::status_notification); TEST_ALERT_TYPE(piece_finished_alert, 27, 0, PROGRESS_NOTIFICATION alert::piece_progress_notification);