Make Websocket send queue configurable

This commit is contained in:
Miguel Portilla
2017-03-31 20:23:19 -04:00
committed by Scott Schurr
parent 00c60d408a
commit 2e5ab4e0e3
5 changed files with 41 additions and 5 deletions

View File

@@ -205,6 +205,34 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log)
}
}
{
auto const result = section.find("send_queue_limit");
if (result.second)
{
try
{
port.ws_queue_limit =
beast::lexicalCastThrow<std::uint16_t>(result.first);
// Queue must be greater than 0
if (port.ws_queue_limit == 0)
Throw<std::exception>();
}
catch (std::exception const&)
{
log <<
"Invalid value '" << result.first << "' for key " <<
"'send_queue_limit' in [" << section.name() << "]\n";
Rethrow();
}
}
else
{
// Default Websocket send queue size limit
port.ws_queue_limit = 100;
}
}
populate (section, "admin", log, port.admin_ip, true, {});
populate (section, "secure_gateway", log, port.secure_gateway_ip, false,
port.admin_ip.get_value_or({}));