]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Sync module moves (dbd, filter, charset_lite) and dbd updates with trunk
authorNick Kew <niq@apache.org>
Sun, 9 Oct 2005 14:31:40 +0000 (14:31 +0000)
committerNick Kew <niq@apache.org>
Sun, 9 Oct 2005 14:31:40 +0000 (14:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@307440 13f79535-47bb-0310-9956-ffa450edef68

19 files changed:
Apache.dsw
CHANGES
modules/NWGNUmakefile
modules/README
modules/database/Makefile.in [new file with mode: 0644]
modules/database/NWGNUmakefile [new file with mode: 0644]
modules/database/config.m4 [new file with mode: 0644]
modules/database/mod_dbd.c [moved from modules/experimental/mod_dbd.c with 90% similarity]
modules/database/mod_dbd.h [moved from modules/experimental/mod_dbd.h with 87% similarity]
modules/experimental/NWGNUmakefile
modules/experimental/config.m4
modules/filters/NWGNUcharsetl [moved from modules/experimental/NWGNUcharsetl with 100% similarity]
modules/filters/NWGNUmakefile
modules/filters/NWGNUmod_filter [moved from modules/experimental/NWGNUmod_filter with 100% similarity]
modules/filters/config.m4
modules/filters/mod_charset_lite.c [moved from modules/experimental/mod_charset_lite.c with 100% similarity]
modules/filters/mod_charset_lite.dsp [moved from modules/experimental/mod_charset_lite.dsp with 100% similarity]
modules/filters/mod_charset_lite.exp [moved from modules/experimental/mod_charset_lite.exp with 100% similarity]
modules/filters/mod_filter.c [moved from modules/experimental/mod_filter.c with 100% similarity]

index c4ecec642366450d5b82777a1fc9036f4089c97e..c99e624567c9105adc706b01436397427ec1f5dc 100644 (file)
@@ -1044,7 +1044,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "mod_charset_lite"=.\modules\experimental\mod_charset_lite.dsp - Package Owner=<4>
+Project: "mod_charset_lite"=.\modules\filters\mod_charset_lite.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
diff --git a/CHANGES b/CHANGES
index a2e9e70caa7e6f5dafcb6f659e7755b247f013e1..603122c5fe39dafc789d5dfc5a6ede5c3d0fe75e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,14 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.1.9
 
+  *) Support dbd connection tied to conn_rec in mod_dbd [Nick Kew]
+
+  *) Fix use of pools in mod_dbd [Brian J France, Nick Kew]
+
+  *) Move mod_dbd to modules/database [Nick Kew]
+
+  *) Move mod_filter and mod_charset_lite to modules/filters [Nick Kew]
+
   *) mod_proxy_ajp: mod_proxy_ajp sends empty SSL attributes for non SSL
      connections. PR36883.
      [William Barker <william.barker wilshire.com>, Ruediger Pluem]
index 57387949b23a0842eb83a0098340e85b40359a3f..1bcbf7db7723ca10a1cfba90345f35391b8c76d5 100644 (file)
@@ -17,6 +17,7 @@ SUBDIRS = \
        metadata \
        proxy \
        filters \
+       database \
        $(EOLIST) 
 
 # If LDAPSDK has been defined then build the util_ldap module
index eab7067e0d02a694e27540f2053c7c06d430f4cf..f4d5549dbe3582f1ed5e1916562258d14d87c973 100644 (file)
@@ -10,6 +10,9 @@ cache/
   This directory houses modules that implement file and data caching
   capability.
 
+database/
+  The apache DBD framework manages connections to SQL backends efficiently.
+
 dav/
   This directory houses modules that implement WebDAV functionality.
 
