From: Stephen D. <sd...@us...> - 2005-10-17 11:25:26
|
Update of /cvsroot/naviserver/naviserver/nsdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10314/nsdb Modified Files: dbinit.c Log Message: * nslog/nslog.c: * nscp/nscp.c: * nscgi/nscgi.c: * nsdb/dbinit.c: Use new config routines. Index: dbinit.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsdb/dbinit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbinit.c 10 Jun 2005 17:58:41 -0000 1.2 --- dbinit.c 17 Oct 2005 11:25:17 -0000 1.3 *************** *** 1039,1060 **** poolPtr->desc = Ns_ConfigGetValue("ns/db/pools", pool); poolPtr->stale_on_close = 0; ! if (!Ns_ConfigGetBool(path, "verbose", &poolPtr->fVerbose)) { ! poolPtr->fVerbose = 0; ! } ! if (!Ns_ConfigGetBool(path, "logsqlerrors", &poolPtr->fVerboseError)) { ! poolPtr->fVerboseError = 0; ! } ! if (!Ns_ConfigGetInt(path, "connections", &poolPtr->nhandles) ! || poolPtr->nhandles <= 0) { ! poolPtr->nhandles = 2; ! } ! if (Ns_ConfigGetInt(path, "MaxIdle", &i) == NS_FALSE || i < 0) { ! i = 600; /* 10 minutes */ ! } ! poolPtr->maxidle = i; ! if (Ns_ConfigGetInt(path, "MaxOpen", &i) == NS_FALSE || i < 0) { ! i = 3600; /* 1 hour */ ! } ! poolPtr->maxopen = i; poolPtr->firstPtr = poolPtr->lastPtr = NULL; for (i = 0; i < poolPtr->nhandles; ++i) { --- 1039,1048 ---- poolPtr->desc = Ns_ConfigGetValue("ns/db/pools", pool); poolPtr->stale_on_close = 0; ! poolPtr->fVerbose = Ns_ConfigBool(path, "verbose", NS_FALSE); ! poolPtr->fVerboseError = Ns_ConfigBool(path, "logsqlerrors", NS_FALSE); ! poolPtr->nhandles = Ns_ConfigIntRange(path, "connections", 2, 0, INT_MAX); ! poolPtr->maxidle = Ns_ConfigIntRange(path, "maxidle", 600, 0, INT_MAX); ! poolPtr->maxopen = Ns_ConfigIntRange(path, "maxopen", 3600, 0, INT_MAX); ! poolPtr->firstPtr = poolPtr->lastPtr = NULL; for (i = 0; i < poolPtr->nhandles; ++i) { *************** *** 1087,1094 **** ReturnHandle(handlePtr); } ! if (!Ns_ConfigGetInt(path, "checkinterval", &i) || i < 0) { ! i = 600; /* 10 minutes. */ ! } ! Ns_ScheduleProc(CheckPool, poolPtr, 0, i); return poolPtr; } --- 1075,1080 ---- ReturnHandle(handlePtr); } ! Ns_ScheduleProc(CheckPool, poolPtr, 0, ! Ns_ConfigIntRange(path, "checkinterval", 600, 0, INT_MAX)); return poolPtr; } |