From 6ad58b7d5c5d0ca53ec644021f0108811bceac4a Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Fri, 05 Mar 2004 00:30:58 +0000 Subject: updated compatability header for Apache 1.3 Changed log_error routing for Apache 1.3 to include APLOG_NOERRNO re-added quarter second delay between reconnect and query retry. updated makefile to generate HTML version of docbook docs. added comments to mod_log_sql_mysql.c updated documentation about --with-db-inc configure option --- (limited to 'mod_log_sql.c') 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 @@ -/* $Id: mod_log_sql.c,v 1.19 2004/03/04 05:43:20 urkle Exp $ */ +/* $Id: mod_log_sql.c,v 1.20 2004/03/05 00:30:58 urkle Exp $ */ #if defined(WITH_APACHE20) # include "apache20.h" @@ -459,6 +459,20 @@ static logsql_query_ret safe_sql_insert(request_rec *r, logsql_tabletype table_t /* re-open the connection and try again */ if (log_sql_opendb_link(r->server) != LOGSQL_OPENDB_FAIL) { log_error(APLOG_MARK,APLOG_ERR,r->server,"db reconnect successful"); +# if defined(WITH_APACHE20) + apr_sleep(apr_time_from_sec(0.25)); /* pause for a quarter second */ +# elif defined(WITH_APACHE13) + { + struct timespec delay, remainder; + int nanoret; + delay.tv_sec = 0; + delay.tv_nsec = 250000000; /* pause for a quarter second */ + nanoret = nanosleep(&delay, &remainder); + if (nanoret && errno != EINTR) { + log_error(APLOG_MARK,APLOG_ERR,r->server,"nanosleep unsuccessful"); + } + } +# endif result = log_sql_mysql_query(r,&global_config.db,query); if (result == LOGSQL_QUERY_SUCCESS) { return LOGSQL_QUERY_SUCCESS; -- cgit v0.9.2