summaryrefslogtreecommitdiffstats
path: root/mod_log_sql.c
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-04-09 01:12:19 +0000
committerGravatar Edward Rudd 2004-04-09 01:12:19 +0000
commit9a1ac03f0412c24b99790b07372d4e3686f8d1f8 (patch)
tree7086800fe4a9b0de79e53f9d42595a2c5fde25f5 /mod_log_sql.c
parenta6b66ca67e883f8d982ce3ff9363fa99027b6f2d (diff)
Made to work under Apache 1.3 again1.97
removed debugging for config merge function
Diffstat (limited to 'mod_log_sql.c')
-rw-r--r--mod_log_sql.c32
1 files changed, 9 insertions, 23 deletions
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)
394static void log_sql_child_exit(server_rec *s, apr_pool_t *p) 394static 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
681static void *log_sql_merge_state(apr_pool_t *p, void *basev, void *addv) 667static void *log_sql_merge_state(apr_pool_t *p, void *basev, void *addv)