initial rate limit support
This commit is contained in:
@@ -37,7 +37,6 @@ auto configure_sasl(const Settings &settings) -> std::unique_ptr<SaslMechanism>
|
||||
settings.sasl_mechanism == "ECDSA" &&
|
||||
not settings.sasl_authcid.empty() &&
|
||||
not settings.sasl_key_file.empty()
|
||||
|
||||
) {
|
||||
if (auto sasl_key = key_from_file(settings.sasl_key_file, settings.sasl_key_password))
|
||||
return std::make_unique<SaslEcdsa>(
|
||||
@@ -62,18 +61,17 @@ static auto start(boost::asio::io_context &io, const Settings &settings) -> void
|
||||
tls_key = key_from_file(settings.tls_key_file, settings.tls_key_password);
|
||||
}
|
||||
|
||||
auto sasl_mech = configure_sasl(settings);
|
||||
|
||||
const auto connection = std::make_shared<Connection>(io);
|
||||
const auto client = Client::start(connection);
|
||||
const auto bot = Bot::start(client);
|
||||
|
||||
Registration::start({
|
||||
.nickname = settings.nickname,
|
||||
.realname = settings.realname,
|
||||
.username = settings.username,
|
||||
.password = settings.password,
|
||||
.sasl_mechanism = std::move(sasl_mech),
|
||||
.sasl_mechanism = configure_sasl(settings),
|
||||
}, client);
|
||||
const auto bot = Bot::start(client);
|
||||
|
||||
// Configure CHALLENGE on registration if applicable
|
||||
if (not settings.challenge_username.empty() && not settings.challenge_key_file.empty()) {
|
||||
@@ -84,7 +82,7 @@ static auto start(boost::asio::io_context &io, const Settings &settings) -> void
|
||||
}
|
||||
}
|
||||
|
||||
// On disconnect tear down the various layers and reconnect in 5 seconds
|
||||
// On disconnect reconnect in 5 seconds
|
||||
// connection is captured in the disconnect handler so it can keep itself alive
|
||||
connection->sig_disconnect.connect(
|
||||
[&io, &settings, connection]() {
|
||||
|
Reference in New Issue
Block a user