Removed max connections limit.

git-svn-id: http://yate.null.ro/svn/yate/trunk@5297 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2012-10-19 07:28:59 +00:00
parent d11a3736a0
commit 82eed34f8d
4 changed files with 5 additions and 20 deletions

View File

@ -43,6 +43,5 @@
;encoding=
; poolsize: int: Number of connections to establish for this account
; If not set or empty, it will create only one connection
; Minimum number of connections is 1, maximum is 10
; Minimum number of connections is 1
;poolsize=1

View File

@ -44,8 +44,5 @@
;password=
; poolsize: int: Number of connections to establish for this account
; If not set or empty, it will create only one connection
; Minimum number of connections is 1, maximum is 10
; The value is clamped to interval margins, e.g. poolsize=0 creates 1 connection,
; poolsize=12 creates 10 connections
; Minimum number of connections is 1
;poolsize=1

View File

@ -40,9 +40,6 @@
#define mysql_library_end mysql_server_end
#endif
#define MIN_CONNECTIONS 1
#define MAX_CONNECTIONS 10
using namespace TelEngine;
namespace { // anonymous
@ -435,7 +432,8 @@ int MyConn::queryDbInternal(DbQuery* query)
MyAcct::MyAcct(const NamedList* sect)
: String(*sect),
Mutex(true,"MySQL::acct"),
m_queueSem(MAX_CONNECTIONS,"MySQL::queue"),
m_poolSize(sect->getIntValue("poolsize",1,1)),
m_queueSem(m_poolSize,"MySQL::queue"),
m_queueMutex(false,"MySQL::queue"),
m_totalQueries(0), m_failedQueries(0), m_errorQueries(0),
m_queryTime(0), m_failedConns(0),
@ -456,11 +454,6 @@ MyAcct::MyAcct(const NamedList* sect)
m_compress = sect->getBoolValue("compress");
m_encoding = sect->getValue("encoding");
m_poolSize = sect->getIntValue("poolsize",MIN_CONNECTIONS);
if (m_poolSize < MIN_CONNECTIONS)
m_poolSize = MIN_CONNECTIONS;
else if (m_poolSize > MAX_CONNECTIONS)
m_poolSize = MAX_CONNECTIONS;
Debug(&module, DebugNote, "For account '%s' connection pool size is %d",
c_str(),m_poolSize);

View File

@ -27,10 +27,6 @@
#include <stdio.h>
#include <libpq-fe.h>
// Min/max numbner of connections
#define MIN_CONNECTIONS 1
#define MAX_CONNECTIONS 10
using namespace TelEngine;
namespace { // anonymous
@ -448,7 +444,7 @@ PgAccount::PgAccount(const NamedList& sect)
m_timeout = 500000;
m_retry = sect.getIntValue("retry",5);
m_encoding = sect.getValue("encoding");
m_connPoolSize = sect.getIntValue("poolsize",MIN_CONNECTIONS,MIN_CONNECTIONS,MAX_CONNECTIONS);
m_connPoolSize = sect.getIntValue("poolsize",1,1);
m_connPool = new PgConn[m_connPoolSize];
for (unsigned int i = 0; i < m_connPoolSize; i++) {
m_connPool[i].m_account = this;