diff --git a/cache_managers/mysql_cache_manager/src/mysql_cache_manager.cpp b/cache_managers/mysql_cache_manager/src/mysql_cache_manager.cpp index 008a132..320f66e 100644 --- a/cache_managers/mysql_cache_manager/src/mysql_cache_manager.cpp +++ b/cache_managers/mysql_cache_manager/src/mysql_cache_manager.cpp @@ -158,7 +158,7 @@ mysql_cache_manager::set_streams(std::vector mode // TODO : Update an entry if it already exists. - if (result.data->next()) return; + if (result.data->next()) continue; query = tool::fmt(this->insert_with_id_query, this->connection.get_db_name().c_str(), diff --git a/cameradar_standalone/src/describe.cpp b/cameradar_standalone/src/describe.cpp index 9215bd8..11f9bc5 100644 --- a/cameradar_standalone/src/describe.cpp +++ b/cameradar_standalone/src/describe.cpp @@ -75,6 +75,7 @@ curl_describe(const std::string& path, bool logs) { if (logs) { // Some cameras return 400 instead of 401, don't know why. // Some cameras timeout and then curl considers the status as 0 + // GST-RTSP-SERVER returns 404 instead of 401, then 401 instead of 404. if (rc != 401 && rc != 400 && rc && pos == std::string::npos) LOG_INFO_("Unprotected camera discovered.", "brutelogs"); return ((res == CURLE_OK) && rc != 401 && rc != 400 && rc); diff --git a/cameradar_standalone/src/dispatcher.cpp b/cameradar_standalone/src/dispatcher.cpp index df7edbb..7077631 100644 --- a/cameradar_standalone/src/dispatcher.cpp +++ b/cameradar_standalone/src/dispatcher.cpp @@ -17,6 +17,8 @@ namespace etix { namespace cameradar { + using namespace std::chrono_literals; + // The main loop of the binary void dispatcher::run() { @@ -47,7 +49,7 @@ dispatcher::run() { // Waiting for task to cleanup / force stop command while ((signal_handler::instance().should_stop() not_eq stop_priority::force_stop) and doing_stuff()) { - std::this_thread::sleep_for(std::chrono::milliseconds(30)); + std::this_thread::sleep_for(30ms); } worker.join(); } @@ -88,6 +90,7 @@ dispatcher::do_stuff() { "dispatcher"); break; } + std::this_thread::sleep_for(30ms); } this->current = task::finished; } diff --git a/cameradar_standalone/src/main.cpp b/cameradar_standalone/src/main.cpp index 6b11e2b..04163ed 100644 --- a/cameradar_standalone/src/main.cpp +++ b/cameradar_standalone/src/main.cpp @@ -124,7 +124,7 @@ main(int argc, char* argv[]) { auto plug = std::make_shared(conf.second.cache_manager_path, conf.second.cache_manager_name); - if (not plug->make_instance()) { + if (not plug || not plug->make_instance()) { LOG_ERR_(std::string("Invalid cache manager "), "cameradar"); return false; }