diff --git a/modules/database/Makefile.in b/modules/database/Makefile.in
new file mode 100644 (file)
index 0000000..7c5c149
--- /dev/null
@@ -0,0 +1,3 @@
+# a modules Makefile has no explicit targets -- they will be defined by
+# whatever modules are enabled. just grab special.mk to deal with this.
+include $(top_srcdir)/build/special.mk
diff --git a/modules/database/NWGNUmakefile b/modules/database/NWGNUmakefile
new file mode 100644 (file)
index 0000000..9715dda
--- /dev/null
@@ -0,0 +1,261 @@
+#
+# Declare the sub-directories to be built here
+#
+
+SUBDIRS = \
+       $(EOLIST) 
+
+#
+# Get the 'head' of the build environment.  This includes default targets and
+# paths to tools
+#
+
+include $(AP_WORK)\build\NWGNUhead.inc
+
+#
+# build this level's files
+
+#
+# Make sure all needed macro's are defined
+#
+
+#
+# These directories will be at the beginning of the include list, followed by
+# INCDIRS
+#
+XINCDIRS       += \
+                       $(AP_WORK)/include \
+                       $(NWOS) \
+                       $(AP_WORK)/modules/arch/netware \
+                       $(APR)/include \
+                       $(APRUTIL)/include \
+                       $(APR) \
+                       $(EOLIST)
+
+#
+# These flags will come after CFLAGS
+#
+XCFLAGS                += \
+                       -prefix pre_nw.h \
+                       $(EOLIST)
+
+#
+# These defines will come after DEFINES
+#
+XDEFINES       += \
+                       $(EOLIST)
+
+#
+# These flags will be added to the link.opt file
+#
+XLFLAGS                += \
+                       $(EOLIST)
+
+#
+# These values will be appended to the correct variables based on the value of
+# RELEASE
+#
+ifeq "$(RELEASE)" "debug"
+XINCDIRS       += \
+                       $(EOLIST)
+
+XCFLAGS                += \
+                       $(EOLIST)
+
+XDEFINES       += \
+                       $(EOLIST)
+
+XLFLAGS                += \
+                       $(EOLIST)
+endif
+
+ifeq "$(RELEASE)" "noopt"
+XINCDIRS       += \
+                       $(EOLIST)
+
+XCFLAGS                += \
+                       $(EOLIST)
+
+XDEFINES       += \
+                       $(EOLIST)
+
+XLFLAGS                += \
+                       $(EOLIST)
+endif
+
+ifeq "$(RELEASE)" "release"
+XINCDIRS       += \
+                       $(EOLIST)
+
+XCFLAGS                += \
+                       $(EOLIST)
+
+XDEFINES       += \
+                       $(EOLIST)
+
+XLFLAGS                += \
+                       $(EOLIST)
+endif
+
+#
+# These are used by the link target if an NLM is being generated
+# This is used by the link 'name' directive to name the nlm.  If left blank
+# TARGET_nlm (see below) will be used.
+#
+NLM_NAME               = moddbd
+
+#
+# This is used by the link '-desc ' directive. 
+# If left blank, NLM_NAME will be used.
+#
+NLM_DESCRIPTION        = Apache $(VERSION_STR) DBD Module
+
+#
+# This is used by the '-threadname' directive.  If left blank,
+# NLM_NAME Thread will be used.
+#
+NLM_THREAD_NAME        = DBD Module
+
+#
+# If this is specified, it will override VERSION value in 
+# $(AP_WORK)\build\NWGNUenvironment.inc
+#
+NLM_VERSION            =
+
+#
+# If this is specified, it will override the default of 64K
+#
+NLM_STACK_SIZE = 8192
+
+
+#
+# If this is specified it will be used by the link '-entry' directive
+#
+NLM_ENTRY_SYM  = _LibCPrelude
+
+#
+# If this is specified it will be used by the link '-exit' directive
+#
+NLM_EXIT_SYM   = _LibCPostlude
+
+#
+# If this is specified it will be used by the link '-check' directive
+#
+NLM_CHECK_SYM  =
+
+#
+# If these are specified it will be used by the link '-flags' directive
+#
+NLM_FLAGS              =  AUTOUNLOAD, PSEUDOPREEMPTION
+
+#
+# If this is specified it will be linked in with the XDCData option in the def 
+# file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
+# by setting APACHE_UNIPROC in the environment
+#
+XDCDATA         = 
+
+#
+# If there is an NLM target, put it here
+#
+TARGET_nlm = \
+       $(OBJDIR)/moddbd.nlm \
+       $(EOLIST)
+
+#
+# If there is an LIB target, put it here
+#
+TARGET_lib = \
+       $(EOLIST)
+
+#
+# These are the OBJ files needed to create the NLM target above.
+# Paths must all use the '/' character
+#
+FILES_nlm_objs = \
+       $(OBJDIR)/mod_dbd.o \
+       $(EOLIST)
+
+#
+# These are the LIB files needed to create the NLM target above.
+# These will be added as a library command in the link.opt file.
+#
+FILES_nlm_libs = \
+       libcpre.o \
+       $(EOLIST)
+
+#
+# These are the modules that the above NLM target depends on to load.
+# These will be added as a module command in the link.opt file.
+#
+FILES_nlm_modules = \
+       aprlib \
+       libc \
+       $(EOLIST)
+
+#
+# If the nlm has a msg file, put it's path here
+#
+FILE_nlm_msg =
+#
+# If the nlm has a hlp file put it's path here
+#
+FILE_nlm_hlp =
+
+#
+# If this is specified, it will override $(NWOS)\copyright.txt.
+#
+FILE_nlm_copyright =
+
+#
+# Any additional imports go here
+#
+FILES_nlm_Ximports = \
+       @$(APR)/aprlib.imp \
+       @$(NWOS)/httpd.imp \
+       @libc.imp \
+       $(EOLIST)
+#   
+# Any symbols exported to here
+#
+FILES_nlm_exports = \
+       dbd_module \
+       $(EOLIST)
+       
+#   
+# These are the OBJ files needed to create the LIB target above.
+# Paths must all use the '/' character
+#
+FILES_lib_objs = \
+               $(EOLIST)
+
+#
+# implement targets and dependancies (leave this section alone)
+#
+
+libs :: $(OBJDIR) $(TARGET_lib)
+
+nlms :: libs $(TARGET_nlm)
+
+#
+# Updated this target to create necessary directories and copy files to the 
+# correct place.  (See $(AP_WORK)\build\NWGNUhead.inc for examples)
+#
+install :: nlms FORCE
+       copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.*
+
+#
+# Any specialized rules here
+#
+
+#
+# Include the 'tail' makefile that has targets that depend on variables defined
+# in this makefile
+#
+
+include $(AP_WORK)\build\NWGNUtail.inc
+
+
+       
diff --git a/modules/database/config.m4 b/modules/database/config.m4
new file mode 100644 (file)
index 0000000..ab2f941
--- /dev/null
@@ -0,0 +1,6 @@
+
+APACHE_MODPATH_INIT(database)
+
+APACHE_MODULE(dbd, Apache DBD Framework, , , most)
+
+APACHE_MODPATH_FINISH
similarity index 90%
rename from modules/experimental/mod_dbd.c
rename to modules/database/mod_dbd.c
index bdf78176b2edb763876904127129f871f7346a87..fff0e4b2cb590a97dbc1bbdee9bed1ca98a84837 100644 (file)
@@ -420,6 +420,29 @@ ap_dbd_t *ap_dbd_acquire(request_rec *r)
     }
     return req->conn;
 }
