From 1bf5ae378079e212f6918d09d87dec5420a0d6ec Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 6 Dec 2010 16:30:02 +0200 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B8=20=D0=B7=D0=B0=D0=BF=D0=B8?= =?utf8?q?=D1=81=D0=B8=20=D0=B4=D0=B5=D1=82=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE?= =?utf8?q?=D0=B9=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=81=D1=82=D0=B8=D0=BA?= =?utf8?q?=D0=B8=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D1=82=D0=B5?= =?utf8?q?=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0?= =?utf8?q?=D1=8E=D1=82=D1=81=D1=8F=20=D0=BD=D0=B5=20=D0=BF=D0=BE=20=D1=83?= =?utf8?q?=D0=BA=D0=B0=D0=B7=D0=B0=D1=82=D0=B5=D0=BB=D1=8E=20=D1=8F=20?= =?utf8?q?=D0=BF=D0=BE=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B5.=20=D0=A1?= =?utf8?q?=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D0=B5?= =?utf8?q?=D0=BD=D0=BD=D0=BE,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?utf8?q?=D0=B5=D0=BD=D1=8B=20=D0=B2=D1=81=D0=B5=20=D0=BF=D0=BB=D0=B0?= =?utf8?q?=D0=B3=D0=B8=D0=BD=D1=8B=20=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D0=BB?= =?utf8?q?=D0=B8=D1=89.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/base_store.h | 2 +- projects/stargazer/plugins/store/files/file_store.cpp | 6 +++--- projects/stargazer/plugins/store/files/file_store.h | 2 +- projects/stargazer/plugins/store/firebird/firebird_store.h | 2 +- .../plugins/store/firebird/firebird_store_users.cpp | 6 +++--- projects/stargazer/plugins/store/mysql/mysql_store.cpp | 6 +++--- projects/stargazer/plugins/store/mysql/mysql_store.h | 2 +- .../stargazer/plugins/store/postgresql/postgresql_store.h | 2 +- .../plugins/store/postgresql/postgresql_store_users.cpp | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/base_store.h b/include/base_store.h index e5939623..c35b49c7 100644 --- a/include/base_store.h +++ b/include/base_store.h @@ -73,7 +73,7 @@ public: double freeMb, const std::string & reason) const = 0; - virtual int WriteDetailedStat(const map * statTree, + virtual int WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const = 0; diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/projects/stargazer/plugins/store/files/file_store.cpp index 07638400..556bf8cf 100644 --- a/projects/stargazer/plugins/store/files/file_store.cpp +++ b/projects/stargazer/plugins/store/files/file_store.cpp @@ -1766,7 +1766,7 @@ switch (td.tariffConf.traffType) return 0; } //----------------------------------------------------------------------------- -int FILES_STORE::WriteDetailedStat(const map * statTree, +int FILES_STORE::WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const { @@ -1899,9 +1899,9 @@ if (fprintf(statFile, "-> %02d.%02d.%02d - %02d.%02d.%02d\n", } map::const_iterator stIter; -stIter = statTree->begin(); +stIter = statTree.begin(); -while (stIter != statTree->end()) +while (stIter != statTree.end()) { string u, d; x2str(stIter->second.up, u); diff --git a/projects/stargazer/plugins/store/files/file_store.h b/projects/stargazer/plugins/store/files/file_store.h index 4734a54d..38fea5e1 100644 --- a/projects/stargazer/plugins/store/files/file_store.h +++ b/projects/stargazer/plugins/store/files/file_store.h @@ -137,7 +137,7 @@ public: double freeMb, const std::string & reason) const; - virtual int WriteDetailedStat(const map * statTree, + virtual int WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const; diff --git a/projects/stargazer/plugins/store/firebird/firebird_store.h b/projects/stargazer/plugins/store/firebird/firebird_store.h index 2cc62cfa..55333888 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store.h +++ b/projects/stargazer/plugins/store/firebird/firebird_store.h @@ -73,7 +73,7 @@ public: double cash, double freeMb, const std::string & reason) const; - int WriteDetailedStat(const std::map * statTree, + int WriteDetailedStat(const std::map & statTree, time_t lastStat, const std::string & login) const; diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp index 035ae134..6d2d36bf 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp @@ -717,7 +717,7 @@ catch (IBPP::Exception & ex) return 0; } //----------------------------------------------------------------------------- -int FIREBIRD_STORE::WriteDetailedStat(const map * statTree, +int FIREBIRD_STORE::WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const { @@ -735,14 +735,14 @@ try { tr->Start(); map::const_iterator it; - it = statTree->begin(); + it = statTree.begin(); st->Prepare("insert into tb_detail_stats \ (till_time, from_time, fk_user, dir_num, \ ip, download, upload, cost) \ values (?, ?, (select pk_user from tb_users \ where name = ?), \ ?, ?, ?, ?, ?)"); - while (it != statTree->end()) + while (it != statTree.end()) { st->Set(1, now); st->Set(2, statTime); diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index 94503c78..f78586fb 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -1689,7 +1689,7 @@ if(MysqlSetQuery(res.c_str())) return 0; } //----------------------------------------------------------------------------- -int MYSQL_STORE::WriteDetailedStat(const map * statTree, +int MYSQL_STORE::WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const { @@ -1776,9 +1776,9 @@ strprintf(&res,"INSERT INTO detailstat_%02d_%4d SET login='%s',"\ int retRes; map::const_iterator stIter; -stIter = statTree->begin(); +stIter = statTree.begin(); -while (stIter != statTree->end()) +while (stIter != statTree.end()) { strprintf(&tempStr,"IP='%s', dir=%d, down=%lld, up=%lld, cash=%f", inet_ntostring(stIter->first.ip).c_str(), diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.h b/projects/stargazer/plugins/store/mysql/mysql_store.h index 649cb858..7b48712f 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.h +++ b/projects/stargazer/plugins/store/mysql/mysql_store.h @@ -78,7 +78,7 @@ public: double freeMb, const std::string & reason) const; - virtual int WriteDetailedStat(const map * statTree, + virtual int WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const; diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store.h b/projects/stargazer/plugins/store/postgresql/postgresql_store.h index 67119db2..a731fbf9 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store.h +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store.h @@ -72,7 +72,7 @@ public: double cash, double freeMb, const std::string & reason) const; - int WriteDetailedStat(const std::map * statTree, + int WriteDetailedStat(const std::map & statTree, time_t lastStat, const std::string & login) const; diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp index 0e26327b..2c66cc7f 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp @@ -1330,7 +1330,7 @@ return 0; } //----------------------------------------------------------------------------- -int POSTGRESQL_STORE::WriteDetailedStat(const map * statTree, +int POSTGRESQL_STORE::WriteDetailedStat(const map & statTree, time_t lastStat, const string & login) const { @@ -1370,7 +1370,7 @@ if (EscapeString(elogin)) map::const_iterator it; time_t currTime = time(NULL); -for (it = statTree->begin(); it != statTree->end(); ++it) +for (it = statTree.begin(); it != statTree.end(); ++it) { std::stringstream query; query << "INSERT INTO tb_detail_stats " -- 2.43.2