[asterisk-addons-commits] file: trunk r365 - /trunk/res_config_mysql.c

asterisk-addons-commits at lists.digium.com asterisk-addons-commits at lists.digium.com
Wed Apr 11 09:43:28 MST 2007


Author: file
Date: Wed Apr 11 11:43:28 2007
New Revision: 365

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=365
Log:
Logic failure! Only deal with the database socket setting if a host was not specified.

Modified:
    trunk/res_config_mysql.c

Modified: trunk/res_config_mysql.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/res_config_mysql.c?view=diff&rev=365&r1=364&r2=365
==============================================================================
--- trunk/res_config_mysql.c (original)
+++ trunk/res_config_mysql.c Wed Apr 11 11:43:28 2007
@@ -792,12 +792,14 @@
 	} else
 		conn->port = atoi(s);
 
-	if (ast_strlen_zero(conn->host) && !(s = ast_variable_retrieve(config, "general", "dbsock"))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: No database socket found, using '/tmp/mysql.sock' as default.\n");
-		s = "/tmp/mysql.sock";
-	}
-	ast_copy_string(conn->sock, s, sizeof(conn->sock));
-
+	if (ast_strlen_zero(conn->host)) {
+		if (!(s = ast_variable_retrieve(config, "general", "dbsock"))) {
+			ast_log(LOG_WARNING, "MySQL RealTime: No database socket found, using '/tmp/mysql.sock' as default.\n");
+			s = "/tmp/mysql.sock";
+		}
+		ast_copy_string(conn->sock, s, sizeof(conn->sock));
+	} else
+		ast_copy_string(conn->sock, "", sizeof(conn->sock));
 
 	if (!ast_strlen_zero(conn->host)) {
 		ast_log(LOG_DEBUG, "MySQL RealTime host: %s\n", conn->host);



More information about the asterisk-addons-commits mailing list