mod_dbd.c revision fae764c11cd956df4868dc5e7c1a0b42f7d3fd54
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* Copyright 2003-5 The Apache Software Foundation or its licensors, as
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi * applicable.
d3e250aab242db84d14060985b5db675a731d548nd * Licensed under the Apache License, Version 2.0 (the "License");
89565ae25f070411b0b32505b798195a9c98a1c2mturk * you may not use this file except in compliance with the License.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * You may obtain a copy of the License at
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Unless required by applicable law or agreed to in writing, software
738ad457843927ece7fa5e91e4fb4a5710d13690lgentis * distributed under the License is distributed on an "AS IS" BASIS,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * See the License for the specific language governing permissions and
#include <ctype.h>
#include "http_protocol.h"
#include "http_config.h"
#include "http_log.h"
#include "apr_reslist.h"
#include "apr_strings.h"
#include "apr_dbd.h"
#include "mod_dbd.h"
typedef struct dbd_prepared {
const char *label;
const char *query;
} dbd_prepared;
typedef struct svr_cfg {
const char *name;
const char *params;
int persist;
#if APR_HAS_THREADS
int nmin;
int nkeep;
int nmax;
int exptime;
} svr_cfg;
} cmd_parts;
for (p = val; *p; ++p) \
if (!isdigit(*p)) \
case cmd_name:
case APR_ENOTIMPL:
case APR_EDSOOPEN:
"DBD: Can't load driver file apr_dbd_%s.so",
case APR_ESYMNOTFOUND:
case cmd_params:
case cmd_persist:
#if APR_HAS_THREADS
case cmd_min:
case cmd_keep:
case cmd_max:
case cmd_exp:
return NULL;
const char *label)
return NULL;
"Use persistent connection/pool"),
#if APR_HAS_THREADS
{NULL}
#define DEFAULT_NMIN 0
#if APR_HAS_THREADS
return cfg;
#if APR_HAS_THREADS
return svr;
dbd_prepared *p;
return ret;
switch (rv) {
case APR_ENOTIMPL:
return rv;
case APR_EDSOOPEN:
return rv;
case APR_ESYMNOTFOUND:
return rv;
return rv;
case APR_SUCCESS:
switch (rv) {
case APR_EGENERAL:
return rv;
return rv;
case APR_SUCCESS:
return rv;
#if APR_HAS_THREADS
(void*)apr_reslist_destroy,
return rv;
#if APR_HAS_THREADS
const char *errmsg;
return NULL;
return NULL;
if (!errmsg) {
return NULL;
return arec;
const char *errmsg;
if (!errmsg) {
#if APR_HAS_THREADS
#if APR_HAS_THREADS
} dbd_pool_rec;
return APR_SUCCESS;
if (!req) {
if (!req) {
if (!ret) {
if (ret) {
return ret;
if (!ret) {
if (ret) {
return ret;
#if APR_HAS_THREADS
NULL,
NULL,