+ap_dbd_t *ap_dbd_cacquire(conn_rec *c)
+{
+    svr_cfg *svr;
+    dbd_pool_rec *req = ap_get_module_config(c->conn_config, &dbd_module);
+    if (!req) {
+        req = apr_palloc(c->pool, sizeof(dbd_pool_rec));
+        req->conn = ap_dbd_open(c->pool, c->base_server);
+        if (req->conn) {
+            svr = ap_get_module_config(c->base_server->module_config, &dbd_module);
+            ap_set_module_config(c->conn_config, &dbd_module, req);
+            if (svr->persist) {
+                req->dbpool = svr->dbpool;
+                apr_pool_cleanup_register(c->pool, req, dbd_release,
+                                          apr_pool_cleanup_null);
+            }
+            else {
+                apr_pool_cleanup_register(c->pool, req->conn, dbd_close,
+                                          apr_pool_cleanup_null);
+            }
+        }
+    }
+    return req->conn;
+}
 #else
 ap_dbd_t *ap_dbd_acquire(request_rec *r)
 {
@@ -428,7 +451,7 @@ ap_dbd_t *ap_dbd_acquire(request_rec *r)
     if (!ret) {
         svr = ap_get_module_config(r->server->module_config, &dbd_module);
         ret = ap_dbd_open(r->pool, r->server);
-        if ( ret ) {
+        if (ret) {
             ap_set_module_config(r->request_config, &dbd_module, ret);
             if (!svr->persist) {
                 apr_pool_cleanup_register(r->pool, svr->conn, dbd_close,
@@ -439,6 +462,24 @@ ap_dbd_t *ap_dbd_acquire(request_rec *r)
     }
     return ret;
 }
+ap_dbd_t *ap_dbd_cacquire(conn_rec *c)
+{
+    svr_cfg *svr;
+    ap_dbd_t *ret = ap_get_module_config(c->conn_config, &dbd_module);
+    if (!ret) {
+        svr = ap_get_module_config(c->base_server->module_config, &dbd_module);
+        ret = ap_dbd_open(c->pool, c->base_server);
+        if (ret) {
+            ap_set_module_config(c->conn_config, &dbd_module, ret);
+            if (!svr->persist) {
+                apr_pool_cleanup_register(c->pool, svr->conn, dbd_close,
+                                          apr_pool_cleanup_null);
+            }
+            /* if persist then dbd_open registered cleanup on proc pool */
+        }
+    }
+    return ret;
+}
 #endif
 
 static void dbd_hooks(apr_pool_t *pool)
@@ -449,6 +490,7 @@ static void dbd_hooks(apr_pool_t *pool)
     APR_REGISTER_OPTIONAL_FN(ap_dbd_open);
     APR_REGISTER_OPTIONAL_FN(ap_dbd_close);
     APR_REGISTER_OPTIONAL_FN(ap_dbd_acquire);
+    APR_REGISTER_OPTIONAL_FN(ap_dbd_cacquire);
     APR_REGISTER_OPTIONAL_FN(ap_dbd_prepare);
     apr_dbd_init(pool);
 }
similarity index 87%
rename from modules/experimental/mod_dbd.h
rename to modules/database/mod_dbd.h
index 252981367c76792fc856c1b17ef363432b49a21c..f98df9948e19ab66f213141390e6111124a34629 100644 (file)
@@ -58,6 +58,12 @@ AP_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*);
  */
 AP_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*);
 
+/* acquire a connection that will have the lifetime of a connection
+ * and MUST NOT be explicitly closed.  Return NULL on error.
+ * This is the preferred function for most applications.
+ */
+AP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*);
+
 /* Prepare a statement for use by a client module */
 AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
 
