1
0
Fork 0

Feature: Check if client_limit is reasonable bigger than source_limit

This commit is contained in:
Philipp Schafft 2022-03-01 12:46:19 +00:00
parent 1abcc9a4f6
commit 35a9b743ab
3 changed files with 9 additions and 0 deletions

View File

@ -1549,6 +1549,8 @@ static void command_dashboard (client_t *client, source_t *source, adm
__reportxml_add_maintenance(reportnode, config->reportxml_db, "b6224fc4-53a1-433f-a6cd-d5b85c60f1c9", "error", "Obsolete tags are used in the config file. See the error.log for details and update your configuration accordingly.", NULL);
if (config->config_problems & CONFIG_PROBLEM_INVALID_NODE)
__reportxml_add_maintenance(reportnode, config->reportxml_db, "0f6f757d-52d8-4b9a-8e57-9bcd528fffba", "error", "Invalid tags are used in the config file. See the error.log for details and update your configuration accordingly.", NULL);
if (config->config_problems & CONFIG_PROBLEM_VALIDATION)
__reportxml_add_maintenance(reportnode, config->reportxml_db, "8fc33086-274d-4ccb-b32f-599b3fa0f41a", "error", "The configuration did not validate. See the error.log for details and update your configuration accordingly.", NULL);
if (!has_sources)
__reportxml_add_maintenance(reportnode, config->reportxml_db, "f68dd8a3-22b1-4118-aba6-b039f2c5b51e", "info", "Currently no sources are connected to this server.", NULL);

View File

@ -1040,6 +1040,12 @@ int config_parse_file(const char *filename, ice_config_t *configuration)
_parse_root(doc, node->xmlChildrenNode, configuration);
xmlFreeDoc(doc);
_merge_mounts_all(configuration);
if (configuration->client_limit <= (configuration->source_limit*2)) {
configuration->config_problems |= CONFIG_PROBLEM_VALIDATION;
ICECAST_LOG_ERROR("Client limit (%i) is too small for given source limit (%i)", configuration->client_limit, configuration->source_limit);
}
return 0;
}

View File

@ -37,6 +37,7 @@
#define CONFIG_PROBLEM_UNKNOWN_NODE 0x0010U
#define CONFIG_PROBLEM_OBSOLETE_NODE 0x0020U
#define CONFIG_PROBLEM_INVALID_NODE 0x0040U
#define CONFIG_PROBLEM_VALIDATION 0x0080U
typedef enum _http_header_type {
/* static: headers are passed as is to the client. */