Lines Matching defs:cfg
43 (apr_pool_t *pool, dbd_cfg_t *cfg,
45 (pool, cfg, dbd), OK, DECLINED)
47 /************ svr cfg: manage db connection pool ****************/
57 dbd_cfg_t *cfg;
70 dbd_cfg_t *cfg;
97 dbd_cfg_t *cfg = svr->cfg = apr_pcalloc(pool, sizeof(dbd_cfg_t));
99 cfg->server = s;
100 cfg->name = no_dbdriver; /* to generate meaningful error messages */
101 cfg->params = ""; /* don't risk segfault on misconfiguration */
102 cfg->persist = -1;
104 cfg->nmin = DEFAULT_NMIN;
105 cfg->nkeep = DEFAULT_NKEEP;
106 cfg->nmax = DEFAULT_NMAX;
107 cfg->exptime = DEFAULT_EXPTIME;
109 cfg->queries = apr_hash_make(pool);
110 cfg->init_queries = apr_array_make(pool, DEFAULT_SQL_INIT_ARRAY_SIZE,
118 dbd_cfg_t *base = ((svr_cfg*) basev)->cfg;
119 dbd_cfg_t *add = ((svr_cfg*) addv)->cfg;
121 dbd_cfg_t *new = svr->cfg = apr_pcalloc(pool, sizeof(dbd_cfg_t));
156 arr_item = apr_array_push(svr->cfg->init_queries);
167 dbd_cfg_t *cfg = svr->cfg;
171 cfg->name = val;
176 rv = apr_dbd_get_driver(cmd->pool, cfg->name, &driver);
178 return apr_psprintf(cmd->pool, "No driver for %s", cfg->name);
187 cfg->name);
192 cfg->name);
196 cfg->params = val;
208 dbd_cfg_t *cfg = svr->cfg;
219 cfg->nmin = atoi(val);
220 cfg->set |= NMIN_SET;
223 cfg->nkeep = atoi(val);
224 cfg->set |= NKEEP_SET;
227 cfg->nmax = atoi(val);
228 cfg->set |= NMAX_SET;
231 cfg->exptime = atoi(val);
232 cfg->set |= EXPTIME_SET;
247 svr->cfg->persist = flag;
328 if (apr_hash_get(svr->cfg->queries, label, APR_HASH_KEY_STRING)
334 apr_hash_set(svr->cfg->queries, label, APR_HASH_KEY_STRING, query);
350 dbd_cfg_t *cfg = svr->cfg;
351 apr_hash_index_t *hi_first = apr_hash_first(ptemp, cfg->queries);
359 if (cfg->name == no_dbdriver || !cfg->persist) {
364 dbd_cfg_t *group_cfg = group->cfg;
368 if (strcmp(cfg->name, group_cfg->name)
369 || strcmp(cfg->params, group_cfg->params)) {
374 if (cfg->nmin != group_cfg->nmin
375 || cfg->nkeep != group_cfg->nkeep
376 || cfg->nmax != group_cfg->nmax
377 || cfg->exptime != group_cfg->exptime) {
424 group->cfg = cfg;
434 static apr_status_t dbd_prepared_init(apr_pool_t *pool, dbd_cfg_t *cfg,
441 for (hi = apr_hash_first(pool, cfg->queries); hi;
465 static apr_status_t dbd_init_sql_init(apr_pool_t *pool, dbd_cfg_t *cfg,
471 for (i = 0; i < cfg->init_queries->nelts; i++) {
475 query_p = (char **)cfg->init_queries->elts + i;
516 dbd_cfg_t *cfg = group->cfg;
524 ap_log_error(APLOG_MARK, APLOG_CRIT, rv, cfg->server, APLOGNO(00624)
538 rv = apr_dbd_get_driver(rec->pool, cfg->name, &rec->driver);
541 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00625)
542 "driver for %s not available", cfg->name);
545 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00626)
546 "can't find driver for %s", cfg->name);
549 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00627)
551 cfg->name);
554 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00628)
561 rv = apr_dbd_open_ex(rec->driver, rec->pool, cfg->params, &rec->handle, &err);
565 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00629)
566 "Can't connect to %s: %s", cfg->name, err);
569 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00630)
586 ap_log_error(APLOG_MARK, APLOG_CRIT, rv, cfg->server, APLOGNO(00631)
593 rv = dbd_prepared_init(prepared_pool, cfg, rec);
596 ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server, APLOGNO(00632)
604 dbd_run_post_connect(prepared_pool, cfg, rec);
623 dbd_cfg_t *cfg = group->cfg;
645 cfg->nmin, cfg->nkeep, cfg->nmax,
646 apr_time_from_sec(cfg->exptime),
756 if (!svr->cfg->persist) {
786 "DBD [%s] Error: %s", svr->cfg->name, errmsg);
794 dbd_cfg_t *cfg = svr->cfg;
801 if (cfg->name == no_dbdriver) {
807 if (!cfg->persist) {
811 group->cfg = cfg;
892 if (svr->cfg->persist) {
915 if (svr->cfg->persist) {