From 6ad58b7d5c5d0ca53ec644021f0108811bceac4a Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Fri, 05 Mar 2004 00:30:58 +0000 Subject: updated compatability header for Apache 1.3 Changed log_error routing for Apache 1.3 to include APLOG_NOERRNO re-added quarter second delay between reconnect and query retry. updated makefile to generate HTML version of docbook docs. added comments to mod_log_sql_mysql.c updated documentation about --with-db-inc configure option --- diff --git a/CHANGELOG b/CHANGELOG index 06ff1bd..319eb0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.15 2004/03/04 05:41:12 urkle Exp $ +$Id: CHANGELOG,v 1.16 2004/03/05 00:30:58 urkle Exp $ 1.96: ? * fixed LogSQLPreserveFile config parameter * reworked safe_create_tables and core SQL insert routine. @@ -12,6 +12,8 @@ $Id: CHANGELOG,v 1.15 2004/03/04 05:41:12 urkle Exp $ * LogSQLDelayedInserts config option removed * Added DB generic LogSQLDBParam. Usage is LogSQLDBParam param value example: LogSQLDBParam tcpport 12345 +* notes, cookes, headersin, headersout tables are no longer created unless they + are used. 1.95: 2004-02-05 * audit and update of extract_* functions to acheive same output as diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in index 2d07cfd..81f2298 100644 --- a/Documentation/Makefile.in +++ b/Documentation/Makefile.in @@ -3,7 +3,9 @@ # Modify these top variables. SUBDIRS = -EXTRA_DIST = README documentation.lyx +EXTRA_DIST = README \ + manual.xml \ + manual.html #Don't modify anything below here @@ -16,6 +18,12 @@ DISTFILES = $(STD_DIST) $(EXTRA_DIST) all: all-subdirs +%.html: %.xml + @xmlto html-nochunks $< + +%.pdf: %.xml + @xmlto pdf $< + all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: @otarget=`echo $@|sed s/-subdirs//`; \ list=' $(SUBDIRS)'; \ diff --git a/Documentation/manual.xml b/Documentation/manual.xml index 5ff595e..495b15f 100644 --- a/Documentation/manual.xml +++ b/Documentation/manual.xml @@ -213,7 +213,8 @@ $ cd mod_log_sql-1.9 $ locate ndbm.h /usr/include/db1/ndbm.h /usr/include/gdbm/ndbm.h - As far as I can tell, there is no difference as to which you specify, but it should be the one that you compiled mod_ssl with. If unsure specify the /usr/include/db1. + As far as I can tell, there is no difference as to which you specify, but it should be the one that you compiled mod_ssl with. + The default is /usr/include/db1, which should work on most systems. diff --git a/apache13.h b/apache13.h index 11e8dcb..6d756b6 100644 --- a/apache13.h +++ b/apache13.h @@ -1,4 +1,4 @@ -/* $Header: /home/cvs/mod_log_sql/apache13.h,v 1.5 2004/02/29 23:36:17 urkle Exp $ */ +/* $Header: /home/cvs/mod_log_sql/apache13.h,v 1.6 2004/03/05 00:30:58 urkle Exp $ */ #ifndef APACHE13_H #define APACHE13_H @@ -24,6 +24,9 @@ /** method of declaring a directive which takes 1 argument */ # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ { directive, func, mconfig, where, TAKE1, help } +/** method of declaring a directive which takes 2 argument */ +# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \ + { directive, func, mconfig, where, TAKE2, help } /** method of declaring a directive which takes multiple arguments */ # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ { directive, func, mconfig, where, ITERATE, help } @@ -37,6 +40,7 @@ /* Types */ #define apr_pool_t pool #define apr_array_header_t array_header +#define apr_table_t table /* Functions */ #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) @@ -62,6 +66,16 @@ #define apr_tolower ap_tolower -#define log_error ap_log_error +static void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); +static inline void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) +{ + static char buff[MAX_STRING_LEN]; + va_list args; + va_start(args, fmt); + ap_vsnprintf(buff,MAX_STRING_LEN, fmt,args); + ap_log_error(file,line,level | APLOG_NOERRNO ,s,"%s",buff); + va_end(args); +} + #endif /* APACHE13_H */ diff --git a/mod_log_sql.c b/mod_log_sql.c index 754a224..666ac46 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c @@ -1,4 +1,4 @@ -/* $Id: mod_log_sql.c,v 1.19 2004/03/04 05:43:20 urkle Exp $ */ +/* $Id: mod_log_sql.c,v 1.20 2004/03/05 00:30:58 urkle Exp $ */ #if defined(WITH_APACHE20) # include "apache20.h" @@ -459,6 +459,20 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t /* re-open the connection and try again */ if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { log_error(APLOG_MARK,APLOG_ERR,r->server,"db reconnect successful"); +# if defined(WITH_APACHE20) + apr_sleep(apr_time_from_sec(0.25)); /* pause for a quarter second */ +# elif defined(WITH_APACHE13) + { + struct timespec delay, remainder; + int nanoret; + delay.tv_sec = 0; + delay.tv_nsec = 250000000; /* pause for a quarter second */ + nanoret = nanosleep(&delay, &remainder); + if (nanoret && errno != EINTR) { + log_error(APLOG_MARK,APLOG_ERR,r->server,"nanosleep unsuccessful"); + } + } +# endif result = log_sql_mysql_query(r,&global_config.db,query); if (result == LOGSQL_QUERY_SUCCESS) { return LOGSQL_QUERY_SUCCESS; diff --git a/mod_log_sql.prj b/mod_log_sql.prj index 4c194ce..9cd8fea 100644 --- a/mod_log_sql.prj +++ b/mod_log_sql.prj @@ -97,10 +97,11 @@ module.doc.expanded=1 module.doc.files=\ Documentation/README\ INSTALL\ - Documentation/documentation.lyx\ CHANGELOG\ LICENSE\ - AUTHORS + AUTHORS\ + TODO\ + Documentation/manual.xml module.po.expanded=0 module.po.files= diff --git a/mod_log_sql_mysql.c b/mod_log_sql_mysql.c index 86c259a..edc0189 100644 --- a/mod_log_sql_mysql.c +++ b/mod_log_sql_mysql.c @@ -1,4 +1,4 @@ -/* $Id: mod_log_sql_mysql.c,v 1.3 2004/03/04 05:41:12 urkle Exp $ */ +/* $Id: mod_log_sql_mysql.c,v 1.4 2004/03/05 00:30:58 urkle Exp $ */ #include "mysql.h" #include "mysqld_error.h" @@ -62,6 +62,7 @@ logsql_opendb_ret log_sql_mysql_connect(server_rec *s, logsql_dbconnection *db) } } +/* Close the DB link */ void log_sql_mysql_close(logsql_dbconnection *db) { mysql_close((MYSQL *)db->handle); @@ -108,6 +109,7 @@ const char *log_sql_mysql_escape(const char *from_str, apr_pool_t *p, } } +/* Run a mysql insert query and return a categorized error or success */ logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, const char *query) { @@ -144,6 +146,7 @@ logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, return LOGSQL_QUERY_FAIL; } +/* Create table table_name of type table_type. */ logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db, logsql_tabletype table_type, const char *table_name) { diff --git a/mod_log_sql_ssl.c b/mod_log_sql_ssl.c index fd68a7d..d65ca79 100644 --- a/mod_log_sql_ssl.c +++ b/mod_log_sql_ssl.c @@ -1,4 +1,4 @@ -/* $Id: mod_log_sql_ssl.c,v 1.6 2004/03/04 05:43:20 urkle Exp $ */ +/* $Id: mod_log_sql_ssl.c,v 1.7 2004/03/05 00:30:58 urkle Exp $ */ /* mod_log_sql_ssl */ #if defined(WITH_APACHE20) @@ -37,7 +37,7 @@ static const char *extract_ssl_keysize(request_rec *r, char *a) if (TEST_SSL(r) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); - log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_KEYSIZE: %s", result); + log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_KEYSIZE: %s", result); if (result != NULL && result[0] == '\0') result = NULL; return result; @@ -52,7 +52,7 @@ static const char *extract_ssl_maxkeysize(request_rec *r, char *a) if (TEST_SSL(r) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); - log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_ALGKEYSIZE: %s", result); + log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_ALGKEYSIZE: %s", result); if (result != NULL && result[0] == '\0') result = NULL; return result; @@ -67,7 +67,7 @@ static const char *extract_ssl_cipher(request_rec *r, char *a) if (TEST_SSL(r) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); - log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_CIPHER: %s", result); + log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_CIPHER: %s", result); if (result != NULL && result[0] == '\0') result = NULL; return result; -- cgit v0.9.2