git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5faa80c
)
Various fixes of issues reported by static analyzers.
author
Maxim Mamontov
<faust.madf@gmail.com>
Sat, 21 Jan 2017 18:19:06 +0000
(20:19 +0200)
committer
Maxim Mamontov
<faust.madf@gmail.com>
Sat, 21 Jan 2017 18:53:09 +0000
(20:53 +0200)
67 files changed:
include/stg/admin_conf.h
patch
|
blob
|
history
include/stg/corp_conf.h
patch
|
blob
|
history
include/stg/locker.h
patch
|
blob
|
history
include/stg/plugin_creator.h
patch
|
blob
|
history
include/stg/resetable.h
patch
|
blob
|
history
include/stg/service_conf.h
patch
|
blob
|
history
include/stg/tariff_conf.h
patch
|
blob
|
history
include/stg/user_property.h
patch
|
blob
|
history
include/stg/user_traff.h
patch
|
blob
|
history
include/stg/utime.h
patch
|
blob
|
history
projects/rscriptd/listener.h
patch
|
blob
|
history
projects/rscriptd/pidfile.h
patch
|
blob
|
history
projects/sgauth/web.cpp
patch
|
blob
|
history
projects/sgconf/common_sg.cpp
patch
|
blob
|
history
projects/sgconf/main.cpp
patch
|
blob
|
history
projects/sgconv/settings_impl.h
patch
|
blob
|
history
projects/stargazer/admin_impl.cpp
patch
|
blob
|
history
projects/stargazer/admin_impl.h
patch
|
blob
|
history
projects/stargazer/admins_impl.cpp
patch
|
blob
|
history
projects/stargazer/admins_impl.h
patch
|
blob
|
history
projects/stargazer/corps_impl.cpp
patch
|
blob
|
history
projects/stargazer/corps_impl.h
patch
|
blob
|
history
projects/stargazer/pidfile.h
patch
|
blob
|
history
projects/stargazer/plugin_runner.cpp
patch
|
blob
|
history
projects/stargazer/plugin_runner.h
patch
|
blob
|
history
projects/stargazer/plugins/authorization/ao/ao.cpp
patch
|
blob
|
history
projects/stargazer/plugins/authorization/ao/ao.h
patch
|
blob
|
history
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
patch
|
blob
|
history
projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/configproto.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/conn.cpp
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/conn.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser_admins.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser_message.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h
patch
|
blob
|
history
projects/stargazer/plugins/configuration/sgconfig/parser_users.h
patch
|
blob
|
history
projects/stargazer/plugins/other/ping/ping.h
patch
|
blob
|
history
projects/stargazer/plugins/other/rscript/rscript.cpp
patch
|
blob
|
history
projects/stargazer/plugins/other/rscript/rscript.h
patch
|
blob
|
history
projects/stargazer/plugins/other/rscript/send_functor.h
patch
|
blob
|
history
projects/stargazer/plugins/other/rscript/ur_functor.h
patch
|
blob
|
history
projects/stargazer/plugins/other/smux/sensors.h
patch
|
blob
|
history
projects/stargazer/plugins/other/smux/smux.h
patch
|
blob
|
history
projects/stargazer/plugins/other/smux/tables.h
patch
|
blob
|
history
projects/stargazer/plugins/other/smux/types.h
patch
|
blob
|
history
projects/stargazer/plugins/store/mysql/mysql_store.cpp
patch
|
blob
|
history
projects/stargazer/services_impl.cpp
patch
|
blob
|
history
projects/stargazer/services_impl.h
patch
|
blob
|
history
projects/stargazer/settings_impl.h
patch
|
blob
|
history
projects/stargazer/store_loader.cpp
patch
|
blob
|
history
projects/stargazer/store_loader.h
patch
|
blob
|
history
projects/stargazer/tariff_impl.h
patch
|
blob
|
history
projects/stargazer/tariffs_impl.h
patch
|
blob
|
history
projects/stargazer/traffcounter_impl.cpp
patch
|
blob
|
history
projects/stargazer/traffcounter_impl.h
patch
|
blob
|
history
projects/stargazer/user_impl.cpp
patch
|
blob
|
history
projects/stargazer/user_impl.h
patch
|
blob
|
history
projects/stargazer/users_impl.cpp
patch
|
blob
|
history
stglibs/conffiles.lib/conffiles.cpp
patch
|
blob
|
history
stglibs/dotconfpp.lib/include/stg/dotconfpp.h
patch
|
blob
|
history
stglibs/logger.lib/include/stg/logger.h
patch
|
blob
|
history
stglibs/pinger.lib/include/stg/pinger.h
patch
|
blob
|
history
diff --git
a/include/stg/admin_conf.h
b/include/stg/admin_conf.h
index f88ab0c8035bef250f5a9d7800bd8c5e03ccbe02..a2639d36963899224c812bb6189625910c562ebf 100644
(file)
--- a/
include/stg/admin_conf.h
+++ b/
include/stg/admin_conf.h
@@
-29,7
+29,7
@@
struct PRIV
serviceChg(0),
corpChg(0)
{}
serviceChg(0),
corpChg(0)
{}
- PRIV(uint32_t p)
+
explicit
PRIV(uint32_t p)
: userStat((p & 0x00000003) >> 0x00),
userConf((p & 0x0000000C) >> 0x02),
userCash((p & 0x00000030) >> 0x04),
: userStat((p & 0x00000003) >> 0x00),
userConf((p & 0x0000000C) >> 0x02),
userCash((p & 0x00000030) >> 0x04),
@@
-62,11
+62,6
@@
struct ADMIN_CONF
login(),
password("* NO PASSWORD *")
{}
login(),
password("* NO PASSWORD *")
{}
- ADMIN_CONF(const ADMIN_CONF & rvalue)
- : priv(rvalue.priv),
- login(rvalue.login),
- password(rvalue.password)
- {}
ADMIN_CONF(const PRIV & pr, const std::string & l, const std::string & p)
: priv(pr),
login(l),
ADMIN_CONF(const PRIV & pr, const std::string & l, const std::string & p)
: priv(pr),
login(l),
@@
-81,18
+76,6
@@
struct ADMIN_CONF_RES
{
ADMIN_CONF_RES()
{}
{
ADMIN_CONF_RES()
{}
- ADMIN_CONF_RES(const ADMIN_CONF_RES & rhs)
- : priv(rhs.priv),
- login(rhs.login),
- password(rhs.password)
- {}
- ADMIN_CONF_RES & operator=(const ADMIN_CONF_RES & rhs)
- {
- priv = rhs.priv;
- login = rhs.login;
- password = rhs.password;
- return *this;
- }
RESETABLE<PRIV> priv;
RESETABLE<std::string> login;
RESETABLE<std::string> password;
RESETABLE<PRIV> priv;
RESETABLE<std::string> login;
RESETABLE<std::string> password;
diff --git
a/include/stg/corp_conf.h
b/include/stg/corp_conf.h
index d6cc2ebbe626f5422de591c3f9e47f26d4e97a83..3810516dfb8e73d3c786dfce5fba9ebdea4e4b24 100644
(file)
--- a/
include/stg/corp_conf.h
+++ b/
include/stg/corp_conf.h
@@
-6,7
+6,7
@@
struct CORP_CONF
{
CORP_CONF() : name(), cash(0) {}
struct CORP_CONF
{
CORP_CONF() : name(), cash(0) {}
-CORP_CONF(const std::string & n) : name(n), cash(0) {}
+
explicit
CORP_CONF(const std::string & n) : name(n), cash(0) {}
CORP_CONF(const std::string & n, double c) : name(n), cash(c) {}
std::string name;
CORP_CONF(const std::string & n, double c) : name(n), cash(c) {}
std::string name;
diff --git
a/include/stg/locker.h
b/include/stg/locker.h
index fe1014d779093b94e277f0248f1fa997a12db621..2a395f37698b6c3cfa9e8814c850e3409c572071 100644
(file)
--- a/
include/stg/locker.h
+++ b/
include/stg/locker.h
@@
-34,7
+34,7
@@
class STG_LOCKER
{
public:
class STG_LOCKER
{
public:
- STG_LOCKER(pthread_mutex_t * m)
+
explicit
STG_LOCKER(pthread_mutex_t * m)
: mutex(m)
{
pthread_mutex_lock(mutex);
: mutex(m)
{
pthread_mutex_lock(mutex);
diff --git
a/include/stg/plugin_creator.h
b/include/stg/plugin_creator.h
index 755c20686cc8a2cca398be740a9b93a057aea011..e1531e1214694c16dc5e553d0d112971388edb5e 100644
(file)
--- a/
include/stg/plugin_creator.h
+++ b/
include/stg/plugin_creator.h
@@
-1,20
+1,19
@@
#ifndef __PLUGIN_CREATOR_H__
#define __PLUGIN_CREATOR_H__
#ifndef __PLUGIN_CREATOR_H__
#define __PLUGIN_CREATOR_H__
+#include "noncopyable.h"
+
template <class T>
template <class T>
-class PLUGIN_CREATOR
+class PLUGIN_CREATOR
: private NONCOPYABLE
{
public:
PLUGIN_CREATOR() : plugin(new T()) {}
{
public:
PLUGIN_CREATOR() : plugin(new T()) {}
- ~PLUGIN_CREATOR() { delete plugin; }
+
//
~PLUGIN_CREATOR() { delete plugin; }
T * GetPlugin() { return plugin; }
private:
T * plugin;
T * GetPlugin() { return plugin; }
private:
T * plugin;
-
- PLUGIN_CREATOR(const PLUGIN_CREATOR<T> & rvalue);
- PLUGIN_CREATOR<T> & operator=(const PLUGIN_CREATOR<T> & rvalue);
};
#endif
};
#endif
diff --git
a/include/stg/resetable.h
b/include/stg/resetable.h
index a451b357326cd946c72b77ddf7b4bd57c65b1a36..e7914efd3e90fdfc958025ac0317589d06735163 100644
(file)
--- a/
include/stg/resetable.h
+++ b/
include/stg/resetable.h
@@
-16,19
+16,7
@@
public:
typedef T value_type;
RESETABLE() : value(), is_set(false) {}
typedef T value_type;
RESETABLE() : value(), is_set(false) {}
- RESETABLE(const T & v) : value(v), is_set(true) {}
-
- RESETABLE(const RESETABLE<T> & rvalue)
- : value(rvalue.value),
- is_set(rvalue.is_set)
- {}
-
- RESETABLE<T> & operator=(const RESETABLE<T> & rhs)
- {
- value = rhs.value;
- is_set = rhs.is_set;
- return *this;
- }
+ explicit RESETABLE(const T & v) : value(v), is_set(true) {}
RESETABLE<T> & operator=(const T & rhs)
{
RESETABLE<T> & operator=(const T & rhs)
{
diff --git
a/include/stg/service_conf.h
b/include/stg/service_conf.h
index 84f052a557b55f0befe40b09b24cb50547135b82..b6c244908d8791e07a78ff7ccef06172f44535d3 100644
(file)
--- a/
include/stg/service_conf.h
+++ b/
include/stg/service_conf.h
@@
-31,7
+31,7
@@
struct SERVICE_CONF
SERVICE_CONF()
: name(), comment(), cost(0), payDay(0)
{}
SERVICE_CONF()
: name(), comment(), cost(0), payDay(0)
{}
-SERVICE_CONF(const std::string & n)
+
explicit
SERVICE_CONF(const std::string & n)
: name(n), comment(), cost(0), payDay(0)
{}
SERVICE_CONF(const std::string & n, double c)
: name(n), comment(), cost(0), payDay(0)
{}
SERVICE_CONF(const std::string & n, double c)
@@
-58,7
+58,7
@@
SERVICE_CONF_RES()
cost(), payDay()
{}
cost(), payDay()
{}
-SERVICE_CONF_RES(const SERVICE_CONF & rhs)
+
explicit
SERVICE_CONF_RES(const SERVICE_CONF & rhs)
: name(rhs.name), comment(rhs.comment),
cost(rhs.cost), payDay(rhs.payDay)
{}
: name(rhs.name), comment(rhs.comment),
cost(rhs.cost), payDay(rhs.payDay)
{}
diff --git
a/include/stg/tariff_conf.h
b/include/stg/tariff_conf.h
index 79ade2eb44bef6ddaee90bf705a8d421297b7dcf..f705d0a0bef90e4e8575791505a76df8cb81934a 100644
(file)
--- a/
include/stg/tariff_conf.h
+++ b/
include/stg/tariff_conf.h
@@
-162,7
+162,7
@@
struct TARIFF_CONF
changePolicyTimeout(0)
{}
changePolicyTimeout(0)
{}
- TARIFF_CONF(const std::string & n)
+
explicit
TARIFF_CONF(const std::string & n)
: fee(0),
free(0),
traffType(TARIFF::TRAFF_UP_DOWN),
: fee(0),
free(0),
traffType(TARIFF::TRAFF_UP_DOWN),
@@
-234,22
+234,10
@@
struct TARIFF_DATA
dirPrice(DIR_NUM)
{}
dirPrice(DIR_NUM)
{}
- TARIFF_DATA(const std::string & name)
+
explicit
TARIFF_DATA(const std::string & name)
: tariffConf(name),
dirPrice(DIR_NUM)
{}
: tariffConf(name),
dirPrice(DIR_NUM)
{}
-
- TARIFF_DATA(const TARIFF_DATA & td)
- : tariffConf(td.tariffConf),
- dirPrice(td.dirPrice)
- {}
-
- TARIFF_DATA & operator=(const TARIFF_DATA & td)
- {
- tariffConf = td.tariffConf;
- dirPrice = td.dirPrice;
- return *this;
- }
};
//-----------------------------------------------------------------------------
struct TARIFF_DATA_RES
};
//-----------------------------------------------------------------------------
struct TARIFF_DATA_RES
diff --git
a/include/stg/user_property.h
b/include/stg/user_property.h
index f024f4575269d2c13f7728f8d5531a442e46e088..4a26b21144dc5e2c908c70ba0eacbfaea3384be4 100644
(file)
--- a/
include/stg/user_property.h
+++ b/
include/stg/user_property.h
@@
-39,7
+39,7
@@
typedef std::map<std::string, USER_PROPERTY_BASE *> REGISTRY;
template<typename varT>
class USER_PROPERTY : public USER_PROPERTY_BASE {
public:
template<typename varT>
class USER_PROPERTY : public USER_PROPERTY_BASE {
public:
- USER_PROPERTY(varT & val);
+
explicit
USER_PROPERTY(varT & val);
virtual ~USER_PROPERTY();
void Set(const varT & rvalue);
virtual ~USER_PROPERTY();
void Set(const varT & rvalue);
@@
-131,7
+131,7
@@
private:
REGISTRY properties;
public:
REGISTRY properties;
public:
- USER_PROPERTIES(const SETTINGS& s);
+
explicit
USER_PROPERTIES(const SETTINGS& s);
USER_STAT & Stat() { return stat; }
USER_CONF & Conf() { return conf; }
USER_STAT & Stat() { return stat; }
USER_CONF & Conf() { return conf; }
diff --git
a/include/stg/user_traff.h
b/include/stg/user_traff.h
index eec4627669f6c8e8ee47797a695a1f0d3caf6304..d820588e3702d412436635474996da7d1a78b2c1 100644
(file)
--- a/
include/stg/user_traff.h
+++ b/
include/stg/user_traff.h
@@
-45,8
+45,6
@@
public:
typedef ContainerType::size_type IndexType;
DIR_TRAFF() : traff(DIR_NUM) {}
typedef ContainerType::size_type IndexType;
DIR_TRAFF() : traff(DIR_NUM) {}
- DIR_TRAFF(const DIR_TRAFF & ts) : traff(ts.traff) {}
- DIR_TRAFF & operator=(const DIR_TRAFF & ts) { traff = ts.traff; return *this; }
const uint64_t & operator[](IndexType idx) const { return traff[idx]; }
uint64_t & operator[](IndexType idx) { return traff[idx]; }
IndexType size() const { return traff.size(); }
const uint64_t & operator[](IndexType idx) const { return traff[idx]; }
uint64_t & operator[](IndexType idx) { return traff[idx]; }
IndexType size() const { return traff.size(); }
@@
-85,12
+83,18
@@
public:
typedef ContainerType::size_type IndexType;
DIR_TRAFF_RES() : traff(DIR_NUM) {}
typedef ContainerType::size_type IndexType;
DIR_TRAFF_RES() : traff(DIR_NUM) {}
- DIR_TRAFF_RES(const DIR_TRAFF & ts)
+
explicit
DIR_TRAFF_RES(const DIR_TRAFF & ts)
: traff(ts.size())
{
for (IndexType i = 0; i < ts.size(); ++i)
traff[i] = ts[i];
}
: traff(ts.size())
{
for (IndexType i = 0; i < ts.size(); ++i)
traff[i] = ts[i];
}
+ DIR_TRAFF_RES & operator=(const DIR_TRAFF & ts)
+ {
+ for (IndexType i = 0; i < ts.size(); ++i)
+ traff[i] = ts[i];
+ return *this;
+ }
const ValueType & operator[](IndexType idx) const { return traff[idx]; }
ValueType & operator[](IndexType idx) { return traff[idx]; }
DIR_TRAFF GetData() const
const ValueType & operator[](IndexType idx) const { return traff[idx]; }
ValueType & operator[](IndexType idx) { return traff[idx]; }
DIR_TRAFF GetData() const
diff --git
a/include/stg/utime.h
b/include/stg/utime.h
index fe6b3f69d9601d2f737404f78e0bfc31e24196a3..853b3db194c7d91c875c5ef40d07024424cf198f 100644
(file)
--- a/
include/stg/utime.h
+++ b/
include/stg/utime.h
@@
-46,7
+46,7
@@
struct UTIME: public timeval
tv_usec = 0;
}
tv_usec = 0;
}
- UTIME(time_t t)
+
explicit
UTIME(time_t t)
{
tv_sec = t;
tv_usec = 0;
{
tv_sec = t;
tv_usec = 0;
diff --git
a/projects/rscriptd/listener.h
b/projects/rscriptd/listener.h
index c6fb143a05c3104aeba54530ef9f1c12e296c31c..22b029b663f67704676e96bedde0911ce4072702 100644
(file)
--- a/
projects/rscriptd/listener.h
+++ b/
projects/rscriptd/listener.h
@@
-56,7
+56,7
@@
struct AliveData : public UserData
class IsNotTimedOut : public std::unary_function<const AliveData &, bool> {
public:
class IsNotTimedOut : public std::unary_function<const AliveData &, bool> {
public:
- IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
+
explicit
IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
bool operator()(const AliveData & data) const
{
return difftime(now, data.lastAlive) < timeout;
bool operator()(const AliveData & data) const
{
return difftime(now, data.lastAlive) < timeout;
@@
-133,7
+133,7
@@
private:
class DisconnectUser : public std::unary_function<const UserData &, void> {
public:
class DisconnectUser : public std::unary_function<const UserData &, void> {
public:
- DisconnectUser(LISTENER & l) : listener(l) {};
+
explicit
DisconnectUser(LISTENER & l) : listener(l) {};
void operator()(const UserData & data)
{
listener.Disconnect(data);
void operator()(const UserData & data)
{
listener.Disconnect(data);
diff --git
a/projects/rscriptd/pidfile.h
b/projects/rscriptd/pidfile.h
index a8a7bb3061d852eadf89be12a3efa96ae9abdd23..82ff0038cc3d10f5bc9d7cae8185c2265cb963ae 100644
(file)
--- a/
projects/rscriptd/pidfile.h
+++ b/
projects/rscriptd/pidfile.h
@@
-35,7
+35,7
@@
class PIDFile {
public:
class PIDFile {
public:
- PIDFile(const std::string & fn);
+
explicit
PIDFile(const std::string & fn);
~PIDFile();
private:
std::string fileName;
~PIDFile();
private:
std::string fileName;
diff --git
a/projects/sgauth/web.cpp
b/projects/sgauth/web.cpp
index 01660b6169622126401359f4a7521afb30903bfc..8c23482b04deb8f41e51e3396eb42c0078bcd607 100644
(file)
--- a/
projects/sgauth/web.cpp
+++ b/
projects/sgauth/web.cpp
@@
-358,7
+358,6
@@
res = send(outerSocket, str, strlen(str), 0);
sprintf(str," <TD id=\"TraffTableDSCellC\">%s</TD>\n", gettext("Session Download"));
res = send(outerSocket, str, strlen(str), 0);
sprintf(str," <TD id=\"TraffTableDSCellC\">%s</TD>\n", gettext("Session Download"));
res = send(outerSocket, str, strlen(str), 0);
-rowNum = 0;
for (j = 0; j < DIR_NUM; j++)
{
if (dirName[j][0] == 0)
for (j = 0; j < DIR_NUM; j++)
{
if (dirName[j][0] == 0)
diff --git
a/projects/sgconf/common_sg.cpp
b/projects/sgconf/common_sg.cpp
index 9c1b7283705bdf3cbc1652811e847c463b55cab9..86214a3dd916c81b6333733f90f97f7dc1546215 100644
(file)
--- a/
projects/sgconf/common_sg.cpp
+++ b/
projects/sgconf/common_sg.cpp
@@
-213,13
+213,6
@@
return usr;
void ConvertKOI8(const string & src, string * dst, int encType)
{
iconv_t cd;
void ConvertKOI8(const string & src, string * dst, int encType)
{
iconv_t cd;
-char * ob = new char[src.size() * 2 + 1];
-char * ib = new char[src.size() + 1];
-
-strcpy(ib, src.c_str());
-
-char * outbuf = ob;
-char * inbuf = ib;
setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
@@
-239,11
+232,6
@@
else
size_t nconv = 1;
size_t nconv = 1;
-size_t insize = strlen(ib);
-size_t outsize = insize * 2 + 1;
-
-insize = src.size();
-
cd = iconv_open(charsetT, charsetF);
if (cd == (iconv_t) -1)
{
cd = iconv_open(charsetT, charsetF);
if (cd == (iconv_t) -1)
{
@@
-259,6
+247,19
@@
if (cd == (iconv_t) -1)
exit(ICONV_ERR_CODE);
}
exit(ICONV_ERR_CODE);
}
+char * ob = new char[src.size() * 2 + 1];
+char * ib = new char[src.size() + 1];
+
+strcpy(ib, src.c_str());
+
+char * outbuf = ob;
+char * inbuf = ib;
+
+size_t insize = strlen(ib);
+size_t outsize = insize * 2 + 1;
+
+insize = src.size();
+
#if defined(CONST_ICONV)
nconv = iconv(cd, (const char **)&inbuf, &insize, &outbuf, &outsize);
#else
#if defined(CONST_ICONV)
nconv = iconv(cd, (const char **)&inbuf, &insize, &outbuf, &outsize);
#else
diff --git
a/projects/sgconf/main.cpp
b/projects/sgconf/main.cpp
index b107ee9515c1265e589ebfcd6924c8fc3ac77143..3eaffb9f07120c5089c0aa2bef585cfc4594d5f2 100644
(file)
--- a/
projects/sgconf/main.cpp
+++ b/
projects/sgconf/main.cpp
@@
-332,13
+332,6
@@
return stg_timegm(&brokenTime);
void ParseAnyString(const char * c, string * msg, const char * enc)
{
iconv_t cd;
void ParseAnyString(const char * c, string * msg, const char * enc)
{
iconv_t cd;
-char * ob = new char[strlen(c) + 1];
-char * ib = new char[strlen(c) + 1];
-
-strcpy(ib, c);
-
-char * outbuf = ob;
-char * inbuf = ib;
setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
@@
-349,11
+342,6
@@
const char * charsetT = enc;
size_t nconv = 1;
size_t nconv = 1;
-size_t insize = strlen(ib);
-size_t outsize = strlen(ib);
-
-insize = strlen(c);
-
cd = iconv_open(charsetT, charsetF);
if (cd == (iconv_t) -1)
{
cd = iconv_open(charsetT, charsetF);
if (cd == (iconv_t) -1)
{
@@
-369,6
+357,17
@@
if (cd == (iconv_t) -1)
exit(ICONV_ERR_CODE);
}
exit(ICONV_ERR_CODE);
}
+char * ob = new char[strlen(c) + 1];
+char * ib = new char[strlen(c) + 1];
+
+strcpy(ib, c);
+
+char * outbuf = ob;
+char * inbuf = ib;
+
+size_t insize = strlen(c);
+size_t outsize = strlen(ib);
+
#if defined(CONST_ICONV)
nconv = iconv (cd, (const char**)&inbuf, &insize, &outbuf, &outsize);
#else
#if defined(CONST_ICONV)
nconv = iconv (cd, (const char**)&inbuf, &insize, &outbuf, &outsize);
#else
diff --git
a/projects/sgconv/settings_impl.h
b/projects/sgconv/settings_impl.h
index 3dfb9596e666cf1f5dcc1f3c6f2ea2201095cc76..0a0b5d1a677c26ec87f6df337bee76263475ea54 100644
(file)
--- a/
projects/sgconv/settings_impl.h
+++ b/
projects/sgconv/settings_impl.h
@@
-39,7
+39,7
@@
class DOTCONFDocumentNode;
class SETTINGS_IMPL {
public:
SETTINGS_IMPL() : confFile("./sgconv.conf") {}
class SETTINGS_IMPL {
public:
SETTINGS_IMPL() : confFile("./sgconv.conf") {}
- SETTINGS_IMPL(const std::string & cf) : confFile(cf) {}
+
explicit
SETTINGS_IMPL(const std::string & cf) : confFile(cf) {}
~SETTINGS_IMPL() {}
int ReadSettings();
~SETTINGS_IMPL() {}
int ReadSettings();
diff --git
a/projects/stargazer/admin_impl.cpp
b/projects/stargazer/admin_impl.cpp
index 3d2c4895bf52ef84b64d50f9e40eb437a452fe3f..400fe5c4a6a8bb14abec25d28ab0ba344ba72d92 100644
(file)
--- a/
projects/stargazer/admin_impl.cpp
+++ b/
projects/stargazer/admin_impl.cpp
@@
-29,22
+29,21
@@
*/
#include "admin_impl.h"
*/
#include "admin_impl.h"
+
#include "stg/common.h"
//-----------------------------------------------------------------------------
ADMIN_IMPL::ADMIN_IMPL()
: ADMIN(),
conf(),
#include "stg/common.h"
//-----------------------------------------------------------------------------
ADMIN_IMPL::ADMIN_IMPL()
: ADMIN(),
conf(),
- ip(0),
- WriteServLog(GetStgLogger())
+ ip(0)
{
}
//-----------------------------------------------------------------------------
ADMIN_IMPL::ADMIN_IMPL(const ADMIN_CONF & ac)
: ADMIN(),
conf(ac),
{
}
//-----------------------------------------------------------------------------
ADMIN_IMPL::ADMIN_IMPL(const ADMIN_CONF & ac)
: ADMIN(),
conf(ac),
- ip(0),
- WriteServLog(GetStgLogger())
+ ip(0)
{
}
//-----------------------------------------------------------------------------
{
}
//-----------------------------------------------------------------------------
@@
-53,8
+52,7
@@
ADMIN_IMPL::ADMIN_IMPL(const PRIV & priv,
const std::string & password)
: ADMIN(),
conf(priv, login, password),
const std::string & password)
: ADMIN(),
conf(priv, login, password),
- ip(0),
- WriteServLog(GetStgLogger())
+ ip(0)
{
}
//-----------------------------------------------------------------------------
{
}
//-----------------------------------------------------------------------------
diff --git
a/projects/stargazer/admin_impl.h
b/projects/stargazer/admin_impl.h
index 9a2b9781242a62eec4a06e8d82b776fec6a2732b..88f38eb434699722751f8a4ae97900e106fd7e82 100644
(file)
--- a/
projects/stargazer/admin_impl.h
+++ b/
projects/stargazer/admin_impl.h
@@
-31,17
+31,16
@@
#ifndef ADMIN_IMPL_H
#define ADMIN_IMPL_H
#ifndef ADMIN_IMPL_H
#define ADMIN_IMPL_H
-#include <string>
-
#include "stg/admin.h"
#include "stg/os_int.h"
#include "stg/admin_conf.h"
#include "stg/admin.h"
#include "stg/os_int.h"
#include "stg/admin_conf.h"
-#include "stg/logger.h"
+
+#include <string>
class ADMIN_IMPL : public ADMIN {
public:
ADMIN_IMPL();
class ADMIN_IMPL : public ADMIN {
public:
ADMIN_IMPL();
- ADMIN_IMPL(const ADMIN_CONF & ac);
+
explicit
ADMIN_IMPL(const ADMIN_CONF & ac);
ADMIN_IMPL(const PRIV & priv,
const std::string & login,
const std::string & password);
ADMIN_IMPL(const PRIV & priv,
const std::string & login,
const std::string & password);
@@
-68,7
+67,6
@@
public:
private:
ADMIN_CONF conf;
uint32_t ip;
private:
ADMIN_CONF conf;
uint32_t ip;
- STG_LOGGER & WriteServLog;
};
#endif
};
#endif
diff --git
a/projects/stargazer/admins_impl.cpp
b/projects/stargazer/admins_impl.cpp
index fb28b6e6260759ac6823afcb3575de7df283017e..8f2760ced67ef37a5b11a3bf09fb944ec9873d85 100644
(file)
--- a/
projects/stargazer/admins_impl.cpp
+++ b/
projects/stargazer/admins_impl.cpp
@@
-28,19
+28,19
@@
$Author: faust $
*/
$Author: faust $
*/
-#include <cerrno>
-#include <cassert>
-#include <algorithm>
-
#include "stg/common.h"
#include "admins_impl.h"
#include "admin_impl.h"
#include "stg/common.h"
#include "admins_impl.h"
#include "admin_impl.h"
+#include <cerrno>
+#include <cassert>
+#include <algorithm>
+
//-----------------------------------------------------------------------------
ADMINS_IMPL::ADMINS_IMPL(STORE * st)
: ADMINS(),
//-----------------------------------------------------------------------------
ADMINS_IMPL::ADMINS_IMPL(STORE * st)
: ADMINS(),
- stg(
0xFFFF
, "@stargazer", ""),
- noAdmin(
0xFFFF
, "NO-ADMIN", ""),
+ stg(
PRIV(0xFFFF)
, "@stargazer", ""),
+ noAdmin(
PRIV(0xFFFF)
, "NO-ADMIN", ""),
data(),
store(st),
WriteServLog(GetStgLogger()),
data(),
store(st),
WriteServLog(GetStgLogger()),
@@
-66,7
+66,7
@@
if (!priv->adminChg)
return -1;
}
return -1;
}
-ADMIN_IMPL adm(
0
, login, "");
+ADMIN_IMPL adm(
PRIV(0)
, login, "");
admin_iter ai(find(data.begin(), data.end(), adm));
if (ai != data.end())
admin_iter ai(find(data.begin(), data.end(), adm));
if (ai != data.end())
@@
-95,7
+95,6
@@
return -1;
int ADMINS_IMPL::Del(const std::string & login, const ADMIN * admin)
{
STG_LOCKER lock(&mutex);
int ADMINS_IMPL::Del(const std::string & login, const ADMIN * admin)
{
STG_LOCKER lock(&mutex);
-ADMIN_IMPL adm(0, login, "");
const PRIV * priv = admin->GetPriv();
if (!priv->adminChg)
const PRIV * priv = admin->GetPriv();
if (!priv->adminChg)
@@
-106,7
+105,7
@@
if (!priv->adminChg)
return -1;
}
return -1;
}
-admin_iter ai(find(data.begin(), data.end(),
adm
));
+admin_iter ai(find(data.begin(), data.end(),
ADMIN_IMPL(PRIV(0), login, "")
));
if (ai == data.end())
{
if (ai == data.end())
{
@@
-121,7
+120,7
@@
while (si != searchDescriptors.end())
{
if (si->second == ai)
(si->second)++;
{
if (si->second == ai)
(si->second)++;
-
si++
;
+
++si
;
}
data.remove(*ai);
}
data.remove(*ai);
@@
-150,8
+149,7
@@
if (!priv->adminChg)
return -1;
}
return -1;
}
-ADMIN_IMPL adm(0, ac.login, "");
-admin_iter ai(find(data.begin(), data.end(), adm));
+admin_iter ai(find(data.begin(), data.end(), ADMIN_IMPL(PRIV(0), ac.login, "")));
if (ai == data.end())
{
if (ai == data.end())
{
@@
-186,7
+184,7
@@
if (store->GetAdminsList(&adminsList) < 0)
for (unsigned int i = 0; i < adminsList.size(); i++)
{
for (unsigned int i = 0; i < adminsList.size(); i++)
{
- ADMIN_CONF ac(
0
, adminsList[i], "");
+ ADMIN_CONF ac(
PRIV(0)
, adminsList[i], "");
if (store->RestoreAdmin(&ac, adminsList[i]))
{
if (store->RestoreAdmin(&ac, adminsList[i]))
{
@@
-211,8
+209,7
@@
if (data.empty())
return false;
}
return false;
}
-ADMIN_IMPL adm(0, l, "");
-admin_iter ai(find(data.begin(), data.end(), adm));
+admin_iter ai(find(data.begin(), data.end(), ADMIN_IMPL(PRIV(0), l, "")));
if (ai != data.end())
{
if (ai != data.end())
{
@@
-232,8
+229,7
@@
if (data.empty())
return true;
}
return true;
}
-ADMIN_IMPL adm(0, login, "");
-const_admin_iter ai(find(data.begin(), data.end(), adm));
+const_admin_iter ai(find(data.begin(), data.end(), ADMIN_IMPL(PRIV(0), login, "")));
if (ai != data.end())
return true;
if (ai != data.end())
return true;
@@
-250,8
+246,7
@@
if (data.empty())
return true;
}
return true;
}
-ADMIN_IMPL adm(0, login, "");
-admin_iter ai(find(data.begin(), data.end(), adm));
+admin_iter ai(find(data.begin(), data.end(), ADMIN_IMPL(PRIV(0), login, "")));
if (ai == data.end())
{
if (ai == data.end())
{
diff --git
a/projects/stargazer/admins_impl.h
b/projects/stargazer/admins_impl.h
index 7434c44567dd9153e1f0d79c05c03e0d863bed59..03aa4ece97ed9a14463e9c511d66ed928635d6ea 100644
(file)
--- a/
projects/stargazer/admins_impl.h
+++ b/
projects/stargazer/admins_impl.h
@@
-31,11
+31,7
@@
#ifndef ADMINS_IMPL_H
#define ADMINS_IMPL_H
#ifndef ADMINS_IMPL_H
#define ADMINS_IMPL_H
-#include <pthread.h>
-
-#include <list>
-#include <map>
-#include <string>
+#include "admin_impl.h"
#include "stg/admins.h"
#include "stg/admin.h"
#include "stg/admins.h"
#include "stg/admin.h"
@@
-43,11
+39,16
@@
#include "stg/store.h"
#include "stg/noncopyable.h"
#include "stg/logger.h"
#include "stg/store.h"
#include "stg/noncopyable.h"
#include "stg/logger.h"
-#include "admin_impl.h"
+
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
class ADMINS_IMPL : private NONCOPYABLE, public ADMINS {
public:
class ADMINS_IMPL : private NONCOPYABLE, public ADMINS {
public:
- ADMINS_IMPL(STORE * st);
+
explicit
ADMINS_IMPL(STORE * st);
virtual ~ADMINS_IMPL() {}
int Add(const std::string & login, const ADMIN * admin);
virtual ~ADMINS_IMPL() {}
int Add(const std::string & login, const ADMIN * admin);
diff --git
a/projects/stargazer/corps_impl.cpp
b/projects/stargazer/corps_impl.cpp
index 4109bb28a567b53e2f845c3bc17953e923fe94dd..098acacac1b9f7ec6761d19751b1431b321e3c6d 100644
(file)
--- a/
projects/stargazer/corps_impl.cpp
+++ b/
projects/stargazer/corps_impl.cpp
@@
-18,13
+18,14
@@
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
-#include <cerrno>
-#include <cassert>
-#include <algorithm>
+#include "corps_impl.h"
#include "stg/admin.h"
#include "stg/common.h"
#include "stg/admin.h"
#include "stg/common.h"
-#include "corps_impl.h"
+
+#include <cerrno>
+#include <cassert>
+#include <algorithm>
//-----------------------------------------------------------------------------
CORPORATIONS_IMPL::CORPORATIONS_IMPL(STORE * st)
//-----------------------------------------------------------------------------
CORPORATIONS_IMPL::CORPORATIONS_IMPL(STORE * st)
@@
-107,7
+108,7
@@
while (csi != searchDescriptors.end())
{
if (csi->second == si)
(csi->second)++;
{
if (csi->second == si)
(csi->second)++;
-
csi++
;
+
++csi
;
}
data.remove(*si);
}
data.remove(*si);
diff --git
a/projects/stargazer/corps_impl.h
b/projects/stargazer/corps_impl.h
index 7bde401b1a3655ba6ab77849ed7ac790e0abb643..3765c5c1959aa67a9022e43949b6cb8f58d33615 100644
(file)
--- a/
projects/stargazer/corps_impl.h
+++ b/
projects/stargazer/corps_impl.h
@@
-21,12
+21,6
@@
#ifndef CORPORATIONS_IMPL_H
#define CORPORATIONS_IMPL_H
#ifndef CORPORATIONS_IMPL_H
#define CORPORATIONS_IMPL_H
-#include <pthread.h>
-
-#include <list>
-#include <map>
-#include <string>
-
#include "stg/corporations.h"
#include "stg/corp_conf.h"
#include "stg/locker.h"
#include "stg/corporations.h"
#include "stg/corp_conf.h"
#include "stg/locker.h"
@@
-34,11
+28,17
@@
#include "stg/noncopyable.h"
#include "stg/logger.h"
#include "stg/noncopyable.h"
#include "stg/logger.h"
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
+
class ADMIN;
class CORPORATIONS_IMPL : private NONCOPYABLE, public CORPORATIONS {
public:
class ADMIN;
class CORPORATIONS_IMPL : private NONCOPYABLE, public CORPORATIONS {
public:
- CORPORATIONS_IMPL(STORE * st);
+
explicit
CORPORATIONS_IMPL(STORE * st);
virtual ~CORPORATIONS_IMPL() {}
int Add(const CORP_CONF & corp, const ADMIN * admin);
virtual ~CORPORATIONS_IMPL() {}
int Add(const CORP_CONF & corp, const ADMIN * admin);
diff --git
a/projects/stargazer/pidfile.h
b/projects/stargazer/pidfile.h
index 47fbefd93233778f23566c86e2e5ef3fb609cec7..2600f7fe1183bd19e1949f632386b427078fe2dc 100644
(file)
--- a/
projects/stargazer/pidfile.h
+++ b/
projects/stargazer/pidfile.h
@@
-35,7
+35,7
@@
class PIDFile {
public:
class PIDFile {
public:
- PIDFile(const std::string & fn);
+
explicit
PIDFile(const std::string & fn);
~PIDFile();
private:
std::string fileName;
~PIDFile();
private:
std::string fileName;
diff --git
a/projects/stargazer/plugin_runner.cpp
b/projects/stargazer/plugin_runner.cpp
index e57a421ef245d955d6c0dfbd9945cf9e404d6cae..e43271c0fc946194e20eab2cfb9e7c7c65f946a6 100644
(file)
--- a/
projects/stargazer/plugin_runner.cpp
+++ b/
projects/stargazer/plugin_runner.cpp
@@
-48,6
+48,7
@@
PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & fileName,
//-----------------------------------------------------------------------------
PLUGIN_RUNNER::~PLUGIN_RUNNER()
{
//-----------------------------------------------------------------------------
PLUGIN_RUNNER::~PLUGIN_RUNNER()
{
+delete &m_plugin;
if (dlclose(libHandle))
{
errorStr = "Failed to unload plugin '" + pluginFileName + "': " + dlerror();
if (dlclose(libHandle))
{
errorStr = "Failed to unload plugin '" + pluginFileName + "': " + dlerror();
diff --git
a/projects/stargazer/plugin_runner.h
b/projects/stargazer/plugin_runner.h
index 2d0c22c4e069145cbc0f6adf35be40aa4b8c1eea..a30b6940b3d809946d37e805037882466c6611fe 100644
(file)
--- a/
projects/stargazer/plugin_runner.h
+++ b/
projects/stargazer/plugin_runner.h
@@
-42,7
+42,7
@@
class STORE;
class PLUGIN_RUNNER {
public:
struct Error : public std::runtime_error {
class PLUGIN_RUNNER {
public:
struct Error : public std::runtime_error {
- Error(const std::string & msg) : runtime_error(msg) {}
+
explicit
Error(const std::string & msg) : runtime_error(msg) {}
};
PLUGIN_RUNNER(const std::string & pluginFileName,
};
PLUGIN_RUNNER(const std::string & pluginFileName,
diff --git
a/projects/stargazer/plugins/authorization/ao/ao.cpp
b/projects/stargazer/plugins/authorization/ao/ao.cpp
index 5acea091a9e17de0bbfd8a124069934877372af3..853df2a4f8595162380ca873106c5ee1afb93f5e 100644
(file)
--- a/
projects/stargazer/plugins/authorization/ao/ao.cpp
+++ b/
projects/stargazer/plugins/authorization/ao/ao.cpp
@@
-56,7
+56,7
@@
template <typename varType>
class IS_CONTAINS_USER: public std::binary_function<varType, USER_PTR, bool>
{
public:
class IS_CONTAINS_USER: public std::binary_function<varType, USER_PTR, bool>
{
public:
- bool operator()(
varType
notifier, USER_PTR user) const
+ bool operator()(
const varType&
notifier, USER_PTR user) const
{
return notifier.GetUser() == user;
}
{
return notifier.GetUser() == user;
}
diff --git
a/projects/stargazer/plugins/authorization/ao/ao.h
b/projects/stargazer/plugins/authorization/ao/ao.h
index 9ed7ffcf2226b3a6cd76cc1aa773b1602eb16770..bf1cbe6be83188e81cddf48d958f6fb73379cdbd 100644
(file)
--- a/
projects/stargazer/plugins/authorization/ao/ao.h
+++ b/
projects/stargazer/plugins/authorization/ao/ao.h
@@
-126,7
+126,7
@@
private:
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
- ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
+
explicit
ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
virtual ~ADD_USER_NONIFIER() {}
void Notify(const USER_PTR & user) { auth.AddUser(user); }
virtual ~ADD_USER_NONIFIER() {}
void Notify(const USER_PTR & user) { auth.AddUser(user); }
@@
-139,7
+139,7
@@
private:
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
- DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
+
explicit
DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
virtual ~DEL_USER_NONIFIER() {}
void Notify(const USER_PTR & user) { auth.DelUser(user); }
virtual ~DEL_USER_NONIFIER() {}
void Notify(const USER_PTR & user) { auth.DelUser(user); }
diff --git
a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
index 99e0a091819ff873a52708b096c9534c343ef9a9..de30e7d21f0d7b0e77d7d156a658e93bb2765959 100644
(file)
--- a/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
+++ b/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
@@
-480,7
+480,7
@@
while (ia->nonstop)
{
touchTime = stgTime;
std::string monFile = ia->stgSettings->GetMonitorDir() + "/inetaccess_r";
{
touchTime = stgTime;
std::string monFile = ia->stgSettings->GetMonitorDir() + "/inetaccess_r";
- TouchFile(monFile
.c_str()
);
+ TouchFile(monFile);
}
}
}
}
@@
-508,7
+508,7
@@
while (ia->nonstop)
// TODO change counter to timer and MONITOR_TIME_DELAY_SEC
if (++a % (50 * 60) == 0 && ia->stgSettings->GetMonitoring())
{
// TODO change counter to timer and MONITOR_TIME_DELAY_SEC
if (++a % (50 * 60) == 0 && ia->stgSettings->GetMonitoring())
{
- TouchFile(monFile
.c_str()
);
+ TouchFile(monFile);
}
}
}
}
@@
-706,7
+706,7
@@
while (it != ip2user.end())
&& (currTime - it->second.phase.GetTime()) > iaSettings.GetUserDelay())
{
if (iaSettings.LogProtocolErrors())
&& (currTime - it->second.phase.GetTime()) > iaSettings.GetUserDelay())
{
if (iaSettings.LogProtocolErrors())
- logger("User '%s'. Protocol version: %d. Phase 2: connect request timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserDelay());
+ logger("User '%s'. Protocol version: %d. Phase 2: connect request timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserDelay()
.GetSec()
);
it->second.phase.SetPhase1();
printfd(__FILE__, "Phase changed from 2 to 1. Reason: timeout\n");
ip2user.erase(it++);
it->second.phase.SetPhase1();
printfd(__FILE__, "Phase changed from 2 to 1. Reason: timeout\n");
ip2user.erase(it++);
@@
-750,7
+750,7
@@
while (it != ip2user.end())
if ((currTime - it->second.phase.GetTime()) > iaSettings.GetUserTimeout())
{
if (iaSettings.LogProtocolErrors())
if ((currTime - it->second.phase.GetTime()) > iaSettings.GetUserTimeout())
{
if (iaSettings.LogProtocolErrors())
- logger("User '%s'. Protocol version: %d. Phase 3: alive timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserTimeout());
+ logger("User '%s'. Protocol version: %d. Phase 3: alive timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserTimeout()
.GetSec()
);
users->Unauthorize(it->second.user->GetLogin(), this);
ip2user.erase(it++);
continue;
users->Unauthorize(it->second.user->GetLogin(), this);
ip2user.erase(it++);
continue;
@@
-761,7
+761,7
@@
while (it != ip2user.end())
&& ((currTime - it->second.phase.GetTime()) > iaSettings.GetUserDelay()))
{
if (iaSettings.LogProtocolErrors())
&& ((currTime - it->second.phase.GetTime()) > iaSettings.GetUserDelay()))
{
if (iaSettings.LogProtocolErrors())
- logger("User '%s'. Protocol version: %d. Phase 4: disconnect request timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserDelay());
+ logger("User '%s'. Protocol version: %d. Phase 4: disconnect request timeout (%f > %d).", it->second.login.c_str(), it->second.protoVer, (currTime - it->second.phase.GetTime()).AsDouble(), iaSettings.GetUserDelay()
.GetSec()
);
it->second.phase.SetPhase3();
printfd(__FILE__, "Phase changed from 4 to 3. Reason: timeout\n");
}
it->second.phase.SetPhase3();
printfd(__FILE__, "Phase changed from 4 to 3. Reason: timeout\n");
}
@@
-1411,8
+1411,8
@@
for (int j = 0; j < DIR_NUM; j++)
iaUser->rnd = static_cast<uint32_t>(random());
connSynAck6.rnd = iaUser->rnd;
iaUser->rnd = static_cast<uint32_t>(random());
connSynAck6.rnd = iaUser->rnd;
-connSynAck6.userTimeOut = iaSettings.GetUserTimeout();
-connSynAck6.aliveDelay = iaSettings.GetUserDelay();
+connSynAck6.userTimeOut = iaSettings.GetUserTimeout()
.GetSec()
;
+connSynAck6.aliveDelay = iaSettings.GetUserDelay()
.GetSec()
;
#ifdef ARCH_BE
SwapBytes(connSynAck6.len);
#ifdef ARCH_BE
SwapBytes(connSynAck6.len);
@@
-1453,8
+1453,8
@@
for (int j = 0; j < DIR_NUM; j++)
iaUser->rnd = static_cast<uint32_t>(random());
connSynAck8.rnd = iaUser->rnd;
iaUser->rnd = static_cast<uint32_t>(random());
connSynAck8.rnd = iaUser->rnd;
-connSynAck8.userTimeOut = iaSettings.GetUserTimeout();
-connSynAck8.aliveDelay = iaSettings.GetUserDelay();
+connSynAck8.userTimeOut = iaSettings.GetUserTimeout()
.GetSec()
;
+connSynAck8.aliveDelay = iaSettings.GetUserDelay()
.GetSec()
;
#ifdef ARCH_BE
SwapBytes(connSynAck8.len);
#ifdef ARCH_BE
SwapBytes(connSynAck8.len);
diff --git
a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
index 2b527076edbf607d1bb78272d7a9cdc04673da07..fb851f52805d8646c8a76d7e2fec69cdcd784390 100644
(file)
--- a/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
+++ b/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.h
@@
-27,17
+27,6
@@
#ifndef INETACCESS_H
#define INETACCESS_H
#ifndef INETACCESS_H
#define INETACCESS_H
-#include <sys/time.h>
-#include <pthread.h>
-
-#include <cstring>
-#include <ctime>
-#include <string>
-#include <map>
-#include <list>
-#include <functional>
-#include <utility>
-
#include "stg/os_int.h"
#include "stg/auth.h"
#include "stg/store.h"
#include "stg/os_int.h"
#include "stg/auth.h"
#include "stg/store.h"
@@
-51,6
+40,17
@@
#include "stg/utime.h"
#include "stg/logger.h"
#include "stg/utime.h"
#include "stg/logger.h"
+#include <cstring>
+#include <ctime>
+#include <string>
+#include <map>
+#include <list>
+#include <functional>
+#include <utility>
+
+#include <sys/time.h>
+#include <pthread.h>
+
#define IA_PROTO_VER (6)
//#define IA_DEBUG (1)
#define IA_PROTO_VER (6)
//#define IA_DEBUG (1)
@@
-204,8
+204,8
@@
public:
virtual ~AUTH_IA_SETTINGS() {}
const std::string & GetStrError() const { return errorStr; }
int ParseSettings(const MODULE_SETTINGS & s);
virtual ~AUTH_IA_SETTINGS() {}
const std::string & GetStrError() const { return errorStr; }
int ParseSettings(const MODULE_SETTINGS & s);
-
int GetUserDelay() const { return userDelay
; }
-
int GetUserTimeout() const { return userTimeout
; }
+
UTIME GetUserDelay() const { return UTIME(userDelay)
; }
+
UTIME GetUserTimeout() const { return UTIME(userTimeout)
; }
uint16_t GetUserPort() const { return port; }
FREEMB GetFreeMbShowType() const { return freeMbShowType; }
bool LogProtocolErrors() const { return logProtocolErrors; }
uint16_t GetUserPort() const { return port; }
FREEMB GetFreeMbShowType() const { return freeMbShowType; }
bool LogProtocolErrors() const { return logProtocolErrors; }
@@
-223,7
+223,7
@@
class AUTH_IA;
//-----------------------------------------------------------------------------
class DEL_USER_NOTIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
//-----------------------------------------------------------------------------
class DEL_USER_NOTIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
- DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {}
+
explicit
DEL_USER_NOTIFIER(AUTH_IA & a) : auth(a) {}
virtual ~DEL_USER_NOTIFIER() {}
void Notify(const USER_PTR & user);
virtual ~DEL_USER_NOTIFIER() {}
void Notify(const USER_PTR & user);
@@
-369,7
+369,7
@@
private:
//-----------------------------------------------------------------------------
class UnauthorizeUser : std::unary_function<const std::pair<uint32_t, IA_USER> &, void> {
public:
//-----------------------------------------------------------------------------
class UnauthorizeUser : std::unary_function<const std::pair<uint32_t, IA_USER> &, void> {
public:
- UnauthorizeUser(AUTH_IA * a) : auth(a) {}
+
explicit
UnauthorizeUser(AUTH_IA * a) : auth(a) {}
UnauthorizeUser(const UnauthorizeUser & rvalue) : auth(rvalue.auth) {}
void operator()(const std::pair<uint32_t, IA_USER> & p)
{
UnauthorizeUser(const UnauthorizeUser & rvalue) : auth(rvalue.auth) {}
void operator()(const std::pair<uint32_t, IA_USER> & p)
{
diff --git
a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
b/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
index cb72bbf751dffbd6cec753597ddd0b06ca6303f6..f781b9be2700848d0fe9acfadd724bc435a78192 100644
(file)
--- a/
projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
+++ b/
projects/stargazer/plugins/configuration/rpcconfig/info_methods.h
@@
-44,7
+44,7
@@
private:
class METHOD_LOGIN : public xmlrpc_c::method
{
public:
class METHOD_LOGIN : public xmlrpc_c::method
{
public:
- METHOD_LOGIN(RPC_CONFIG * c)
+
explicit
METHOD_LOGIN(RPC_CONFIG * c)
: config(c)
{
}
: config(c)
{
}
@@
-62,7
+62,7
@@
private:
class METHOD_LOGOUT : public xmlrpc_c::method
{
public:
class METHOD_LOGOUT : public xmlrpc_c::method
{
public:
- METHOD_LOGOUT(RPC_CONFIG * c)
+
explicit
METHOD_LOGOUT(RPC_CONFIG * c)
: config(c)
{
}
: config(c)
{
}
diff --git
a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h
b/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h
index 955f810e1cd674305e3bb1d3b522d3e45cab508c..a30b992a0069d646e2d0b89e75d4387e8fbdc48f 100644
(file)
--- a/
projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h
+++ b/
projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h
@@
-7,7
+7,7
@@
class TARIFF_HELPER
{
public:
class TARIFF_HELPER
{
public:
- TARIFF_HELPER(TARIFF_DATA & td)
+
explicit
TARIFF_HELPER(TARIFF_DATA & td)
: data(td)
{}
: data(td)
{}
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
index 567c537ae7f6a5aaef04ef641ff1ff77da829db6..020c1365dcb76fc6e5de4d20d67fbfebf58bae6b 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
+++ b/
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
@@
-65,9
+65,16
@@
CONFIGPROTO::CONFIGPROTO(PLUGIN_LOGGER & l)
CONFIGPROTO::~CONFIGPROTO()
{
CONFIGPROTO::~CONFIGPROTO()
{
+ {
std::deque<STG::Conn *>::iterator it;
for (it = m_conns.begin(); it != m_conns.end(); ++it)
delete *it;
std::deque<STG::Conn *>::iterator it;
for (it = m_conns.begin(); it != m_conns.end(); ++it)
delete *it;
+ }
+ {
+ BASE_PARSER::REGISTRY::iterator it;
+ for (it = m_registry.begin(); it != m_registry.end(); ++it)
+ delete it->second;
+ }
}
int CONFIGPROTO::Prepare()
}
int CONFIGPROTO::Prepare()
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/configproto.h
b/projects/stargazer/plugins/configuration/sgconfig/configproto.h
index 2119bc675214c22aae0eb2f1c3589f659e592c81..f80735754c6bb951e97258eb27c9b50729488a0d 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/configproto.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/configproto.h
@@
-50,7
+50,7
@@
class Conn;
class CONFIGPROTO {
public:
class CONFIGPROTO {
public:
- CONFIGPROTO(PLUGIN_LOGGER & l);
+
explicit
CONFIGPROTO(PLUGIN_LOGGER & l);
~CONFIGPROTO();
void SetPort(uint16_t port) { m_port = port; }
~CONFIGPROTO();
void SetPort(uint16_t port) { m_port = port; }
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/conn.cpp
b/projects/stargazer/plugins/configuration/sgconfig/conn.cpp
index c792125ea35e3eb42f4c14923123adaa095f034d..71de73560bdfd258206b2c9d797a47e6b05c8558 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/conn.cpp
+++ b/
projects/stargazer/plugins/configuration/sgconfig/conn.cpp
@@
-81,6
+81,9
@@
Conn::~Conn()
close(m_sock);
XML_ParserFree(m_xmlParser);
close(m_sock);
XML_ParserFree(m_xmlParser);
+
+ delete m_stream;
+ delete m_parser;
}
bool Conn::Read()
}
bool Conn::Read()
@@
-283,6
+286,8
@@
bool Conn::WriteResponse()
answer = m_parser->GetAnswer();
else
answer = "<Error result=\"Unknown command.\"/>";
answer = m_parser->GetAnswer();
else
answer = "<Error result=\"Unknown command.\"/>";
+ delete m_parser;
+ m_parser = NULL;
printfd(__FILE__, "Writing %d bytes of answer.\n", answer.length());
stream.Put(answer.c_str(), answer.length() + 1 /* including \0 */, true /* final */);
return stream.IsOk();
printfd(__FILE__, "Writing %d bytes of answer.\n", answer.length());
stream.Put(answer.c_str(), answer.length() + 1 /* including \0 */, true /* final */);
return stream.IsOk();
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/conn.h
b/projects/stargazer/plugins/configuration/sgconfig/conn.h
index c67c972eb98df40b9f359bab4852f1348fef28a1..ed2e64d1ba780862c161840de87003fe400f4673 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/conn.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/conn.h
@@
-53,7
+53,7
@@
class Conn
public:
struct Error : public std::runtime_error
{
public:
struct Error : public std::runtime_error
{
- Error(const std::string& message) : runtime_error(message.c_str()) {}
+
explicit
Error(const std::string& message) : runtime_error(message.c_str()) {}
};
Conn(const BASE_PARSER::REGISTRY & registry,
};
Conn(const BASE_PARSER::REGISTRY & registry,
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser.h
b/projects/stargazer/plugins/configuration/sgconfig/parser.h
index af77158d6324d1032a922d9c503fa45b9035fe58..8bddc5178055cbab605b1efe0258d397a26a2f03 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser.h
@@
-31,6
+31,7
@@
class BASE_PARSER
public:
struct FACTORY
{
public:
struct FACTORY
{
+ virtual ~FACTORY() {}
virtual BASE_PARSER * create(const ADMIN & admin) = 0;
};
typedef std::map<std::string, FACTORY *> REGISTRY;
virtual BASE_PARSER * create(const ADMIN & admin) = 0;
};
typedef std::map<std::string, FACTORY *> REGISTRY;
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h
b/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h
index 3b99e6422fc269043c068c04d0b1c8327d767151..70ae02742956ba5e880a56072d2beb8f925de950 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_admins.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_admins.h
@@
-43,7
+43,7
@@
class GET_ADMINS: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const ADMINS & admins) : m_admins(admins) {}
+
explicit
FACTORY(const ADMINS & admins) : m_admins(admins) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_ADMINS(admin, m_admins); }
static void Register(REGISTRY & registry, const ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_ADMINS(admin, m_admins); }
static void Register(REGISTRY & registry, const ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
@@
-68,7
+68,7
@@
class ADD_ADMIN: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(ADMINS & admins) : m_admins(admins) {}
+
explicit
FACTORY(ADMINS & admins) : m_admins(admins) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
@@
-95,7
+95,7
@@
class DEL_ADMIN: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(ADMINS & admins) : m_admins(admins) {}
+
explicit
FACTORY(ADMINS & admins) : m_admins(admins) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
@@
-122,7
+122,7
@@
class CHG_ADMIN: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(ADMINS & admins) : m_admins(admins) {}
+
explicit
FACTORY(ADMINS & admins) : m_admins(admins) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_ADMIN(admin, m_admins); }
static void Register(REGISTRY & registry, ADMINS & admins)
{ registry[ToLower(tag)] = new FACTORY(admins); }
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h
b/projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h
index 9a2e81a81bc7eaa345fc8e3b1f8aab08e109c8fa..abbc8f4e4eeb085f591dd21aa17c479e6bba3fbb 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h
@@
-41,7
+41,7
@@
class AUTH_BY : public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const USERS & users) : m_users(users) {}
+
explicit
FACTORY(const USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new AUTH_BY(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new AUTH_BY(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_message.h
b/projects/stargazer/plugins/configuration/sgconfig/parser_message.h
index 4caa354c47edcc4e6b1ed54f895e489498bcb761..6ed6622de9f03bee114e233391d72966bf3ebf75 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_message.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_message.h
@@
-44,7
+44,7
@@
class SEND_MESSAGE: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(USERS & users) : m_users(users) {}
+
explicit
FACTORY(USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new SEND_MESSAGE(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new SEND_MESSAGE(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h
b/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h
index 6425cca12910ee047d100c3df71476f0d94a1245..418ae45c2ad50396753bce8812e111ca6f670e6f 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h
@@
-44,7
+44,7
@@
class GET_TARIFFS: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const TARIFFS & tariffs) : m_tariffs(tariffs) {}
+
explicit
FACTORY(const TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_TARIFFS(admin, m_tariffs); }
static void Register(REGISTRY & registry, const TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_TARIFFS(admin, m_tariffs); }
static void Register(REGISTRY & registry, const TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
@@
-69,7
+69,7
@@
class ADD_TARIFF: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
+
explicit
FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
@@
-125,7
+125,7
@@
class CHG_TARIFF: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
+
explicit
FACTORY(TARIFFS & tariffs) : m_tariffs(tariffs) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHG_TARIFF(admin, m_tariffs); }
static void Register(REGISTRY & registry, TARIFFS & tariffs)
{ registry[ToLower(tag)] = new FACTORY(tariffs); }
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_users.h
b/projects/stargazer/plugins/configuration/sgconfig/parser_users.h
index c9f72389751aa44aa5b26df1c109d8ce7553ac61..cbf2591555b150b313af851a0b7e98a73824a19f 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_users.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_users.h
@@
-48,7
+48,7
@@
class GET_USERS: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(USERS & users) : m_users(users) {}
+
explicit
FACTORY(USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_USERS(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_USERS(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
@@
-76,7
+76,7
@@
class GET_USER: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const USERS & users) : m_users(users) {}
+
explicit
FACTORY(const USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_USER(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new GET_USER(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
@@
-103,7
+103,7
@@
class ADD_USER: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(USERS & users) : m_users(users) {}
+
explicit
FACTORY(USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_USER(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new ADD_USER(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
@@
-176,7
+176,7
@@
class DEL_USER: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(USERS & users) : m_users(users) {}
+
explicit
FACTORY(USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_USER(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new DEL_USER(admin, m_users); }
static void Register(REGISTRY & registry, USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
@@
-205,7
+205,7
@@
class CHECK_USER: public BASE_PARSER
class FACTORY : public BASE_PARSER::FACTORY
{
public:
class FACTORY : public BASE_PARSER::FACTORY
{
public:
- FACTORY(const USERS & users) : m_users(users) {}
+
explicit
FACTORY(const USERS & users) : m_users(users) {}
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHECK_USER(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
virtual BASE_PARSER * create(const ADMIN & admin) { return new CHECK_USER(admin, m_users); }
static void Register(REGISTRY & registry, const USERS & users)
{ registry[ToLower(tag)] = new FACTORY(users); }
diff --git
a/projects/stargazer/plugins/other/ping/ping.h
b/projects/stargazer/plugins/other/ping/ping.h
index cfab1e550b70375ca5bd2edbac624093ab254558..34bbbc52c5bd407b2e8a7990baa02c3697a0fb40 100644
(file)
--- a/
projects/stargazer/plugins/other/ping/ping.h
+++ b/
projects/stargazer/plugins/other/ping/ping.h
@@
-7,11
+7,6
@@
#ifndef PING_H
#define PING_H
#ifndef PING_H
#define PING_H
-#include <pthread.h>
-
-#include <string>
-#include <list>
-
#include "stg/os_int.h"
#include "stg/plugin.h"
#include "stg/module_settings.h"
#include "stg/os_int.h"
#include "stg/plugin.h"
#include "stg/module_settings.h"
@@
-21,6
+16,11
@@
#include "stg/users.h"
#include "stg/logger.h"
#include "stg/users.h"
#include "stg/logger.h"
+#include <string>
+#include <list>
+
+#include <pthread.h>
+
extern "C" PLUGIN * GetPlugin();
class PING;
extern "C" PLUGIN * GetPlugin();
class PING;
@@
-63,7
+63,7
@@
private:
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER_PING: public NOTIFIER_BASE<USER_PTR> {
public:
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER_PING: public NOTIFIER_BASE<USER_PTR> {
public:
- ADD_USER_NONIFIER_PING(PING & p) : NOTIFIER_BASE<USER_PTR>(), ping(p) {}
+
explicit
ADD_USER_NONIFIER_PING(PING & p) : NOTIFIER_BASE<USER_PTR>(), ping(p) {}
virtual ~ADD_USER_NONIFIER_PING() {}
void Notify(const USER_PTR & user);
virtual ~ADD_USER_NONIFIER_PING() {}
void Notify(const USER_PTR & user);
@@
-76,7
+76,7
@@
private:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER_PING: public NOTIFIER_BASE<USER_PTR> {
public:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER_PING: public NOTIFIER_BASE<USER_PTR> {
public:
- DEL_USER_NONIFIER_PING(PING & p) : NOTIFIER_BASE<USER_PTR>(), ping(p) {}
+
explicit
DEL_USER_NONIFIER_PING(PING & p) : NOTIFIER_BASE<USER_PTR>(), ping(p) {}
virtual ~DEL_USER_NONIFIER_PING() {}
void Notify(const USER_PTR & user);
virtual ~DEL_USER_NONIFIER_PING() {}
void Notify(const USER_PTR & user);
@@
-124,7
+124,7
@@
public:
void DelUser(USER_PTR u);
private:
void DelUser(USER_PTR u);
private:
- PING(const PING & rvalue);
+
explicit
PING(const PING & rvalue);
PING & operator=(const PING & rvalue);
void GetUsers();
PING & operator=(const PING & rvalue);
void GetUsers();
diff --git
a/projects/stargazer/plugins/other/rscript/rscript.cpp
b/projects/stargazer/plugins/other/rscript/rscript.cpp
index 4433dafda702d019ff7da1d405cd330a6ddea92f..1e842d255865925fa642d0cdaeb50502f7da2e25 100644
(file)
--- a/
projects/stargazer/plugins/other/rscript/rscript.cpp
+++ b/
projects/stargazer/plugins/other/rscript/rscript.cpp
@@
-19,14
+19,10
@@
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
-#include
<sys/time.h>
+#include
"rscript.h"
-#include <csignal>
-#include <cassert>
-#include <cstdlib>
-#include <cerrno>
-#include <cstring>
-#include <algorithm>
+#include "ur_functor.h"
+#include "send_functor.h"
#include "stg/common.h"
#include "stg/locker.h"
#include "stg/common.h"
#include "stg/locker.h"
@@
-34,9
+30,17
@@
#include "stg/user_property.h"
#include "stg/plugin_creator.h"
#include "stg/logger.h"
#include "stg/user_property.h"
#include "stg/plugin_creator.h"
#include "stg/logger.h"
-#include "rscript.h"
-#include "ur_functor.h"
-#include "send_functor.h"
+
+#include <algorithm>
+
+#include <csignal>
+#include <cassert>
+#include <cstdlib>
+#include <cerrno>
+#include <cstring>
+
+#include <sys/time.h>
+#include <netinet/ip.h>
extern volatile time_t stgTime;
extern volatile time_t stgTime;
@@
-47,7
+51,7
@@
namespace {
template<typename T>
struct USER_IS
{
template<typename T>
struct USER_IS
{
- USER_IS(USER_PTR u) : user(u) {}
+
explicit
USER_IS(USER_PTR u) : user(u) {}
bool operator()(const T & notifier) { return notifier.GetUser() == user; }
USER_PTR user;
bool operator()(const T & notifier) { return notifier.GetUser() == user; }
USER_PTR user;
diff --git
a/projects/stargazer/plugins/other/rscript/rscript.h
b/projects/stargazer/plugins/other/rscript/rscript.h
index 0de1ea2e201a8702bd386aca651bf008da72cb84..4fb0ac735db5271c7c53d6880906aa3ea6ac6f6a 100644
(file)
--- a/
projects/stargazer/plugins/other/rscript/rscript.h
+++ b/
projects/stargazer/plugins/other/rscript/rscript.h
@@
-22,14
+22,6
@@
#ifndef RSCRIPT_H
#define RSCRIPT_H
#ifndef RSCRIPT_H
#define RSCRIPT_H
-#include <pthread.h>
-
-#include <string>
-#include <list>
-#include <map>
-#include <functional>
-#include <utility>
-
#include "stg/plugin.h"
#include "stg/module_settings.h"
#include "stg/os_int.h"
#include "stg/plugin.h"
#include "stg/module_settings.h"
#include "stg/os_int.h"
@@
-41,6
+33,14
@@
#include "nrmap_parser.h"
#include "nrmap_parser.h"
+#include <string>
+#include <list>
+#include <map>
+#include <functional>
+#include <utility>
+
+#include <pthread.h>
+
extern "C" PLUGIN * GetPlugin();
#define RS_DEBUG (1)
extern "C" PLUGIN * GetPlugin();
#define RS_DEBUG (1)
@@
-60,7
+60,7
@@
class DisconnectUser;
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
- ADD_USER_NONIFIER(REMOTE_SCRIPT & r)
+
explicit
ADD_USER_NONIFIER(REMOTE_SCRIPT & r)
: NOTIFIER_BASE<USER_PTR>(), rs(r) {}
virtual ~ADD_USER_NONIFIER() {}
void Notify(const USER_PTR & user);
: NOTIFIER_BASE<USER_PTR>(), rs(r) {}
virtual ~ADD_USER_NONIFIER() {}
void Notify(const USER_PTR & user);
@@
-74,7
+74,7
@@
private:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
public:
- DEL_USER_NONIFIER(REMOTE_SCRIPT & r)
+
explicit
DEL_USER_NONIFIER(REMOTE_SCRIPT & r)
: NOTIFIER_BASE<USER_PTR>(), rs(r) {}
virtual ~DEL_USER_NONIFIER() {}
void Notify(const USER_PTR & user);
: NOTIFIER_BASE<USER_PTR>(), rs(r) {}
virtual ~DEL_USER_NONIFIER() {}
void Notify(const USER_PTR & user);
@@
-138,7
+138,8
@@
private:
//-----------------------------------------------------------------------------
struct USER {
USER(const std::vector<uint32_t> & r, USER_PTR it)
//-----------------------------------------------------------------------------
struct USER {
USER(const std::vector<uint32_t> & r, USER_PTR it)
- : user(it),
+ : lastSentTime(0),
+ user(it),
routers(r),
shortPacketsCount(0),
ip(user->GetCurrIP())
routers(r),
shortPacketsCount(0),
ip(user->GetCurrIP())
@@
-257,7
+258,7
@@
private:
//-----------------------------------------------------------------------------
class DisconnectUser : public std::unary_function<std::pair<const uint32_t, USER> &, void> {
public:
//-----------------------------------------------------------------------------
class DisconnectUser : public std::unary_function<std::pair<const uint32_t, USER> &, void> {
public:
- DisconnectUser(REMOTE_SCRIPT & rs) : rscript(rs) {}
+
explicit
DisconnectUser(REMOTE_SCRIPT & rs) : rscript(rs) {}
void operator()(std::pair<const uint32_t, USER> & p)
{
rscript.Send(p.second, true);
void operator()(std::pair<const uint32_t, USER> & p)
{
rscript.Send(p.second, true);
diff --git
a/projects/stargazer/plugins/other/rscript/send_functor.h
b/projects/stargazer/plugins/other/rscript/send_functor.h
index a14fe20b3e95cdf18ec602fc656d087974ab0654..baa4c1183de665824169cea9d40e151cee58c0a1 100644
(file)
--- a/
projects/stargazer/plugins/other/rscript/send_functor.h
+++ b/
projects/stargazer/plugins/other/rscript/send_functor.h
@@
-27,12
+27,13
@@
#ifndef __SEND_FUNCTOR_H__
#define __SEND_FUNCTOR_H__
#ifndef __SEND_FUNCTOR_H__
#define __SEND_FUNCTOR_H__
-#include <sys/types.h>
-#include <sys/socket.h>
+#include "stg/os_int.h"
#include <functional>
#include <functional>
-#include "stg/os_int.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/ip.h>
class PacketSender : public std::unary_function<uint32_t, ssize_t> {
public:
class PacketSender : public std::unary_function<uint32_t, ssize_t> {
public:
diff --git
a/projects/stargazer/plugins/other/rscript/ur_functor.h
b/projects/stargazer/plugins/other/rscript/ur_functor.h
index 95382400f6403e945b3e05768ac40d718b3aece1..9ecf2bc5887f30fd3f899eedffb717a693613155 100644
(file)
--- a/
projects/stargazer/plugins/other/rscript/ur_functor.h
+++ b/
projects/stargazer/plugins/other/rscript/ur_functor.h
@@
-21,14
+21,14
@@
#ifndef __UR_FUNCTOR_H__
#define __UR_FUNCTOR_H__
#ifndef __UR_FUNCTOR_H__
#define __UR_FUNCTOR_H__
-#include <functional>
-#include <algorithm>
-#include <utility>
+#include "rscript.h"
#include "stg/os_int.h"
#include "stg/common.h"
#include "stg/os_int.h"
#include "stg/common.h"
-#include "rscript.h"
+#include <functional>
+#include <algorithm>
+#include <utility>
namespace RS
{
namespace RS
{
@@
-36,7
+36,7
@@
namespace RS
class UpdateRouter : public std::unary_function<std::pair<const uint32_t, RS::USER>, void>
{
public:
class UpdateRouter : public std::unary_function<std::pair<const uint32_t, RS::USER>, void>
{
public:
- UpdateRouter(REMOTE_SCRIPT & t)
+
explicit
UpdateRouter(REMOTE_SCRIPT & t)
: obj(t) {}
void operator() (std::pair<const uint32_t, USER> & val)
: obj(t) {}
void operator() (std::pair<const uint32_t, USER> & val)
@@
-60,7
+60,7
@@
public:
{
obj.SendDirect(val.second, *oldIt, true); // Disconnect on old router
++oldIt;
{
obj.SendDirect(val.second, *oldIt, true); // Disconnect on old router
++oldIt;
- }
+ }
else if (*oldIt < *newIt)
{
obj.SendDirect(val.second, *oldIt, true); // Disconnect on old router
else if (*oldIt < *newIt)
{
obj.SendDirect(val.second, *oldIt, true); // Disconnect on old router
@@
-73,8
+73,7
@@
public:
}
else
{
}
else
{
- if (oldIt != val.second.routers.end())
- ++oldIt;
+ ++oldIt;
if (newIt != newRouters.end())
++newIt;
}
if (newIt != newRouters.end())
++newIt;
}
diff --git
a/projects/stargazer/plugins/other/smux/sensors.h
b/projects/stargazer/plugins/other/smux/sensors.h
index 3787611f4263c3cbfe06fe10fac41f5e751b1e03..35de996cb3377f4ef48189f639a7a27df70e505f 100644
(file)
--- a/
projects/stargazer/plugins/other/smux/sensors.h
+++ b/
projects/stargazer/plugins/other/smux/sensors.h
@@
-29,7
+29,7
@@
typedef std::map<OID, Sensor *> Sensors;
class TotalUsersSensor : public Sensor {
public:
class TotalUsersSensor : public Sensor {
public:
- TotalUsersSensor(const USERS & u) : users(u) {}
+
explicit
TotalUsersSensor(const USERS & u) : users(u) {}
virtual ~TotalUsersSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalUsersSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-49,7
+49,7
@@
class TotalUsersSensor : public Sensor {
class UsersSensor : public Sensor {
public:
class UsersSensor : public Sensor {
public:
- UsersSensor(USERS & u) : users(u) {}
+
explicit
UsersSensor(USERS & u) : users(u) {}
virtual ~UsersSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const;
virtual ~UsersSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const;
@@
-65,7
+65,7
@@
class UsersSensor : public Sensor {
class ConnectedUsersSensor : public UsersSensor {
public:
class ConnectedUsersSensor : public UsersSensor {
public:
- ConnectedUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
ConnectedUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~ConnectedUsersSensor() {}
private:
virtual ~ConnectedUsersSensor() {}
private:
@@
-75,7
+75,7
@@
class ConnectedUsersSensor : public UsersSensor {
class AuthorizedUsersSensor : public UsersSensor {
public:
class AuthorizedUsersSensor : public UsersSensor {
public:
- AuthorizedUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
AuthorizedUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~AuthorizedUsersSensor() {}
private:
virtual ~AuthorizedUsersSensor() {}
private:
@@
-85,7
+85,7
@@
class AuthorizedUsersSensor : public UsersSensor {
class AlwaysOnlineUsersSensor : public UsersSensor {
public:
class AlwaysOnlineUsersSensor : public UsersSensor {
public:
- AlwaysOnlineUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
AlwaysOnlineUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~AlwaysOnlineUsersSensor() {}
private:
virtual ~AlwaysOnlineUsersSensor() {}
private:
@@
-95,7
+95,7
@@
class AlwaysOnlineUsersSensor : public UsersSensor {
class NoCashUsersSensor : public UsersSensor {
public:
class NoCashUsersSensor : public UsersSensor {
public:
- NoCashUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
NoCashUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~NoCashUsersSensor() {}
private:
virtual ~NoCashUsersSensor() {}
private:
@@
-105,7
+105,7
@@
class NoCashUsersSensor : public UsersSensor {
class DisabledDetailStatsUsersSensor : public UsersSensor {
public:
class DisabledDetailStatsUsersSensor : public UsersSensor {
public:
- DisabledDetailStatsUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
DisabledDetailStatsUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~DisabledDetailStatsUsersSensor() {}
private:
virtual ~DisabledDetailStatsUsersSensor() {}
private:
@@
-115,7
+115,7
@@
class DisabledDetailStatsUsersSensor : public UsersSensor {
class DisabledUsersSensor : public UsersSensor {
public:
class DisabledUsersSensor : public UsersSensor {
public:
- DisabledUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
DisabledUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~DisabledUsersSensor() {}
private:
virtual ~DisabledUsersSensor() {}
private:
@@
-125,7
+125,7
@@
class DisabledUsersSensor : public UsersSensor {
class PassiveUsersSensor : public UsersSensor {
public:
class PassiveUsersSensor : public UsersSensor {
public:
- PassiveUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
PassiveUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~PassiveUsersSensor() {}
private:
virtual ~PassiveUsersSensor() {}
private:
@@
-135,7
+135,7
@@
class PassiveUsersSensor : public UsersSensor {
class CreditUsersSensor : public UsersSensor {
public:
class CreditUsersSensor : public UsersSensor {
public:
- CreditUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
CreditUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~CreditUsersSensor() {}
private:
virtual ~CreditUsersSensor() {}
private:
@@
-145,7
+145,7
@@
class CreditUsersSensor : public UsersSensor {
class FreeMbUsersSensor : public UsersSensor {
public:
class FreeMbUsersSensor : public UsersSensor {
public:
- FreeMbUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
FreeMbUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~FreeMbUsersSensor() {}
private:
virtual ~FreeMbUsersSensor() {}
private:
@@
-155,7
+155,7
@@
class FreeMbUsersSensor : public UsersSensor {
class TariffChangeUsersSensor : public UsersSensor {
public:
class TariffChangeUsersSensor : public UsersSensor {
public:
- TariffChangeUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
TariffChangeUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~TariffChangeUsersSensor() {}
private:
virtual ~TariffChangeUsersSensor() {}
private:
@@
-165,7
+165,7
@@
class TariffChangeUsersSensor : public UsersSensor {
class ActiveUsersSensor : public UsersSensor {
public:
class ActiveUsersSensor : public UsersSensor {
public:
- ActiveUsersSensor(USERS & u) : UsersSensor(u) {}
+
explicit
ActiveUsersSensor(USERS & u) : UsersSensor(u) {}
virtual ~ActiveUsersSensor() {}
private:
virtual ~ActiveUsersSensor() {}
private:
@@
-174,7
+174,7
@@
class ActiveUsersSensor : public UsersSensor {
class TotalTariffsSensor : public Sensor {
public:
class TotalTariffsSensor : public Sensor {
public:
- TotalTariffsSensor(const TARIFFS & t) : tariffs(t) {}
+
explicit
TotalTariffsSensor(const TARIFFS & t) : tariffs(t) {}
virtual ~TotalTariffsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalTariffsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-194,7
+194,7
@@
class TotalTariffsSensor : public Sensor {
class TotalAdminsSensor : public Sensor {
public:
class TotalAdminsSensor : public Sensor {
public:
- TotalAdminsSensor(const ADMINS & a) : admins(a) {}
+
explicit
TotalAdminsSensor(const ADMINS & a) : admins(a) {}
virtual ~TotalAdminsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalAdminsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-214,7
+214,7
@@
class TotalAdminsSensor : public Sensor {
class TotalServicesSensor : public Sensor {
public:
class TotalServicesSensor : public Sensor {
public:
- TotalServicesSensor(const SERVICES & s) : services(s) {}
+
explicit
TotalServicesSensor(const SERVICES & s) : services(s) {}
virtual ~TotalServicesSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalServicesSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-234,7
+234,7
@@
class TotalServicesSensor : public Sensor {
class TotalCorporationsSensor : public Sensor {
public:
class TotalCorporationsSensor : public Sensor {
public:
- TotalCorporationsSensor(const CORPORATIONS & c) : corporations(c) {}
+
explicit
TotalCorporationsSensor(const CORPORATIONS & c) : corporations(c) {}
virtual ~TotalCorporationsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalCorporationsSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-254,7
+254,7
@@
class TotalCorporationsSensor : public Sensor {
class TotalRulesSensor : public Sensor {
public:
class TotalRulesSensor : public Sensor {
public:
- TotalRulesSensor(const TRAFFCOUNTER & t) : traffcounter(t) {}
+
explicit
TotalRulesSensor(const TRAFFCOUNTER & t) : traffcounter(t) {}
virtual ~TotalRulesSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
virtual ~TotalRulesSensor() {}
bool GetValue(ObjectSyntax_t * objectSyntax) const
@@
-275,7
+275,7
@@
class TotalRulesSensor : public Sensor {
template <typename T>
class ConstSensor : public Sensor {
public:
template <typename T>
class ConstSensor : public Sensor {
public:
- ConstSensor(const T & v) : value(v) {}
+
explicit
ConstSensor(const T & v) : value(v) {}
virtual ~ConstSensor() {}
bool GetValue(ObjectSyntax * objectSyntax) const
virtual ~ConstSensor() {}
bool GetValue(ObjectSyntax * objectSyntax) const
diff --git
a/projects/stargazer/plugins/other/smux/smux.h
b/projects/stargazer/plugins/other/smux/smux.h
index 3b217eb72878cafba22aa532bb129c7e8bbb75e0..721f02044c2f90028819b3aa0245515a77970f4e 100644
(file)
--- a/
projects/stargazer/plugins/other/smux/smux.h
+++ b/
projects/stargazer/plugins/other/smux/smux.h
@@
-74,7
+74,7
@@
private:
//-----------------------------------------------------------------------------
class ADD_DEL_TARIFF_NOTIFIER : public NOTIFIER_BASE<TARIFF_DATA>, private NONCOPYABLE {
public:
//-----------------------------------------------------------------------------
class ADD_DEL_TARIFF_NOTIFIER : public NOTIFIER_BASE<TARIFF_DATA>, private NONCOPYABLE {
public:
-
ADD_DEL_TARIFF_NOTIFIER(SMUX & s)
+
explicit
ADD_DEL_TARIFF_NOTIFIER(SMUX & s)
: NOTIFIER_BASE<TARIFF_DATA>(), smux(s) {}
void Notify(const TARIFF_DATA &);
: NOTIFIER_BASE<TARIFF_DATA>(), smux(s) {}
void Notify(const TARIFF_DATA &);
@@
-84,7
+84,7
@@
private:
//-----------------------------------------------------------------------------
class ADD_USER_NOTIFIER : public NOTIFIER_BASE<USER_PTR>, private NONCOPYABLE {
public:
//-----------------------------------------------------------------------------
class ADD_USER_NOTIFIER : public NOTIFIER_BASE<USER_PTR>, private NONCOPYABLE {
public:
-
ADD_USER_NOTIFIER(SMUX & s) : NOTIFIER_BASE<USER_PTR>(), smux(s) {}
+
explicit
ADD_USER_NOTIFIER(SMUX & s) : NOTIFIER_BASE<USER_PTR>(), smux(s) {}
void Notify(const USER_PTR &);
private:
void Notify(const USER_PTR &);
private:
@@
-93,7
+93,7
@@
private:
//-----------------------------------------------------------------------------
class DEL_USER_NOTIFIER : public NOTIFIER_BASE<USER_PTR>, private NONCOPYABLE {
public:
//-----------------------------------------------------------------------------
class DEL_USER_NOTIFIER : public NOTIFIER_BASE<USER_PTR>, private NONCOPYABLE {
public:
-
DEL_USER_NOTIFIER(SMUX & s) : NOTIFIER_BASE<USER_PTR>(), smux(s) {}
+
explicit
DEL_USER_NOTIFIER(SMUX & s) : NOTIFIER_BASE<USER_PTR>(), smux(s) {}
void Notify(const USER_PTR &);
private:
void Notify(const USER_PTR &);
private:
diff --git
a/projects/stargazer/plugins/other/smux/tables.h
b/projects/stargazer/plugins/other/smux/tables.h
index ea0bc627b67261b7df4959ed66e702684066e318..a1f97f673fccb8ef8f57568da8adf75b62e1af48 100644
(file)
--- a/
projects/stargazer/plugins/other/smux/tables.h
+++ b/
projects/stargazer/plugins/other/smux/tables.h
@@
-11,7
+11,7
@@
class USERS;
class TableSensor {
public:
class TableSensor {
public:
- TableSensor(const std::string & p) : prefix(p) {}
+
explicit
TableSensor(const std::string & p) : prefix(p) {}
virtual ~TableSensor() {}
const std::string & GetPrefix() const { return prefix; }
virtual ~TableSensor() {}
const std::string & GetPrefix() const { return prefix; }
diff --git
a/projects/stargazer/plugins/other/smux/types.h
b/projects/stargazer/plugins/other/smux/types.h
index 5498d2ebce3e6350b2b4f513425e824e66b2f01b..2b54f2a2fc428231ef78266849433848abaf2940 100644
(file)
--- a/
projects/stargazer/plugins/other/smux/types.h
+++ b/
projects/stargazer/plugins/other/smux/types.h
@@
-9,11
+9,11
@@
class OID {
public:
class OID {
public:
- OID(const std::string & str);
+
explicit
OID(const std::string & str);
OID(const char * str, size_t length);
OID(const char * str, size_t length);
- OID(const std::vector<unsigned> & arcs);
+
explicit
OID(const std::vector<unsigned> & arcs);
OID(const unsigned * arcs, size_t length);
OID(const unsigned * arcs, size_t length);
- OID(OBJECT_IDENTIFIER_t * oid);
+
explicit
OID(OBJECT_IDENTIFIER_t * oid);
OID(const OID & rvalue);
~OID();
OID(const OID & rvalue);
~OID();
diff --git
a/projects/stargazer/plugins/store/mysql/mysql_store.cpp
b/projects/stargazer/plugins/store/mysql/mysql_store.cpp
index 198b5f3b812375fcfe88ef3fa532865f45eb1cac..8108de0900a12b4d29278965fc0397968ffcfc2a 100644
(file)
--- a/
projects/stargazer/plugins/store/mysql/mysql_store.cpp
+++ b/
projects/stargazer/plugins/store/mysql/mysql_store.cpp
@@
-222,12
+222,13
@@
else
{
if(mysql_select_db(sock, storeSettings.GetDBName().c_str()))
{
{
if(mysql_select_db(sock, storeSettings.GetDBName().c_str()))
{
- errorStr = "Couldn't select database! With error:\n";
- errorStr += mysql_error(sock);
- mysql_close(sock);
- ret = -1;
+
errorStr = "Couldn't select database! With error:\n";
+
errorStr += mysql_error(sock);
+
mysql_close(sock);
+
ret = -1;
}
}
- ret = CheckAllTables(sock);
+ else
+ ret = CheckAllTables(sock);
}
}
else
}
}
else
diff --git
a/projects/stargazer/services_impl.cpp
b/projects/stargazer/services_impl.cpp
index 90c23f812acd856a5ec282e0f97f7006eba41af5..109a327bbe1e5b500fd656b139b2559449787aa3 100644
(file)
--- a/
projects/stargazer/services_impl.cpp
+++ b/
projects/stargazer/services_impl.cpp
@@
-107,7
+107,7
@@
while (csi != searchDescriptors.end())
{
if (csi->second == si)
(csi->second)++;
{
if (csi->second == si)
(csi->second)++;
-
csi++
;
+
++csi
;
}
data.remove(*si);
}
data.remove(*si);
diff --git
a/projects/stargazer/services_impl.h
b/projects/stargazer/services_impl.h
index 56202c7a116ac65297f1cd387ab0a7d9e04fb2a5..8101f2d94314a0fb9709b2e7f6d37f3630325563 100644
(file)
--- a/
projects/stargazer/services_impl.h
+++ b/
projects/stargazer/services_impl.h
@@
-21,12
+21,6
@@
#ifndef SERVICES_IMPL_H
#define SERVICES_IMPL_H
#ifndef SERVICES_IMPL_H
#define SERVICES_IMPL_H
-#include <pthread.h>
-
-#include <list>
-#include <map>
-#include <string>
-
#include "stg/services.h"
#include "stg/service_conf.h"
#include "stg/locker.h"
#include "stg/services.h"
#include "stg/service_conf.h"
#include "stg/locker.h"
@@
-34,11
+28,17
@@
#include "stg/noncopyable.h"
#include "stg/logger.h"
#include "stg/noncopyable.h"
#include "stg/logger.h"
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
+
class ADMIN;
class SERVICES_IMPL : private NONCOPYABLE, public SERVICES {
public:
class ADMIN;
class SERVICES_IMPL : private NONCOPYABLE, public SERVICES {
public:
- SERVICES_IMPL(STORE * st);
+
explicit
SERVICES_IMPL(STORE * st);
virtual ~SERVICES_IMPL() {}
int Add(const SERVICE_CONF & service, const ADMIN * admin);
virtual ~SERVICES_IMPL() {}
int Add(const SERVICE_CONF & service, const ADMIN * admin);
diff --git
a/projects/stargazer/settings_impl.h
b/projects/stargazer/settings_impl.h
index cc35393b2d18fab8d21cc705f3d1687fa031f43c..9bcce5b0f30bed2dbb9a259d6fa061202c06b40e 100644
(file)
--- a/
projects/stargazer/settings_impl.h
+++ b/
projects/stargazer/settings_impl.h
@@
-37,13
+37,13
@@
#ifndef SETTINGS_IMPL_H
#define SETTINGS_IMPL_H
#ifndef SETTINGS_IMPL_H
#define SETTINGS_IMPL_H
-#include <string>
-#include <vector>
-
#include "stg/settings.h"
#include "stg/common.h"
#include "stg/module_settings.h"
#include "stg/settings.h"
#include "stg/common.h"
#include "stg/module_settings.h"
+#include <string>
+#include <vector>
+
//-----------------------------------------------------------------------------
enum DETAIL_STAT_PERIOD {
dsPeriod_1,
//-----------------------------------------------------------------------------
enum DETAIL_STAT_PERIOD {
dsPeriod_1,
@@
-57,7
+57,7
@@
class DOTCONFDocumentNode;
//-----------------------------------------------------------------------------
class SETTINGS_IMPL : public SETTINGS {
public:
//-----------------------------------------------------------------------------
class SETTINGS_IMPL : public SETTINGS {
public:
- SETTINGS_IMPL(const std::string &);
+
explicit
SETTINGS_IMPL(const std::string &);
SETTINGS_IMPL(const SETTINGS_IMPL &);
virtual ~SETTINGS_IMPL() {}
SETTINGS_IMPL & operator=(const SETTINGS_IMPL &);
SETTINGS_IMPL(const SETTINGS_IMPL &);
virtual ~SETTINGS_IMPL() {}
SETTINGS_IMPL & operator=(const SETTINGS_IMPL &);
diff --git
a/projects/stargazer/store_loader.cpp
b/projects/stargazer/store_loader.cpp
index d27c09023603f8745a02df66554d84cff694c862..1529a2ccd7c5fb744bff2de7e95fead20a75aafd 100644
(file)
--- a/
projects/stargazer/store_loader.cpp
+++ b/
projects/stargazer/store_loader.cpp
@@
-115,6
+115,8
@@
if (!isLoaded)
return true;
}
return true;
}
+delete plugin;
+
if (dlclose(handle))
{
errorStr = "Failed to unload plugin '";
if (dlclose(handle))
{
errorStr = "Failed to unload plugin '";
diff --git
a/projects/stargazer/store_loader.h
b/projects/stargazer/store_loader.h
index 5245eb572f8c42f8091edc55657ee0fe30238faa..b38a46ee94fcbf85d2fd79a7f115e2bc474040ec 100644
(file)
--- a/
projects/stargazer/store_loader.h
+++ b/
projects/stargazer/store_loader.h
@@
-31,17
+31,17
@@
#ifndef __STORE_LOADER_H__
#define __STORE_LOADER_H__
#ifndef __STORE_LOADER_H__
#define __STORE_LOADER_H__
-#include <string>
-
#include "stg/module_settings.h"
#include "stg/noncopyable.h"
#include "stg/module_settings.h"
#include "stg/noncopyable.h"
+#include <string>
+
class STORE;
class SETTINGS_IMPL;
class STORE_LOADER : private NONCOPYABLE {
public:
class STORE;
class SETTINGS_IMPL;
class STORE_LOADER : private NONCOPYABLE {
public:
- STORE_LOADER(const SETTINGS_IMPL & settings);
+
explicit
STORE_LOADER(const SETTINGS_IMPL & settings);
~STORE_LOADER();
bool Load();
~STORE_LOADER();
bool Load();
diff --git
a/projects/stargazer/tariff_impl.h
b/projects/stargazer/tariff_impl.h
index 0619d50bb5f852f725833a6294e613b8e31c88b5..3a12fbdf6769a18047540d6466d1808ff6849cbf 100644
(file)
--- a/
projects/stargazer/tariff_impl.h
+++ b/
projects/stargazer/tariff_impl.h
@@
-31,14
+31,14
@@
#ifndef TARIFF_IMPL_H
#define TARIFF_IMPL_H
#ifndef TARIFF_IMPL_H
#define TARIFF_IMPL_H
-#include <ctime>
+#include "stg/tariff.h"
+#include "stg/os_int.h"
+#include "stg/tariff_conf.h"
#include <string>
#include <list>
#include <string>
#include <list>
-#include "stg/tariff.h"
-#include "stg/os_int.h"
-#include "stg/tariff_conf.h"
+#include <ctime>
#define TARIFF_DAY 0
#define TARIFF_NIGHT 1
#define TARIFF_DAY 0
#define TARIFF_NIGHT 1
@@
-49,18
+49,14
@@
public:
: TARIFF(),
tariffData()
{}
: TARIFF(),
tariffData()
{}
- TARIFF_IMPL(const std::string & name)
+
explicit
TARIFF_IMPL(const std::string & name)
: TARIFF(),
tariffData(name)
{}
: TARIFF(),
tariffData(name)
{}
- TARIFF_IMPL(const TARIFF_DATA & td)
+
explicit
TARIFF_IMPL(const TARIFF_DATA & td)
: TARIFF(),
tariffData(td)
{}
: TARIFF(),
tariffData(td)
{}
- TARIFF_IMPL(const TARIFF_IMPL & t)
- : TARIFF(),
- tariffData(t.tariffData)
- {}
virtual ~TARIFF_IMPL() {}
double GetPriceWithTraffType(uint64_t up,
virtual ~TARIFF_IMPL() {}
double GetPriceWithTraffType(uint64_t up,
diff --git
a/projects/stargazer/tariffs_impl.h
b/projects/stargazer/tariffs_impl.h
index 288f1225412a159eb60e63200a4cc07681423c46..55cc49b336ebb6cb68a1388e142fd2d93da81b6c 100644
(file)
--- a/
projects/stargazer/tariffs_impl.h
+++ b/
projects/stargazer/tariffs_impl.h
@@
-25,16
+25,16
@@
#ifndef TARIFFS_IMPL_H
#define TARIFFS_IMPL_H
#ifndef TARIFFS_IMPL_H
#define TARIFFS_IMPL_H
-#include <pthread.h>
+#include "stg/tariff.h"
+#include "stg/tariffs.h"
+#include "stg/tariff_conf.h"
+#include "tariff_impl.h"
#include <string>
#include <list>
#include <set>
#include <string>
#include <list>
#include <set>
-#include "stg/tariff.h"
-#include "stg/tariffs.h"
-#include "stg/tariff_conf.h"
-#include "tariff_impl.h"
+#include <pthread.h>
#define TARIFF_DAY 0
#define TARIFF_NIGHT 1
#define TARIFF_DAY 0
#define TARIFF_NIGHT 1
@@
-47,7
+47,7
@@
class TARIFFS_IMPL : public TARIFFS {
public:
typedef std::list<TARIFF_IMPL> Tariffs;
public:
typedef std::list<TARIFF_IMPL> Tariffs;
- TARIFFS_IMPL(STORE * store);
+
explicit
TARIFFS_IMPL(STORE * store);
virtual ~TARIFFS_IMPL();
int ReadTariffs ();
const TARIFF * FindByName(const std::string & name) const;
virtual ~TARIFFS_IMPL();
int ReadTariffs ();
const TARIFF * FindByName(const std::string & name) const;
diff --git
a/projects/stargazer/traffcounter_impl.cpp
b/projects/stargazer/traffcounter_impl.cpp
index 5223c5c4c8bfa7e8739c844ad23620b5ac91285c..8cc08839151a2fb7dde09763468be225251b6729 100644
(file)
--- a/
projects/stargazer/traffcounter_impl.cpp
+++ b/
projects/stargazer/traffcounter_impl.cpp
@@
-188,7
+188,7
@@
while (tc->running)
std::string monFile(tc->monitorDir + "/traffcounter_r");
printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", tc->monitoring, monFile.c_str());
touchTime = stgTime;
std::string monFile(tc->monitorDir + "/traffcounter_r");
printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", tc->monitoring, monFile.c_str());
touchTime = stgTime;
- TouchFile(monFile
.c_str()
);
+ TouchFile(monFile);
}
if (++c % FLUSH_TIME == 0)
}
if (++c % FLUSH_TIME == 0)
@@
-209,7
+209,7
@@
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());
touchTimeP = stgTime;
std::string monFile = monitorDir + "/traffcounter_p";
printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", monitoring, monFile.c_str());
touchTimeP = stgTime;
- TouchFile(monFile
.c_str()
);
+ TouchFile(monFile);
}
STG_LOCKER lock(&mutex);
}
STG_LOCKER lock(&mutex);
@@
-509,10
+509,10
@@
void TRAFFCOUNTER_IMPL::DeterminateDir(const RAW_PACKET & packet,
int * dirU, // Direction for incoming packet
int * dirD) const // Direction for outgoing packet
{
int * dirU, // Direction for incoming packet
int * dirD) const // Direction for outgoing packet
{
-bool addrMatchU;
-bool portMatchU;
-bool addrMatchD;
-bool portMatchD;
+bool addrMatchU
= false
;
+bool portMatchU
= false
;
+bool addrMatchD
= false
;
+bool portMatchD
= false
;
bool foundU = false; // Was rule for U found ?
bool foundD = false; // Was rule for D found ?
//printfd(__FILE__, "foundU=%d, foundD=%d\n", foundU, foundD);
bool foundU = false; // Was rule for U found ?
bool foundD = false; // Was rule for D found ?
//printfd(__FILE__, "foundU=%d, foundD=%d\n", foundU, foundD);
@@
-526,7
+526,6
@@
while (ln != rules.end())
{
if (!foundU)
{
{
if (!foundU)
{
- addrMatchU = false;
portMatchU = false;
switch (ln->proto)
portMatchU = false;
switch (ln->proto)
@@
-572,7
+571,6
@@
while (ln != rules.end())
if (!foundD)
{
if (!foundD)
{
- addrMatchD = false;
portMatchD = false;
switch (ln->proto)
portMatchD = false;
switch (ln->proto)
@@
-654,7
+652,7
@@
while (fgets(str, 1023, f))
continue;
}
continue;
}
- r = sscanf(str,"%
100s %100s %100
s", tp, ta, td);
+ r = sscanf(str,"%
99s %99s %99
s", tp, ta, td);
if (r != 3)
{
printfd(__FILE__, "TRAFFCOUNTER_IMPL::ReadRules() - Error in file '%s' at line %d. There must be 3 parameters.\n", rulesFileName.c_str(), lineNumber);
if (r != 3)
{
printfd(__FILE__, "TRAFFCOUNTER_IMPL::ReadRules() - Error in file '%s' at line %d. There must be 3 parameters.\n", rulesFileName.c_str(), lineNumber);
diff --git
a/projects/stargazer/traffcounter_impl.h
b/projects/stargazer/traffcounter_impl.h
index 12439313e9a05a9cdb10afb817da7777f303776f..a1dfa74303aa8a4844fcf443550a53b712b4b359 100644
(file)
--- a/
projects/stargazer/traffcounter_impl.h
+++ b/
projects/stargazer/traffcounter_impl.h
@@
-28,13
+28,6
@@
#ifndef TRAFFCOUNTER_IMPL_H
#define TRAFFCOUNTER_IMPL_H
#ifndef TRAFFCOUNTER_IMPL_H
#define TRAFFCOUNTER_IMPL_H
-#include <pthread.h>
-
-#include <ctime>
-#include <list>
-#include <map>
-#include <string>
-
#include "stg/traffcounter.h"
#include "stg/os_int.h"
#include "stg/logger.h"
#include "stg/traffcounter.h"
#include "stg/os_int.h"
#include "stg/logger.h"
@@
-45,6
+38,13
@@
#include "eventloop.h"
#include "user_impl.h"
#include "eventloop.h"
#include "user_impl.h"
+#include <ctime>
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
+
#define PROTOMAX (5)
class USERS_IMPL;
#define PROTOMAX (5)
class USERS_IMPL;
@@
-147,7
+147,7
@@
private:
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
public:
//-----------------------------------------------------------------------------
class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
public:
- ADD_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
+
explicit
ADD_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
NOTIFIER_BASE<USER_IMPL_PTR>(),
traffCnt(t)
{}
NOTIFIER_BASE<USER_IMPL_PTR>(),
traffCnt(t)
{}
@@
-163,7
+163,7
@@
private:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
public:
//-----------------------------------------------------------------------------
class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
public:
- DEL_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
+
explicit
DEL_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
NOTIFIER_BASE<USER_IMPL_PTR>(),
traffCnt(t)
{}
NOTIFIER_BASE<USER_IMPL_PTR>(),
traffCnt(t)
{}
diff --git
a/projects/stargazer/user_impl.cpp
b/projects/stargazer/user_impl.cpp
index 36c0f84f01f02abb6e082d47d31e246c4eeef4b1..d6c749b71c5c635f91c3631e8438e41cd06d72d6 100644
(file)
--- a/
projects/stargazer/user_impl.cpp
+++ b/
projects/stargazer/user_impl.cpp
@@
-134,6
+134,8
@@
USER_IMPL::USER_IMPL(const SETTINGS * s,
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
@@
-204,6
+206,8
@@
USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
@@
-298,6
+302,8
@@
USER_IMPL::USER_IMPL(const USER_IMPL & u)
userdata9(property.userdata9),
sessionUpload(),
sessionDownload(),
userdata9(property.userdata9),
sessionUpload(),
sessionDownload(),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
diff --git
a/projects/stargazer/user_impl.h
b/projects/stargazer/user_impl.h
index 77887514b272b2603d5a3422b028562479736a73..8bc696648a0430de96d9bd5ba4a2306151787324 100644
(file)
--- a/
projects/stargazer/user_impl.h
+++ b/
projects/stargazer/user_impl.h
@@
-66,7
+66,7
@@
private:
class CHG_PASSIVE_NOTIFIER : public PROPERTY_NOTIFIER_BASE<int>,
private NONCOPYABLE {
public:
class CHG_PASSIVE_NOTIFIER : public PROPERTY_NOTIFIER_BASE<int>,
private NONCOPYABLE {
public:
- CHG_PASSIVE_NOTIFIER(USER_IMPL * u) : user(u) {}
+
explicit
CHG_PASSIVE_NOTIFIER(USER_IMPL * u) : user(u) {}
void Notify(const int & oldPassive, const int & newPassive);
private:
void Notify(const int & oldPassive, const int & newPassive);
private:
@@
-76,7
+76,7
@@
private:
class CHG_DISABLED_NOTIFIER : public PROPERTY_NOTIFIER_BASE<int>,
private NONCOPYABLE {
public:
class CHG_DISABLED_NOTIFIER : public PROPERTY_NOTIFIER_BASE<int>,
private NONCOPYABLE {
public:
- CHG_DISABLED_NOTIFIER(USER_IMPL * u) : user(u) {}
+
explicit
CHG_DISABLED_NOTIFIER(USER_IMPL * u) : user(u) {}
void Notify(const int & oldValue, const int & newValue);
private:
void Notify(const int & oldValue, const int & newValue);
private:
@@
-86,7
+86,7
@@
private:
class CHG_TARIFF_NOTIFIER : public PROPERTY_NOTIFIER_BASE<std::string>,
private NONCOPYABLE {
public:
class CHG_TARIFF_NOTIFIER : public PROPERTY_NOTIFIER_BASE<std::string>,
private NONCOPYABLE {
public:
- CHG_TARIFF_NOTIFIER(USER_IMPL * u) : user(u) {}
+
explicit
CHG_TARIFF_NOTIFIER(USER_IMPL * u) : user(u) {}
void Notify(const std::string & oldTariff, const std::string & newTariff);
private:
void Notify(const std::string & oldTariff, const std::string & newTariff);
private:
@@
-96,7
+96,7
@@
private:
class CHG_CASH_NOTIFIER : public PROPERTY_NOTIFIER_BASE<double>,
private NONCOPYABLE {
public:
class CHG_CASH_NOTIFIER : public PROPERTY_NOTIFIER_BASE<double>,
private NONCOPYABLE {
public:
- CHG_CASH_NOTIFIER(USER_IMPL * u) : user(u) {}
+
explicit
CHG_CASH_NOTIFIER(USER_IMPL * u) : user(u) {}
void Notify(const double & oldCash, const double & newCash);
private:
void Notify(const double & oldCash, const double & newCash);
private:
@@
-106,7
+106,7
@@
private:
class CHG_IPS_NOTIFIER : public PROPERTY_NOTIFIER_BASE<USER_IPS>,
private NONCOPYABLE {
public:
class CHG_IPS_NOTIFIER : public PROPERTY_NOTIFIER_BASE<USER_IPS>,
private NONCOPYABLE {
public:
- CHG_IPS_NOTIFIER(USER_IMPL * u) : user(u) {}
+
explicit
CHG_IPS_NOTIFIER(USER_IMPL * u) : user(u) {}
void Notify(const USER_IPS & oldIPs, const USER_IPS & newIPs);
private:
void Notify(const USER_IPS & oldIPs, const USER_IPS & newIPs);
private:
diff --git
a/projects/stargazer/users_impl.cpp
b/projects/stargazer/users_impl.cpp
index 18d1abaf163dd4758d3113fa068c7d0fd723326a..e973d2cd7192197a7744e3ba5a06c9135a5b30a2 100644
(file)
--- a/
projects/stargazer/users_impl.cpp
+++ b/
projects/stargazer/users_impl.cpp
@@
-419,7
+419,7
@@
while (us->nonstop)
{
//printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", tc->monitoring, monFile.c_str());
touchTime = stgTime;
{
//printfd(__FILE__, "Monitor=%d file TRAFFCOUNTER %s\n", tc->monitoring, monFile.c_str());
touchTime = stgTime;
- TouchFile(monFile
.c_str()
);
+ TouchFile(monFile);
}
stgUsleep(100000);
}
stgUsleep(100000);
diff --git
a/stglibs/conffiles.lib/conffiles.cpp
b/stglibs/conffiles.lib/conffiles.cpp
index a9c3e555093a87e8e60cc7c7d946cfdf347865b8..9578e24f298791daad4e3923ae948bde7da9cf62 100644
(file)
--- a/
stglibs/conffiles.lib/conffiles.cpp
+++ b/
stglibs/conffiles.lib/conffiles.cpp
@@
-70,7
+70,7
@@
if (pos != std::string::npos)
return val;
}
//---------------------------------------------------------------------------
return val;
}
//---------------------------------------------------------------------------
-std::string Trim(
std::string
val)
+std::string Trim(
const std::string&
val)
{
return TrimR(TrimL(val));
}
{
return TrimR(TrimL(val));
}
diff --git
a/stglibs/dotconfpp.lib/include/stg/dotconfpp.h
b/stglibs/dotconfpp.lib/include/stg/dotconfpp.h
index 930750135ac6bb9fbb84a0421335fd6dd05a64b7..63cd7eb37f00a79a560d5fb81613e97db9f009bd 100644
(file)
--- a/
stglibs/dotconfpp.lib/include/stg/dotconfpp.h
+++ b/
stglibs/dotconfpp.lib/include/stg/dotconfpp.h
@@
-107,7
+107,7
@@
protected:
virtual void error(int lineNum, const char * fileName, const char * fmt, ...);
public:
virtual void error(int lineNum, const char * fileName, const char * fmt, ...);
public:
- DOTCONFDocument(CaseSensitive caseSensitivity = CASESENSITIVE);
+
explicit
DOTCONFDocument(CaseSensitive caseSensitivity = CASESENSITIVE);
virtual ~DOTCONFDocument();
void setErrorCallback(DOTCONFCallback _callback, void * _data) { errorCallback = _callback; errorCallbackData = _data; }
virtual ~DOTCONFDocument();
void setErrorCallback(DOTCONFCallback _callback, void * _data) { errorCallback = _callback; errorCallbackData = _data; }
diff --git
a/stglibs/logger.lib/include/stg/logger.h
b/stglibs/logger.lib/include/stg/logger.h
index e8d625a0f105b1f137c9a64514431e8f7b758c2f..5165f0fb7203b540fa69bac94f18564e1768aa8c 100644
(file)
--- a/
stglibs/logger.lib/include/stg/logger.h
+++ b/
stglibs/logger.lib/include/stg/logger.h
@@
-1,17
+1,17
@@
#ifndef STG_LOGGER_H
#define STG_LOGGER_H
#ifndef STG_LOGGER_H
#define STG_LOGGER_H
-#include <pthread.h>
-
#include <string>
#include <string>
+#include <pthread.h>
+
class STG_LOGGER;
STG_LOGGER & GetStgLogger();
//-----------------------------------------------------------------------------
class STG_LOGGER_LOCKER
{
public:
class STG_LOGGER;
STG_LOGGER & GetStgLogger();
//-----------------------------------------------------------------------------
class STG_LOGGER_LOCKER
{
public:
- STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); }
+
explicit
STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); }
~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); }
private:
~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); }
private:
diff --git
a/stglibs/pinger.lib/include/stg/pinger.h
b/stglibs/pinger.lib/include/stg/pinger.h
index 91608dbbc2b38c8341943635f6e8dc8878967bcf..f31cc270ccb0e1ad48a4bd032d84ebeda5eb278b 100644
(file)
--- a/
stglibs/pinger.lib/include/stg/pinger.h
+++ b/
stglibs/pinger.lib/include/stg/pinger.h
@@
-87,7
+87,7
@@
public:
typedef std::multimap<uint32_t, time_t> PingIPs;
typedef PingIPs::size_type SizeType;
typedef std::multimap<uint32_t, time_t> PingIPs;
typedef PingIPs::size_type SizeType;
- STG_PINGER(time_t delay = 15);
+
explicit
STG_PINGER(time_t delay = 15);
~STG_PINGER();
int Start();
~STG_PINGER();
int Start();