From 8c11e9e35e0cd09e25f513c15dc0c4a0613aa2f0 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sat, 21 Jun 2014 01:11:25 +0300 Subject: [PATCH 1/1] Added modification time for session traffic. --- include/stg/user.h | 2 ++ projects/stargazer/user_impl.cpp | 4 ++++ projects/stargazer/user_impl.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/include/stg/user.h b/include/stg/user.h index 8dc761e3..7772a298 100644 --- a/include/stg/user.h +++ b/include/stg/user.h @@ -70,6 +70,8 @@ public: virtual const DIR_TRAFF & GetSessionUpload() const = 0; virtual const DIR_TRAFF & GetSessionDownload() const = 0; + virtual time_t GetSessionUploadModificationTime() const = 0; + virtual time_t GetSessionDownloadModificationTime() const = 0; virtual bool GetConnected() const = 0; virtual time_t GetConnectedModificationTime() const = 0; diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 22afa7f8..2b60c9ad 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -690,6 +690,8 @@ DIR_TRAFF zeroSesssion; sessionUpload = zeroSesssion; sessionDownload = zeroSesssion; +sessionUploadModTime = stgTime; +sessionDownloadModTime = stgTime; } //----------------------------------------------------------------------------- void USER_IMPL::PrintUser() const @@ -895,6 +897,7 @@ if (tt == TRAFF_UP || up = dt; sessionUpload[dir] += len; +sessionUploadModTime = stgTime; //Add detailed stat @@ -986,6 +989,7 @@ if (tt == TRAFF_DOWN || down = dt; sessionDownload[dir] += len; +sessionDownloadModTime = stgTime; //Add detailed stat diff --git a/projects/stargazer/user_impl.h b/projects/stargazer/user_impl.h index 5b51fc5d..29cc63c4 100644 --- a/projects/stargazer/user_impl.h +++ b/projects/stargazer/user_impl.h @@ -181,6 +181,8 @@ public: const DIR_TRAFF & GetSessionUpload() const { return sessionUpload; } const DIR_TRAFF & GetSessionDownload() const { return sessionDownload; } + time_t GetSessionUploadModificationTime() const { return sessionUploadModTime; } + time_t GetSessionDownloadModificationTime() const { return sessionDownloadModTime; } bool GetConnected() const { return connected; } time_t GetConnectedModificationTime() const { return connected.ModificationTime(); } @@ -325,6 +327,8 @@ private: DIR_TRAFF sessionUpload; DIR_TRAFF sessionDownload; + time_t sessionUploadModTime; + time_t sessionDownloadModTime; CHG_PASSIVE_NOTIFIER passiveNotifier; CHG_DISABLED_NOTIFIER disabledNotifier; -- 2.44.2