From: Maxim Mamontov Date: Fri, 20 Jun 2014 22:11:25 +0000 (+0300) Subject: Added modification time for session traffic. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/d8f5aa2489e10fc20ee3522a8abe2a56f24076d7 Added modification time for session traffic. --- 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;