[Mod-auth-commit] mod_dbi_pool/include mod_dbi_pool.h,NONE,1.1
Brought to you by:
firechipmunk,
honx
From: <fir...@us...> - 2004-02-29 08:58:52
|
Update of /cvsroot/mod-auth/mod_dbi_pool/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14614/include Added Files: mod_dbi_pool.h Log Message: initial work to make mod_dbi_pool support multiple connection pools. --- NEW FILE: mod_dbi_pool.h --- /* ==================================================================== * Copyright 2003-2004 Paul Querna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ==================================================================== */ /** * Author: Paul Querna <chip force-elite.com> * * Originaly Based on mod_mysql_pool by Nick Kew: * http://apache.webthing.com/ * * $Id: mod_dbi_pool.h,v 1.1 2004/02/29 08:40:52 firechipmunk Exp $ */ /** * mod_dbi_pool: manage a pool of libdbi connections. * EXPORTS: * dbi_conn* dbipool_open(server_rec*) * - retrieve a connection from the pool and check it's valid * - May return null and log a message on error. * void dbipool_close(server_rec*, dbi_conn*) * - return a connection to the pool after use * */ #define DFLT_DBI_DBNAME "mod_dbi" #define DFLT_DBI_HOST "localhost" #define DFLT_DBI_DRIVER "mysql" #define DFLT_DBI_USER "root" #define DFLT_DBI_PASS "" /* setting this to NULL triggers a bug in libdbi which causes a segfault. mysql docs * say this must be set to NULL in order to login without a password. fortunately, * setting "" works as well. the bug is reported to the libdbi maintainers. we will * change this back when the bug is fixed. * */ #define DFLT_CONN_MIN (1) #define DFLT_CONN_SOFT (5) #define DFLT_CONN_MAX (25) #define DFLT_CONN_TTL (600) #define DFLT_OPTIONS (0) #ifndef DBI_HARD_MAX_CONNS #define DBI_HARD_MAX_CONNS (255) #endif typedef enum { CONF_DBI_DRIVER, CONF_DBI_DRIVER_DIR, CONF_DBI_HOST, CONF_DBI_USERNAME, CONF_DBI_PASSWORD, CONF_DBI_DBNAME, CONF_DBI_CONN_MIN, CONF_DBI_CONN_SOFTMAX, CONF_DBI_CONN_HARDMAX, CONF_DBI_CONN_TTL, } CONF_DBI; typedef struct dbi_config_rec_struct { const char *dbi_dbname; const char *dbi_user; const char *dbi_pass; const char *dbi_driver; const char *dbi_host; int conn_min; int conn_soft; int conn_max; int conn_ttl; } dbi_config_rec; |