From 9a1ac03f0412c24b99790b07372d4e3686f8d1f8 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Fri, 9 Apr 2004 01:12:19 +0000 Subject: Made to work under Apache 1.3 again removed debugging for config merge function --- CHANGELOG | 2 +- apache13.h | 21 ++++++++++++++++++--- mod_log_sql.c | 32 +++++++++----------------------- mod_log_sql.h | 10 +++++----- mod_log_sql.prj | 3 +-- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4610c86..fd7dff6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ $Id: CHANGELOG,v 1.18 2004/03/22 20:32:16 urkle Exp $ -?: ? +1.97: 2004-04-08 * fixed apache.m4 to work with apache 2 setups with different include directories for APR and APU then core Apache * cleaned up configuration documentation (updated due to deprecated commands) diff --git a/apache13.h b/apache13.h index d5aeac5..38a9cae 100644 --- a/apache13.h +++ b/apache13.h @@ -14,6 +14,9 @@ #define APR_SUCCESS 0 #define APR_OFFSETOF XtOffsetOf +/** method of declaring a directive with raw argument parsing */ +# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \ + { directive, func, mconfig, where, RAW_ARGS, help } /** method of declaring a directive which takes 1 argument */ # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ { directive, func, mconfig, where, TAKE1, help } @@ -23,6 +26,9 @@ /** method of declaring a directive which takes multiple arguments */ # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \ { directive, func, mconfig, where, ITERATE, help } +/** method of declaring a directive which takes 1 or 3 arguments */ +# define AP_INIT_TAKE13(directive, func, mconfig, where, help) \ + { directive, func, mconfig, where, TAKE13, help } /** method of declaring a directive which takes 3 arguments */ # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \ { directive, func, mconfig, where, TAKE3, help } @@ -35,12 +41,19 @@ #define apr_array_header_t array_header #define apr_table_t table +#define apr_status_t int +#define apr_uri_t uri_components + /* Functions */ #define ap_get_remote_host(a,b,c,d) ap_get_remote_host(a,b,c) - +#define ap_set_deprecated NULL + #define apr_uri_unparse ap_unparse_uri_components +#define apr_uri_parse ap_parse_uri_components +#define ap_add_version_component(p,s) ap_add_version_component(s) #define apr_pool_create(a,b) *(a) = ap_make_sub_pool(b) +#define apr_pool_destroy ap_destroy_pool #define apr_palloc ap_palloc #define apr_pcalloc ap_pcalloc #define apr_pstrdup ap_pstrdup @@ -59,8 +72,10 @@ #define apr_tolower ap_tolower -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))); -static inline void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) +static void log_error(char *file, int line, int level, apr_status_t status, + const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 6,7))); +static inline void log_error(char *file, int line, int level, + apr_status_t status, const server_rec *s, const char *fmt, ...) { static char buff[MAX_STRING_LEN]; 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 @@ /* $Id: mod_log_sql.c,v 1.20 2004/03/05 00:30:58 urkle Exp $ */ -#if defined(WITH_APACHE20) -# include "apache20.h" -#elif defined(WITH_APACHE13) -# include "apache13.h" -#else -# error Unsupported Apache version -#endif - #ifdef HAVE_CONFIG_H /* Undefine these to prevent conflicts between Apache ap_config_auto.h and * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt. @@ -21,6 +13,14 @@ #include "config.h" #endif +#if defined(WITH_APACHE20) +# include "apache20.h" +#elif defined(WITH_APACHE13) +# include "apache13.h" +#else +# error Unsupported Apache version +#endif + #if APR_HAVE_UNISTD_H #include #endif @@ -393,7 +393,7 @@ static apr_status_t log_sql_close_link(void *data) #elif defined(WITH_APACHE13) static void log_sql_child_exit(server_rec *s, apr_pool_t *p) { - log_sql_mysql_close(&global_config.db); + global_config.driver->disconnect(&global_config.db); } #endif @@ -625,15 +625,6 @@ static int in_array(apr_array_header_t *ary, const char *elem) return 0; } -/* Debugging print */ -#define PRINT_ARRAY(ary) { \ - char **a_ptr = (char **)(ary->elts); \ - int a_itr; \ - fprintf(stderr, "\nPrinting %s\n\n", #ary); \ - for (a_itr=0; a_itrnelts; a_itr++) { \ - fprintf(stderr, "Array Elem: %s\n",a_ptr[a_itr]); \ - } \ -} /* Parse through cookie lists and merge based on +/- prefixes */ #define DO_MERGE_ARRAY(parent,child,pool) \ @@ -659,9 +650,6 @@ if (apr_is_empty_array(child)) { \ *elem = ptr[itr]; \ } \ } \ - PRINT_ARRAY(addlist); \ - PRINT_ARRAY(dellist); \ - PRINT_ARRAY(parent); \ child = apr_array_make(p,1,sizeof(char *)); \ ptr = (char **)(parent->elts); \ if (overwrite==0) { \ @@ -673,9 +661,7 @@ if (apr_is_empty_array(child)) { \ } \ } \ } \ - PRINT_ARRAY(child); \ apr_array_cat(child, addlist); \ - PRINT_ARRAY(child); \ } 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 { LOGSQL_QUERY_FAIL, LOGSQL_QUERY_NOLINK, LOGSQL_QUERY_NOTABLE, - LOGSQL_QUERY_PRESERVED, + LOGSQL_QUERY_PRESERVED } logsql_query_ret; typedef enum { LOGSQL_TABLE_SUCCESS = 0, - LOGSQL_TABLE_FAIL, + LOGSQL_TABLE_FAIL } logsql_table_ret; /* Table type to create/log to */ @@ -66,7 +66,7 @@ typedef enum { LOGSQL_TABLE_NOTES, LOGSQL_TABLE_HEADERSOUT, LOGSQL_TABLE_HEADERSIN, - LOGSQL_TABLE_COOKIES, + LOGSQL_TABLE_COOKIES } logsql_tabletype; /* All Tables */ @@ -111,10 +111,10 @@ LOGSQL_DECLARE(void) log_sql_register_driver(apr_pool_t *p, NULL, NULL, NULL, NULL, NULL, register_hooks }; \ static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) #elif defined(WITH_APACHE13) -# define LOGSQL_REGISTER() \ +# define LOGSQL_REGISTER(driver) \ static void module_init(server_rec *s, apr_pool_t *p); \ module log_sql_##driver##_module = { \ - STANDARD_MODULE_STUFF, module_init }; + STANDARD_MODULE_STUFF, module_init }; \ static void module_init(server_rec *s, apr_pool_t *p) #endif 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= compiler.options.supports= compiler.options.include.paths=\ .\ - ..\ - /opt/apache2/include + /usr/include/apache compiler.options.library.paths= compiler.options.libraries= compiler.options.libraries.selected= -- cgit