summaryrefslogtreecommitdiffstats
path: root/mod_log_sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'mod_log_sql.c')
-rw-r--r--mod_log_sql.c16
1 files changed, 15 insertions, 1 deletions
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;