diff options
-rw-r--r-- | apache13.h | 11 | ||||
-rw-r--r-- | apache20.h | 6 | ||||
-rw-r--r-- | functions.h | 10 | ||||
-rw-r--r-- | mod_log_sql.c | 62 | ||||
-rw-r--r-- | mod_log_sql.prj | 3 | ||||
-rw-r--r-- | mod_log_sql_mysql.c | 12 | ||||
-rw-r--r-- | mod_log_sql_ssl.c | 6 |
7 files changed, 57 insertions, 53 deletions
@@ -14,13 +14,6 @@ | |||
14 | #define APR_SUCCESS 0 | 14 | #define APR_SUCCESS 0 |
15 | #define APR_OFFSETOF XtOffsetOf | 15 | #define APR_OFFSETOF XtOffsetOf |
16 | 16 | ||
17 | /*AP_INIT_TAKE1("LogSQLTransferLogTable", set_server_nmv_string_slot, | ||
18 | (void *)APR_OFFSETOF(logsql_state, transfer_table_name), RSRC_CONF, | ||
19 | "The database table that holds the transfer log") | ||
20 | |||
21 | {"LogSQLTransferLogTable", set_log_sql_transfer_table, NULL, RSRC_CONF, TAKE1, | ||
22 | "The database table that holds the transfer log"}*/ | ||
23 | |||
24 | /** method of declaring a directive which takes 1 argument */ | 17 | /** method of declaring a directive which takes 1 argument */ |
25 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ | 18 | # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \ |
26 | { directive, func, mconfig, where, TAKE1, help } | 19 | { directive, func, mconfig, where, TAKE1, help } |
@@ -66,8 +59,8 @@ | |||
66 | 59 | ||
67 | #define apr_tolower ap_tolower | 60 | #define apr_tolower ap_tolower |
68 | 61 | ||
69 | static void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); | 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))); |
70 | static inline void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) | 63 | static inline void log_error(char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) |
71 | { | 64 | { |
72 | static char buff[MAX_STRING_LEN]; | 65 | static char buff[MAX_STRING_LEN]; |
73 | va_list args; | 66 | va_list args; |
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include "util_time.h" | 21 | #include "util_time.h" |
22 | 22 | ||
23 | static void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); | 23 | /*static void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__ ((format (printf, 5,6))); |
24 | static inline void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) | 24 | static inline void log_error(char *file, int line, int level, const server_rec *s, const char *fmt, ...) |
25 | { | 25 | { |
26 | static char buff[MAX_STRING_LEN]; | 26 | static char buff[MAX_STRING_LEN]; |
@@ -29,6 +29,8 @@ static inline void log_error(char *file, int line, int level, const server_rec * | |||
29 | apr_vsnprintf(buff,MAX_STRING_LEN, fmt,args); | 29 | apr_vsnprintf(buff,MAX_STRING_LEN, fmt,args); |
30 | ap_log_error(file,line,level,0,s,"%s",buff); | 30 | ap_log_error(file,line,level,0,s,"%s",buff); |
31 | va_end(args); | 31 | va_end(args); |
32 | } | 32 | }*/ |
33 | |||
34 | #define log_error ap_log_error | ||
33 | 35 | ||
34 | #endif /* APACHE20_H */ | 36 | #endif /* APACHE20_H */ |
diff --git a/functions.h b/functions.h index 540376e..2c06f61 100644 --- a/functions.h +++ b/functions.h | |||
@@ -175,13 +175,13 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
175 | char *cookiebuf; | 175 | char *cookiebuf; |
176 | 176 | ||
177 | if (a != NULL) { | 177 | if (a != NULL) { |
178 | log_error(APLOG_MARK,APLOG_DEBUG, | 178 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
179 | r->server,"watching for cookie '%s'", a); | 179 | "watching for cookie '%s'", a); |
180 | 180 | ||
181 | /* Fetch out the cookie header */ | 181 | /* Fetch out the cookie header */ |
182 | cookiestr = (char *)apr_table_get(r->headers_in, "cookie2"); | 182 | cookiestr = (char *)apr_table_get(r->headers_in, "cookie2"); |
183 | if (cookiestr != NULL) { | 183 | if (cookiestr != NULL) { |
184 | log_error(APLOG_MARK,APLOG_DEBUG,r->server, | 184 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
185 | "Cookie2: [%s]", cookiestr); | 185 | "Cookie2: [%s]", cookiestr); |
186 | /* Does the cookie string contain one with our name? */ | 186 | /* Does the cookie string contain one with our name? */ |
187 | isvalid = strstr(cookiestr, a); | 187 | isvalid = strstr(cookiestr, a); |
@@ -201,7 +201,7 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
201 | 201 | ||
202 | cookiestr = (char *)apr_table_get(r->headers_in, "cookie"); | 202 | cookiestr = (char *)apr_table_get(r->headers_in, "cookie"); |
203 | if (cookiestr != NULL) { | 203 | if (cookiestr != NULL) { |
204 | log_error(APLOG_MARK,APLOG_DEBUG,r->server, | 204 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
205 | "Cookie: [%s]", cookiestr); | 205 | "Cookie: [%s]", cookiestr); |
206 | isvalid = strstr(cookiestr, a); | 206 | isvalid = strstr(cookiestr, a); |
207 | if (isvalid != NULL) { | 207 | if (isvalid != NULL) { |
@@ -216,7 +216,7 @@ static const char *extract_specific_cookie(request_rec *r, char *a) | |||
216 | 216 | ||
217 | cookiestr = apr_table_get(r->headers_out, "set-cookie"); | 217 | cookiestr = apr_table_get(r->headers_out, "set-cookie"); |
218 | if (cookiestr != NULL) { | 218 | if (cookiestr != NULL) { |
219 | log_error(APLOG_MARK,APLOG_DEBUG,r->server, | 219 | log_error(APLOG_MARK,APLOG_DEBUG, 0, r->server, |
220 | "Set-Cookie: [%s]", cookiestr); | 220 | "Set-Cookie: [%s]", cookiestr); |
221 | isvalid = strstr(cookiestr, a); | 221 | isvalid = strstr(cookiestr, a); |
222 | if (isvalid != NULL) { | 222 | if (isvalid != NULL) { |
diff --git a/mod_log_sql.c b/mod_log_sql.c index a247f30..3b4e6f4 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c | |||
@@ -164,7 +164,8 @@ static logsql_opendb_ret log_sql_opendb_link(server_rec* s) | |||
164 | } | 164 | } |
165 | return result; | 165 | return result; |
166 | } else { | 166 | } else { |
167 | log_error(APLOG_MARK,APLOG_ERR,s,"mod_log_sql: insufficient configuration info to establish database link"); | 167 | log_error(APLOG_MARK, APLOG_ERR, 0, s, |
168 | "mod_log_sql: insufficient configuration info to establish database link"); | ||
168 | return LOGSQL_OPENDB_FAIL; | 169 | return LOGSQL_OPENDB_FAIL; |
169 | } | 170 | } |
170 | } | 171 | } |
@@ -188,10 +189,11 @@ static void preserve_entry(request_rec *r, const char *query) | |||
188 | FILE *fp; | 189 | FILE *fp; |
189 | int result; | 190 | int result; |
190 | fp = ap_pfopen(r->pool, cls->preserve_file, "a"); | 191 | fp = ap_pfopen(r->pool, cls->preserve_file, "a"); |
191 | result = (fp)?0:1; | 192 | result = (fp)?0:errno; |
192 | #endif | 193 | #endif |
193 | if (result != APR_SUCCESS) { | 194 | if (result != APR_SUCCESS) { |
194 | log_error(APLOG_MARK,APLOG_ERR,r->server,"attempted append of local preserve file '%s' but failed.",cls->preserve_file); | 195 | log_error(APLOG_MARK, APLOG_ERR, result, r->server, |
196 | "attempted append of local preserve file '%s' but failed.",cls->preserve_file); | ||
195 | } else { | 197 | } else { |
196 | #if defined(WITH_APACHE20) | 198 | #if defined(WITH_APACHE20) |
197 | apr_file_printf(fp,"%s;\n", query); | 199 | apr_file_printf(fp,"%s;\n", query); |
@@ -200,7 +202,8 @@ static void preserve_entry(request_rec *r, const char *query) | |||
200 | fprintf(fp,"%s;\n", query); | 202 | fprintf(fp,"%s;\n", query); |
201 | ap_pfclose(r->pool, fp); | 203 | ap_pfclose(r->pool, fp); |
202 | #endif | 204 | #endif |
203 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"mod_log_sql: entry preserved in %s", cls->preserve_file); | 205 | log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, |
206 | "mod_log_sql: entry preserved in %s", cls->preserve_file); | ||
204 | } | 207 | } |
205 | } | 208 | } |
206 | 209 | ||
@@ -403,14 +406,17 @@ static void log_sql_child_init(server_rec *s, apr_pool_t *p) | |||
403 | retval = log_sql_opendb_link(s); | 406 | retval = log_sql_opendb_link(s); |
404 | switch (retval) { | 407 | switch (retval) { |
405 | case LOGSQL_OPENDB_FAIL: | 408 | case LOGSQL_OPENDB_FAIL: |
406 | log_error(APLOG_MARK,APLOG_ERR,s,"mod_log_sql: child spawned but unable to open database link"); | 409 | log_error(APLOG_MARK, APLOG_ERR, 0, s, |
410 | "mod_log_sql: child spawned but unable to open database link"); | ||
407 | break; | 411 | break; |
408 | case LOGSQL_OPENDB_SUCCESS: | 412 | case LOGSQL_OPENDB_SUCCESS: |
409 | case LOGSQL_OPENDB_ALREADY: | 413 | case LOGSQL_OPENDB_ALREADY: |
410 | log_error(APLOG_MARK,APLOG_DEBUG,s,"mod_log_sql: open_logdb_link successful"); | 414 | log_error(APLOG_MARK,APLOG_DEBUG,0, s, |
415 | "mod_log_sql: open_logdb_link successful"); | ||
411 | break; | 416 | break; |
412 | case LOGSQL_OPENDB_PRESERVE: | 417 | case LOGSQL_OPENDB_PRESERVE: |
413 | log_error(APLOG_MARK,APLOG_DEBUG,s,"mod_log_sql: open_logdb_link said that preservation is forced"); | 418 | log_error(APLOG_MARK,APLOG_DEBUG, 0, s, |
419 | "mod_log_sql: open_logdb_link said that preservation is forced"); | ||
414 | break; | 420 | break; |
415 | } | 421 | } |
416 | } | 422 | } |
@@ -488,7 +494,7 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t | |||
488 | global_config.db.connected = 0; | 494 | global_config.db.connected = 0; |
489 | /* re-open the connection and try again */ | 495 | /* re-open the connection and try again */ |
490 | if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { | 496 | if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { |
491 | log_error(APLOG_MARK,APLOG_ERR,r->server,"db reconnect successful"); | 497 | log_error(APLOG_MARK,APLOG_NOTICE,0, r->server,"db reconnect successful"); |
492 | # if defined(WITH_APACHE20) | 498 | # if defined(WITH_APACHE20) |
493 | apr_sleep(apr_time_from_sec(0.25)); /* pause for a quarter second */ | 499 | apr_sleep(apr_time_from_sec(0.25)); /* pause for a quarter second */ |
494 | # elif defined(WITH_APACHE13) | 500 | # elif defined(WITH_APACHE13) |
@@ -499,7 +505,7 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t | |||
499 | delay.tv_nsec = 250000000; /* pause for a quarter second */ | 505 | delay.tv_nsec = 250000000; /* pause for a quarter second */ |
500 | nanoret = nanosleep(&delay, &remainder); | 506 | nanoret = nanosleep(&delay, &remainder); |
501 | if (nanoret && errno != EINTR) { | 507 | if (nanoret && errno != EINTR) { |
502 | log_error(APLOG_MARK,APLOG_ERR,r->server,"nanosleep unsuccessful"); | 508 | log_error(APLOG_MARK,APLOG_ERR, errno, r->server,"nanosleep unsuccessful"); |
503 | } | 509 | } |
504 | } | 510 | } |
505 | # endif | 511 | # endif |
@@ -507,50 +513,52 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t | |||
507 | if (result == LOGSQL_QUERY_SUCCESS) { | 513 | if (result == LOGSQL_QUERY_SUCCESS) { |
508 | return LOGSQL_QUERY_SUCCESS; | 514 | return LOGSQL_QUERY_SUCCESS; |
509 | } else { | 515 | } else { |
510 | log_error(APLOG_MARK,APLOG_ERR,r->server,"second attempt failed"); | 516 | log_error(APLOG_MARK,APLOG_ERR,0,r->server,"second attempt failed"); |
511 | preserve_entry(r, query); | 517 | preserve_entry(r, query); |
512 | return LOGSQL_QUERY_PRESERVED; | 518 | return LOGSQL_QUERY_PRESERVED; |
513 | } | 519 | } |
514 | } else { | 520 | } else { |
515 | log_error(APLOG_MARK,APLOG_ERR,r->server,"reconnect failed, unable to reach database. SQL logging stopped until child regains a db connection."); | 521 | log_error(APLOG_MARK,APLOG_ERR,0,r->server, |
516 | log_error(APLOG_MARK,APLOG_ERR,r->server,"log entries are being preserved in %s",cls->preserve_file); | 522 | "reconnect failed, unable to reach database. SQL logging stopped until child regains a db connection."); |
523 | log_error(APLOG_MARK,APLOG_ERR,0,r->server, | ||
524 | "log entries are being preserved in %s",cls->preserve_file); | ||
517 | preserve_entry(r, query); | 525 | preserve_entry(r, query); |
518 | return LOGSQL_QUERY_PRESERVED; | 526 | return LOGSQL_QUERY_PRESERVED; |
519 | } | 527 | } |
520 | break; | 528 | break; |
521 | case LOGSQL_QUERY_NOTABLE: | 529 | case LOGSQL_QUERY_NOTABLE: |
522 | if (global_config.createtables) { | 530 | if (global_config.createtables) { |
523 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 531 | log_error(APLOG_MARK,APLOG_ERR,0,r->server, |
524 | "table doesn't exist...creating now"); | 532 | "table doesn't exist...creating now"); |
525 | if ((result = log_sql_mysql_create(r, &global_config.db, table_type, | 533 | if ((result = log_sql_mysql_create(r, &global_config.db, table_type, |
526 | table_name))!=LOGSQL_TABLE_SUCCESS) { | 534 | table_name))!=LOGSQL_TABLE_SUCCESS) { |
527 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 535 | log_error(APLOG_MARK,APLOG_ERR,result,r->server, |
528 | "child attempted but failed to create one or more tables for %s, preserving query", ap_get_server_name(r)); | 536 | "child attempted but failed to create one or more tables for %s, preserving query", ap_get_server_name(r)); |
529 | preserve_entry(r, query); | 537 | preserve_entry(r, query); |
530 | return LOGSQL_QUERY_PRESERVED; | 538 | return LOGSQL_QUERY_PRESERVED; |
531 | } else { | 539 | } else { |
532 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 540 | log_error(APLOG_MARK,APLOG_ERR,result, r->server, |
533 | "tables successfully created - retrying query"); | 541 | "tables successfully created - retrying query"); |
534 | if ((result = log_sql_mysql_query(r,&global_config.db,query))!=LOGSQL_QUERY_SUCCESS) { | 542 | if ((result = log_sql_mysql_query(r,&global_config.db,query))!=LOGSQL_QUERY_SUCCESS) { |
535 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 543 | log_error(APLOG_MARK,APLOG_ERR,result, r->server, |
536 | "giving up, preserving query"); | 544 | "giving up, preserving query"); |
537 | preserve_entry(r, query); | 545 | preserve_entry(r, query); |
538 | return LOGSQL_QUERY_PRESERVED; | 546 | return LOGSQL_QUERY_PRESERVED; |
539 | } else { | 547 | } else { |
540 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 548 | log_error(APLOG_MARK,APLOG_NOTICE,0, r->server, |
541 | "query successful after table creation"); | 549 | "query successful after table creation"); |
542 | return LOGSQL_QUERY_SUCCESS; | 550 | return LOGSQL_QUERY_SUCCESS; |
543 | } | 551 | } |
544 | } | 552 | } |
545 | } else { | 553 | } else { |
546 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 554 | log_error(APLOG_MARK,APLOG_ERR,0,r->server, |
547 | "table doesn't exist, creation denied by configuration, preserving query"); | 555 | "table doesn't exist, creation denied by configuration, preserving query"); |
548 | preserve_entry(r, query); | 556 | preserve_entry(r, query); |
549 | return LOGSQL_QUERY_PRESERVED; | 557 | return LOGSQL_QUERY_PRESERVED; |
550 | } | 558 | } |
551 | break; | 559 | break; |
552 | default: | 560 | default: |
553 | log_error(APLOG_MARK,APLOG_ERR,r->server, | 561 | log_error(APLOG_MARK,APLOG_ERR,0, r->server, |
554 | "Invalid return code from mog_log_query"); | 562 | "Invalid return code from mog_log_query"); |
555 | return LOGSQL_QUERY_FAIL; | 563 | return LOGSQL_QUERY_FAIL; |
556 | break; | 564 | break; |
@@ -773,7 +781,7 @@ static int log_sql_transaction(request_rec *orig) | |||
773 | for (i = 0; i<length; i++) { | 781 | for (i = 0; i<length; i++) { |
774 | logsql_item *item = cls->parsed_log_format[i]; | 782 | logsql_item *item = cls->parsed_log_format[i]; |
775 | if (item==NULL) { | 783 | if (item==NULL) { |
776 | log_error(APLOG_MARK, APLOG_ERR, orig->server, | 784 | log_error(APLOG_MARK, APLOG_ERR, 0, orig->server, |
777 | "Log Format '%c' unknown",cls->transfer_log_format[i]); | 785 | "Log Format '%c' unknown",cls->transfer_log_format[i]); |
778 | continue; | 786 | continue; |
779 | } | 787 | } |
@@ -825,7 +833,7 @@ static int log_sql_transaction(request_rec *orig) | |||
825 | note_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", | 833 | note_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", |
826 | /*global_config.insertdelayed?"delayed":*/"", notes_tablename, itemsets); | 834 | /*global_config.insertdelayed?"delayed":*/"", notes_tablename, itemsets); |
827 | 835 | ||
828 | log_error(APLOG_MARK,APLOG_DEBUG,orig->server,"mod_log_sql: note string: %s", note_query); | 836 | log_error(APLOG_MARK,APLOG_DEBUG,0, orig->server,"mod_log_sql: note string: %s", note_query); |
829 | } | 837 | } |
830 | 838 | ||
831 | /* Work through the list of headers-out defined by LogSQLWhichHeadersOut*/ | 839 | /* Work through the list of headers-out defined by LogSQLWhichHeadersOut*/ |
@@ -853,7 +861,7 @@ static int log_sql_transaction(request_rec *orig) | |||
853 | hout_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", | 861 | hout_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", |
854 | /*global_config.insertdelayed?"delayed":*/"", hout_tablename, itemsets); | 862 | /*global_config.insertdelayed?"delayed":*/"", hout_tablename, itemsets); |
855 | 863 | ||
856 | log_error(APLOG_MARK,APLOG_DEBUG,orig->server,"mod_log_sql: header_out string: %s", hout_query); | 864 | log_error(APLOG_MARK,APLOG_DEBUG,0, orig->server,"mod_log_sql: header_out string: %s", hout_query); |
857 | } | 865 | } |
858 | 866 | ||
859 | 867 | ||
@@ -882,7 +890,7 @@ static int log_sql_transaction(request_rec *orig) | |||
882 | hin_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", | 890 | hin_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", |
883 | /*global_config.insertdelayed?"delayed":*/"", hin_tablename, itemsets); | 891 | /*global_config.insertdelayed?"delayed":*/"", hin_tablename, itemsets); |
884 | 892 | ||
885 | log_error(APLOG_MARK,APLOG_DEBUG,orig->server,"mod_log_sql: header_in string: %s", hin_query); | 893 | log_error(APLOG_MARK,APLOG_DEBUG,0, orig->server,"mod_log_sql: header_in string: %s", hin_query); |
886 | } | 894 | } |
887 | 895 | ||
888 | 896 | ||
@@ -912,7 +920,7 @@ static int log_sql_transaction(request_rec *orig) | |||
912 | cookie_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", | 920 | cookie_query = apr_psprintf(r->pool, "insert %s into `%s` (id, item, val) values %s", |
913 | /*global_config.insertdelayed?"delayed":*/"", cookie_tablename, itemsets); | 921 | /*global_config.insertdelayed?"delayed":*/"", cookie_tablename, itemsets); |
914 | 922 | ||
915 | log_error(APLOG_MARK,APLOG_DEBUG,orig->server,"mod_log_sql: cookie string: %s", cookie_query); | 923 | log_error(APLOG_MARK,APLOG_DEBUG,0, orig->server,"mod_log_sql: cookie string: %s", cookie_query); |
916 | } | 924 | } |
917 | 925 | ||
918 | 926 | ||
@@ -920,13 +928,13 @@ static int log_sql_transaction(request_rec *orig) | |||
920 | access_query = apr_psprintf(r->pool, "insert %s into `%s` (%s) values (%s)", | 928 | access_query = apr_psprintf(r->pool, "insert %s into `%s` (%s) values (%s)", |
921 | /*global_config.insertdelayed?"delayed":*/"", transfer_tablename, fields, values); | 929 | /*global_config.insertdelayed?"delayed":*/"", transfer_tablename, fields, values); |
922 | 930 | ||
923 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"mod_log_sql: access string: %s", access_query); | 931 | log_error(APLOG_MARK,APLOG_DEBUG,0, r->server,"mod_log_sql: access string: %s", access_query); |
924 | 932 | ||
925 | /* If the person activated force-preserve, go ahead and push all the entries | 933 | /* If the person activated force-preserve, go ahead and push all the entries |
926 | * into the preserve file, then return. | 934 | * into the preserve file, then return. |
927 | */ | 935 | */ |
928 | if (global_config.forcepreserve) { | 936 | if (global_config.forcepreserve) { |
929 | log_error(APLOG_MARK,APLOG_DEBUG,orig->server,"mod_log_sql: preservation forced"); | 937 | log_error(APLOG_MARK,APLOG_DEBUG,0, orig->server,"mod_log_sql: preservation forced"); |
930 | preserve_entry(orig, access_query); | 938 | preserve_entry(orig, access_query); |
931 | if ( note_query != NULL ) | 939 | if ( note_query != NULL ) |
932 | preserve_entry(orig, note_query); | 940 | preserve_entry(orig, note_query); |
@@ -964,7 +972,7 @@ static int log_sql_transaction(request_rec *orig) | |||
964 | return OK; | 972 | return OK; |
965 | } else { | 973 | } else { |
966 | /* Whew, we got the DB link back */ | 974 | /* Whew, we got the DB link back */ |
967 | log_error(APLOG_MARK,APLOG_NOTICE,orig->server,"mod_log_sql: child established database connection"); | 975 | log_error(APLOG_MARK,APLOG_NOTICE,0, orig->server,"mod_log_sql: child established database connection"); |
968 | } | 976 | } |
969 | } | 977 | } |
970 | 978 | ||
diff --git a/mod_log_sql.prj b/mod_log_sql.prj index 9cd8fea..81050ce 100644 --- a/mod_log_sql.prj +++ b/mod_log_sql.prj | |||
@@ -101,7 +101,8 @@ module.doc.files=\ | |||
101 | LICENSE\ | 101 | LICENSE\ |
102 | AUTHORS\ | 102 | AUTHORS\ |
103 | TODO\ | 103 | TODO\ |
104 | Documentation/manual.xml | 104 | Documentation/manual.xml\ |
105 | TODO.in | ||
105 | 106 | ||
106 | module.po.expanded=0 | 107 | module.po.expanded=0 |
107 | module.po.files= | 108 | module.po.files= |
diff --git a/mod_log_sql_mysql.c b/mod_log_sql_mysql.c index edc0189..a3f8bbc 100644 --- a/mod_log_sql_mysql.c +++ b/mod_log_sql_mysql.c | |||
@@ -50,13 +50,13 @@ logsql_opendb_ret log_sql_mysql_connect(server_rec *s, logsql_dbconnection *db) | |||
50 | 50 | ||
51 | if (mysql_real_connect(dblink, host, user, passwd, database, tcpport, | 51 | if (mysql_real_connect(dblink, host, user, passwd, database, tcpport, |
52 | socketfile, 0)) { | 52 | socketfile, 0)) { |
53 | log_error(APLOG_MARK,APLOG_DEBUG,s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", | 53 | log_error(APLOG_MARK,APLOG_DEBUG,0, s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", |
54 | host, tcpport, database, user, socketfile); | 54 | host, tcpport, database, user, socketfile); |
55 | return LOGSQL_OPENDB_SUCCESS; | 55 | return LOGSQL_OPENDB_SUCCESS; |
56 | } else { | 56 | } else { |
57 | log_error(APLOG_MARK,APLOG_DEBUG,s,"mod_log_sql: database connection error: %s", | 57 | log_error(APLOG_MARK,APLOG_DEBUG,0, s,"mod_log_sql: database connection error: %s", |
58 | MYSQL_ERROR(dblink)); | 58 | MYSQL_ERROR(dblink)); |
59 | log_error(APLOG_MARK,APLOG_DEBUG,s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", | 59 | log_error(APLOG_MARK,APLOG_DEBUG, 0, s,"HOST: '%s' PORT: '%d' DB: '%s' USER: '%s' SOCKET: '%s'", |
60 | host, tcpport, database, user, socketfile); | 60 | host, tcpport, database, user, socketfile); |
61 | return LOGSQL_OPENDB_FAIL; | 61 | return LOGSQL_OPENDB_FAIL; |
62 | } | 62 | } |
@@ -135,7 +135,7 @@ logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db, | |||
135 | real_error = mysql_errno(dblink); | 135 | real_error = mysql_errno(dblink); |
136 | 136 | ||
137 | if (real_error == ER_NO_SUCH_TABLE) { | 137 | if (real_error == ER_NO_SUCH_TABLE) { |
138 | log_error(APLOG_MARK,APLOG_ERR,r->server,"table does not exist, preserving query"); | 138 | log_error(APLOG_MARK,APLOG_ERR,0, r->server,"table does not exist, preserving query"); |
139 | /* Restore SIGPIPE to its original handler function */ | 139 | /* Restore SIGPIPE to its original handler function */ |
140 | signal(SIGPIPE, handler); | 140 | signal(SIGPIPE, handler); |
141 | return LOGSQL_QUERY_NOTABLE; | 141 | return LOGSQL_QUERY_NOTABLE; |
@@ -213,7 +213,7 @@ logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db, | |||
213 | create_sql = apr_pstrcat(r->pool, create_prefix, table_name, create_suffix, | 213 | create_sql = apr_pstrcat(r->pool, create_prefix, table_name, create_suffix, |
214 | type_suffix, NULL); | 214 | type_suffix, NULL); |
215 | 215 | ||
216 | log_error(APLOG_MARK,APLOG_DEBUG,r->server,"create string: %s", create_sql); | 216 | log_error(APLOG_MARK,APLOG_DEBUG,0, r->server,"create string: %s", create_sql); |
217 | 217 | ||
218 | if (!dblink) { | 218 | if (!dblink) { |
219 | return LOGSQL_QUERY_NOLINK; | 219 | return LOGSQL_QUERY_NOLINK; |
@@ -223,7 +223,7 @@ logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db, | |||
223 | 223 | ||
224 | /* Run the create query */ | 224 | /* Run the create query */ |
225 | if ((retval = mysql_query(dblink, create_sql))) { | 225 | if ((retval = mysql_query(dblink, create_sql))) { |
226 | log_error(APLOG_MARK,APLOG_ERR,r->server,"failed to create table: %s", | 226 | log_error(APLOG_MARK,APLOG_ERR,0, r->server,"failed to create table: %s", |
227 | table_name); | 227 | table_name); |
228 | signal(SIGPIPE, handler); | 228 | signal(SIGPIPE, handler); |
229 | return LOGSQL_TABLE_FAIL; | 229 | return LOGSQL_TABLE_FAIL; |
diff --git a/mod_log_sql_ssl.c b/mod_log_sql_ssl.c index d65ca79..5f3a16e 100644 --- a/mod_log_sql_ssl.c +++ b/mod_log_sql_ssl.c | |||
@@ -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,r->server,"SSL_KEYSIZE: %s", result); | 40 | log_error(APLOG_MARK,APLOG_DEBUG,0, 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,r->server,"SSL_ALGKEYSIZE: %s", result); | 55 | log_error(APLOG_MARK,APLOG_DEBUG,0, 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,r->server,"SSL_CIPHER: %s", result); | 70 | log_error(APLOG_MARK,APLOG_DEBUG,0, 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; |