summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG10
-rw-r--r--Makefile.in51
-rwxr-xr-xautogen.sh6
-rw-r--r--configure.ac54
-rw-r--r--mod_log_sql.c10
-rw-r--r--mod_log_sql.h2
-rw-r--r--mod_log_sql_mysql.c1
7 files changed, 85 insertions, 49 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 919d2a6..bdbe8bc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,9 +1,13 @@
1?: ? 11.99: 2004-06-10
2* Added DBI support 2* Added DBI support (not completed yet)
3* fixed segfault in the mysql driver escape_string function 3* fixed segfault in the mysql driver escape_string function
4* fixed segfault when forcepreserve is set on.
4* switched escape_string driver function to include the string quotes. 5* switched escape_string driver function to include the string quotes.
6* On Database connection failure Database errors are printed at ERR loglevel
7 instead of debug
8* forgot to include build-apache(13|2).bat scripts in the distribution
5 9
61.98: 2004-04-12 101.98: 2004-05-12
7* re-fixed apache.m4 to better detect APR and APU code 11* re-fixed apache.m4 to better detect APR and APU code
8* fixed for win32 compilation under apache 2 12* fixed for win32 compilation under apache 2
9* lowered minumum required apache 2 version to 2.0.40 (RH9) 13* lowered minumum required apache 2 version to 2.0.40 (RH9)
diff --git a/Makefile.in b/Makefile.in
index 5b4f368..7e7ae94 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2,7 +2,6 @@
2 2
3# Modify these top variables. 3# Modify these top variables.
4SUBDIRS = docs contrib 4SUBDIRS = docs contrib
5SOURCES = @PACKAGE_NAME@.c
6 5
7HEADERS = mod_log_sql.h \ 6HEADERS = mod_log_sql.h \
8 functions.h \ 7 functions.h \
@@ -11,15 +10,21 @@ HEADERS = mod_log_sql.h \
11 apache13.h \ 10 apache13.h \
12 apache20.h 11 apache20.h
13 12
14CFLAGS = -Wc,-Wall -Wc,-Werror -Wc,-fno-strict-aliasing 13CFLAGS = -Wc,-Wall -Wc,-fno-strict-aliasing
15 14
16LDADD = @RT_LIBS@ 15ifeq (@OOO_MAINTAIN@,1)
17 16CFLAGS += -Wc,-Werror
18EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG 17endif
19 18
20TARGET = @PACKAGE_NAME@@APXS_EXTENSION@ 19EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG \
20 build-apache13.bat build-apache2.bat
21 21
22TARGETS = $(TARGET) 22coreSOURCES = @PACKAGE_NAME@.c
23coreTARGET = @PACKAGE_NAME@@APXS_EXTENSION@
24coreLDADD = @RT_LIBS@
25coreCFLAGS =
26coreNAME = log_sql
27TARGETS = $(coreTARGET)
23 28
24sslSOURCES = @PACKAGE_NAME@_ssl.c 29sslSOURCES = @PACKAGE_NAME@_ssl.c
25sslTARGET = @PACKAGE_NAME@_ssl@APXS_EXTENSION@ 30sslTARGET = @PACKAGE_NAME@_ssl@APXS_EXTENSION@
@@ -68,11 +73,14 @@ PROVIDERS_SUBDIRS = @subdirs@
68srcdir = @abs_srcdir@ 73srcdir = @abs_srcdir@
69builddir = @abs_builddir@ 74builddir = @abs_builddir@
70 75
71OBJ = $(SOURCES:.c=.o) $(sslSOURCES:.c=.o) $(mysqlSOURCES:.c=.o) 76OBJ = $(SOURCES:.c=.o) $(sslSOURCES:.c=.o) $(mysqlSOURCES:.c=.o) \
77 $(dbiSOURCES:.c=.o) $(pgsqlSOURCES:.c=.o)
72 78
73LO = $(SOURCES:.c=.lo) $(sslSOURCES:.c=.lo) $(mysqlSOURCES:.c=.lo) 79LO = $(SOURCES:.c=.lo) $(sslSOURCES:.c=.lo) $(mysqlSOURCES:.c=.lo) \
80 $(dbiSOURCES:.c=.lo) $(pgsqlSOURCES:.c=.lo)
74 81
75SLO = $(SOURCES:.c=.slo) $(sslSOURCES:.c=.slo) $(mysqlSOURCES:.c=.slo) 82SLO = $(SOURCES:.c=.slo) $(sslSOURCES:.c=.slo) $(mysqlSOURCES:.c=.slo) \
83 $(dbiSOURCES:.c=.slo) $(pgsqlSOURCES:.c=.slo)
76 84
77STD_DIST = install-sh \ 85STD_DIST = install-sh \
78 config.sub \ 86 config.sub \
@@ -84,8 +92,8 @@ STD_DIST = install-sh \
84 stamp-h.in \ 92 stamp-h.in \
85 config.h.in 93 config.h.in
86 94
87DISTFILES = $(STD_DIST) $(EXTRA_DIST) $(SOURCES) $(HEADERS) \ 95DISTFILES = $(STD_DIST) $(EXTRA_DIST) $(coreSOURCES) $(HEADERS) \
88 $(sslSOURCES) $(mysqlSOURCES) 96 $(sslSOURCES) $(mysqlSOURCES) $(pgsqlSOURCES) $(dbsqlSOURCES)
89 97
90all: $(TARGETS) all-subdirs 98all: $(TARGETS) all-subdirs
91 99
@@ -107,9 +115,9 @@ all-subdirs install-subdirs activate-subdirs clean-subdirs distclean-subdirs:
107TODO: TODO.in 115TODO: TODO.in
108 @./gen_todo.pl 116 @./gen_todo.pl
109 117
110$(TARGET): $(SOURCES) $(HEADERS) 118$(coreTARGET): $(coreSOURCES) $(HEADERS)
111 @@APXS_BIN@ -c -o $(TARGET) $(CFLAGS) \ 119 @@APXS_BIN@ -c -o $(coreTARGET) $(coreCFLAGS) $(CFLAGS) \
112 @DEFS@ @AP_DEFS@ $(LDADD) $(SOURCES) 120 @DEFS@ @AP_DEFS@ $(coreLDADD) $(coreSOURCES)
113 121
114$(sslTARGET): $(sslSOURCES) $(HEADERS) 122$(sslTARGET): $(sslSOURCES) $(HEADERS)
115 @@APXS_BIN@ -c -o $(sslTARGET) $(sslCFLAGS) $(CFLAGS) \ 123 @@APXS_BIN@ -c -o $(sslTARGET) $(sslCFLAGS) $(CFLAGS) \
@@ -128,8 +136,13 @@ $(dbiTARGET): $(dbiSOURCES) $(HEADERS)
128 @DEFS@ @AP_DEFS@ $(dbiLDADD) $(dbiSOURCES) 136 @DEFS@ @AP_DEFS@ $(dbiLDADD) $(dbiSOURCES)
129 137
130install: $(TARGETS) install-subdirs 138install: $(TARGETS) install-subdirs
131 @@APXS_BIN@ -i $(TARGET); \ 139 @@APXS_BIN@ -n $(coreNAME) -i $(coreTARGET); \
132 @APXS_BIN@ -n $(mysqlNAME) -i $(mysqlTARGET); \ 140 if test @WANT_MYSQL_MOD@ -eq 1; then \
141 @APXS_BIN@ -n $(mysqlNAME) -i $(mysqlTARGET); \
142 fi; \
143 if test @WANT_PGSQL_MOD@ -eq 1; then \
144 @APXS_BIN@ -n $(pgsqlNAME) -i $(pgsqlTARGET); \
145 fi; \
133 if test @WANT_DBI_MOD@ -eq 1; then \ 146 if test @WANT_DBI_MOD@ -eq 1; then \
134 @APXS_BIN@ -n $(dbiNAME) -i $(dbiTARGET); \ 147 @APXS_BIN@ -n $(dbiNAME) -i $(dbiTARGET); \
135 fi; \ 148 fi; \
@@ -152,9 +165,9 @@ install: $(TARGETS) install-subdirs
152 echo "*************************************************************************"; 165 echo "*************************************************************************";
153 166
154activate: activate-subdirs 167activate: activate-subdirs
155 @@APXS_BIN@ -i -a $(TARGET); \ 168 @@APXS_BIN@ -n $(coreNAME) -i -a $(coreTARGET); \
156 if test @WANT_SSL_MOD@ -eq 1; then \ 169 if test @WANT_SSL_MOD@ -eq 1; then \
157 @APXS_BIN@ -i -a $(sslTARGET); \ 170 @APXS_BIN@ -n $(sslNAME) -i -a $(sslTARGET); \
158 fi 171 fi
159 172
160clean: clean-subdirs 173clean: clean-subdirs
diff --git a/autogen.sh b/autogen.sh
index 78f11a7..9d8dbac 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,13 +1,13 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ -z $ACLOCAL ]; then 3if [ -z $ACLOCAL ]; then
4 ACLOCAL=aclocal-1.5 4 ACLOCAL=aclocal-1.7
5fi 5fi
6if [ -z $AUTOCONF ]; then 6if [ -z $AUTOCONF ]; then
7 AUTOCONF=autoconf-2.53 7 AUTOCONF=autoconf-2.57
8fi 8fi
9if [ -z $AUTOHEADER ]; then 9if [ -z $AUTOHEADER ]; then
10 AUTOHEADER=autoheader-2.53 10 AUTOHEADER=autoheader-2.57
11fi 11fi
12rm -rf autom4te-2.53.cache 12rm -rf autom4te-2.53.cache
13$ACLOCAL -I m4 13$ACLOCAL -I m4
diff --git a/configure.ac b/configure.ac
index d10ad4f..f2c0df2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,8 @@ AC_CONFIG_HEADERS(config.h)
6 6
7AC_CONFIG_SRCDIR(mod_log_sql.c) 7AC_CONFIG_SRCDIR(mod_log_sql.c)
8 8
9OOO_MAINTAIN_MODE
10
9dnl Add a test for a compiler. 11dnl Add a test for a compiler.
10AC_PROG_CC 12AC_PROG_CC
11 13
@@ -19,31 +21,31 @@ CHECK_APACHE($APACHE13_VERSION,$APACHE20_VERSION,
19 AC_MSG_ERROR([*** or Apache 2.0/2.1 version $APACHE20_VERSION or greater!]) 21 AC_MSG_ERROR([*** or Apache 2.0/2.1 version $APACHE20_VERSION or greater!])
20 ) 22 )
21 23
22CHECK_PATH_MYSQL(:, 24CHECK_PATH_MYSQL(
25 WANT_MYSQL_MOD=1,
23 AC_MSG_ERROR([*** Mysql client libraries not found!]) 26 AC_MSG_ERROR([*** Mysql client libraries not found!])
27 WANT_MYSQL_MOD=0
24 ) 28 )
29AC_SUBST(WANT_MYSQL_MOD)
30
31CHECK_PATH_LIBDBI(WANT_DBI_MOD=1,
32 AC_MSG_ERROR([** libDBI client libraries not found!])
33 WANT_DBI_MOD=0
34 )
35AC_SUBST(WANT_DBI_MOD)
36
37dnl to write, checking for pgsql libs
38WANT_PGSQL_MOD=0
39AC_SUBST(WANT_PGSQL_MOD)
40
25 41
26CHECK_PATH_MOD_SSL( 42CHECK_PATH_MOD_SSL(
27 AC_DEFINE(WANT_SSL_LOGGING,,[Define if we want to compile in SSL support.]) 43 AC_DEFINE(WANT_SSL_LOGGING,,[Define if we want to compile in SSL support.])
28 WANT_SSL_MOD=1, 44 WANT_SSL_MOD=1,
29 WANT_SSL_MOD=0 45 WANT_SSL_MOD=0
30 ) 46 )
31
32AC_SUBST(WANT_SSL_MOD) 47AC_SUBST(WANT_SSL_MOD)
33 48
34WANT_MYSQL_MOD=1
35AC_SUBST(WANT_MYSQL_MOD)
36WANT_PGSQL_MOD=0
37AC_SUBST(WANT_PGSQL_MOD)
38WANT_DBI_MOD=1
39DBI_LDFLAGS=""
40DBI_LIBS="-ldbi"
41DBI_CFLAGS=""
42AC_SUBST(DBI_LDFLAGS)
43AC_SUBST(DBI_LIBS)
44AC_SUBST(DBI_CFLAGS)
45AC_SUBST(WANT_DBI_MOD)
46
47case "$target" in 49case "$target" in
48 *-*-solaris* | *-*-osf* ) 50 *-*-solaris* | *-*-osf* )
49 if test $APACHE_VERSION -eq 1.3; then 51 if test $APACHE_VERSION -eq 1.3; then
@@ -70,10 +72,24 @@ contrib/Makefile)
70 72
71 73
72AC_MSG_RESULT([------------------------------------]) 74AC_MSG_RESULT([------------------------------------])
73AC_MSG_RESULT([Apache version : $AP_VERSION]) 75AC_MSG_RESULT([Apache version : $AP_VERSION])
74if test $WANT_SSL_MOD -eq 1; then 76if test $WANT_SSL_MOD -eq 1; then
75 AC_MSG_RESULT([SSL Support : yes]) 77 AC_MSG_RESULT([SSL Support : yes])
76else 78else
77 AC_MSG_RESULT([SSL Support : no]) 79 AC_MSG_RESULT([SSL Support : no])
78 AC_MSG_RESULT([*** Use --enable-ssl to enable SSL support]) 80 AC_MSG_RESULT([*** Use --enable-ssl to enable SSL support])
81fi
82AC_MSG_RESULT([Enabled drivers :])
83if test $WANT_MYSQL_MOD -eq 1; then
84 AC_MSG_RESULT([ MySQL Driver])
79fi 85fi
86if test $WANT_PGSQL_MOD -eq 1; then
87 AC_MSG_RESULT([ PostgreSQL Driver])
88fi
89if test $WANT_DBI_MOD -eq 1; then
90 AC_MSG_RESULT([ libDBI Driver])
91fi
92if test $OOO_MAINTAIN -eq 1; then
93 AC_MSG_RESULT([Maintainer mode is on. -Werror is in effect])
94fi
95AC_MSG_RESULT([------------------------------------])
diff --git a/mod_log_sql.c b/mod_log_sql.c
index dace2d4..7aaa595 100644
--- a/mod_log_sql.c
+++ b/mod_log_sql.c
@@ -154,7 +154,7 @@ static logsql_opendb_ret log_sql_opendb_link(server_rec* s)
154{ 154{
155 logsql_opendb_ret result; 155 logsql_opendb_ret result;
156 if (global_config.forcepreserve) { 156 if (global_config.forcepreserve) {
157 global_config.db.connected = 1; 157 //global_config.db.connected = 1;
158 return LOGSQL_OPENDB_PRESERVE; 158 return LOGSQL_OPENDB_PRESERVE;
159 } 159 }
160 if (global_config.db.connected) { 160 if (global_config.db.connected) {
@@ -1054,10 +1054,10 @@ static int log_sql_transaction(request_rec *orig)
1054 1054
1055 /* How's our mysql link integrity? */ 1055 /* How's our mysql link integrity? */
1056 if (!global_config.db.connected) { 1056 if (!global_config.db.connected) {
1057 1057 if (!global_config.forcepreserve) {
1058 /* Make a try to establish the link */ 1058 /* Make a try to establish the link */
1059 log_sql_opendb_link(r->server); 1059 log_sql_opendb_link(r->server);
1060 1060 }
1061 if (!global_config.db.connected) { 1061 if (!global_config.db.connected) {
1062 /* Unable to re-establish a DB link, so assume that it's really 1062 /* Unable to re-establish a DB link, so assume that it's really
1063 * gone and send the entry to the preserve file instead. 1063 * gone and send the entry to the preserve file instead.
diff --git a/mod_log_sql.h b/mod_log_sql.h
index e708f57..6bcd6cb 100644
--- a/mod_log_sql.h
+++ b/mod_log_sql.h
@@ -79,6 +79,8 @@ typedef enum {
79/* Registration function for database drivers */ 79/* Registration function for database drivers */
80 80
81typedef struct { 81typedef struct {
82 /* name of the provider */
83 const char *providername;
82 /* NULL terminated list of drivers strings */ 84 /* NULL terminated list of drivers strings */
83 const char **provided_drivers; 85 const char **provided_drivers;
84 /* create a connection to the underlying database layer */ 86 /* create a connection to the underlying database layer */
diff --git a/mod_log_sql_mysql.c b/mod_log_sql_mysql.c
index f058110..fd1668a 100644
--- a/mod_log_sql_mysql.c
+++ b/mod_log_sql_mysql.c
@@ -247,6 +247,7 @@ static logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection
247 247
248static const char *supported_drivers[] = {"mysql",NULL}; 248static const char *supported_drivers[] = {"mysql",NULL};
249static logsql_dbdriver mysql_driver = { 249static logsql_dbdriver mysql_driver = {
250 "mysql",
250 supported_drivers, 251 supported_drivers,
251 log_sql_mysql_connect, /* open DB connection */ 252 log_sql_mysql_connect, /* open DB connection */
252 log_sql_mysql_close, /* close DB connection */ 253 log_sql_mysql_close, /* close DB connection */