[asterisk-addons-commits] tilghman: branch 1.6.0 r983 - in /branches/1.6.0: ./ res/res_config_mysql.c
SVN commits to the Asterisk addons project
asterisk-addons-commits at lists.digium.com
Mon Jul 6 16:32:57 CDT 2009
Author: tilghman
Date: Mon Jul 6 16:32:52 2009
New Revision: 983
URL: http://svn.asterisk.org/svn-view/asterisk-addons?view=rev&rev=983
Log:
Merged revisions 982 via svnmerge from
https://origsvn.digium.com/svn/asterisk-addons/trunk
................
r982 | tilghman | 2009-07-06 16:31:41 -0500 (Mon, 06 Jul 2009) | 14 lines
Recorded merge of revisions 981 via svnmerge from
https://origsvn.digium.com/svn/asterisk-addons/branches/1.4
........
r981 | tilghman | 2009-07-06 16:30:13 -0500 (Mon, 06 Jul 2009) | 7 lines
Don't reset reconnect time, unless a reconnect really occurred.
(closes issue #15375)
Reported by: kowalma
Patches:
20090628__issue15375.diff.txt uploaded by tilghman (license 14)
Tested by: kowalma, jacco
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/res/res_config_mysql.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Mon Jul 6 16:32:52 2009
@@ -1,1 +1,1 @@
-/trunk:540-559,575,579,583,586,588,590,592,594,603,607,612,615,617,627,647,653,659,662,707,715,719,725-726,730,887,933,960
+/trunk:540-559,575,579,583,586,588,590,592,594,603,607,612,615,617,627,647,653,659,662,707,715,719,725-726,730,887,933,960,982
Modified: branches/1.6.0/res/res_config_mysql.c
URL: http://svn.asterisk.org/svn-view/asterisk-addons/branches/1.6.0/res/res_config_mysql.c?view=diff&rev=983&r1=982&r2=983
==============================================================================
--- branches/1.6.0/res/res_config_mysql.c (original)
+++ branches/1.6.0/res/res_config_mysql.c Mon Jul 6 16:32:52 2009
@@ -868,6 +868,7 @@
ast_log(LOG_ERROR, "MySQL RealTime: Failed to connect database server %s on %s (err %d). Check debug for more info.\n", conn->name, !ast_strlen_zero(conn->host) ? conn->host : conn->sock, mysql_errno(&conn->handle));
ast_debug(1, "MySQL RealTime: Cannot Connect (%d): %s\n", mysql_errno(&conn->handle), mysql_error(&conn->handle));
conn->connected = 0;
+ conn->connect_time = 0;
return 0;
}
} else {
@@ -875,13 +876,16 @@
* So the postman pings twice. */
if (mysql_ping(&conn->handle) != 0 && mysql_ping(&conn->handle) != 0) {
conn->connected = 0;
+ conn->connect_time = 0;
ast_log(LOG_ERROR, "MySQL RealTime: Ping failed (%d). Trying an explicit reconnect.\n", mysql_errno(&conn->handle));
ast_debug(1, "MySQL RealTime: Server Error (%d): %s\n", mysql_errno(&conn->handle), mysql_error(&conn->handle));
goto reconnect_tryagain;
}
- conn->connected = 1;
- conn->connect_time = time(NULL);
+ if (!conn->connected) {
+ conn->connected = 1;
+ conn->connect_time = time(NULL);
+ }
if (mysql_select_db(&conn->handle, conn->name) != 0) {
ast_log(LOG_WARNING, "MySQL RealTime: Unable to select database: %s. Still Connected (%u) - %s.\n", conn->name, mysql_errno(&conn->handle), mysql_error(&conn->handle));
More information about the asterisk-addons-commits
mailing list