From ca63abae14c2b7649317630be2bb6f6a0148971e Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 30 Jul 2020 00:35:52 +0200 Subject: [PATCH] Added STAT_CUTOFF compile flag --- CMakeLists.txt | 3 +++ lib/config.cpp | 13 ++++++++++++- src/controller/controller_statistics.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85be13eb..2b9e7f74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,9 @@ endif() if (DEFINED DATASIZE ) add_definitions(-DSHM_DATASIZE=${DATASIZE}) endif() +if (DEFINED STAT_CUTOFF ) + add_definitions(-DSTAT_CUTOFF=${STAT_CUTOFF}) +endif() if (NOT DEFINED NOUPDATE ) add_definitions(-DUPDATER=1) endif() diff --git a/lib/config.cpp b/lib/config.cpp index 9ade9ed8..f950ea7c 100644 --- a/lib/config.cpp +++ b/lib/config.cpp @@ -200,6 +200,14 @@ bool Util::Config::parseArgs(int &argc, char **&argv){ "names." << std::endl; #endif +#ifdef STAT_CUTOFF + if (STAT_CUTOFF != 600){ + std::cout << "- Setting: Stats cutoff point " << STAT_CUTOFF << " seconds. Statistics and session cache are only kept for this long, as opposed to the default of 600 seconds." << std::endl; + } +#endif +#ifndef SSL + std::cout << "- Flag: SSL support disabled. HTTPS/RTMPS are unavailable." << std::endl; +#endif /*LTS-START*/ #ifndef UPDATER std::cout << "- Flag: Updater disabled. Server will not call back home and attempt to search " @@ -213,7 +221,7 @@ bool Util::Config::parseArgs(int &argc, char **&argv){ #endif #ifdef KILLONEXIT std::cout << "- Flag: Kill on exit. All binaries will forcibly shut down all their children " - "on exit. This disabled rolling restart support." + "on exit. Rolling restart support is disabled." << std::endl; #endif #ifdef STATS_DELAY @@ -226,6 +234,9 @@ bool Util::Config::parseArgs(int &argc, char **&argv){ std::cout << "This makes them less accurate." << std::endl; } } +#endif +#ifndef LICENSING + std::cout << "- Flag: Licensing system disabled. No checks for validity will occur." << std::endl; #endif /*LTS-END*/ std::cout << "Built on " __DATE__ ", " __TIME__ << std::endl; diff --git a/src/controller/controller_statistics.h b/src/controller/controller_statistics.h index b080cbd6..eb224e82 100644 --- a/src/controller/controller_statistics.h +++ b/src/controller/controller_statistics.h @@ -11,7 +11,9 @@ #include /// The STAT_CUTOFF define sets how many seconds of statistics history is kept. +#ifndef STAT_CUTOFF #define STAT_CUTOFF 600 +#endif namespace Controller{