You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2005/12/06 11:55:01 UTC
svn commit: r354400 - /httpd/httpd/trunk/modules/database/mod_dbd.c
Author: niq
Date: Tue Dec 6 02:54:57 2005
New Revision: 354400
URL: http://svn.apache.org/viewcvs?rev=354400&view=rev
Log:
Improve defaults from 'test' values (and get meaningful errors on
startup if database is down); trivial tidyups.
Modified:
httpd/httpd/trunk/modules/database/mod_dbd.c
Modified: httpd/httpd/trunk/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.c?rev=354400&r1=354399&r2=354400&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.c (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.c Tue Dec 6 02:54:57 2005
@@ -140,7 +140,7 @@
return NULL;
}
DBD_DECLARE_NONSTD(void) ap_dbd_prepare(server_rec *s, const char *query,
- const char *label)
+ const char *label)
{
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
dbd_prepared *prepared = apr_pcalloc(s->process->pool, sizeof(dbd_prepared));
@@ -194,10 +194,13 @@
cfg->set = add->set | base->set;
return (void*) cfg;
}
-#define DEFAULT_NMIN 0
-#define DEFAULT_NKEEP 1
-#define DEFAULT_NMAX 5
-#define DEFAULT_EXPTIME 120
+/* A default nmin of >0 will help with generating meaningful
+ * startup error messages if the database is down.
+ */
+#define DEFAULT_NMIN 1
+#define DEFAULT_NKEEP 2
+#define DEFAULT_NMAX 10
+#define DEFAULT_EXPTIME 300
static void *dbd_cfg(apr_pool_t *p, server_rec *x)
{
svr_cfg *svr = (svr_cfg*) apr_pcalloc(p, sizeof(svr_cfg));
@@ -324,7 +327,7 @@
}
rv = apr_reslist_create(&svr->dbpool, svr->nmin, svr->nkeep, svr->nmax,
- ((apr_interval_time_t) svr->exptime) * 1000000,
+ apr_time_from_sec(svr->exptime),
dbd_construct, dbd_destruct, svr, svr->pool);
if (rv == APR_SUCCESS) {
apr_pool_cleanup_register(svr->pool, svr->dbpool,