Added proper status and debugging control.
git-svn-id: http://yate.null.ro/svn/yate/trunk@604 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
7399c56e0c
commit
5fe9c66756
|
@ -112,6 +112,7 @@ public:
|
|||
~MyModule();
|
||||
protected:
|
||||
virtual void initialize();
|
||||
virtual void statusParams(String& str);
|
||||
private:
|
||||
bool m_init;
|
||||
};
|
||||
|
@ -318,7 +319,7 @@ bool MyHandler::received(Message& msg)
|
|||
if (tmp.null())
|
||||
return false;
|
||||
Lock lock(s_conmutex);
|
||||
DbConn* db= findDb(tmp);
|
||||
DbConn* db = findDb(tmp);
|
||||
if (!db)
|
||||
return false;
|
||||
Lock lo(db->mutex());
|
||||
|
@ -341,8 +342,14 @@ MyModule::~MyModule()
|
|||
Output("Unloaded module MySQL");
|
||||
}
|
||||
|
||||
void MyModule::statusParams(String& str)
|
||||
{
|
||||
str.append("conns=",",") << s_conns.count();
|
||||
}
|
||||
|
||||
void MyModule::initialize()
|
||||
{
|
||||
Module::initialize();
|
||||
if (m_init)
|
||||
return;
|
||||
m_init = true;
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
~PgModule();
|
||||
protected:
|
||||
virtual void initialize();
|
||||
virtual void statusParams(String& str);
|
||||
private:
|
||||
bool m_init;
|
||||
};
|
||||
|
@ -323,7 +324,7 @@ bool PgHandler::received(Message& msg)
|
|||
if (tmp.null())
|
||||
return false;
|
||||
Lock lock(s_conmutex);
|
||||
DbConn* db= findDb(tmp);
|
||||
DbConn* db = findDb(tmp);
|
||||
if (!db)
|
||||
return false;
|
||||
Lock lo(db->mutex());
|
||||
|
@ -346,8 +347,14 @@ PgModule::~PgModule()
|
|||
s_conns.clear();
|
||||
}
|
||||
|
||||
void PgModule::statusParams(String& str)
|
||||
{
|
||||
str.append("conns=",",") << s_conns.count();
|
||||
}
|
||||
|
||||
void PgModule::initialize()
|
||||
{
|
||||
Module::initialize();
|
||||
if (m_init)
|
||||
return;
|
||||
m_init = true;
|
||||
|
|
Loading…
Reference in New Issue