diff options
author | Edward Rudd | 2004-03-05 00:30:58 +0000 |
---|---|---|
committer | Edward Rudd | 2004-03-05 00:30:58 +0000 |
commit | 6ad58b7d5c5d0ca53ec644021f0108811bceac4a (patch) | |
tree | 5556cfe9eed0c379b875d38eeac556a32f8b5f6d | |
parent | a3d0fadb9bbc2a70cac6d46b768822b1875a1811 (diff) |
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
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | Documentation/Makefile.in | 10 | ||||
-rw-r--r-- | Documentation/manual.xml | 3 | ||||
-rw-r--r-- | apache13.h | 18 | ||||
-rw-r--r-- | mod_log_sql.c | 16 | ||||
-rw-r--r-- | mod_log_sql.prj | 5 | ||||
-rw-r--r-- | mod_log_sql_mysql.c | 5 | ||||
-rw-r--r-- | mod_log_sql_ssl.c | 8 |
8 files changed, 56 insertions, 13 deletions
@@ -1,4 +1,4 @@ | |||
1 | $Id: CHANGELOG,v 1.15 2004/03/04 05:41:12 urkle Exp $ | 1 | $Id: CHANGELOG,v 1.16 2004/03/05 00:30:58 urkle Exp $ |
2 | 1.96: ? | 2 | 1.96: ? |
3 | * fixed LogSQLPreserveFile config parameter | 3 | * fixed LogSQLPreserveFile config parameter |
4 | * reworked safe_create_tables and core SQL insert routine. | 4 | * 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 $ | |||
12 | * LogSQLDelayedInserts config option removed | 12 | * LogSQLDelayedInserts config option removed |
13 | * Added DB generic LogSQLDBParam. Usage is LogSQLDBParam param value | 13 | * Added DB generic LogSQLDBParam. Usage is LogSQLDBParam param value |
14 | example: LogSQLDBParam tcpport 12345 | 14 | example: LogSQLDBParam tcpport 12345 |
15 | * notes, cookes, headersin, headersout tables are no longer created unless they | ||
16 | are used. | ||
15 | 17 | ||
16 | 1.95: 2004-02-05 | 18 | 1.95: 2004-02-05 |
17 | * audit and update of extract_* functions to acheive same output as | 19 | * 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 @@ | |||
3 | # Modify these top variables. | 3 | # Modify these top variables. |
4 | SUBDIRS = | 4 | SUBDIRS = |
5 | 5 | ||
6 | EXTRA_DIST = README documentation.lyx | 6 | EXTRA_DIST = README \ |
7 | manual.xml \ | ||
8 | manual.html | ||
7 | 9 | ||
8 | #Don't modify anything below here | 10 | #Don't modify anything below here |
9 | 11 | ||
@@ -16,6 +18,12 @@ DISTFILES = $(STD_DIST) $(EXTRA_DIST) | |||
16 | 18 | ||
17 | all: all-subdirs | 19 | all: all-subdirs |
18 | 20 | ||
21 | %.html: %.xml | ||
22 | @xmlto html-nochunks $< | ||
23 | |||
24 | %.pdf: %.xml | ||
25 | @xmlto pdf $< | ||
26 | |||
19 | all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: | 27 | all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: |
20 | @otarget=`echo $@|sed s/-subdirs//`; \ | 28 | @otarget=`echo $@|sed s/-subdirs//`; \ |
21 | list=' $(SUBDIRS)'; \ | 29 | 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</screen> | |||
213 | <screen format="linespecific">$ locate ndbm.h | 213 | <screen format="linespecific">$ locate ndbm.h |
214 | /usr/include/db1/ndbm.h | 214 | /usr/include/db1/ndbm.h |
215 | /usr/include/gdbm/ndbm.h</screen> | 215 | /usr/include/gdbm/ndbm.h</screen> |
216 | <para>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 <filename>/usr/include/db1</filename>.</para> | 216 | <para>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.</para> |
217 | <para>The default is <filename>/usr/include/db1</filename>, which should work on most systems.</para> | ||
217 | </listitem> | 218 | </listitem> |
218 | </varlistentry> | 219 | </varlistentry> |
219 | <varlistentry> | 220 | <varlistentry> |
@@ -1,4 +1,4 @@ | |||
1 | /* $Header: /home/cvs/mod_log_sql/apache13.h,v 1.5 2004/02/29 23:36:17 urkle Exp $ */ | 1 | /* $Header: /home/cvs/mod_log_sql/apache13.h,v 1.6 2004/03/05 00:30:58 urkle Exp $ */ |
2 | #ifndef APACHE13_H | 2 | #ifndef APACHE13_H |
3 | #define APACHE13_H | 3 | #define APACHE13_H |
4 | 4 | ||
@@ -24,6 +24,9 @@ | |||
24 | /** method of declaring a directive which takes 1 argument */ | 24 | /** method of declaring a directive which takes 1 argument */ |
25 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ | 25 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ |
26 | { directive, func, mconfig, where, TAKE1, help } | 26 | { directive, func, mconfig, where, TAKE1, help } |
27 | /** method of declaring a directive which takes 2 argument */ | ||
28 | # define AP_INIT_TAKE2(directive, func, mconfig, where, help) \ | ||
29 | { directive, func, mconfig, where, TAKE2, help } | ||
27 | /** method of declaring a directive which takes multiple arguments */ | 30 | /** method of declaring a directive which takes multiple arguments */ |
28 | # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ | 31 | # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ |
29 | { directive, func, mconfig, where, ITERATE, help } | 32 | { directive, func, mconfig, where, ITERATE, help } |
@@ -37,6 +40,7 @@ | |||
37 | /* Types */ | 40 | /* Types */ |
38 | #define apr_pool_t pool | 41 | #define apr_pool_t pool |
39 | #define apr_array_header_t array_header | 42 | #define apr_array_header_t array_header |
43 | #define apr_table_t table | ||
40 | 44 | ||
41 | /* Functions */ | 45 | /* Functions */ |
42 | #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) | 46 | #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) |
@@ -62,6 +66,16 @@ | |||
62 | 66 | ||
63 | #define apr_tolower ap_tolower | 67 | #define apr_tolower ap_tolower |
64 | 68 | ||
65 | #define log_error ap_log_error | 69 | static void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); |
70 | static inline void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) | ||
71 | { | ||
72 | static char buff[MAX_STRING_LEN]; | ||
73 | va_list args; | ||
74 | va_start(args, fmt); | ||
75 | ap_vsnprintf(buff,MAX_STRING_LEN, fmt,args); | ||
76 | ap_log_error(file,line,level | APLOG_NOERRNO ,s,"%s",buff); | ||
77 | va_end(args); | ||
78 | } | ||
79 | |||
66 | 80 | ||
67 | #endif /* APACHE13_H */ | 81 | #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 @@ | |||
1 | /* $Id: mod_log_sql.c,v 1.19 2004/03/04 05:43:20 urkle Exp $ */ | 1 | /* $Id: mod_log_sql.c,v 1.20 2004/03/05 00:30:58 urkle Exp $ */ |
2 | 2 | ||
3 | #if defined(WITH_APACHE20) | 3 | #if defined(WITH_APACHE20) |
4 | # include "apache20.h" | 4 | # include "apache20.h" |
@@ -459,6 +459,20 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t | |||
459 | /* re-open the connection and try again */ | 459 | /* re-open the connection and try again */ |
460 | if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { | 460 | if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { |
461 | log_error(APLOG_MARK,APLOG_ERR,r->server,"db reconnect successful"); | 461 | log_error(APLOG_MARK,APLOG_ERR,r->server,"db reconnect successful"); |
462 | # if defined(WITH_APACHE20) | ||
463 | apr_sleep(apr_time_from_sec(0.25)); /* pause for a quarter second */ | ||
464 | # elif defined(WITH_APACHE13) | ||
465 | { | ||
466 | struct timespec delay, remainder; | ||
467 | int nanoret; | ||
468 | delay.tv_sec = 0; | ||
469 | delay.tv_nsec = 250000000; /* pause for a quarter second */ | ||
470 | nanoret = nanosleep(&delay, &remainder); | ||
471 | if (nanoret && errno != EINTR) { | ||
472 | log_error(APLOG_MARK,APLOG_ERR,r->server,"nanosleep unsuccessful"); | ||
473 | } | ||
474 | } | ||
475 | # endif | ||
462 | result = log_sql_mysql_query(r,&global_config.db,query); | 476 | result = log_sql_mysql_query(r,&global_config.db,query); |
463 | if (result == LOGSQL_QUERY_SUCCESS) { | 477 | if (result == LOGSQL_QUERY_SUCCESS) { |
464 | return LOGSQL_QUERY_SUCCESS; | 478 | 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 | |||
97 | module.doc.files=\ | 97 | module.doc.files=\ |
98 | Documentation/README\ | 98 | Documentation/README\ |
99 | INSTALL\ | 99 | INSTALL\ |
100 | Documentation/documentation.lyx\ | ||
101 | CHANGELOG\ | 100 | CHANGELOG\ |
102 | LICENSE\ | 101 | LICENSE\ |
103 | AUTHORS | 102 | AUTHORS\ |
103 | TODO\ | ||
104 | Documentation/manual.xml | ||
104 | 105 | ||
105 | module.po.expanded=0 | 106 | module.po.expanded=0 |
106 | module.po.files= | 107 | 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 @@ | |||
1 | /* $Id: mod_log_sql_mysql.c,v 1.3 2004/03/04 05:41:12 urkle Exp $ */ | 1 | /* $Id: mod_log_sql_mysql.c,v 1.4 2004/03/05 00:30:58 urkle Exp $ */ |
2 | #include "mysql.h" | 2 | #include "mysql.h" |
3 | #include "mysqld_error.h" | 3 | #include "mysqld_error.h" |
4 | 4 | ||
@@ -62,6 +62,7 @@ logsql_opendb_ret log_sql_mysql_connect(server_rec *s, logsql_dbconnection *db) | |||
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Close the DB link */ | ||
65 | void log_sql_mysql_close(logsql_dbconnection *db) | 66 | void log_sql_mysql_close(logsql_dbconnection *db) |
66 | { | 67 | { |
67 | mysql_close((MYSQL *)db->handle); | 68 | mysql_close((MYSQL *)db->handle); |
@@ -108,6 +109,7 @@ const char *log_sql_mysql_escape(const char *from_str, apr_pool_t *p, | |||
108 | } | 109 | } |
109 | } | 110 | } |
110 | 111 | ||
112 | /* Run a mysql insert query and return a categorized error or success */ | ||
111 | logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, | 113 | logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, |
112 | const char *query) | 114 | const char *query) |
113 | { | 115 | { |
@@ -144,6 +146,7 @@ logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, | |||
144 | return LOGSQL_QUERY_FAIL; | 146 | return LOGSQL_QUERY_FAIL; |
145 | } | 147 | } |
146 | 148 | ||
149 | /* Create table table_name of type table_type. */ | ||
147 | logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db, | 150 | logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db, |
148 | logsql_tabletype table_type, const char *table_name) | 151 | logsql_tabletype table_type, const char *table_name) |
149 | { | 152 | { |
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 @@ | |||
1 | /* $Id: mod_log_sql_ssl.c,v 1.6 2004/03/04 05:43:20 urkle Exp $ */ | 1 | /* $Id: mod_log_sql_ssl.c,v 1.7 2004/03/05 00:30:58 urkle Exp $ */ |
2 | /* mod_log_sql_ssl */ | 2 | /* mod_log_sql_ssl */ |
3 | 3 | ||
4 | #if defined(WITH_APACHE20) | 4 | #if defined(WITH_APACHE20) |
@@ -37,7 +37,7 @@ static const char *extract_ssl_keysize(request_rec *r, char *a) | |||
37 | if (TEST_SSL(r) != NULL) | 37 | if (TEST_SSL(r) != NULL) |
38 | { | 38 | { |
39 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); | 39 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); |
40 | log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_KEYSIZE: %s", result); | 40 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_KEYSIZE: %s", result); |
41 | if (result != NULL && result[0] == '\0') | 41 | if (result != NULL && result[0] == '\0') |
42 | result = NULL; | 42 | result = NULL; |
43 | return result; | 43 | return result; |
@@ -52,7 +52,7 @@ static const char *extract_ssl_maxkeysize(request_rec *r, char *a) | |||
52 | if (TEST_SSL(r) != NULL) | 52 | if (TEST_SSL(r) != NULL) |
53 | { | 53 | { |
54 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); | 54 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); |
55 | log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_ALGKEYSIZE: %s", result); | 55 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_ALGKEYSIZE: %s", result); |
56 | if (result != NULL && result[0] == '\0') | 56 | if (result != NULL && result[0] == '\0') |
57 | result = NULL; | 57 | result = NULL; |
58 | return result; | 58 | return result; |
@@ -67,7 +67,7 @@ static const char *extract_ssl_cipher(request_rec *r, char *a) | |||
67 | if (TEST_SSL(r) != NULL) | 67 | if (TEST_SSL(r) != NULL) |
68 | { | 68 | { |
69 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); | 69 | result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); |
70 | log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_CIPHER: %s", result); | 70 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_CIPHER: %s", result); |
71 | if (result != NULL && result[0] == '\0') | 71 | if (result != NULL && result[0] == '\0') |
72 | result = NULL; | 72 | result = NULL; |
73 | return result; | 73 | return result; |