ebb62867fb
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
...
advantage of per-module loglevels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
fadce7cbef
Switch mod_dbd to using APR_STATUS_IS_foo macros in error handling
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@806692 13f79535-47bb-0310-9956-ffa450edef68
2009-08-21 19:40:17 +00:00
e1ce763c78
Fix module scope, to avoid this, copy and past from loadable modules, not core
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@767806 13f79535-47bb-0310-9956-ffa450edef68
2009-04-23 05:38:45 +00:00
b3d0dfcab3
mod_dbd: add DBDInitSQL command. PR 46827
...
Patch by Marko Kevac.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@766938 13f79535-47bb-0310-9956-ffa450edef68
2009-04-21 01:29:15 +00:00
0cfc4a278e
* modules/database/mod_dbd.c
...
(dbd_child_init): New function, wrapper around dbd_setup_init.
(dbd_hooks): Call dbd_child_init instead of casting dbd_setup_init.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708820 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 08:10:21 +00:00
f682b795c7
Fix typo in r689224 (thanks rpluem for spotting it)
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@689246 13f79535-47bb-0310-9956-ffa450edef68
2008-08-26 21:40:29 +00:00
4fb3f96388
Try to get a meaningful error message when dbd_open fails
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@689224 13f79535-47bb-0310-9956-ffa450edef68
2008-08-26 21:03:46 +00:00
d8672172fd
Revert prior change; some of these are registered
...
and therefore the wrong declspec. But why is the
question, and this should be reviewed before release.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664160 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 22:21:07 +00:00
d8998ab2a7
No.
...
_NONSTD refers to type fn (arg, arg, ...) incomplete declarations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664080 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 18:56:13 +00:00
31735f8fe9
Handle integer configuration directive parameters with a dedicated
...
function, akin to dbd_param_flag(). Only needed when APR_HAS_THREADS.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646453 13f79535-47bb-0310-9956-ffa450edef68
2008-04-09 18:01:53 +00:00
b6a0e58749
reverted r553031 since it breaks Linux/Unix platform builds.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@553563 13f79535-47bb-0310-9956-ffa450edef68
2007-07-05 17:10:43 +00:00
be9ce1e0a1
changed error message to use APU_DBD_DRIVER_FMT for correct driver name;
...
removed platform ifdefs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@553031 13f79535-47bb-0310-9956-ffa450edef68
2007-07-04 01:03:48 +00:00
af98980f19
apr_dbd_check_conn() just returns APR_SUCCESS or APR_EGENERAL, so we
...
don't actually have a driver-specific value to pass to apr_dbd_error(),
but that's OK because most/all drivers just ignore this value anyway
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539687 13f79535-47bb-0310-9956-ffa450edef68
2007-05-19 05:01:44 +00:00
5679e48e5a
added proper error message for NetWare.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@521230 13f79535-47bb-0310-9956-ffa450edef68
2007-03-22 11:58:20 +00:00
11e2a1a700
Introduce configuration groups to allow inheritance by virtual hosts of
...
database configurations from the main server. The post_config hook function
determines the minimal set of distinct configurations necessary so that
database connection pools are shared between virtual hosts whenever possible.
The SQL statements which should be prepared for each database connection
are now stored in a hash for each virtual host during the configuration
phase, and these hashes are merged in the normal manner using
apr_hash_overlay() with that of the main server. This allows for statements
to be de-registered by DBDPrepareSQL, if desired. The post_config hook
function then compares the statements registered for each virtual host
when determining if a separate configuration group is required. The
changes in r424798, r432560, r432562, and r466641, which still have problems
with configuration inheritance, are therefore no longer necessary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@503931 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 00:25:15 +00:00
3d26090bc7
We now create memory sub-pools for each DB connection and close DB
...
connections in a pool cleanup function. This simplifies the ap_dbd_acquire()
and ap_dbd_cacquire() functions, and also stops us from leaking ap_dbd_t
structures when using reslists.
We ensure that prepared statements are destroyed before their DB connection
is closed, in case any drivers would have problems cleaning up prepared
statements after the DB connection is closed.
The combination of reslists and memory pool cleanup functions was causing
segfaults when child processes exited, as reported in PR 39985. To prevent
this, we register dbd_destroy() as a cleanup that will execute prior to
the internal cleanup function registered by apr_reslist_create(). When the
reslist's memory pool is destroyed, dbd_destroy() informs dbd_destruct() not
to do anything when subsequently called by the reslist's internal cleanup
function.
We avoid the use of s->process->pool (the global pool) since it isn't
destroyed by exiting child processes in most multi-process MPMs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@496831 13f79535-47bb-0310-9956-ffa450edef68
2007-01-16 19:36:26 +00:00
1ec60b4325
Fix several strict compiler warnings for both the threaded
...
and non-threaded versions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@492394 13f79535-47bb-0310-9956-ffa450edef68
2007-01-04 03:12:48 +00:00
bf27d1a354
Handle error conditions in dbd_construct() properly. Simplify
...
ap_dbd_open() and use correct arguments to apr_dbd_error() when
non-threaded. Register correct cleanup data in non-threaded
ap_dbd_acquire() and ap_dbd_cacquire(). Clean up configuration data
and merge function. Use ap_log_error() wherever possible.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@491884 13f79535-47bb-0310-9956-ffa450edef68
2007-01-02 18:26:00 +00:00
89d7aeea28
Rename functions and variables for consistency, and move some functions
...
around for readability, prior to forthcoming functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@491729 13f79535-47bb-0310-9956-ffa450edef68
2007-01-02 01:19:21 +00:00
090e7a6d73
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
2006-12-10 23:38:05 +00:00
f9a951b5d4
* Add the missing include of http_request.h and thus fix a compiler warning.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@483630 13f79535-47bb-0310-9956-ffa450edef68
2006-12-07 19:47:18 +00:00
29121126c5
Stash DBD connections in request_config of initial request
...
only, or else sub-requests and internal redirections may cause
entire DBD pool to be stashed in a single HTTP request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481509 13f79535-47bb-0310-9956-ffa450edef68
2006-12-02 06:25:07 +00:00
1edf74155f
mod_dbd: Key the storage of prepared statements on the hex string
...
value of server_rec, rather than the server name, as the server name
may change (eg when the server name is set) at any time, causing
weird behaviour in modules dependent on mod_dbd.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@466641 13f79535-47bb-0310-9956-ffa450edef68
2006-10-22 13:31:25 +00:00
5c94bb0140
Log a message if we try to prepare a statement not attached to a hostname.
...
This fix supplements r432560 (don't crash).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@432562 13f79535-47bb-0310-9956-ffa450edef68
2006-08-18 12:38:28 +00:00
07e5187677
Don't use NULL s->server_hostname as hash lookup key.
...
Reported by paritosh (at limewire.co.in) on dev@httpd (thread
Re: apache 2.2 crashes at the start time in mod_dbd.c then preparing AuthDBDUserPWQuery)
Fixed by paritosh and Yours Truly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@432560 13f79535-47bb-0310-9956-ffa450edef68
2006-08-18 12:16:13 +00:00
4d0960edaf
Remove dependence on server config from ap_dbd_prepare, as that may
...
be called in per-directory config functions where there is no
server context causing segfault.
Discussion at
http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/ <831327593.20060720023332%40engec.ru>
and subsequent thread.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@424798 13f79535-47bb-0310-9956-ffa450edef68
2006-07-23 20:22:57 +00:00
de659cbed0
update license header text
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
04109c6452
PR#39761
...
Make the error message more meaningful when DBD is configured
without a driver.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@413015 13f79535-47bb-0310-9956-ffa450edef68
2006-06-09 11:15:41 +00:00
813eb9b9c7
PR#39386: Fix merge-config to support prepared statements (Brian J. France)
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@396310 13f79535-47bb-0310-9956-ffa450edef68
2006-04-23 19:59:23 +00:00
31eb7ed8c1
Log a better error message if initialisation fails on prepared statements.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@386321 13f79535-47bb-0310-9956-ffa450edef68
2006-03-16 12:47:53 +00:00
05cec364c7
Improve defaults from 'test' values (and get meaningful errors on
...
startup if database is down); trivial tidyups.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@354400 13f79535-47bb-0310-9956-ffa450edef68
2005-12-06 10:54:57 +00:00
0acff75150
Optional functions are of __cdecl the kind on win32, due to "APU_DECLARE_NONSTD
...
apr_dynamic_fn_register" from apr-util, so we can't use __stdcall. Declare our
functions as non-std.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@349768 13f79535-47bb-0310-9956-ffa450edef68
2005-11-29 17:27:02 +00:00
6dac445844
Give DBD a set of _DECLARE macros consistent with other modules, so that
...
_EXPORT and _STATIC and be turned on/off more easily.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@349752 13f79535-47bb-0310-9956-ffa450edef68
2005-11-29 16:37:49 +00:00
512ffac2c1
PR#37553
...
Redesign of pools handling in mod_dbd
Submitted: Chris Darroch, Reviewed: Nick Kew
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@348026 13f79535-47bb-0310-9956-ffa450edef68
2005-11-21 23:41:44 +00:00
74e4bf0209
Wrap exported functions in AP_DECLARE
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@348008 13f79535-47bb-0310-9956-ffa450edef68
2005-11-21 23:01:49 +00:00
54c8162ce5
Add defaults and comments for better robustness against misuse
...
(based on comments from Chris Darroch).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@345128 13f79535-47bb-0310-9956-ffa450edef68
2005-11-16 21:20:33 +00:00
dcb0ab5158
Fix (Chris Darroch) to register cleanup for persistent connection
...
in the no-threads case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@345040 13f79535-47bb-0310-9956-ffa450edef68
2005-11-16 15:30:32 +00:00
3995bb8737
Fix driver-dependent potential memor-use bug in preparing statements
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@344140 13f79535-47bb-0310-9956-ffa450edef68
2005-11-14 15:06:07 +00:00
b87b4fa9a0
Work if check_conn is NOTIMPL in a driver
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332142 13f79535-47bb-0310-9956-ffa450edef68
2005-11-09 21:12:45 +00:00
7d8187cc83
Support dbd connections tied to the conn_rec.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@307439 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 14:19:22 +00:00
cd3937b2d2
Fix pool in dbd_construct, and set sensible config defaults
...
(based on feedback from Brian France)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@292769 13f79535-47bb-0310-9956-ffa450edef68
2005-09-30 15:26:45 +00:00
7f9e4fa4f9
Add note on DBD APIs to Module Developer Changes in new_features.
...
Update cast in mod_dbd.c as suggested by jorton.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291100 13f79535-47bb-0310-9956-ffa450edef68
2005-09-23 10:56:07 +00:00
63518050d4
Eliminate possible compiler warnings pointed out by Joe.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@290711 13f79535-47bb-0310-9956-ffa450edef68
2005-09-21 14:29:57 +00:00
535d0ab956
Move mod_dbd from /experimental/ to /database/
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@290672 13f79535-47bb-0310-9956-ffa450edef68
2005-09-21 10:04:00 +00:00