From: Maxim Mamontov Date: Tue, 5 Feb 2013 19:22:21 +0000 (+0200) Subject: Added separate touch time for traffcounter packet processor. X-Git-Tag: 2.409~363 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/a536658cf9e66cd5b19c428aa40bcdabf8b5ecd2 Added separate touch time for traffcounter packet processor. --- diff --git a/projects/stargazer/traffcounter_impl.cpp b/projects/stargazer/traffcounter_impl.cpp index dd2b4395..17a786ff 100644 --- a/projects/stargazer/traffcounter_impl.cpp +++ b/projects/stargazer/traffcounter_impl.cpp @@ -68,6 +68,7 @@ TRAFFCOUNTER_IMPL::TRAFFCOUNTER_IMPL(USERS_IMPL * u, const std::string & fn) rulesFileName(fn), monitorDir(), monitoring(false), + touchTimeP(stgTime - MONITOR_TIME_DELAY_SEC), users(u), running(false), stopped(true), @@ -203,13 +204,11 @@ void TRAFFCOUNTER_IMPL::Process(const RAW_PACKET & rawPacket) if (!running) return; -time_t touchTime = stgTime - MONITOR_TIME_DELAY_SEC; - -if (monitoring && (touchTime + MONITOR_TIME_DELAY_SEC <= stgTime)) +if (monitoring && (touchTimeP + MONITOR_TIME_DELAY_SEC <= stgTime)) { std::string monFile = monitorDir + "/traffcounter_p"; printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", monitoring, monFile.c_str()); - touchTime = stgTime; + touchTimeP = stgTime; TouchFile(monFile.c_str()); } diff --git a/projects/stargazer/traffcounter_impl.h b/projects/stargazer/traffcounter_impl.h index f4049433..7e552f82 100644 --- a/projects/stargazer/traffcounter_impl.h +++ b/projects/stargazer/traffcounter_impl.h @@ -241,6 +241,7 @@ private: std::string monitorDir; bool monitoring; + time_t touchTimeP; USERS_IMPL * users;