@@ -65,6 +71,7 @@ AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
 APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_open, (apr_pool_t*, server_rec*));
 APR_DECLARE_OPTIONAL_FN(void, ap_dbd_close, (server_rec*, ap_dbd_t*));
 APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_acquire, (request_rec*));
+APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_cacquire, (conn_rec*));
 APR_DECLARE_OPTIONAL_FN(void, ap_dbd_prepare, (server_rec*, const char*, const char*));
 
 #endif
index d6e1337a29f611154d318710be7321d4b648c5bb..78e453e99011b69132557cffb0e92023b9931da0 100644 (file)
@@ -152,9 +152,7 @@ XDCDATA         =
 # If there is an NLM target, put it here
 #
 TARGET_nlm = \
-       $(OBJDIR)/charsetl.nlm \
        $(OBJDIR)/example.nlm \
-       $(OBJDIR)/mod_filter.nlm \
        $(EOLIST)
        
 #
index c5bfacd6dbf538a8d4d90343d9e98bc62a7f0931..317c48f2b685dc6ebd483046cea90235939365e0 100644 (file)
@@ -1,17 +1,8 @@
 
 APACHE_MODPATH_INIT(experimental)
 
-if test "$ac_cv_ebcdic" = "yes"; then
-# mod_charset_lite can be very useful on an ebcdic system, 
-#   so include it by default
-    APACHE_MODULE(charset_lite, character set translation, , , yes)
-else
-    APACHE_MODULE(charset_lite, character set translation, , , no)
-fi
-
 APACHE_MODULE(example, example and demo module, , , no)
 APACHE_MODULE(case_filter, example uppercase conversion filter, , , no)
 APACHE_MODULE(case_filter_in, example uppercase conversion input filter, , , no)
-APACHE_MODULE(filter, smart filtering module, , , no)
 
 APACHE_MODPATH_FINISH
index c8509428eb642d93fc87b98a996a5def34ae111e..33e48a2595717c1185a77e99db7d652c6cecffe4 100644 (file)
@@ -153,6 +153,8 @@ XDCDATA         =
 #
 TARGET_nlm = \
        $(OBJDIR)/extfiltr.nlm \
+       $(OBJDIR)/charsetl.nlm \
+       $(OBJDIR)/mod_filter.nlm \
        $(EOLIST)
        
 # If the zlib libraries source exists then build the mod_deflate module
index a481e4037004a8ad0ffe7a7e5536e119cdeffdef..c9c8f386c9eb4a3b020fbbfb23feab485a6a9019 100644 (file)
@@ -6,6 +6,16 @@ APACHE_MODPATH_INIT(filters)
 
 APACHE_MODULE(ext_filter, external filter module, , , most)
 APACHE_MODULE(include, Server Side Includes, , , yes)
+APACHE_MODULE(filter, Smart Filtering, , , yes)
+
+if test "$ac_cv_ebcdic" = "yes"; then
+# mod_charset_lite can be very useful on an ebcdic system,
+#   so include it by default
+    APACHE_MODULE(charset_lite, character set translation, , , yes)
+else
+    APACHE_MODULE(charset_lite, character set translation, , , no)
+fi
+
 
 APACHE_MODULE(deflate, Deflate transfer encoding support, , , most, [
   AC_ARG_WITH(z, APACHE_HELP_STRING(--with-z=DIR,use a specific zlib library),