mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Stop mod_dbd emitting bogus error messages when it's loaded
but not configured. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@485311 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -361,6 +361,15 @@ static apr_status_t dbd_setup_init(apr_pool_t *pool, server_rec *s)
|
|||||||
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
|
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
|
||||||
apr_status_t rv;
|
apr_status_t rv;
|
||||||
|
|
||||||
|
/* dbd_setup in 2.2.3 and under was causing spurious error messages
|
||||||
|
* when dbd isn't configured. We can stop that with a quick check here
|
||||||
|
* together with a similar check in ap_dbd_open (where being
|
||||||
|
* unconfigured is a genuine error that must be reported).
|
||||||
|
*/
|
||||||
|
if (svr->name == no_dbdriver) {
|
||||||
|
return APR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (!svr->persist) {
|
if (!svr->persist) {
|
||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -442,6 +451,12 @@ DBD_DECLARE_NONSTD(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
|
|||||||
apr_status_t rv = APR_SUCCESS;
|
apr_status_t rv = APR_SUCCESS;
|
||||||
const char *errmsg;
|
const char *errmsg;
|
||||||
|
|
||||||
|
/* If nothing is configured, we shouldn't be here */
|
||||||
|
if (svr->name == no_dbdriver) {
|
||||||
|
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "DBD: not configured");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!svr->persist) {
|
if (!svr->persist) {
|
||||||
/* Return a once-only connection */
|
/* Return a once-only connection */
|
||||||
rv = dbd_construct(&rec, svr, s->process->pool);
|
rv = dbd_construct(&rec, svr, s->process->pool);
|
||||||
@@ -480,6 +495,12 @@ DBD_DECLARE_NONSTD(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
|
|||||||
void *rec = NULL;
|
void *rec = NULL;
|
||||||
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
|
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
|
||||||
|
|
||||||
|
/* If nothing is configured, we shouldn't be here */
|
||||||
|
if (svr->name == no_dbdriver) {
|
||||||
|
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "DBD: not configured");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!svr->persist) {
|
if (!svr->persist) {
|
||||||
/* Return a once-only connection */
|
/* Return a once-only connection */
|
||||||
rv = dbd_construct(&rec, svr, s->process->pool);
|
rv = dbd_construct(&rec, svr, s->process->pool);
|
||||||
|
Reference in New Issue
Block a user