X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=config.cpp;h=cb16cbc33e06f7d1032d2b8d13f20379b20c262a;hp=d47bfec0fbb72fc4fe668939805ad54d7249d861;hb=74cd48ffef90d7d0752e37a4515e4ecfb68f7c9d;hpb=7b3d494100ef1063578b1ef76818baee4ab53ada diff --git a/config.cpp b/config.cpp index d47bfec..cb16cbc 100644 --- a/config.cpp +++ b/config.cpp @@ -1,8 +1,11 @@ +#include #include #include +#include #include #include #include +#include #include #include #include @@ -378,7 +381,14 @@ bool parse_config(const string &filename, Config *config) bool has_stats_file = fetch_config_string(lines, "stats_file", &config->stats_file); bool has_stats_interval = fetch_config_int(lines, "stats_interval", &config->stats_interval); if (has_stats_interval && !has_stats_file) { - log(WARNING, "'stats_interval' given, but no 'stats_file'. No statistics will be written."); + log(WARNING, "'stats_interval' given, but no 'stats_file'. No client statistics will be written."); + } + + config->input_stats_interval = 60; + bool has_input_stats_file = fetch_config_string(lines, "input_stats_file", &config->input_stats_file); + bool has_input_stats_interval = fetch_config_int(lines, "input_stats_interval", &config->input_stats_interval); + if (has_input_stats_interval && !has_input_stats_file) { + log(WARNING, "'input_stats_interval' given, but no 'input_stats_file'. No input statistics will be written."); } fetch_config_string(lines, "access_log", &config->access_log_file); @@ -388,6 +398,8 @@ bool parse_config(const string &filename, Config *config) if (line.keyword == "num_servers" || line.keyword == "stats_file" || line.keyword == "stats_interval" || + line.keyword == "input_stats_file" || + line.keyword == "input_stats_interval" || line.keyword == "access_log") { // Already taken care of, above. } else if (line.keyword == "port") {