diff options
author | Eric Faurot <eric@faurot.net> | 2013-07-15 17:13:24 +0200 |
---|---|---|
committer | Eric Faurot <eric@faurot.net> | 2013-07-15 17:13:24 +0200 |
commit | 2769557bd5db1342b7524b19590f68897fd127ed (patch) | |
tree | 14b633458c627ea035d500f8e058793713ce5730 | |
parent | add missing parameter in IMSG_DELIVERY_TEMPFAIL message. (diff) | |
download | OpenSMTPD-opensmtpd-201307151919.tar.xz OpenSMTPD-opensmtpd-201307151919.zip |
use auto-reconnectopensmtpd-201307151919
-rw-r--r-- | smtpd/backends/table_mysql.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/smtpd/backends/table_mysql.c b/smtpd/backends/table_mysql.c index a5999960..f924f6bb 100644 --- a/smtpd/backends/table_mysql.c +++ b/smtpd/backends/table_mysql.c @@ -203,6 +203,7 @@ table_mysql_update(void) const char *e; int i, ret; long long ll; + my_bool reconn; host = NULL; username = NULL; @@ -216,6 +217,7 @@ table_mysql_update(void) _source_refresh = DEFAULT_REFRESH; _source_expire = DEFAULT_EXPIRE; + reconn = 1; ret = 0; @@ -340,6 +342,12 @@ table_mysql_update(void) goto end; } + if (mysql_options(_db, MYSQL_OPT_RECONNECT, &reconn) != 0) { + log_warnx("warn: backend-table-mysql: mysql_options: %s", + mysql_error(_db)); + goto end; + } + if (!mysql_real_connect(_db, host, username, password, database, 0, NULL, 0)) { log_warnx("warn: backend-table-mysql: mysql_real_connect: %s", mysql_error(_db)); |