From 2e6150de52e2ad50543d215de88389e93bed96c2 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 29 Sep 2017 15:14:48 -0700 Subject: [PATCH] make it possible to override alert_mask and user_agent settings on the client_test command line --- examples/client_test.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index b7fd097e0..fd0ea32e9 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1062,6 +1062,18 @@ MAGNETURL is a magnet link settings.set_int(settings_pack::cache_size, cache_size); 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 + )); + lt::time_duration refresh_delay = lt::milliseconds(500); bool rate_limit_locals = false; @@ -1204,18 +1216,6 @@ MAGNETURL is a magnet link , errno, strerror(errno)); } - 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 - )); - lt::session ses(std::move(params)); if (rate_limit_locals)