From 7d0df9b6ddee8db69ea0a511f031f32a4537a749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 23 Aug 2018 15:21:12 +0200 Subject: Disable the throttle limit if negative Also, invalid values result in -1 being set --- src/xmpp/biboumi_adhoc_commands.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xmpp') diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index 45557aa..7c31f36 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -494,7 +494,11 @@ void ConfigureIrcServerStep2(XmppComponent& xmpp_component, AdhocSession& sessio else if (field->get_tag("var") == "throttle_limit" && value) { - options.col() = std::stoul(value->get_inner()); + try { + options.col() = std::stol(value->get_inner()); + } catch (const std::logic_error&) { + options.col() = -1; + } Bridge* bridge = biboumi_component.find_user_bridge(session.get_owner_jid()); if (bridge) { -- cgit v1.2.3