- enable auto-reconnect support

PR:             ports/152644
Submitted by:   Alex Samorukov <samm@os2.kiev.ua>
This commit is contained in:
Philip M. Gollucci 2010-12-07 21:29:34 +00:00
parent 5c181c521c
commit fcdb3e1a3f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=265821
3 changed files with 18 additions and 2 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= mod_log_mysql
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= www
# Original location: http://bitbrook.de/software/mod_log_mysql/mod_log_mysql.c
MASTER_SITES= http://sheepkiller.nerim.net/ports/${PORTNAME}/
@ -17,7 +18,7 @@ COMMENT= Allows Apache 2 to log to a MySQL database
RUN_DEPENDS+= ${LOCALBASE}/${APACHEMODDIR}/mod_log_config-st.so:${PORTSDIR}/www/mod_log_config-st
MAKE_JOBS_SAFE= yes
MAKE_JOBS_SAFE= yes
USE_APACHE= 20+
AP_FAST_BUILD= YES

View file

@ -1,3 +1,2 @@
MD5 (apache2/mod_log_mysql-1.0.tar.gz) = bdde1ff13749437e2650fb4d376e2e5a
SHA256 (apache2/mod_log_mysql-1.0.tar.gz) = 27fdd2c87133d62171a38585807f70009821a3cb13e011d2ceb62fcc1c8ad4bb
SIZE (apache2/mod_log_mysql-1.0.tar.gz) = 8046

View file

@ -0,0 +1,16 @@
--- mod_log_mysql.c 2003-11-01 12:21:28.000000000 +0200
+++ mod_log_mysql.c.new 2010-11-28 17:01:06.000000000 +0200
@@ -172,11 +172,13 @@
{
mysql_log *l = param;
MYSQL *db;
+ my_bool do_reconnect = 1;
db = apr_palloc(p, sizeof(MYSQL));
mysql_init(db);
mysql_options(db, MYSQL_READ_DEFAULT_GROUP, "mod_log_mysql");
+ mysql_options(db, MYSQL_OPT_RECONNECT,&do_reconnect);
if (! mysql_real_connect(db, l->host, l->user, l->passwd, l->database, l->port, l->socket, 0)) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, p, "log database %s: %s", l->uri, mysql_error(db));