You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2006/12/12 15:17:18 UTC

svn commit: r486157 - in /httpd/httpd/branches/2.2.x: STATUS modules/database/mod_dbd.c

Author: jim
Date: Tue Dec 12 06:17:17 2006
New Revision: 486157

URL: http://svn.apache.org/viewvc?view=rev&rev=486157
Log:
Merge r485311 from trunk:

Stop mod_dbd emitting bogus error messages when it's loaded
but not configured.

Submitted by: niq
Reviewed by: jim

Modified:
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/database/mod_dbd.c

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?view=diff&rev=486157&r1=486156&r2=486157
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Tue Dec 12 06:17:17 2006
@@ -79,11 +79,6 @@
   [ 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.

Modified: httpd/httpd/branches/2.2.x/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/database/mod_dbd.c?view=diff&rev=486157&r1=486156&r2=486157
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/database/mod_dbd.c (original)
+++ httpd/httpd/branches/2.2.x/modules/database/mod_dbd.c Tue Dec 12 06:17:17 2006
@@ -361,6 +361,15 @@
     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 @@
     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);
@@ -479,6 +494,12 @@
     const char *errmsg;
     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 */