make it possible to override alert_mask and user_agent settings on the client_test command line

This commit is contained in:
arvidn 2017-09-29 15:14:48 -07:00 committed by Arvid Norberg
parent 61733787f7
commit 2e6150de52
1 changed files with 12 additions and 12 deletions

View File

@ -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)