]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r485311 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 12 Dec 2006 14:17:17 +0000 (14:17 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 12 Dec 2006 14:17:17 +0000 (14:17 +0000)
Stop mod_dbd emitting bogus error messages when it's loaded
but not configured.

Submitted by: niq
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@486157 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/database/mod_dbd.c

diff --git a/STATUS b/STATUS
index e447037e8885e7c970352588b24dab4e296afd6d..25f1781056e4ce66182ae25c26fe49e96a6e6d54 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,11 +79,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
 
-   * mod_dbd: Don't try to set up a connection pool (and emit bogus
-              error messages) when DBD isn't configured.
-     http://svn.apache.org/viewvc?view=rev&revision=485311
-     +1: niq, rpluem, jim
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 
     * mpm_winnt: Fix return values from wait_for_many_objects.
index e5409a3b6fc0867573c4514f615270a274d6f8d7..4df4f4b65b4c1bc4220c4c3b01131471b1cbd48c 100644 (file)
@@ -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);
     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) {
         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;
     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) {
         /* Return a once-only connection */
         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;
     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) {
         /* Return a once-only connection */
         rv = dbd_construct(&rec, svr, s->process->pool);