diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | apache13.h | 21 | ||||
-rw-r--r-- | mod_log_sql.c | 32 | ||||
-rw-r--r-- | mod_log_sql.h | 10 | ||||
-rw-r--r-- | mod_log_sql.prj | 3 |
5 files changed, 34 insertions, 34 deletions
@@ -1,5 +1,5 @@ | |||
1 | $Id: CHANGELOG,v 1.18 2004/03/22 20:32:16 urkle Exp $ | 1 | $Id: CHANGELOG,v 1.18 2004/03/22 20:32:16 urkle Exp $ |
2 | ?: ? | 2 | 1.97: 2004-04-08 |
3 | * fixed apache.m4 to work with apache 2 setups with different include | 3 | * fixed apache.m4 to work with apache 2 setups with different include |
4 | directories for APR and APU then core Apache | 4 | directories for APR and APU then core Apache |
5 | * cleaned up configuration documentation (updated due to deprecated commands) | 5 | * cleaned up configuration documentation (updated due to deprecated commands) |
@@ -14,6 +14,9 @@ | |||
14 | #define APR_SUCCESS 0 | 14 | #define APR_SUCCESS 0 |
15 | #define APR_OFFSETOF XtOffsetOf | 15 | #define APR_OFFSETOF XtOffsetOf |
16 | 16 | ||
17 | /** method of declaring a directive with raw argument parsing */ | ||
18 | # define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \ | ||
19 | { directive, func, mconfig, where, RAW_ARGS, help } | ||
17 | /** method of declaring a directive which takes 1 argument */ | 20 | /** method of declaring a directive which takes 1 argument */ |
18 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ | 21 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ |
19 | { directive, func, mconfig, where, TAKE1, help } | 22 | { directive, func, mconfig, where, TAKE1, help } |
@@ -23,6 +26,9 @@ | |||
23 | /** method of declaring a directive which takes multiple arguments */ | 26 | /** method of declaring a directive which takes multiple arguments */ |
24 | # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ | 27 | # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ |
25 | { directive, func, mconfig, where, ITERATE, help } | 28 | { directive, func, mconfig, where, ITERATE, help } |
29 | /** method of declaring a directive which takes 1 or 3 arguments */ | ||
30 | # define AP_INIT_TAKE13(directive, func, mconfig, where, help) \ | ||
31 | { directive, func, mconfig, where, TAKE13, help } | ||
26 | /** method of declaring a directive which takes 3 arguments */ | 32 | /** method of declaring a directive which takes 3 arguments */ |
27 | # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \ | 33 | # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \ |
28 | { directive, func, mconfig, where, TAKE3, help } | 34 | { directive, func, mconfig, where, TAKE3, help } |
@@ -35,12 +41,19 @@ | |||
35 | #define apr_array_header_t array_header | 41 | #define apr_array_header_t array_header |
36 | #define apr_table_t table | 42 | #define apr_table_t table |
37 | 43 | ||
44 | #define apr_status_t int | ||
45 | #define apr_uri_t uri_components | ||
46 | |||
38 | /* Functions */ | 47 | /* Functions */ |
39 | #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) | 48 | #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) |
40 | 49 | #define ap_set_deprecated NULL | |
50 | |||
41 | #define apr_uri_unparse ap_unparse_uri_components | 51 | #define apr_uri_unparse ap_unparse_uri_components |
52 | #define apr_uri_parse ap_parse_uri_components | ||
53 | #define ap_add_version_component(p,s) ap_add_version_component(s) | ||
42 | 54 | ||
43 | #define apr_pool_create(a,b) *(a) = ap_make_sub_pool(b) | 55 | #define apr_pool_create(a,b) *(a) = ap_make_sub_pool(b) |
56 | #define apr_pool_destroy ap_destroy_pool | ||
44 | #define apr_palloc ap_palloc | 57 | #define apr_palloc ap_palloc |
45 | #define apr_pcalloc ap_pcalloc | 58 | #define apr_pcalloc ap_pcalloc |
46 | #define apr_pstrdup ap_pstrdup | 59 | #define apr_pstrdup ap_pstrdup |
@@ -59,8 +72,10 @@ | |||
59 | 72 | ||
60 | #define apr_tolower ap_tolower | 73 | #define apr_tolower ap_tolower |
61 | 74 | ||
62 | static void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); | 75 | static void log_error(char *file, int line, int level, apr_status_t status, |
63 | static inline void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) | 76 | const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 6,7))); |
77 | static inline void log_error(char *file, int line, int level, | ||
78 | apr_status_t status, const server_rec *s, const char *fmt, ...) | ||
64 | { | 79 | { |
65 | static char buff[MAX_STRING_LEN]; | 80 | static char buff[MAX_STRING_LEN]; |
66 | va_list args; | 81 | va_list args; |
diff --git a/mod_log_sql.c b/mod_log_sql.c index 9309f9a..7c16ab9 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c | |||
@@ -1,13 +1,5 @@ | |||
1 | /* $Id: mod_log_sql.c,v 1.20 2004/03/05 00:30:58 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) | ||
4 | # include "apache20.h" | ||
5 | #elif defined(WITH_APACHE13) | ||
6 | # include "apache13.h" | ||
7 | #else | ||
8 | # error Unsupported Apache version | ||
9 | #endif | ||
10 | |||
11 | #ifdef HAVE_CONFIG_H | 3 | #ifdef HAVE_CONFIG_H |
12 | /* Undefine these to prevent conflicts between Apache ap_config_auto.h and | 4 | /* Undefine these to prevent conflicts between Apache ap_config_auto.h and |
13 | * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt. | 5 | * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt. |
@@ -21,6 +13,14 @@ | |||
21 | #include "config.h" | 13 | #include "config.h" |
22 | #endif | 14 | #endif |
23 | 15 | ||
16 | #if defined(WITH_APACHE20) | ||
17 | # include "apache20.h" | ||
18 | #elif defined(WITH_APACHE13) | ||
19 | # include "apache13.h" | ||
20 | #else | ||
21 | # error Unsupported Apache version | ||
22 | #endif | ||
23 | |||
24 | #if APR_HAVE_UNISTD_H | 24 | #if APR_HAVE_UNISTD_H |
25 | #include <unistd.h> | 25 | #include <unistd.h> |
26 | #endif | 26 | #endif |
@@ -393,7 +393,7 @@ static apr_status_t log_sql_close_link(void *data) | |||
393 | #elif defined(WITH_APACHE13) | 393 | #elif defined(WITH_APACHE13) |
394 | static void log_sql_child_exit(server_rec *s, apr_pool_t *p) | 394 | static void log_sql_child_exit(server_rec *s, apr_pool_t *p) |
395 | { | 395 | { |
396 | log_sql_mysql_close(&global_config.db); | 396 | global_config.driver->disconnect(&global_config.db); |
397 | } | 397 | } |
398 | #endif | 398 | #endif |
399 | 399 | ||
@@ -625,15 +625,6 @@ static int in_array(apr_array_header_t *ary, const char *elem) | |||
625 | return 0; | 625 | return 0; |
626 | } | 626 | } |
627 | 627 | ||
628 | /* Debugging print */ | ||
629 | #define PRINT_ARRAY(ary) { \ | ||
630 | char **a_ptr = (char **)(ary->elts); \ | ||
631 | int a_itr; \ | ||
632 | fprintf(stderr, "\nPrinting %s\n\n", #ary); \ | ||
633 | for (a_itr=0; a_itr<ary->nelts; a_itr++) { \ | ||
634 | fprintf(stderr, "Array Elem: %s\n",a_ptr[a_itr]); \ | ||
635 | } \ | ||
636 | } | ||
637 | 628 | ||
638 | /* Parse through cookie lists and merge based on +/- prefixes */ | 629 | /* Parse through cookie lists and merge based on +/- prefixes */ |
639 | #define DO_MERGE_ARRAY(parent,child,pool) \ | 630 | #define DO_MERGE_ARRAY(parent,child,pool) \ |
@@ -659,9 +650,6 @@ if (apr_is_empty_array(child)) { \ | |||
659 | *elem = ptr[itr]; \ | 650 | *elem = ptr[itr]; \ |
660 | } \ | 651 | } \ |
661 | } \ | 652 | } \ |
662 | PRINT_ARRAY(addlist); \ | ||
663 | PRINT_ARRAY(dellist); \ | ||
664 | PRINT_ARRAY(parent); \ | ||
665 | child = apr_array_make(p,1,sizeof(char *)); \ | 653 | child = apr_array_make(p,1,sizeof(char *)); \ |
666 | ptr = (char **)(parent->elts); \ | 654 | ptr = (char **)(parent->elts); \ |
667 | if (overwrite==0) { \ | 655 | if (overwrite==0) { \ |
@@ -673,9 +661,7 @@ if (apr_is_empty_array(child)) { \ | |||
673 | } \ | 661 | } \ |
674 | } \ | 662 | } \ |
675 | } \ | 663 | } \ |
676 | PRINT_ARRAY(child); \ | ||
677 | apr_array_cat(child, addlist); \ | 664 | apr_array_cat(child, addlist); \ |
678 | PRINT_ARRAY(child); \ | ||
679 | } | 665 | } |
680 | 666 | ||
681 | static void *log_sql_merge_state(apr_pool_t *p, void *basev, void *addv) | 667 | static void *log_sql_merge_state(apr_pool_t *p, void *basev, void *addv) |
diff --git a/mod_log_sql.h b/mod_log_sql.h index 032bd01..994ddf6 100644 --- a/mod_log_sql.h +++ b/mod_log_sql.h | |||
@@ -52,12 +52,12 @@ typedef enum { | |||
52 | LOGSQL_QUERY_FAIL, | 52 | LOGSQL_QUERY_FAIL, |
53 | LOGSQL_QUERY_NOLINK, | 53 | LOGSQL_QUERY_NOLINK, |
54 | LOGSQL_QUERY_NOTABLE, | 54 | LOGSQL_QUERY_NOTABLE, |
55 | LOGSQL_QUERY_PRESERVED, | 55 | LOGSQL_QUERY_PRESERVED |
56 | } logsql_query_ret; | 56 | } logsql_query_ret; |
57 | 57 | ||
58 | typedef enum { | 58 | typedef enum { |
59 | LOGSQL_TABLE_SUCCESS = 0, | 59 | LOGSQL_TABLE_SUCCESS = 0, |
60 | LOGSQL_TABLE_FAIL, | 60 | LOGSQL_TABLE_FAIL |
61 | } logsql_table_ret; | 61 | } logsql_table_ret; |
62 | 62 | ||
63 | /* Table type to create/log to */ | 63 | /* Table type to create/log to */ |
@@ -66,7 +66,7 @@ typedef enum { | |||
66 | LOGSQL_TABLE_NOTES, | 66 | LOGSQL_TABLE_NOTES, |
67 | LOGSQL_TABLE_HEADERSOUT, | 67 | LOGSQL_TABLE_HEADERSOUT, |
68 | LOGSQL_TABLE_HEADERSIN, | 68 | LOGSQL_TABLE_HEADERSIN, |
69 | LOGSQL_TABLE_COOKIES, | 69 | LOGSQL_TABLE_COOKIES |
70 | } logsql_tabletype; | 70 | } logsql_tabletype; |
71 | 71 | ||
72 | /* All Tables */ | 72 | /* All Tables */ |
@@ -111,10 +111,10 @@ LOGSQL_DECLARE(void) log_sql_register_driver(apr_pool_t *p, | |||
111 | NULL, NULL, NULL, NULL, NULL, register_hooks }; \ | 111 | NULL, NULL, NULL, NULL, NULL, register_hooks }; \ |
112 | static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) | 112 | static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) |
113 | #elif defined(WITH_APACHE13) | 113 | #elif defined(WITH_APACHE13) |
114 | # define LOGSQL_REGISTER() \ | 114 | # define LOGSQL_REGISTER(driver) \ |
115 | static void module_init(server_rec *s, apr_pool_t *p); \ | 115 | static void module_init(server_rec *s, apr_pool_t *p); \ |
116 | module log_sql_##driver##_module = { \ | 116 | module log_sql_##driver##_module = { \ |
117 | STANDARD_MODULE_STUFF, module_init }; | 117 | STANDARD_MODULE_STUFF, module_init }; \ |
118 | static void module_init(server_rec *s, apr_pool_t *p) | 118 | static void module_init(server_rec *s, apr_pool_t *p) |
119 | #endif | 119 | #endif |
120 | 120 | ||
diff --git a/mod_log_sql.prj b/mod_log_sql.prj index 81050ce..e88b2c6 100644 --- a/mod_log_sql.prj +++ b/mod_log_sql.prj | |||
@@ -110,8 +110,7 @@ module.po.files= | |||
110 | compiler.options.supports= | 110 | compiler.options.supports= |
111 | compiler.options.include.paths=\ | 111 | compiler.options.include.paths=\ |
112 | .\ | 112 | .\ |
113 | ..\ | 113 | /usr/include/apache |
114 | /opt/apache2/include | ||
115 | compiler.options.library.paths= | 114 | compiler.options.library.paths= |
116 | compiler.options.libraries= | 115 | compiler.options.libraries= |
117 | compiler.options.libraries.selected= | 116 | compiler.options.libraries.selected= |