Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 67037 invoked from network); 28 Feb 2007 02:13:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Feb 2007 02:13:01 -0000 Received: (qmail 80658 invoked by uid 500); 28 Feb 2007 02:13:08 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 80626 invoked by uid 500); 28 Feb 2007 02:13:08 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 80615 invoked by uid 99); 28 Feb 2007 02:13:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2007 18:13:08 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: 206.46.252.46 is neither permitted nor denied by domain of donovant@bellatlantic.net) Received: from [206.46.252.46] (HELO vms046pub.verizon.net) (206.46.252.46) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2007 18:12:56 -0800 Received: from [192.168.0.2] ([70.22.187.66]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JE5002X7I4HRRY4@vms046.mailsrvcs.net> for dev@apr.apache.org; Tue, 27 Feb 2007 20:12:17 -0600 (CST) Date: Tue, 27 Feb 2007 21:12:16 -0500 From: Tom Donovan Subject: Re: [PATCH] DBD drivers as DSOs To: dev@apr.apache.org Reply-to: Tom.Donovan@acm.org Message-id: <45E4E500.8090804@bellatlantic.net> MIME-version: 1.0 Content-type: multipart/mixed; boundary=------------090302020202090708080402 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------090302020202090708080402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm puzzled by the implicit rule in apr_dbd.c that if one or more static dbd drivers are configured, dso drivers aren't allowed. Also by the fact that dso dbd drivers need to be explicitly enabled. Now that it works to have several different dbd drivers loaded, this seems unnecessarily restrictive. It makes more sense to me to always allow dso dbd drivers if the platform supports dso and the driver name is not already in the 'drivers' hash. Static drivers would, of course, get in there first and take precedence. This patch to 1.3 works for me on Windows. I haven't tried it on Unix yet. It dispenses with the whole --enable-dbd-dso/APU_DSO_BUILD thing and just enables dso dbd drivers if dso is enabled - regardless of whether there are any static dbd drivers or not. I hope I'm missing something here, or else I wish I brought this point up before all the work went into changing the build. Alas, I just started looking at the dbd thing in the last few days. -tom- --------------090302020202090708080402 Content-Type: text/plain; name="patch_apr_dbd_dso_trunk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch_apr_dbd_dso_trunk.diff" --- apr-util/dbd/apr_dbd.c_512324 2007-02-27 12:10:30.460285600 -0500 +++ apr-util/dbd/apr_dbd.c 2007-02-27 13:14:19.218906600 -0500 @@ -53,7 +53,6 @@ } #endif -#ifndef APU_DSO_BUILD #define DRIVER_LOAD(name,driver,pool) \ { \ extern const apr_dbd_driver_t driver; \ @@ -62,7 +61,6 @@ driver.init(pool); \ } \ } -#endif static apr_status_t apr_dbd_term(void *ptr) { @@ -92,7 +90,6 @@ /* This already registers a pool cleanup */ #endif -#ifndef APU_DSO_BUILD /* Load statically-linked drivers: */ #if APU_HAVE_MYSQL DRIVER_LOAD("mysql", apr_dbd_mysql_driver, pool); @@ -112,12 +109,11 @@ #if APU_HAVE_SOME_OTHER_BACKEND DRIVER_LOAD("firebird", apr_dbd_other_driver, pool); #endif -#endif /* APU_DSO_BUILD */ return ret; } -#if defined(APU_DSO_BUILD) && APR_HAS_THREADS +#if defined(APR_HAS_DSO) && APR_HAS_THREADS #define dbd_drivers_lock(m) apr_thread_mutex_lock(m) #define dbd_drivers_unlock(m) apr_thread_mutex_unlock(m) #else @@ -128,7 +124,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, const apr_dbd_driver_t **driver) { -#ifdef APU_DSO_BUILD +#ifdef APR_HAS_DSO char path[80]; apr_dso_handle_t *dlhandle = NULL; apr_dso_handle_sym_t symbol; @@ -146,7 +142,7 @@ return APR_SUCCESS; } -#ifdef APU_DSO_BUILD +#ifdef APR_HAS_DSO #ifdef WIN32 sprintf(path, "apr_dbd_%s.dll", name); --------------090302020202090708080402--