summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
-rw-r--r--Makefile.in4
-rw-r--r--configure.ac6
-rw-r--r--mod_log_sql.c48
3 files changed, 44 insertions, 14 deletions
diff --git a/Makefile.in b/Makefile.in
index e45968b..2789904 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,7 +16,7 @@ CFLAGS = -Wc,-Wall -Wc,-Werror -Wc,-fno-strict-aliasing
16 16
17INCLUDES = @MYSQL_CFLAGS@ 17INCLUDES = @MYSQL_CFLAGS@
18 18
19LDADD = @MYSQL_LDFLAGS@ @MYSQL_LIBS@ @RT_LIBS 19LDADD = @MYSQL_LDFLAGS@ @MYSQL_LIBS@ @RT_LIBS@
20 20
21EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG 21EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG
22 22
@@ -96,7 +96,7 @@ install: $(TARGETS) install-subdirs
96 echo "*** Please edit your Apache configuration files and"; \ 96 echo "*** Please edit your Apache configuration files and"; \
97 echo "*** add the appropriate LoadModule directives per the documentation"; \ 97 echo "*** add the appropriate LoadModule directives per the documentation"; \
98 echo "*** in docs/manual.html"; \ 98 echo "*** in docs/manual.html"; \
99 echo "*** If you have previously used 1.18 or lower then update you must change"; \ 99 echo "*** If you have previously used 1.18 or lower then you must change"; \
100 echo "*** >LoadModule sql_log_module modules/mod_log_sql.so"; \ 100 echo "*** >LoadModule sql_log_module modules/mod_log_sql.so"; \
101 echo "*** to"; \ 101 echo "*** to"; \
102 echo "*** >LoadModule log_sql_module modules/mod_log_sql.so"; \ 102 echo "*** >LoadModule log_sql_module modules/mod_log_sql.so"; \
diff --git a/configure.ac b/configure.ac
index bf8ba6e..c93d224 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,15 +33,15 @@ AC_SUBST(WANT_SSL_MOD)
33case "$target" in 33case "$target" in
34 *-*-solaris* | *-*-osf* ) 34 *-*-solaris* | *-*-osf* )
35 if test $APACHE_VERSION -eq 1.3; then 35 if test $APACHE_VERSION -eq 1.3; then
36 RTLIBS=-lrt 36 RT_LIBS=-lrt
37 fi 37 fi
38 ;; 38 ;;
39 *) 39 *)
40 RTLIBS="" 40 RT_LIBS=""
41 ;; 41 ;;
42esac 42esac
43 43
44AC_SUBST(RTLIBS) 44AC_SUBST(RT_LIBS)
45 45
46AC_CHECK_HEADERS(limits.h) 46AC_CHECK_HEADERS(limits.h)
47 47
diff --git a/mod_log_sql.c b/mod_log_sql.c
index 666ac46..a247f30 100644
--- a/mod_log_sql.c
+++ b/mod_log_sql.c
@@ -312,14 +312,44 @@ static const char *set_dbparam_slot(cmd_parms *cmd,
312static const char *set_log_sql_info(cmd_parms *cmd, void *dummy, 312static const char *set_log_sql_info(cmd_parms *cmd, void *dummy,
313 const char *host, const char *user, const char *pwd) 313 const char *host, const char *user, const char *pwd)
314{ 314{
315 if (*host != '.') { 315 ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server,
316 set_dbparam(cmd, NULL, "host", host); 316 "%s - %s - %s", host, user, pwd);
317 } 317 if (!user) { /* user is null, so only one arg passed */
318 if (*user != '.') { 318 apr_uri_t uri;
319 set_dbparam(cmd, NULL, "user", user); 319 apr_uri_parse(cmd->pool, host, &uri);
320 } 320 if (uri.scheme) {
321 if (*pwd != '.') { 321 /* set DB plugin */
322 set_dbparam(cmd, NULL, "passwd", pwd); 322 }
323 if (uri.hostname) {
324 set_dbparam(cmd, NULL, "host", uri.hostname);
325 }
326 if (uri.user) {
327 set_dbparam(cmd, NULL, "user", uri.user);
328 }
329 if (uri.password) {
330 set_dbparam(cmd, NULL, "passwd", uri.password);
331 }
332 if (uri.port_str) {
333 set_dbparam(cmd, NULL, "tcpport", uri.port_str);
334 }
335 if (uri.path) {
336 /* extract Database name */
337 char *off = strchr(++uri.path,'/');
338 if (off)
339 *off='\0';
340 set_dbparam(cmd, NULL, "database", uri.path);
341
342 }
343 } else {
344 if (*host != '.') {
345 set_dbparam(cmd, NULL, "host", host);
346 }
347 if (*user != '.') {
348 set_dbparam(cmd, NULL, "user", user);
349 }
350 if (*pwd != '.') {
351 set_dbparam(cmd, NULL, "passwd", pwd);
352 }
323 } 353 }
324 return NULL; 354 return NULL;
325} 355}
@@ -1048,7 +1078,7 @@ static const command_rec log_sql_cmds[] = {
1048 (void *)APR_OFFSETOF(global_config_t, createtables), RSRC_CONF, 1078 (void *)APR_OFFSETOF(global_config_t, createtables), RSRC_CONF,
1049 "Turn on module's capability to create its SQL tables on the fly") 1079 "Turn on module's capability to create its SQL tables on the fly")
1050 , 1080 ,
1051 AP_INIT_TAKE3("LogSQLLoginInfo", set_log_sql_info, NULL, RSRC_CONF, 1081 AP_INIT_TAKE13("LogSQLLoginInfo", set_log_sql_info, NULL, RSRC_CONF,
1052 "The database host, user-id and password for logging") 1082 "The database host, user-id and password for logging")
1053 , 1083 ,
1054 AP_INIT_TAKE2("LogSQLDBParam", set_dbparam, NULL, RSRC_CONF, 1084 AP_INIT_TAKE2("LogSQLDBParam", set_dbparam, NULL, RSRC_CONF,